SourceWriter.ViewController.ConfigureEditor C# (CSharp) Method

ConfigureEditor() public method

Configures the editor with the current user preferences.
public ConfigureEditor ( ) : void
return void
		public void ConfigureEditor() {

			// General Preferences
			TextEditor.AutomaticLinkDetectionEnabled = App.Preferences.SmartLinks;
			TextEditor.AutomaticQuoteSubstitutionEnabled = App.Preferences.SmartQuotes;
			TextEditor.AutomaticDashSubstitutionEnabled = App.Preferences.SmartDashes;
			TextEditor.AutomaticDataDetectionEnabled = App.Preferences.DataDetectors;
			TextEditor.AutomaticTextReplacementEnabled = App.Preferences.TextReplacement;
			TextEditor.SmartInsertDeleteEnabled = App.Preferences.SmartInsertDelete;
			TextEditor.ContinuousSpellCheckingEnabled = App.Preferences.SpellChecking;
			TextEditor.AutomaticSpellingCorrectionEnabled = App.Preferences.AutoCorrect;
			TextEditor.GrammarCheckingEnabled = App.Preferences.GrammarChecking;

			// Editor Preferences
			TextEditor.RichText = App.Preferences.RichText;
			TextEditor.ImportsGraphics = App.Preferences.AllowGraphics;
			TextEditor.AllowsImageEditing = App.Preferences.AllowImageEditing;
			TextEditor.AllowsDocumentBackgroundColorChange = App.Preferences.AllowBackgroundColor;
			TextEditor.BackgroundColor = App.Preferences.EditorBackgroundColor;
			TextEditor.UsesFontPanel = App.Preferences.UseFontPanel;
			TextEditor.UsesRuler = App.Preferences.UseRuler;
			TextEditor.UsesInspectorBar = App.Preferences.UseInspectorBar;
			TextEditor.CompleteClosures = App.Preferences.CompleteClosures;
			TextEditor.WrapClosures = App.Preferences.WrapClosures;
			TextEditor.SelectAfterWrap = App.Preferences.SelectAfterWrap;

			// Search Preferences
			switch (App.Preferences.SearchType) {
			case 0:
				// None
				TextEditor.UsesFindBar = false;
				TextEditor.UsesFindPanel = false;
				break;
			case 1:
				// Uses bar
				TextEditor.UsesFindBar = true;
				break;
			case 2:
				// Uses panel
				TextEditor.UsesFindPanel = true;
				break;
			}
			TextEditor.IsIncrementalSearchingEnabled = App.Preferences.IncrementalSearch;

			// Auto Complete Preferences
			TextEditor.AllowAutoComplete = App.Preferences.AllowAutoComplete;
			TextEditor.AutoCompleteKeywords = App.Preferences.AutoCompleteKeywords;
			TextEditor.AutoCompleteKeywords = App.Preferences.AutoCompleteDefaultWords;
			TextEditor.DefaultWordsOnlyIfKeywordsEmpty = App.Preferences.DefaultWordsOnlyIfKeywordsEmpty;

		}