Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public EcasRaisingEventArgs(EcasEvent evt)
 {
     m_evt = evt;
 }
Ejemplo n.º 7
0
 public EcasRaisingEventArgs(EcasEvent evt, EcasPropertyDictionary props)
 {
     m_evt   = evt;
     m_props = props;
 }
Ejemplo n.º 8
0
 private static bool EcasEventCompareTrue(EcasEvent e, EcasContext ctx)
 {
     return(true);
 }