Example #1
0
        private string OnMacroExecute(string sName)
        {
			helpers.replica.mam.Macro.Flags eFlags = helpers.replica.mam.Macro.ParseFlags(ref sName);
            string sRetVal = "";
            DBInteract cDBI = new DBInteract();
            Macro cMacro = Macro.Get(sName);
            switch (cMacro.cType.sName)
            {
                case "sql":
                    sRetVal = cMacro.Execute();
                    break;
                default:
                    throw new Exception("обнаружен неизвестный тип макро-строки [" + cMacro.cType.sName + "] в темплейте [" + sFile + "]"); //TODO LANG
            }
			if (null != sRetVal)
			{
				if (eFlags.HasFlag(helpers.replica.mam.Macro.Flags.Escaped))
					sRetVal = sRetVal.Replace("\\", "\\\\").Replace("\"", "\\\"");
				if (eFlags.HasFlag(helpers.replica.mam.Macro.Flags.Caps))
					sRetVal = sRetVal.ToUpper();
			}
            return sRetVal;
        }
Example #2
0
		public Clip[] ClipsSCRGet(Clip[] aClips)
		{
			List<Clip> aRetVal = new List<Clip>();
			DBInteract cDBI = new DBInteract();
			string sClipsPath = "NULL";
			(new Logger()).WriteDebug("ClipsSCRGet: [in_count:" + aClips.Length + "]");
			try
			{
				//List<Clip> aSource = cDBI.ClipsSCRGet();
				userspace.Helper cHelper = new userspace.Helper();
				sClipsPath = _ahStoragesSCR.Values.FirstOrDefault(o => o.Contains("clips"));
				if (sClipsPath != null)
					foreach (Clip cClip in aClips)
					{
						if (cHelper.FileExist(sClipsPath + cClip.sFilename))
						{
							cClip.sDuration = cClip.nFramesQty.ToFramesString();
							cClip.bLocked = cClip.sRotation == "Стоп" ? true : false; //PREFERENCES
							cClip.sStoragePath = sClipsPath; //PREFERENCES
							aRetVal.Add(cClip);
						}
					}
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			(new Logger()).WriteDebug("ClipsSCRGet: [out_count:" + aRetVal.Count + "][path:" + sClipsPath + "]");
			return aRetVal.ToArray();
		}