Beispiel #1
0
        public void SaveSettings()
        {
            var settings = SettingsBuilder.GetSettings <IFinderSettings>(_view);

            settings.Options                = Options;
            settings.FindWhatHistory        = SerializeHistory(_view.GetFindWhatHistory());
            settings.ReplaceWithHistory     = SerializeHistory(_view.GetReplaceWithHistory());
            settings.LookInHistory          = SerializeHistory(_view.GetLookInHistory());
            settings.LookAtFileTypesHistory = SerializeHistory(_view.GetLookAtFileTypesHistory());
        }
Beispiel #2
0
        private void LoadSettings()
        {
            var settings = SettingsBuilder.GetSettings <IFinderSettings>(_view);

            _view.LoadFindWhatHistory(ParseHistory(settings.FindWhatHistory));
            _view.LoadReplaceWithHistory(ParseHistory(settings.ReplaceWithHistory));
            _view.LoadLookInHistory(ParseHistory(settings.LookInHistory));
            _view.LoadLookAtFileTypesHistory(ParseHistory(settings.LookAtFileTypesHistory));

            SetOptions(settings.Options, settings.Options);
        }
Beispiel #3
0
        protected override Control CreateClient()
        {
            var fontSettings = SettingsBuilder.GetSettings <IFontSettings>(this);

            var control = new TextEditorControl
            {
                Font = fontSettings.CodeFont ?? Constants.DefaultCodeFont,
                ConvertTabsToSpaces = true,
                Site = new SiteProxy(this)
            };

            HookEvents(control.ActiveTextAreaControl);

            return(control);
        }
Beispiel #4
0
        private void _textViewer_UnifiedDiffChanged(object sender, EventArgs e)
        {
            NiDiffViewerMode mode;

            if (_textViewer.UnifiedDiff)
            {
                mode = NiDiffViewerMode.Unified;
            }
            else
            {
                mode = NiDiffViewerMode.SideBySide;
            }

            if (Mode != NiDiffViewerMode.Default)
            {
                Mode = mode;
            }
            else
            {
                SettingsBuilder.GetSettings <IDiffViewerSettings>(Site).DefaultMode = mode;
            }
        }
Beispiel #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(
            IServiceCollection services)
        {
            var dbSettings = SettingsBuilder.GetDbSettings();

            services.AddControllers();
            services.AddSwaggerGen(
                c => {
                c.SwaggerDoc(
                    "v1",
                    new OpenApiInfo {
                    Title   = "TheStore.Api.Core",
                    Version = "v1"
                });
            });
            var settingsBuilder = new SettingsBuilder(new DbHelper(SettingsBuilder.GetDbSettings()));

            services.AddTransient(provider => settingsBuilder.GetSettings());
            services.AddSingleton <PriorityQueue>();
            services.AddSingleton <BackgroundWorks>();
            services.AddTransient(r =>
                                  new TheStoreRepository(dbSettings.GetConnectionString(), dbSettings.Version));
            services.AddScoped(r => new DbHelper(dbSettings));
        }
Beispiel #6
0
 private void _textViewer_IgnoreWhitespaceChanged(object sender, EventArgs e)
 {
     SettingsBuilder.GetSettings <IDiffViewerSettings>(Site).IgnoreWhitespace = _textViewer.IgnoreWhitespace;
 }
Beispiel #7
0
        private void FontsControl_Load(object sender, EventArgs e)
        {
            _settings = SettingsBuilder.GetSettings <IFontSettings>(Site);

            InitializeFontControl(_font, _settings.CodeFont ?? Constants.DefaultCodeFont);
        }
 public object GetSettings(Type type)
 {
     return(_settingsBuilder.GetSettings(type));
 }