当前位置: 首页>>代码示例>>C#>>正文


C# Ecas.EcasContext类代码示例

本文整理汇总了C#中KeePass.Ecas.EcasContext的典型用法代码示例。如果您正苦于以下问题:C# EcasContext类的具体用法?C# EcasContext怎么用?C# EcasContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EcasContext类属于KeePass.Ecas命名空间,在下文中一共展示了EcasContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsMatchCustomTbButton

        private static bool IsMatchCustomTbButton(EcasEvent e, EcasContext ctx)
        {
            string strIdRef = EcasUtil.GetParamString(e.Parameters, 0, true);
            if(string.IsNullOrEmpty(strIdRef)) return true;

            string strIdCur = EcasUtil.GetParamString(ctx.Event.Parameters, 0);
            if(string.IsNullOrEmpty(strIdCur)) return false;

            return strIdRef.Equals(strIdCur, StrUtil.CaseIgnoreCmp);
        }
开发者ID:elitak,项目名称:keepass,代码行数:10,代码来源:EcasDefaultEventProvider.cs

示例2: Evaluate

        public bool Evaluate(EcasCondition c, EcasContext ctx)
        {
            if(c == null) throw new ArgumentNullException("c");

            foreach(EcasConditionType t in m_conditions)
            {
                if(t.Type.EqualsValue(c.Type))
                    return t.EvaluateMethod(c, ctx);
            }

            throw new NotSupportedException();
        }
开发者ID:elitak,项目名称:keepass,代码行数:12,代码来源:EcasConditionProvider.cs

示例3: Compare

		public bool Compare(EcasEvent e, EcasContext ctx)
		{
			if(e == null) throw new ArgumentNullException("e");
			if(ctx == null) throw new ArgumentNullException("ctx");

			Debug.Assert(e.Type.Equals(ctx.Event.Type));

			foreach(EcasEventType t in m_events)
			{
				if(t.Type.Equals(e.Type))
					return t.CompareMethod(e, ctx);
			}

			throw new NotSupportedException();
		}
开发者ID:riking,项目名称:go-keepass2,代码行数:15,代码来源:EcasEventProvider.cs

示例4: Execute

        public void Execute(EcasAction a, EcasContext ctx)
        {
            if(a == null) throw new ArgumentNullException("a");

            foreach(EcasActionType t in m_actions)
            {
                if(t.Type.EqualsValue(a.Type))
                {
                    t.ExecuteMethod(a, ctx);
                    return;
                }
            }

            throw new NotSupportedException();
        }
开发者ID:eis,项目名称:keepass-eis-flavored,代码行数:15,代码来源:EcasActionProvider.cs

示例5: IsMatchEnvironmentVar

		private static bool IsMatchEnvironmentVar(EcasCondition c, EcasContext ctx)
		{
			string strName = EcasUtil.GetParamString(c.Parameters, 0, true);
			uint uCompareType = EcasUtil.GetParamEnum(c.Parameters, 1,
				EcasUtil.StdStringCompareEquals, EcasUtil.StdStringCompare);
			string strValue = EcasUtil.GetParamString(c.Parameters, 2, true);

			if(string.IsNullOrEmpty(strName) || (strValue == null))
				return false;

			try
			{
				string strVar = Environment.GetEnvironmentVariable(strName);
				if(strVar == null) return false;

				return EcasUtil.CompareStrings(strVar, strValue, uCompareType);
			}
			catch(Exception) { Debug.Assert(false); }

			return false;
		}
开发者ID:riking,项目名称:go-keepass2,代码行数:21,代码来源:EcasDefaultConditionProvider.cs

示例6: IsDatabaseModified

 private static bool IsDatabaseModified(EcasCondition c, EcasContext ctx)
 {
     PwDatabase pd = Program.MainForm.ActiveDatabase;
     if((pd == null) || !pd.IsOpen) return false;
     return pd.Modified;
 }
开发者ID:rdealexb,项目名称:keepass,代码行数:6,代码来源:EcasDefaultConditionProvider.cs

示例7: IsMatchFileExists

        private static bool IsMatchFileExists(EcasCondition c, EcasContext ctx)
        {
            string strFile = EcasUtil.GetParamString(c.Parameters, 0, true);
            if(string.IsNullOrEmpty(strFile)) return true;

            try
            {
                // return File.Exists(strFile);

                IOConnectionInfo ioc = IOConnectionInfo.FromPath(strFile);
                return IOConnection.FileExists(ioc);
            }
            catch(Exception) { }

            return false;
        }
开发者ID:rdealexb,项目名称:keepass,代码行数:16,代码来源:EcasDefaultConditionProvider.cs

示例8: ShowEntriesByTag

 private static void ShowEntriesByTag(EcasAction a, EcasContext ctx)
 {
     string strTag = EcasUtil.GetParamString(a.Parameters, 0, true);
     Program.MainForm.ShowEntriesByTag(strTag);
 }
开发者ID:rdealexb,项目名称:keepass,代码行数:5,代码来源:EcasDefaultActionProvider.cs

示例9: RemoveToolBarButton

 private static void RemoveToolBarButton(EcasAction a, EcasContext ctx)
 {
     string strID = EcasUtil.GetParamString(a.Parameters, 0, true);
     Program.MainForm.RemoveCustomToolBarButton(strID);
 }
开发者ID:rdealexb,项目名称:keepass,代码行数:5,代码来源:EcasDefaultActionProvider.cs

示例10: ImportIntoCurrentDatabase

        private static void ImportIntoCurrentDatabase(EcasAction a, EcasContext ctx)
        {
            PwDatabase pd = Program.MainForm.ActiveDatabase;
            if((pd == null) || !pd.IsOpen) return;

            string strPath = EcasUtil.GetParamString(a.Parameters, 0, true);
            if(string.IsNullOrEmpty(strPath)) return;
            IOConnectionInfo ioc = IOConnectionInfo.FromPath(strPath);

            string strFormat = EcasUtil.GetParamString(a.Parameters, 1, true);
            if(string.IsNullOrEmpty(strFormat)) return;
            FileFormatProvider ff = Program.FileFormatPool.Find(strFormat);
            if(ff == null)
                throw new Exception(KPRes.Unknown + ": " + strFormat);

            uint uMethod = EcasUtil.GetParamUInt(a.Parameters, 2);
            Type tMM = Enum.GetUnderlyingType(typeof(PwMergeMethod));
            object oMethod = Convert.ChangeType(uMethod, tMM);
            PwMergeMethod mm = PwMergeMethod.None;
            if(Enum.IsDefined(typeof(PwMergeMethod), oMethod))
                mm = (PwMergeMethod)oMethod;
            else { Debug.Assert(false); }
            if(mm == PwMergeMethod.None) mm = PwMergeMethod.CreateNewUuids;

            CompositeKey cmpKey = KeyFromParams(a, 3, 4, 5);
            if((cmpKey == null) && ff.RequiresKey)
            {
                KeyPromptForm kpf = new KeyPromptForm();
                kpf.InitEx(ioc, false, true);

                if(UIUtil.ShowDialogNotValue(kpf, DialogResult.OK)) return;

                cmpKey = kpf.CompositeKey;
                UIUtil.DestroyForm(kpf);
            }

            bool? b = true;
            try { b = ImportUtil.Import(pd, ff, ioc, mm, cmpKey); }
            finally
            {
                if(b.GetValueOrDefault(false))
                    Program.MainForm.UpdateUI(false, null, true, null, true, null, true);
            }
        }
开发者ID:rdealexb,项目名称:keepass,代码行数:44,代码来源:EcasDefaultActionProvider.cs

示例11: ExecuteSleep

        private static void ExecuteSleep(EcasAction a, EcasContext ctx)
        {
            uint uTimeSpan = EcasUtil.GetParamUInt(a.Parameters, 0);

            if((uTimeSpan != 0) && (uTimeSpan <= (uint)int.MaxValue))
                Thread.Sleep((int)uTimeSpan);
        }
开发者ID:rdealexb,项目名称:keepass,代码行数:7,代码来源:EcasDefaultActionProvider.cs

示例12: IsMatchTextEvent

        private static bool IsMatchTextEvent(EcasEvent e, EcasContext ctx)
        {
            uint uCompareType = EcasUtil.GetParamEnum(e.Parameters, 0,
                EcasUtil.StdStringCompareEquals, EcasUtil.StdStringCompare);

            string strFilter = EcasUtil.GetParamString(e.Parameters, 1, true);
            if(string.IsNullOrEmpty(strFilter)) return true;

            string strCurFile = EcasUtil.GetParamString(ctx.Event.Parameters, 0);
            if(string.IsNullOrEmpty(strCurFile)) return false;

            return EcasUtil.CompareStrings(strCurFile, strFilter, uCompareType);
        }
开发者ID:eis,项目名称:keepass-eis-flavored,代码行数:13,代码来源:EcasDefaultEventProvider.cs

示例13: EcasConditionEvaluateTrue

		private static bool EcasConditionEvaluateTrue(EcasCondition c, EcasContext ctx)
		{
			return true;
		}
开发者ID:riking,项目名称:go-keepass2,代码行数:4,代码来源:EcasConditionType.cs

示例14: EcasEventCompareTrue

 private static bool EcasEventCompareTrue(EcasEvent e, EcasContext ctx)
 {
     return true;
 }
开发者ID:rdealexb,项目名称:keepass,代码行数:4,代码来源:EcasEventType.cs

示例15: IsMatchFile

        private static bool IsMatchFile(EcasCondition c, EcasContext ctx)
        {
            string strFile = EcasUtil.GetParamString(c.Parameters, 0, true);
            if(string.IsNullOrEmpty(strFile)) return true;

            try { return File.Exists(strFile); }
            catch(Exception) { }

            return false;
        }
开发者ID:amiryal,项目名称:keepass2,代码行数:10,代码来源:EcasDefaultConditionProvider.cs


注:本文中的KeePass.Ecas.EcasContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。