예제 #1
0
        internal void EnableWriter(string name, bool enable)
        {
            if ((this._writerList == null) || (this._writerMap == null))
            {
                throw new InternalException("writerList and writerMap should be initialized.");
            }
            WriterInfo info = null;

            if (!this._writerMap.TryGetValue(name, out info) || (info == null))
            {
                throw new Exception("Writer '" + name + "' does not exist.");
            }
            info.Enabled = enable;
        }
예제 #2
0
        internal void RemoveTextWriter(string name)
        {
            if ((this._writerList == null) || (this._writerMap == null))
            {
                throw new InternalException("writerList and writerMap should be initialized.");
            }
            WriterInfo info = null;

            if (!this._writerMap.TryGetValue(name, out info) || (info == null))
            {
                throw new Exception("Writer '" + name + "' does not exist.");
            }
            this._writerList.Remove(info);
            this._writerMap.Remove(name);
        }
예제 #3
0
        internal void AddTextWriter(string name, TextWriter writer, bool enabled)
        {
            if ((this._writerList == null) || (this._writerMap == null))
            {
                throw new InternalException("writerList and writerMap should be initialized.");
            }
            if (this._writerMap.ContainsKey(name))
            {
                throw new Exception("Writer '" + name + "' has already been added.");
            }
            WriterInfo item = new WriterInfo(name, writer, enabled);

            this._writerList.Add(item);
            this._writerMap[name] = item;
        }