コード例 #1
0
        public override bool Equals(object o)
        {
            if (!(o is clawPDFSettings))
            {
                return(false);
            }
            var v = o as clawPDFSettings;

            if (!ApplicationProperties.Equals(v.ApplicationProperties))
            {
                return(false);
            }
            if (!ApplicationSettings.Equals(v.ApplicationSettings))
            {
                return(false);
            }

            if (ConversionProfiles.Count != v.ConversionProfiles.Count)
            {
                return(false);
            }
            for (var i = 0; i < ConversionProfiles.Count; i++)
            {
                if (!ConversionProfiles[i].Equals(v.ConversionProfiles[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
        public ApplicationProperties Copy()
        {
            var copy = new ApplicationProperties();

            copy.NextUpdate      = NextUpdate;
            copy.SettingsVersion = SettingsVersion;

            return(copy);
        }
コード例 #3
0
        public void StoreValues(Data data, string path)
        {
            ApplicationProperties.StoreValues(data, path + @"ApplicationProperties\");
            ApplicationSettings.StoreValues(data, path + @"ApplicationSettings\");

            for (var i = 0; i < ConversionProfiles.Count; i++)
            {
                var tmp = ConversionProfiles[i];
                tmp.StoreValues(data, @"" + path + @"ConversionProfiles\" + i + @"\");
            }

            data.SetValue(@"" + path + @"ConversionProfiles\numClasses", ConversionProfiles.Count.ToString());
        }
コード例 #4
0
        public clawPDFSettings Copy()
        {
            var copy = new clawPDFSettings(storage);

            copy.ApplicationProperties = ApplicationProperties.Copy();
            copy.ApplicationSettings   = ApplicationSettings.Copy();

            copy.ConversionProfiles = new List <ConversionProfile>();
            for (var i = 0; i < ConversionProfiles.Count; i++)
            {
                copy.ConversionProfiles.Add(ConversionProfiles[i].Copy());
            }

            return(copy);
        }
コード例 #5
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.AppendLine("[ApplicationProperties]");
            sb.AppendLine(ApplicationProperties.ToString());
            sb.AppendLine("[ApplicationSettings]");
            sb.AppendLine(ApplicationSettings.ToString());

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

            return(sb.ToString());
        }
コード例 #6
0
        public void ReadValues(Data data, string path)
        {
            ApplicationProperties.ReadValues(data, path + @"ApplicationProperties\");
            ApplicationSettings.ReadValues(data, path + @"ApplicationSettings\");

            try
            {
                var numClasses = int.Parse(data.GetValue(@"" + path + @"ConversionProfiles\numClasses"));
                for (var i = 0; i < numClasses; i++)
                {
                    var tmp = new ConversionProfile();
                    tmp.ReadValues(data, @"" + path + @"ConversionProfiles\" + i + @"\");
                    ConversionProfiles.Add(tmp);
                }
            }
            catch
            {
            }
        }
コード例 #7
0
 private void Init()
 {
     ApplicationProperties = new ApplicationProperties();
     ApplicationSettings   = new ApplicationSettings();
     ConversionProfiles    = new List <ConversionProfile>();
 }