/// <summary> /// This function is the callback used to execute a command when the a menu item is clicked. /// See the Initialize method to see how the menu item is associated to this function using /// the OleMenuCommandService service and the MenuCommand class. /// </summary> private void MenuItemCallback(object sender, EventArgs e) { if (!Application.Current.Windows.OfType <SpriteContainer>().Any()) { SpriteContainer container = new SpriteContainer(this); } Application.Current.Windows.OfType <SpriteContainer>().First().Show(); }
void MainWindow_ContentRendered(object sender, EventArgs e) { var componentModel = (IComponentModel)(GetService(typeof(SComponentModel))); IClippyVSSettings s = componentModel.DefaultExportProvider.GetExportedValue <IClippyVSSettings>(); SpriteContainer container = new SpriteContainer(this); if (s.ShowAtStartup) { container.Show(); } }
async void MainWindow_ContentRendered(object sender, EventArgs e) { var token = new CancellationToken(); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(token); var shellSettingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider); var writableSettingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); IClippyVSSettings settings = new ClippyVSSettings(writableSettingsStore); SpriteContainer container = new SpriteContainer(this); if (settings.ShowAtStartup) { container.Show(); } }