示例#1
0
        internal void WriteObject(StatusTextInterceptEventArgs obj)
        {
            if (ActiveSettings.Instance.DebugLevel == DebugLevel.None)
                return;

            lock (this._writeLock)
            {
                using (StreamWriter stream = new StreamWriter(this._currentPath, true))
                {
                    this.LogRawMessage(this.FormatWithPrefix("StatusTextInterceptEventArgs"), stream);
                    this.LogRawMessage(string.Format("  Text = {0}", obj.Text), stream);

                    //this.WriteCurrentStateStuff(stream, false);

                    this.LogRawMessage("", stream);
                }
            }
        }
        void Hooks_StatusTextIntercept(string bstrText, ref bool bEat)
        {
            // Can't set bEat inside an annonymous method.  So need to duplicate the
            // try/catch logic from InvokeOperationSafely
            try
            {
                var eventArgs = new StatusTextInterceptEventArgs(bstrText);

                REPlugin.Instance.Debug.WriteObject(eventArgs);

                if (this.StatusTextIntercept != null)
                {
                    this.StatusTextIntercept(this, eventArgs);

                    bEat = eventArgs.Eat;
                }
            }
            catch (Exception e)
            {
                REPlugin.Instance.Error.LogError(e);
            }
        }