// should be locked private void Init() { DebugHelper.AssertUIThread(); if (this.localComputer == null) { this.localComputer = new MostRecentlyUsedState(); this.sessionStateService = ToolsUIApplication.Instance.RootServiceProvider.GetService(typeof(ISessionStateService)) as ISessionStateService; if (this.sessionStateService != null) { this.sessionStateService.DeclareSessionStateVariable("MostRecentlyUsed-LocalComputer", this.localComputer); string alias = Environment.MachineName; TargetMostRecentlyUsedState mruState = new TargetMostRecentlyUsedState(alias); this.targets[alias] = mruState; this.sessionStateService.DeclareSessionStateVariable("MostRecentlyUsed-Target-" + mruState.Id, mruState); } this.openReadOnlyFileTabControls.Add(new OpenTabItemData() { SubMode = "ComputerReadOnly", Header = Strings.SingleBoxReadOnlyDevelopmentComputer_Label, Shortcut = Strings.SingleBoxReadOnlyDevelopmentComputer_Shortcut, ContentTemplate = Application.Current.Resources["OpenSingleBoxReadOnlyTemplate"] as DataTemplate, IconTemplate = Application.Current.Resources["LocalComputerIconTemplate"] as DataTemplate, Content = new Tuple <string, object>(null, this.localComputer.Items), }); this.openWritableFileTabControls.Add(new OpenTabItemData() { SubMode = "ComputerEdit", Header = Strings.SingleBoxWritableDevelopmentComputer_Label, Shortcut = Strings.SingleBoxWritableDevelopmentComputer_Shortcut, ContentTemplate = Application.Current.Resources["OpenSingleBoxWritableTemplate"] as DataTemplate, IconTemplate = Application.Current.Resources["LocalComputerIconTemplate"] as DataTemplate, Content = new Tuple <string, object>(null, this.localComputer.Items), }); } }
// should be locked private void Init() { DebugHelper.AssertUIThread(); if (this.localComputer == null) { this.localComputer = new MostRecentlyUsedState(); this.sessionStateService = ToolsUIApplication.Instance.RootServiceProvider.GetService(typeof(ISessionStateService)) as ISessionStateService; if (this.sessionStateService != null) { this.sessionStateService.DeclareSessionStateVariable("MostRecentlyUsed-LocalComputer", this.localComputer); string alias = Environment.MachineName; TargetMostRecentlyUsedState mruState = new TargetMostRecentlyUsedState(alias); this.targets[alias] = mruState; this.sessionStateService.DeclareSessionStateVariable("MostRecentlyUsed-Target-" + mruState.Id, mruState); } this.openReadOnlyFileTabControls.Add(new OpenTabItemData() { SubMode = "ComputerReadOnly", Header = Strings.SingleBoxReadOnlyDevelopmentComputer_Label, Shortcut = Strings.SingleBoxReadOnlyDevelopmentComputer_Shortcut, ContentTemplate = Application.Current.Resources["OpenSingleBoxReadOnlyTemplate"] as DataTemplate, IconTemplate = Application.Current.Resources["LocalComputerIconTemplate"] as DataTemplate, Content = new Tuple<string, object>(null, this.localComputer.Items), }); this.openWritableFileTabControls.Add(new OpenTabItemData() { SubMode = "ComputerEdit", Header = Strings.SingleBoxWritableDevelopmentComputer_Label, Shortcut = Strings.SingleBoxWritableDevelopmentComputer_Shortcut, ContentTemplate = Application.Current.Resources["OpenSingleBoxWritableTemplate"] as DataTemplate, IconTemplate = Application.Current.Resources["LocalComputerIconTemplate"] as DataTemplate, Content = new Tuple<string, object>(null, this.localComputer.Items), }); } }