Beispiel #1
0
        private void OptionsSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PersistantStorage persistantStorage = PersistantStorage.StorageObject;
                persistantStorage.TextUseSpaces = TextUseSpaces.IsChecked ?? true;
                persistantStorage.TextUseTabs   = TextUseTabs.IsChecked ?? true;

                int indentSize;
                if (int.TryParse(TextIndent.Text, out indentSize))
                {
                    persistantStorage.TextIndent = indentSize;
                }

                persistantStorage.TextFormatControlCharacters = TextStyleControlCharacters.IsChecked ?? true;
                persistantStorage.TextFormatHyperLinks        = TextFormatHyperLinks.IsChecked ?? true;
                persistantStorage.TextFormatEmailLinks        = TextFormatEmailLinks.IsChecked ?? true;
                persistantStorage.TextShowFormatting          = TextFormatShowFormatting.IsChecked ?? true;
                persistantStorage.TextWordWrap = TextWordWrap.IsChecked ?? true;
                CurrentTab().LoadOptions();
                this.CancelSettingsUI();
            }
            catch
            {
            }
        }
Beispiel #2
0
        private void UpdateOptions()
        {
            PersistantStorage persistantStorage = PersistantStorage.StorageObject;

            TextUseSpaces.IsChecked = persistantStorage.TextUseSpaces ? true : false;
            TextUseTabs.IsChecked   = persistantStorage.TextUseTabs ? true : false;
            TextIndent.Text         = persistantStorage.TextIndent.ToString();
            TextStyleControlCharacters.IsChecked = persistantStorage.TextFormatControlCharacters ? true : false;
            TextFormatHyperLinks.IsChecked       = persistantStorage.TextFormatHyperLinks ? true : false;
            TextFormatEmailLinks.IsChecked       = persistantStorage.TextFormatEmailLinks ? true : false;
            TextFormatShowFormatting.IsChecked   = persistantStorage.TextShowFormatting ? true : false;
            TextWordWrap.IsChecked = persistantStorage.TextWordWrap ? true : false;
        }
Beispiel #3
0
 static PersistantStorage()
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(PersistantStorage));
         String        filePath   = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
         FileStream    fs         = new FileStream(filePath + settingsFileName, FileMode.Open);
         singletonPersistantStorageObject = (PersistantStorage)serializer.Deserialize(fs);
     }
     catch
     {
         singletonPersistantStorageObject = new PersistantStorage();
     }
 }
Beispiel #4
0
 static PersistantStorage()
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(PersistantStorage));
         String filePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
         FileStream fs = new FileStream(filePath + settingsFileName, FileMode.Open);
         singletonPersistantStorageObject = (PersistantStorage)serializer.Deserialize(fs);
     }
     catch
     {
         singletonPersistantStorageObject = new PersistantStorage();
     }
 }