public void Load(IConfigurationObject value)
 {
     this.ConvertTabsToSpace  = (bool)value.GetProperty(this.prefix + "ConvertTabsToSpace", (object)false);
     this.TabSize             = (int)value.GetProperty(this.prefix + "TabSize", (object)4);
     this.UnescapedFontFamily = (string)value.GetProperty(this.prefix + "FontFamily", (object)EditorSpecificOptionsModel.GetDefaultFont());
     this.FontSize            = (double)value.GetProperty(this.prefix + "FontSize", (object)10.0);
     this.WordWrap            = (bool)value.GetProperty(this.prefix + "WordWrap", (object)false);
 }
Example #2
0
 public void Load(IConfigurationObject config)
 {
     this.configurationObject = config;
     this.isInitializing      = true;
     this.ShowAnnotations     = (bool)config.GetProperty("ShowAnnotations", (object)false);
     this.AuthorName          = (string)config.GetProperty("AuthorName", (object)null);
     this.AuthorInitials      = (string)config.GetProperty("AuthorInitials", (object)null);
     this.isInitializing      = false;
 }
Example #3
0
 public void Load(IConfigurationObject value)
 {
     if (value != null)
     {
         this.NameInteractiveElementsByDefault = (bool)value.GetProperty(ProjectSystemOptionsModel.NameInteractiveElementsByDefaultProperty, false);
         this.ShowSecurityWarning = (bool)value.GetProperty(ProjectSystemOptionsModel.ShowSecurityWarningProperty, true);
         this.UseVisualStudioEventHandlerSupport = (bool)value.GetProperty(ProjectSystemOptionsModel.UseVisualStudioEventHandlerSupportProperty, false);
         this.LargeImageWarningThreshold         = (int)value.GetProperty(ProjectSystemOptionsModel.LargeImageWarningThresholdProperty, 250);
     }
 }
Example #4
0
 public void Load(IConfigurationObject value)
 {
     this.configurationObject = value;
     this.isInitializing      = true;
     this.ViewMode            = (ViewMode)value.GetProperty("ViewMode", (object)ViewMode.Design);
     this.IsVerticalSplit     = (bool)value.GetProperty("IsVerticalSplit", (object)true);
     this.IsDesignOnTop       = (bool)value.GetProperty("IsDesignOnTop", (object)true);
     this.SplitRatio          = (double)value.GetProperty("SplitRatio", (object)0.8);
     this.isInitializing      = false;
 }
Example #5
0
 public void Load(IConfigurationObject value)
 {
     this.configurationObject = value;
     this.isInitializing      = true;
     this.UnitType            = (UnitType)value.GetProperty("UnitType", (object)UnitType.Points);
     this.isInitializing      = false;
 }
 public static T GetPropertyOrDefault <T>(this IConfigurationObject configurationObject, string propertyName)
 {
     if (!configurationObject.HasProperty(propertyName))
     {
         return(default(T));
     }
     return(TypeHelper.ConvertType <T>(configurationObject.GetProperty(propertyName)));
 }
        public static MessageBoxResult ShowSuppressibleWarning(this IServiceProvider source, MessageBoxArgs args, string optionIdentifier, MessageBoxResult suppressedResult, IConfigurationObject configObject)
        {
            bool flag = (configObject != null ? (bool)configObject.GetProperty(optionIdentifier, false) : false);

            if (flag)
            {
                return(suppressedResult);
            }
            MessageBoxResult messageBoxResult = source.MessageDisplayService().ShowMessage(args, out flag);

            if (flag && configObject != null)
            {
                configObject.SetProperty(optionIdentifier, true);
            }
            return(messageBoxResult);
        }
        public static T GetOrCreateProperty <T>(this IConfigurationObject configurationObject, string propertyName, Func <T> propertyConstructor)
            where T : class
        {
            T property;

            if (propertyConstructor == null)
            {
                throw new ArgumentNullException("propertyConstructor");
            }
            if (configurationObject.HasProperty(propertyName))
            {
                property = (T)(configurationObject.GetProperty(propertyName) as T);
                if (property != null)
                {
                    return(property);
                }
            }
            property = propertyConstructor();
            configurationObject.SetProperty(propertyName, property);
            return(property);
        }
Example #9
0
 public WindowService(IConfigurationObject configuration, ICommandBarService commandBarService, ICommandService commandService, IViewService viewService, IWorkspaceService workspaceService, IMessageDisplayService messageDisplayService, IFeedbackService feedbackService, FrameworkElement mainWindowRootElement, ResourceDictionary icons, ReadOnlyCollection <Theme> themes, bool suppressViewUI)
 {
     PerformanceUtility.StartPerformanceSequence(PerformanceEvent.WindowServiceConstructor);
     this.applicationWindow                    = new ApplicationWindow(configuration, feedbackService);
     this.applicationWindow.Closed            += new EventHandler(this.ApplicationWindow_Closed);
     this.applicationWindow.Closing           += new CancelEventHandler(this.ApplicationWindow_Closing);
     this.applicationWindow.ClosingCanceled   += new EventHandler(this.ApplicationWindow_ClosingCanceled);
     this.applicationWindow.KeyDown           += new KeyEventHandler(this.ApplicationWindow_KeyDown);
     this.applicationWindow.PreviewKeyDown    += new KeyEventHandler(this.ApplicationWindow_PreviewKeyDown);
     this.applicationWindow.ThemeChanged      += new EventHandler(this.ApplicationWindow_ThemeChanged);
     this.applicationWindow.StateChanged      += new EventHandler(this.ApplicationWindow_StateChanged);
     this.applicationWindow.SourceInitialized += new EventHandler(this.ApplicationWindow_SourceInitialized);
     EventManager.RegisterClassHandler(typeof(GroupControl), UIElement.GotKeyboardFocusEvent, (Delegate) new KeyboardFocusChangedEventHandler(this.OnTabGroupGotKeyboardFocus));
     EventManager.RegisterClassHandler(typeof(DocumentGroupControl), UIElement.KeyDownEvent, (Delegate) new KeyEventHandler(this.OnDocumentGroupKeyDownOrUp));
     EventManager.RegisterClassHandler(typeof(DocumentGroupControl), UIElement.KeyUpEvent, (Delegate) new KeyEventHandler(this.OnDocumentGroupKeyDownOrUp));
     this.commandService   = commandService;
     this.viewService      = viewService;
     this.workspaceService = workspaceService;
     if (icons != null)
     {
         this.AddResourceDictionary(icons);
     }
     if (themes.Count > 0)
     {
         foreach (ITheme theme in themes)
         {
             this.Themes.Add(theme);
         }
         if (configuration != null)
         {
             this.ActiveTheme = (string)configuration.GetProperty("ActiveTheme", (object)this.Themes[0].Name);
             int num = -1;
             for (int index = 0; index < this.Themes.Count; ++index)
             {
                 if (this.Themes[index].Name == this.ActiveTheme)
                 {
                     num = index;
                     break;
                 }
             }
             if (feedbackService != null)
             {
                 feedbackService.SetData(25, num + 1);
             }
         }
     }
     PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Create PaletteRegistry");
     this.paletteRegistry       = new PaletteRegistry(workspaceService);
     ViewElementFactory.Current = (ViewElementFactory) new ExpressionViewElementFactory();
     if (!suppressViewUI)
     {
         this.dockingViewManager = new ExpressionViewManager();
         ViewManager.Instance    = (ViewManager)this.dockingViewManager;
         DockManager.Instance    = (DockManager) new ExpressionDockManager();
         if (viewService != null)
         {
             this.viewBridge = new ViewBridge(this.workspaceService, this.viewService, messageDisplayService);
         }
     }
     PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Create CommandBarService");
     this.commandBarService = commandBarService;
     TextBoxHelper.RegisterType(typeof(TextBox));
     PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Load Window Content");
     this.mainBody = mainWindowRootElement;
     if (this.mainBody != null)
     {
         this.mainBody.DataContext = (object)this;
         FrameworkElement frameworkElement = this.commandBarService as FrameworkElement;
         if (frameworkElement != null)
         {
             frameworkElement.Name = "CommandBarService";
             frameworkElement.VerticalAlignment = VerticalAlignment.Top;
             frameworkElement.SetValue(Grid.ColumnSpanProperty, (object)2);
             ((Panel)this.mainBody).Children.Insert(0, (UIElement)frameworkElement);
         }
     }
     PerformanceUtility.MarkInterimStep(PerformanceEvent.WindowServiceConstructor, "Hookup Tree to Window Content");
     this.applicationWindow.Content = (object)mainWindowRootElement;
     PerformanceUtility.EndPerformanceSequence(PerformanceEvent.WindowServiceConstructor);
 }
Example #10
0
 public void Load(IConfigurationObject value)
 {
     this.LastSelectedEditor = (int)value.GetProperty("LastSelectedIndex", (object)CodeOptionsModel.DefaultLastSelectedEditor);
     this.LoadCore(value);
 }
 public void ReadFromConfiguration(IConfigurationObject configurationObject)
 {
     this.Size       = (GridLength)configurationObject.GetProperty("Size", (object)GridLength.Auto);
     this.IsExpanded = (bool)configurationObject.GetProperty("IsExpanded", (object)true);
 }
Example #12
0
 public void WriteToConfiguration(IConfigurationObject configurationObject)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         ExpandoListItemModel expandoListItemModel = this.Items[index] as ExpandoListItemModel;
         if (expandoListItemModel != null)
         {
             IConfigurationObject configurationObject1 = (IConfigurationObject)configurationObject.GetProperty(expandoListItemModel.Identifier);
             if (configurationObject1 == null)
             {
                 configurationObject1 = configurationObject.CreateConfigurationObject();
                 configurationObject.SetProperty(expandoListItemModel.Identifier, (object)configurationObject1);
             }
             expandoListItemModel.WriteToConfiguration(configurationObject1);
         }
     }
 }
Example #13
0
 public void ReadFromConfiguration(IConfigurationObject configurationObject)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         ExpandoListItemModel expandoListItemModel = this.Items[index] as ExpandoListItemModel;
         if (expandoListItemModel != null)
         {
             IConfigurationObject configurationObject1 = (IConfigurationObject)configurationObject.GetProperty(expandoListItemModel.Identifier);
             if (configurationObject1 != null)
             {
                 expandoListItemModel.ReadFromConfiguration(configurationObject1);
             }
         }
     }
 }
Example #14
0
        private void OnFirstIdle()
        {
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.StartupCacheWarmUp);
            PerformanceUtility.EndPerformanceSequence(PerformanceEvent.PostingFirstIdleandCallingApplicationRun);
            ICommandLineService service1 = this.Services.GetService <ICommandLineService>();

            this.CloseWelcomeSplashScreen();
            ILicenseService service2 = this.Services.GetService <ILicenseService>();

            BlendApplication.InitializeLicensingDialogResource(service2);
            if (!(service2 is LicenseService) || !LicensingDialogHelper.EnsureProductIsLicensed(this.Services, 0))
            {
                this.Shutdown(-1);
            }
            else
            {
                this.MainWindow.IsEnabled = true;
                this.MainWindow.Focus();
                if (service1.GetArguments("PerfTest") != null)
                {
                    string[] arguments = service1.GetArguments("PerfTest");
                    if (arguments.Length == 1)
                    {
                        new PerformanceTester(this.Services).RunTestFile(arguments[0]);
                    }
                }
                else
                {
                    IProjectManager service3 = this.Services.GetService <IProjectManager>();
                    service3.InitializeRecentProjects();
                    if (this.Services.GetService <IFeedbackService>().ShouldPromptAtStartup)
                    {
                        new FeedbackOptionsCommand(this.Services).Execute();
                    }
                    BlendSdkHelper.PromptUserForMissingSdk(this.Services);
                    this.ShowMefComposeError();
                    bool     flag      = true;
                    string[] arguments = service1.GetArguments(string.Empty);
                    if (arguments == null || arguments.Length != 1)
                    {
                        IConfigurationObject configurationObject = this.Services.GetService <IConfigurationService>()["WindowService"];
                        if (configurationObject != null)
                        {
                            object property = configurationObject.GetProperty("SkipWelcomeScreen");
                            if (property != null && property is bool && (bool)property)
                            {
                                flag = false;
                            }
                        }
                    }
                    if (service1.GetArgument("SkipWelcomeScreen") != null || this.TestingStartup)
                    {
                        flag = false;
                    }
                    service3.InitializeFromKnownProjects((string[])null);
                    if (flag && service3.CurrentSolution == null)
                    {
                        WelcomeScreen.Show(this.Services);
                    }
                }
                string[] arguments1 = service1.GetArguments("actions");
                if (arguments1 != null && arguments1.Length == 1)
                {
                    new ActionProcessor().ProcessActionFile(arguments1[0], this.Services);
                }
                this.Services.GetService <SplashService>().UpdateSplashVersion(service2);
            }
        }
Example #15
0
 /// <summary>
 /// </summary>
 public void Load(IConfigurationObject value)
 {
     this.ConvertTabsToSpace = (Boolean)value.GetProperty("ConvertTabsToSpace", false);
     this.TabSize            = (Int32)value.GetProperty("TabSize", 4);
 }
		/// <summary>
		/// </summary>
		public void Load(IConfigurationObject value)
		{
			this.ConvertTabsToSpace = (Boolean)value.GetProperty("ConvertTabsToSpace", false);
			this.TabSize = (Int32)value.GetProperty("TabSize", 4);
		}