Exemple #1
0
 public void Dispose()
 {
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     this.theBuffer = null;
 }
Exemple #2
0
        private IXmlSettings InstantiateSetting <T>()
        {
            IXmlSettings setting = Activator.CreateInstance(typeof(T))
                                   as IXmlSettings;

            SettingObjects.Add(setting);
            setting.SetDefaults();
            return(setting);
        }
        public XmlTagMatchingTagger(
            ITextView textView, ITextBuffer buffer,
            ITagAggregator <IClassificationTag> aggregator,
            IXmlSettings settings)
        {
            this.theView     = textView;
            this.theBuffer   = buffer;
            this.aggregator  = aggregator;
            this.settings    = settings;
            this.currentSpan = null;

            this.language = new XmlMarkup();

            this.theView.Closed += OnViewClosed;
            this.theView.Caret.PositionChanged += CaretPositionChanged;
            this.theView.LayoutChanged         += ViewLayoutChanged;
            this.settings.SettingsChanged      += OnSettingsChanged;
        }
Exemple #4
0
#pragma warning restore 67

        internal XmlTagger(
            ITextBuffer buffer,
            IClassificationTypeRegistryService registry,
            ITagAggregator <IClassificationTag> aggregator,
            IXmlSettings settings)
        {
            this.theBuffer            = buffer;
            this.settings             = settings;
            xmlCloseTagClassification =
                new ClassificationTag(registry.GetClassificationType(Constants.XML_CLOSING));
            xmlPrefixClassification =
                new ClassificationTag(registry.GetClassificationType(Constants.XML_PREFIX));
            xmlDelimiterClassification =
                new ClassificationTag(registry.GetClassificationType(Constants.DELIMITER));
            razorCloseTagClassification =
                new ClassificationTag(registry.GetClassificationType(Constants.RAZOR_CLOSING));
            settings.SettingsChanged += OnSettingsChanged;
            this.aggregator           = aggregator;
        }
 private void OnViewClosed(object sender, EventArgs e)
 {
     if (this.theView != null)
     {
         this.theView.Closed -= OnViewClosed;
         this.theView.Caret.PositionChanged -= CaretPositionChanged;
         this.theView.LayoutChanged         -= ViewLayoutChanged;
         this.theView = null;
     }
     if (this.settings != null)
     {
         this.settings.SettingsChanged -= OnSettingsChanged;
         this.settings = null;
     }
     if (this.aggregator != null)
     {
         this.aggregator.Dispose();
         this.aggregator = null;
     }
     this.theBuffer = null;
 }
Exemple #6
0
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        /// <summary>
        ///     MainWindows.
        ///     Gets a new movie list instance.
        /// </summary>
        public MainWindow()
        {
            _appBasic = new AppBasic(this);

            _xmlSettings = new XmlSettings();
            _xmlDatabase = new XmlDatabase(_xmlSettings);
            _movies      = new Movies(_xmlDatabase);
            IAppSettingsBase appSettingsBase = new AppSettingsBase(Settings.Default);

            _coreSettings = new ApplicationStyleSettings(appSettingsBase);
            InitializeComponent();
            var themeManagerHelper = new ThemeManagerHelper();

            _style = new ApplicationStyle(this, Accent, ThemeSwitch, _coreSettings, themeManagerHelper);
            _style.Load(true, true);
            _dialogService = new DialogService(this);
            _addEdit       = new AddEdit(this, _movies, _dialogService);
            ValidateSettings();
            var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();

            LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);
            _appBasic.SetComboBoxItems();
        }
Exemple #7
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="xmlSettings"></param>
 public XmlDatabase(IXmlSettings xmlSettings)
 {
     _xmlSettings = xmlSettings ?? throw new ArgumentNullException(nameof(xmlSettings));
 }
Exemple #8
0
 /// <summary>
 ///     Initialisiert eine neue Instanz der <see cref="T:System.Object" />-Klasse.
 /// </summary>
 /// <param name="mainWindow"></param>
 public AppBasic(MainWindow mainWindow)
 {
     _mainWindow  = mainWindow ?? throw new ArgumentNullException(nameof(mainWindow));
     _tools       = new Tools();
     _xmlSettings = new XmlSettings();
 }