Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            currentSettings = LoadSettings();
            LoadUp();

            string   formTitleFormat = "{0} {1}";
            AIHelper ai = new AIHelper(typeof(MMRSettings));

            this.Text = String.Format(formTitleFormat, ai.Title, ai.AssemblyVersion.ToString());
        }
        public static MMRSettings FromXml(string xml)
        {
            MMRSettings   settings   = new MMRSettings();
            XmlSerializer serializer = new XmlSerializer(typeof(MMRSettings));

            using (TextReader reader = new StringReader(xml))
            {
                settings = (MMRSettings)serializer.Deserialize(reader);
            }
            return(settings);
        }
Exemplo n.º 3
0
 private MMRSettings LoadSettings()
 {
     try
     {
         return(MMRSettings.FromXml((string)LoadFromStore(ISOPREFERENCESFILE)));
     }
     catch (Exception ex)
     {
         MMRSettings newSettings = MMRSettings.GetNewSettings();
         SaveSettings(newSettings);
         return(newSettings);
     }
 }
        public static MMRSettings GetNewSettings()
        {
            MMRSettings newSettings = new MMRSettings();

            newSettings.FilePath = @"C:\";

            newSettings.MetadataSettings.MaxColWidth     = 350;
            newSettings.MetadataSettings.MetaFolder      = newSettings.FilePath;
            newSettings.MetadataSettings.AutoSizeColumns = false;
            newSettings.MetadataSettings.MetaGridColumns.Add(new MetadataSet.MetaGridColumn("S.Filename", 305));
            newSettings.MetadataSettings.MetaGridColumns.Add(new MetadataSet.MetaGridColumn("E.Author", 150));
            newSettings.MetadataSettings.MetaGridColumns.Add(new MetadataSet.MetaGridColumn("E.UpdatedTitle", 200));
            newSettings.MetadataSettings.OrderBy.Name      = "S.Filename";
            newSettings.MetadataSettings.OrderBy.Ascending = true;

            return(newSettings);
        }
Exemplo n.º 5
0
 private void tsRestore_Click(object sender, EventArgs e)
 {
     currentSettings = MMRSettings.GetNewSettings();
     LoadUp();
 }
Exemplo n.º 6
0
 private void SaveSettings(MMRSettings settings)
 {
     SaveToStore(settings.ToXml(), ISOPREFERENCESFILE);
 }