Пример #1
0
        internal ChoBufferProfileEx(bool condition, string name, string filePath, ChoProfileIntializationAction mode, TextWriter streamWriter, string msg, IChoProfile outerProfile, bool register)
        {
            _condition = condition;
            _mode      = mode;
            FilePath   = String.IsNullOrEmpty(filePath) ? filePath : ChoString.ExpandProperties(filePath);
            TextWriter = streamWriter;
            //OuterProfile = outerProfile;

            if (String.IsNullOrEmpty(msg))
            {
                msg = ChoProfile.GetDefaultMsg(ChoStackTrace.GetStackFrame(GetType().Namespace));
            }

            msg = ChoString.ExpandProperties(msg);

            if (_condition)
            {
                _formattedMsg.AppendFormat("{0} {{{1}", msg, Environment.NewLine);
            }

            if (register)
            {
                ChoProfile.Register(name, this, ChoStackTrace.GetStackFrame(GetType().Namespace), false);
            }

            //if (OuterProfile is ChoProfileContainer)
            //    ((ChoProfileContainer)OuterProfile).Add(this);
        }
Пример #2
0
 internal ChoBufferProfileEx(bool condition, string filePath, ChoProfileIntializationAction mode, TextWriter streamWriter, string msg, IChoProfile outerProfile, bool register)
     : this(condition, null, filePath, mode, streamWriter, msg, outerProfile, register)
 {
 }