Exemple #1
0
 public override void ReInit(LogType logType, LogIniSection section)
 {
     base.ReInit(logType, section);
     FInit(section.Values[KeyValueType],
         (section.Values[KeyIncludeConditions] == "1"),
         (ParentLogType.Conditions[ParentLogType.LogTypeFile.Sections[section.Values[KeyCondition]].SectionName]));
 }
Exemple #2
0
        public virtual void ReInit(LogType logType, LogIniSection section)
        {
            ParentLogType = logType;
            Section = section;
            try
            {
                Name = section.Values[true, Consts.KeyName, section.SectionName];
                Title = section.Values[KeyTitle];
                if (Title.Length == 0)
                    Title = Name;
                if (ParentLogType != null) //То есть это и есть лог тайп
                    Style = ParentLogType.Styles[section.Values[KeyStyle]];
                if (Style == null)
                    Style = new StyleType(false, false, false, false, System.Drawing.Color.Black, System.Drawing.Color.White, true, false);
                try
                {
                    TitleType = (TitleType)Enum.Parse(typeof(TitleType), section.Values[KeyTitleType], false);
                }
                catch (ArgumentException)
                {
                    TitleType = TitleType.Title;
                }
            }
            catch (IniFiles.Exceptions.IniFileRequiredFieldReadException e)
            {
                throw new Common.Exceptions.LogTypeLoadException(
                    string.Format("Required field missing in the log type description : {0}", e.Message), e);

            }
        }
 public override void ReInit(LogType logType, LogIniSection section)
 {
     base.ReInit(logType, section);
     FInit(
         section.Values[KeyStartsWith],
         section.Values[KeyEndsWith],
         section.ArrayValues[KeyContain],
         section.ArrayValues[KeyExclude]);
 }
Exemple #4
0
 public override void ReInit(LogType logType, LogIniSection section)
 {
     base.ReInit(logType, section);
     StartCondition = ParentLogType.Conditions[section.Values[IniKeyStartCondition]];
     EndCondition = ParentLogType.Conditions[section.Values[IniKeyEndCondition]];
     ChildBlockTypes = (ParentLogType.BlockTypes.GetList(section.ArrayValues[IniKeyChildBlockTypes]));
     ChildStringTypes = (ParentLogType.StringTypes.GetList(section.ArrayValues[IniKeyChildStringTypes]));
     if ((ChildBlockTypes.Count == 0) && (ChildStringTypes.Count == 0))
         throw new Common.Exceptions.LogTypeLoadException("Both ChildBLockTypes and ChildStringTypes are empty");
 }
Exemple #5
0
        public override void ReInit(LogType logType, LogIniSection section)
        {
            base.ReInit(logType, section);
            Condition = ParentLogType.Conditions[section.Values[IniKeyCondition]];
            UseSeparator = (section.Values[IniKeyUseSeparator] == "1");
            if (section.Values[IniKeySeparator].Length > 0)
            {
                var separatorArray = section.ArrayValues[IniKeySeparator, false];
                Separator = separatorArray.Select(separatorString => separatorString[0]).ToArray();
                int temporary;
                if (!(int.TryParse(section.Values[IniKeyTitleValueIndex], out temporary)))
                    temporary = 0;
                TitleValueIndex = temporary;
                TitleValueType = section.Values[IniKeyTitleValueType];
            }
            else
                UseSeparator = false;

            var children = section.ArrayValues[IniKeyChildTypes];
            ChildTypes = new List<ValuesType>();
            ChildTypes.AddRange(children.AsParallel().Select(typeName => ParentLogType.ValueTypes[typeName]));
        }
Exemple #6
0
        public override void ReInit(LogType logType, LogIniSection section)
        {
            base.ReInit(logType, section);
            Bold = section.BoolValues[KeyBold];
            Italic = section.BoolValues[KeyItalic];
            Underline = section.BoolValues[KeyUnderline];
            Strike = section.BoolValues[KeyStrike];

            Trim = section.BoolValues[KeyTrim, true];
            Visible = section.BoolValues[KeyVisible, true];
            try
            {
                Color = Color.FromName(section.Values[KeyColor]);
            }
            catch (Exception)
            {
                Color = Color.Black;
            }
            try
            {
                Background = Color.FromName(section.Values[KeyBackground]);
                if (section.Values[KeyBackground].Length == 0)
                    Background = Color.White;
            }
            catch (Exception)
            {
                Background = Color.White;
            }
            ReInitFont();
        }
Exemple #7
0
 protected BaseType(LogType logType, LogIniSection section)
 {
     ReInit(logType, section);
 }