public PreferenceWindow() { InitializeComponent(); HelpButton.Click += HelpButton_Click; SaveState(); LoadState(); var optionModels = GisEditorHelper.GetManagers().Select(m => m.GetSettingsUI()).Where(c => c != null) .Concat(GisEditorHelper.GetManagers().OfType <PluginManager>().SelectMany(m => m.GetPlugins().Where(p => p.IsActive).OrderByDescending(p => p.Index) .Select(p => p.GetSettingsUI()).Where(c => c != null))) .Select(c => new TreeViewItemModel(c)).ToList(); GroupTreeViewItems(optionModels); foreach (var optionModel in optionModels) { PreferenceTreeView.Items.Add(optionModel.ToTreeViewItem()); } if (PreferenceTreeView.HasItems) { TreeViewItem item = PreferenceTreeView.Items[0] as TreeViewItem; if (item != null) { item.IsSelected = true; } } }
public RecentProjectModel(Uri path, string projectPluginType, int index = 1, int trimFromCharIndex = 40) { FullPath = path; Index = index; Label = GisEditorHelper.SimplifyPath(path.LocalPath, trimFromCharIndex); ProjectPluginType = projectPluginType; isEnabled = true; }
private static IEnumerable <IStorableSettings> GetSettings() { var managerSettings = GisEditorHelper.GetManagers().Cast <IStorableSettings>(); var pluginSettings = GisEditor.InfrastructureManager.GetManagers() .OfType <PluginManager>() .SelectMany(m => m.GetPlugins()); return(managerSettings.Concat(pluginSettings)); }
public RestoreBackupWindow() { InitializeComponent(); autoSavedProjectFileContent = GetBackupProjectFileContent(GisEditorHelper.GetBackupProjectFolder()); savedProjectFileContent = GetBackupProjectFileContent(GisEditorHelper.GetLastSavedBackupProjectFolder()); openProjectFileContent = GetBackupProjectFileContent(GisEditorHelper.GetLastOpenBackupProjectFolder()); rbtnAutoSave.IsEnabled = !string.IsNullOrEmpty(autoSavedProjectFileContent[0]); rbtnSave.IsEnabled = !string.IsNullOrEmpty(savedProjectFileContent[0]); rbtnOpen.IsEnabled = !string.IsNullOrEmpty(openProjectFileContent[0]); needOpen = rbtnAutoSave.IsEnabled || rbtnSave.IsEnabled || rbtnOpen.IsEnabled; }
public static void Started(string startupProjectPath) { AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; GisEditorUserControl gisEditorUserControl = new GisEditorUserControl(startupProjectPath); Window window = new Window(); Application.Current.MainWindow = window; window.Title = GisEditor.LanguageManager.GetStringResource("ShellDscMapSuiteGISDscTitle"); window.Icon = new BitmapImage(new Uri("pack://application:,,,/MapSuiteGisEditor;component/Images/logo.png", UriKind.Absolute)); window.SetBinding(Window.FlowDirectionProperty, new Binding() { Source = GisEditor.LanguageManager, Path = new PropertyPath("FlowDirection") }); ApplyWindowStyle(window); window.Content = gisEditorUserControl; gisEditorUserControl.Load(); GisEditorHelper.RestoreWindowLocation(window, startScreen); window.Loaded += new RoutedEventHandler(window_Loaded); window.Show(); }