Example #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         if (disposing) // dispose of managed resources
         {
             Tracer.WriteTraceMethodLine();
             PageSettingsDataSource.Save(PageSettings);
             PageSettings = null;
             PageTemplate = null;
         }
         _disposed = true;
     }
 }
Example #2
0
        private void UnbindTemplate(Templates.IPageTemplatePresenter template)
        {
            Tracer.WriteTraceMethodLine();
            var model = PageSettings;

            model.ColorChanged -= template.ChangeColor;
            model.RuleLinesHorizontalColorChanged -=
                template.ChangeRuleLinesHorizontalColor;
            model.RuleLinesHorizontalSpacingChanged -=
                template.ChangeRuleLinesHorizontalSpacing;
            model.RuleLinesMarginColorChanged -=
                template.ChangeRuleLinesMarginColor;
            model.RuleLinesVisibleChanged -= template.ChangeRuleLinesVisible;
            model.TitleChanged            -= template.ChangeTitle;
        }
Example #3
0
        private void BindTemplate(OneNote.IApplication application)
        {
            var template = PageTemplate;

            if (template != null)
            {
                UnbindTemplate(template);
            }

            var model = PageSettings;

            template            = TemplateFactory.CreatePageTemplate(application);
            model.ColorChanged += template.ChangeColor;
            model.RuleLinesHorizontalColorChanged +=
                template.ChangeRuleLinesHorizontalColor;
            model.RuleLinesHorizontalSpacingChanged +=
                template.ChangeRuleLinesHorizontalSpacing;
            model.RuleLinesMarginColorChanged +=
                template.ChangeRuleLinesMarginColor;
            model.RuleLinesVisibleChanged += template.ChangeRuleLinesVisible;
            model.TitleChanged            += template.ChangeTitle;
            PageTemplate = template;
            Tracer.WriteTraceMethodLine();
        }