using FastReport.Utils; namespace FastReport.Design.PageDesigners.Code { internal class CodePageSettings { #region Fields private static bool FEnableCodeCompletion; private static bool FEnableVirtualSpace; private static bool FUseSpaces; private static bool FAllowOutlining; private static int FTabSize; private static bool FLineNumbers; private static Language FDefaultScriptLanguage; #endregion #region Properties public static bool EnableCodeCompletion { get { return FEnableCodeCompletion; } set { FEnableCodeCompletion = value; } } public static bool EnableVirtualSpace { get { return FEnableVirtualSpace; } set { FEnableVirtualSpace = value; } } public static bool UseSpaces { get { return FUseSpaces; } set { FUseSpaces = value; } } public static bool AllowOutlining { get { return FAllowOutlining; } set { FAllowOutlining = value; } } public static int TabSize { get { return FTabSize; } set { FTabSize = value; } } public static bool LineNumbers { get { return FLineNumbers; } set { FLineNumbers = value; } } public static Language DefaultScriptLanguage { get { return FDefaultScriptLanguage; } set { FDefaultScriptLanguage = value; Config.ReportSettings.DefaultLanguage = FDefaultScriptLanguage; } } #endregion #region Public Methods public static void SaveState() { var storage = new StorageService("Designer,Code"); storage.SetBool("EnableCodeCompletion", EnableCodeCompletion); storage.SetBool("EnableVirtualSpace", EnableVirtualSpace); storage.SetBool("UseSpaces", UseSpaces); storage.SetBool("AllowOutlining", AllowOutlining); storage.SetInt("TabSize", TabSize); storage.SetBool("LineNumbers", LineNumbers); storage.SetEnum("DefaultScriptLanguage", DefaultScriptLanguage); } static CodePageSettings() { var storage = new StorageService("Designer,Code"); EnableCodeCompletion = storage.GetBool("EnableCodeCompletion", true); EnableVirtualSpace = storage.GetBool("EnableVirtualSpace", true); UseSpaces = storage.GetBool("UseSpaces", true); AllowOutlining = storage.GetBool("AllowOutlining", true); TabSize = storage.GetInt("TabSize", 2); LineNumbers = storage.GetBool("LineNumbers", true); DefaultScriptLanguage = storage.GetEnum("DefaultScriptLanguage", Language.CSharp); } #endregion } }