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)); }
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)); }
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)); }
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(); }
public void RaiseEvent(PwUuid eventType, params string[] vParams) { if (eventType == null) { throw new ArgumentNullException("eventType"); } // if(vParams == null) throw new ArgumentNullException("vParams"); if (m_bEnabled == false) { return; } EcasEvent e = new EcasEvent(); e.Type = eventType; if ((vParams != null) && (vParams.Length > 0)) { e.Parameters.AddRange(vParams); } RaiseEventObj(e); }
public EcasRaisingEventArgs(EcasEvent evt) { m_evt = evt; }
public EcasRaisingEventArgs(EcasEvent evt, EcasPropertyDictionary props) { m_evt = evt; m_props = props; }
private static bool EcasEventCompareTrue(EcasEvent e, EcasContext ctx) { return(true); }