コード例 #1
0
ファイル: EcasEventForm.cs プロジェクト: ComradeP/KeePass-2.x
		private bool UpdateDataEx(EcasEvent e, bool bGuiToInternal, bool bDxTypeInfo)
		{
			m_bBlockTypeSelectionHandler = true;
			bool bResult = EcasUtil.UpdateDialog(EcasObjectType.Event, m_cmbEvents,
				m_dgvParams, e, bGuiToInternal, bDxTypeInfo);
			m_bBlockTypeSelectionHandler = false;
			return bResult;
		}
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: EcasContext.cs プロジェクト: ashwingj/keepass2
        public EcasContext(EcasTriggerSystem coll, EcasTrigger trigger,
            EcasEvent e)
        {
            if(coll == null) throw new ArgumentNullException("coll");
            if(trigger == null) throw new ArgumentNullException("trigger");
            if(e == null) throw new ArgumentNullException("e");

            m_coll = coll;
            m_trigger = trigger;
            m_eOccured = e;
        }
コード例 #4
0
ファイル: EcasContext.cs プロジェクト: Stoom/KeePass
        public EcasContext(EcasTriggerSystem coll, EcasTrigger trigger,
			EcasEvent e, EcasPropertyDictionary props)
        {
            if(coll == null) throw new ArgumentNullException("coll");
            if(trigger == null) throw new ArgumentNullException("trigger");
            if(e == null) throw new ArgumentNullException("e");
            if(props == null) throw new ArgumentNullException("props");

            m_coll = coll;
            m_trigger = trigger;
            m_eOccured = e;
            m_props = props;
        }
コード例 #5
0
		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();
		}
コード例 #6
0
ファイル: EcasSystemEvents.cs プロジェクト: earthday/keepass2
 public EcasRaisingEventArgs(EcasEvent evt, EcasPropertyDictionary props)
 {
     m_evt = evt;
     m_props = props;
 }
コード例 #7
0
		public EcasRaisingEventArgs(EcasEvent evt)
		{
			m_evt = evt;
		}
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: EcasEventForm.cs プロジェクト: matt2005/keepass2
 public void InitEx(EcasEvent e)
 {
     m_eventInOut = e;
     m_event      = e.CloneDeep();
 }
コード例 #10
0
ファイル: EcasTriggerForm.cs プロジェクト: Stoom/KeePass
        private void OnEventAdd(object sender, EventArgs e)
        {
            EcasEvent eNew = new EcasEvent();
            eNew.Type = EcasEventIDs.AppLoadPost;

            EcasEventForm dlg = new EcasEventForm();
            dlg.InitEx(eNew);
            if(UIUtil.ShowDialogAndDestroy(dlg) == DialogResult.OK)
            {
                m_trigger.EventCollection.Add(eNew);
                UpdateEventListEx(false);
            }
        }
コード例 #11
0
ファイル: EcasEventType.cs プロジェクト: rdealexb/keepass
 private static bool EcasEventCompareTrue(EcasEvent e, EcasContext ctx)
 {
     return true;
 }
コード例 #12
0
        private static bool IsMatchIdEvent(EcasEvent e, EcasContext ctx)
        {
            string strIdRef = EcasUtil.GetParamString(e.Parameters, 0, true);
            if(string.IsNullOrEmpty(strIdRef)) return true;

            string strIdCur = ctx.Properties.Get<string>(EcasProperty.CommandID);
            if(string.IsNullOrEmpty(strIdCur)) return false;

            return strIdRef.Equals(strIdCur, StrUtil.CaseIgnoreCmp);
        }
コード例 #13
0
        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 str = ctx.Properties.Get<string>(EcasProperty.Text);
            if(str == null) { Debug.Assert(false); return false; }

            return EcasUtil.CompareStrings(str, strFilter, uCompareType);
        }
コード例 #14
0
        private static bool IsMatchIocDbEvent(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;

            // Must prefer IOC (e.g. for SavingDatabaseFile)
            IOConnectionInfo ioc = ctx.Properties.Get<IOConnectionInfo>(
                EcasProperty.IOConnectionInfo);
            if(ioc == null)
            {
                PwDatabase pd = ctx.Properties.Get<PwDatabase>(EcasProperty.Database);
                if(pd == null) { Debug.Assert(false); return false; }

                ioc = pd.IOConnectionInfo;
            }
            if(ioc == null) { Debug.Assert(false); return false; }
            string strCurFile = ioc.Path;
            if(string.IsNullOrEmpty(strCurFile)) return false;

            return EcasUtil.CompareStrings(strCurFile, strFilter, uCompareType);
        }
コード例 #15
0
ファイル: EcasEventForm.cs プロジェクト: Stoom/KeePass
 public void InitEx(EcasEvent e)
 {
     m_eventInOut = e;
     m_event = e.CloneDeep();
 }
コード例 #16
0
ファイル: EcasPool.cs プロジェクト: elitak/keepass
        public bool CompareEvents(EcasEvent e, EcasContext ctx)
        {
            if(e == null) throw new ArgumentNullException("e");
            if(ctx == null) throw new ArgumentNullException("ctx");

            if(e.Type.EqualsValue(ctx.Event.Type) == false) return false;

            foreach(EcasEventProvider p in m_vEventProviders)
            {
                if(p.IsSupported(e.Type))
                    return p.Compare(e, ctx);
            }

            throw new Exception(KPRes.TriggerEventTypeUnknown + " " +
                KPRes.TypeUnknownHint + MessageService.NewParagraph + e.TypeString);
        }