123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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
- }
- }
|