Exemple #1
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            for (var i = 0; i < ApiAccess.Count; i++)
            {
                sb.AppendLine(ApiAccess.ToString());
            }

            for (var i = 0; i < PrinterMappings.Count; i++)
            {
                sb.AppendLine(PrinterMappings.ToString());
            }

            for (var i = 0; i < TitleReplacement.Count; i++)
            {
                sb.AppendLine(TitleReplacement.ToString());
            }

            sb.AppendLine("AskSwitchDefaultPrinter=" + AskSwitchDefaultPrinter);
            sb.AppendLine("Language=" + Language);
            sb.AppendLine("LastUsedProfileGuid=" + LastUsedProfileGuid);
            sb.AppendLine("LoggingLevel=" + LoggingLevel);
            sb.AppendLine("PrimaryPrinter=" + PrimaryPrinter);
            sb.AppendLine("UpdateInterval=" + UpdateInterval);

            return(sb.ToString());
        }
Exemple #2
0
        public TitleReplacement Copy()
        {
            var copy = new TitleReplacement();

            copy.Replace         = Replace;
            copy.ReplacementType = ReplacementType;
            copy.Search          = Search;

            return(copy);
        }
Exemple #3
0
        public void ReadValues(Data data, string path)
        {
            try
            {
                var numClasses = int.Parse(data.GetValue(@"" + path + @"ApiAccess\numClasses"));
                for (var i = 0; i < numClasses; i++)
                {
                    var tmp = new ApiAccess();
                    tmp.ReadValues(data, @"" + path + @"ApiAccess\" + i + @"\");
                    ApiAccess.Add(tmp);
                }
            }
            catch
            {
            }

            try
            {
                var numClasses = int.Parse(data.GetValue(@"" + path + @"PrinterMappings\numClasses"));
                for (var i = 0; i < numClasses; i++)
                {
                    var tmp = new PrinterMapping();
                    tmp.ReadValues(data, @"" + path + @"PrinterMappings\" + i + @"\");
                    PrinterMappings.Add(tmp);
                }
            }
            catch
            {
            }

            try
            {
                var numClasses = int.Parse(data.GetValue(@"" + path + @"TitleReplacement\numClasses"));
                for (var i = 0; i < numClasses; i++)
                {
                    var tmp = new TitleReplacement();
                    tmp.ReadValues(data, @"" + path + @"TitleReplacement\" + i + @"\");
                    TitleReplacement.Add(tmp);
                }
            }
            catch
            {
            }

            try
            {
                AskSwitchDefaultPrinter = bool.Parse(data.GetValue(@"" + path + @"AskSwitchDefaultPrinter"));
            }
            catch
            {
                AskSwitchDefaultPrinter = true;
            }

            try
            {
                Language = Data.UnescapeString(data.GetValue(@"" + path + @"Language"));
            }
            catch
            {
                Language = "";
            }

            try
            {
                LastUsedProfileGuid = Data.UnescapeString(data.GetValue(@"" + path + @"LastUsedProfileGuid"));
            }
            catch
            {
                LastUsedProfileGuid = "DefaultGuid";
            }

            try
            {
                LoggingLevel =
                    (LoggingLevel)Enum.Parse(typeof(LoggingLevel), data.GetValue(@"" + path + @"LoggingLevel"));
            }
            catch
            {
                LoggingLevel = LoggingLevel.Error;
            }

            try
            {
                PrimaryPrinter = Data.UnescapeString(data.GetValue(@"" + path + @"PrimaryPrinter"));
            }
            catch
            {
                PrimaryPrinter = "clawPDF";
            }

            try
            {
                UpdateInterval = (UpdateInterval)Enum.Parse(typeof(UpdateInterval),
                                                            data.GetValue(@"" + path + @"UpdateInterval"));
            }
            catch
            {
                UpdateInterval = UpdateInterval.Weekly;
            }
        }