├── .github
├── FUNDING.yml
└── workflows
│ └── ci.yml
├── .gitignore
├── CHANGELOG.md
├── LICENCE.txt
├── README.md
├── doc
├── gemini-demo.png
├── gemini-everything-blue.png
├── gemini-everything-light.png
├── gemini-module-codeeditor.png
├── gemini-module-errorlist.png
├── gemini-module-grapheditor.png
├── gemini-module-inspector.png
├── gemini-module-mainmenu.png
├── gemini-module-output.png
├── gemini-module-propertygrid.png
├── gemini-module-shell.png
├── gemini-module-statusbar.png
├── gemini-module-toolbars.png
├── gemini-module-toolbox.png
└── gemini-module-undoredo.png
├── src
├── .editorconfig
├── .vscode
│ └── launch.json
├── Directory.Build.props
├── Gemini.Demo
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── DemoAppBootstrapper.cs
│ ├── Gemini.Demo.csproj
│ ├── Modules
│ │ ├── FilterDesigner
│ │ │ ├── Commands
│ │ │ │ ├── OpenGraphCommandDefinition.cs
│ │ │ │ └── OpenGraphCommandHandler.cs
│ │ │ ├── Design
│ │ │ │ ├── DesignTimeGraphViewModel.cs
│ │ │ │ └── DesignTimeImages.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── Resources
│ │ │ │ ├── Styles.xaml
│ │ │ │ ├── action_add_16xLG.png
│ │ │ │ ├── active_x_16xLG.png
│ │ │ │ ├── color_swatch.png
│ │ │ │ └── image.png
│ │ │ ├── Sample.cs
│ │ │ ├── ShaderEffects
│ │ │ │ ├── AddEffect.cs
│ │ │ │ ├── AddEffect.fx
│ │ │ │ ├── MultiplyEffect.cs
│ │ │ │ ├── MultiplyEffect.fx
│ │ │ │ └── ShaderEffectBase.cs
│ │ │ ├── Util
│ │ │ │ ├── BitmapUtility.cs
│ │ │ │ ├── FastBitmap.cs
│ │ │ │ └── ShaderEffectUtility.cs
│ │ │ ├── ViewModels
│ │ │ │ ├── ConnectionViewModel.cs
│ │ │ │ ├── ConnectorDirection.cs
│ │ │ │ ├── ConnectorViewModel.cs
│ │ │ │ ├── ElementViewModel.cs
│ │ │ │ ├── Elements
│ │ │ │ │ ├── Add.cs
│ │ │ │ │ ├── ColorInput.cs
│ │ │ │ │ ├── DynamicElement.cs
│ │ │ │ │ ├── ImageSource.cs
│ │ │ │ │ ├── Multiply.cs
│ │ │ │ │ └── ShaderEffectElement.cs
│ │ │ │ ├── GraphViewModel.cs
│ │ │ │ ├── InputConnectorViewModel.cs
│ │ │ │ └── OutputConnectorViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── GraphView.xaml
│ │ │ │ └── GraphView.xaml.cs
│ │ ├── Home
│ │ │ ├── Commands
│ │ │ │ ├── ViewHelixCommandDefinition.cs
│ │ │ │ ├── ViewHelixCommandHandler.cs
│ │ │ │ ├── ViewHomeCommandDefinition.cs
│ │ │ │ └── ViewHomeCommandHandler.cs
│ │ │ ├── Module.cs
│ │ │ ├── ViewModels
│ │ │ │ ├── HelixViewModel.cs
│ │ │ │ ├── HomeViewModel.cs
│ │ │ │ └── IDemoScript.cs
│ │ │ └── Views
│ │ │ │ ├── HelixView.xaml
│ │ │ │ ├── HelixView.xaml.cs
│ │ │ │ ├── HomeView.xaml
│ │ │ │ ├── HomeView.xaml.cs
│ │ │ │ └── IHelixView.cs
│ │ ├── SampleBrowser
│ │ │ ├── ISample.cs
│ │ │ ├── Module.cs
│ │ │ ├── ViewModels
│ │ │ │ └── SampleBrowserViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── SampleBrowserView.xaml
│ │ │ │ └── SampleBrowserView.xaml.cs
│ │ ├── Shell
│ │ │ ├── ViewModels
│ │ │ │ ├── DemoApplicationSettingsViewModel.cs
│ │ │ │ └── ShellViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── DemoApplicationSettingsView.xaml
│ │ │ │ └── DemoApplicationSettingsView.xaml.cs
│ │ ├── Startup
│ │ │ └── Module.cs
│ │ └── TextEditor
│ │ │ ├── EditorProvider.cs
│ │ │ ├── ViewModels
│ │ │ └── EditorViewModel.cs
│ │ │ └── Views
│ │ │ ├── EditorView.xaml
│ │ │ └── EditorView.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── PublishProfiles
│ │ │ ├── FolderProfileNet5.pubxml
│ │ │ └── FolderProfileNetCore31.pubxml
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ └── Splash.png
│ └── app.config
├── Gemini.Modules.CodeCompiler
│ ├── CodeCompiler.cs
│ ├── Gemini.Modules.CodeCompiler.csproj
│ └── ICodeCompiler.cs
├── Gemini.Modules.CodeEditor
│ ├── CodeEditorToolBarDefinitions.cs
│ ├── Commands
│ │ ├── ShowEndOfLineCommandDefinition.cs
│ │ ├── ShowLineNumbersCommandDefinition.cs
│ │ ├── ShowSpacesCommandDefinition.cs
│ │ ├── ShowTabsCommandDefinition.cs
│ │ └── WordWrapCommandDefinition.cs
│ ├── Controls
│ │ └── CodeEditor.cs
│ ├── DefaultLanguageDefinition.cs
│ ├── EditorProvider.cs
│ ├── Gemini.Modules.CodeEditor.csproj
│ ├── ILanguageDefinition.cs
│ ├── LanguageDefinitionManager.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ └── Icons
│ │ │ ├── Find.png
│ │ │ ├── ShowEndOfLine.png
│ │ │ ├── ShowLineNumbers.png
│ │ │ ├── ShowSpaces.png
│ │ │ ├── ShowTabs.png
│ │ │ └── WordWrap.png
│ ├── ViewModels
│ │ ├── CodeEditorSettingsViewModel.cs
│ │ └── CodeEditorViewModel.cs
│ └── Views
│ │ ├── CodeEditorSettingsView.xaml
│ │ ├── CodeEditorSettingsView.xaml.cs
│ │ ├── CodeEditorView.xaml
│ │ ├── CodeEditorView.xaml.cs
│ │ └── ICodeEditorView.cs
├── Gemini.Modules.ErrorList
│ ├── Commands
│ │ ├── ToggleErrorsCommandDefinition.cs
│ │ ├── ToggleErrorsWarningsMessagesCommandHandler.cs
│ │ ├── ToggleMessagesCommandDefinition.cs
│ │ ├── ToggleWarningsCommandDefinition.cs
│ │ ├── ViewErrorListCommandDefinition.cs
│ │ └── ViewErrorListCommandHandler.cs
│ ├── Converters
│ │ └── ErrorListItemTypeToImageConverter.cs
│ ├── Design
│ │ └── DesignTimeErrorListViewModel.cs
│ ├── ErrorListItem.cs
│ ├── ErrorListItemType.cs
│ ├── Gemini.Modules.ErrorList.csproj
│ ├── IErrorList.cs
│ ├── MenuDefinitions.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ ├── Error.png
│ │ ├── Message.png
│ │ └── Warning.png
│ ├── ToolBarDefinitions.cs
│ ├── ViewModels
│ │ └── ErrorListViewModel.cs
│ └── Views
│ │ ├── ErrorListView.xaml
│ │ └── ErrorListView.xaml.cs
├── Gemini.Modules.GraphEditor
│ ├── Controls
│ │ ├── AnimationHelper.cs
│ │ ├── BezierLine.cs
│ │ ├── ConnectionDragCompletedEventArgs.cs
│ │ ├── ConnectionDragEventArgs.cs
│ │ ├── ConnectionDragStartedEventArgs.cs
│ │ ├── ConnectionDraggingEventArgs.cs
│ │ ├── ConnectionItem.cs
│ │ ├── ConnectionItemsControl.cs
│ │ ├── ConnectorItem.cs
│ │ ├── ConnectorItemDragCompletedEventArgs.cs
│ │ ├── ConnectorItemDragStartedEventArgs.cs
│ │ ├── ConnectorItemDraggingEventArgs.cs
│ │ ├── ElementItem.cs
│ │ ├── ElementItemsControl.cs
│ │ ├── GraphControl.cs
│ │ ├── ZoomAndPanControl.cs
│ │ └── ZoomAndPanControl_IScrollInfo.cs
│ ├── Converters
│ │ └── ColorToBrushConverter.cs
│ ├── Gemini.Modules.GraphEditor.csproj
│ ├── Module.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── Themes
│ │ └── Generic.xaml
├── Gemini.Modules.Inspector
│ ├── BoundPropertyDescriptor.cs
│ ├── Commands
│ │ ├── ViewInspectorCommandDefinition.cs
│ │ └── ViewInspectorCommandHandler.cs
│ ├── Controls
│ │ ├── InspectorGrid.cs
│ │ ├── InspectorItemTemplateSelector.cs
│ │ ├── NumericTextBox.cs
│ │ ├── ScreenColorPicker.cs
│ │ └── SimpleGridSplitter.cs
│ ├── Conventions
│ │ ├── DefaultPropertyInspectors.cs
│ │ ├── EnumPropertyEditorBuilder.cs
│ │ ├── PropertyEditorBuilder.cs
│ │ ├── RangePropertyEditorBuilder.cs
│ │ └── StandardPropertyEditorBuilder.cs
│ ├── Gemini.Modules.Inspector.csproj
│ ├── IInspectableObject.cs
│ ├── IInspectorTool.cs
│ ├── InspectableObject.cs
│ ├── InspectableObjectBuilder.cs
│ ├── InspectorBuilder.cs
│ ├── Inspectors
│ │ ├── BitmapSourceEditorView.xaml
│ │ ├── BitmapSourceEditorView.xaml.cs
│ │ ├── BitmapSourceEditorViewModel.cs
│ │ ├── ChangeObjectValueAction.cs
│ │ ├── CheckBoxEditorView.xaml
│ │ ├── CheckBoxEditorView.xaml.cs
│ │ ├── CheckBoxEditorViewModel.cs
│ │ ├── CollapsibleGroupBuilder.cs
│ │ ├── CollapsibleGroupView.xaml
│ │ ├── CollapsibleGroupView.xaml.cs
│ │ ├── CollapsibleGroupViewModel.cs
│ │ ├── ColorEditorView.xaml
│ │ ├── ColorEditorView.xaml.cs
│ │ ├── ColorEditorViewModel.cs
│ │ ├── EditorBase.cs
│ │ ├── EnumEditorView.xaml
│ │ ├── EnumEditorView.xaml.cs
│ │ ├── EnumEditorViewModel.cs
│ │ ├── IEditor.cs
│ │ ├── IInspector.cs
│ │ ├── ILabelledInspector.cs
│ │ ├── InspectorBase.cs
│ │ ├── Point3DEditorView.xaml
│ │ ├── Point3DEditorView.xaml.cs
│ │ ├── Point3DEditorViewModel.cs
│ │ ├── RangeEditorView.xaml
│ │ ├── RangeEditorView.xaml.cs
│ │ ├── RangeEditorViewModel.cs
│ │ ├── ResetObjectValueAction.cs
│ │ ├── SelectiveUndoEditorBase.cs
│ │ ├── TextBoxEditorView.xaml
│ │ ├── TextBoxEditorView.xaml.cs
│ │ └── TextBoxEditorViewModel.cs
│ ├── MenuDefinitions.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ └── Resources.zh-Hans.resx
│ ├── Resources
│ │ ├── Resources.xaml
│ │ └── eyedropper_16xLG.png
│ ├── Themes
│ │ └── Generic.xaml
│ ├── Util
│ │ ├── ExpressionUtility.cs
│ │ └── ScreenShotUtility.cs
│ ├── ViewModels
│ │ └── InspectorViewModel.cs
│ ├── Views
│ │ ├── InspectorView.xaml
│ │ └── InspectorView.xaml.cs
│ └── Win32
│ │ └── NativeMethods.cs
├── Gemini.Modules.Output
│ ├── Commands
│ │ ├── ViewOutputCommandDefinition.cs
│ │ └── ViewOutputCommandHandler.cs
│ ├── Gemini.Modules.Output.csproj
│ ├── IOutput.cs
│ ├── MenuDefinitions.cs
│ ├── Properties
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ └── Resources.zh-Hans.resx
│ ├── ViewModels
│ │ ├── OutputViewModel.cs
│ │ └── OutputWriter.cs
│ └── Views
│ │ ├── IOutputView.cs
│ │ ├── OutputView.xaml
│ │ └── OutputView.xaml.cs
├── Gemini.Modules.PropertyGrid
│ ├── Commands
│ │ ├── ViewPropertyGridCommandDefinition.cs
│ │ └── ViewPropertyGridCommandHandler.cs
│ ├── Gemini.Modules.PropertyGrid.csproj
│ ├── IPropertyGrid.cs
│ ├── MenuDefinitions.cs
│ ├── Properties
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ └── Resources.zh-Hans.resx
│ ├── Resources
│ │ └── Icons
│ │ │ └── Properties.png
│ ├── ViewModels
│ │ └── PropertyGridViewModel.cs
│ └── Views
│ │ ├── PropertyGridView.xaml
│ │ └── PropertyGridView.xaml.cs
├── Gemini.sln
├── Gemini
│ ├── AppBootstrapper.cs
│ ├── Framework
│ │ ├── AsyncCommand.cs
│ │ ├── Behaviors
│ │ │ ├── BindableTreeViewSelectedItemBehavior.cs
│ │ │ ├── KeyboardFocusBehavior.cs
│ │ │ └── WindowOptionsBehavior.cs
│ │ ├── Commands
│ │ │ ├── Command.cs
│ │ │ ├── CommandDefinition.cs
│ │ │ ├── CommandDefinitionAttribute.cs
│ │ │ ├── CommandDefinitionBase.cs
│ │ │ ├── CommandHandlerAttribute.cs
│ │ │ ├── CommandHandlerWrapper.cs
│ │ │ ├── CommandKeyGestureService.cs
│ │ │ ├── CommandKeyboardShortcut.cs
│ │ │ ├── CommandListDefinition.cs
│ │ │ ├── CommandRouter.cs
│ │ │ ├── CommandService.cs
│ │ │ ├── ExcludeCommandKeyboardShortcut.cs
│ │ │ ├── ICommandHandler.cs
│ │ │ ├── ICommandKeyGestureService.cs
│ │ │ ├── ICommandRerouter.cs
│ │ │ ├── ICommandRouter.cs
│ │ │ ├── ICommandService.cs
│ │ │ ├── ICommandUiItem.cs
│ │ │ └── TargetableCommand.cs
│ │ ├── Controls
│ │ │ ├── ClippingHwndHost.cs
│ │ │ ├── DynamicStyle.cs
│ │ │ ├── ExpanderEx.cs
│ │ │ ├── HwndMouse.cs
│ │ │ ├── HwndMouseEventArgs.cs
│ │ │ ├── HwndMouseState.cs
│ │ │ ├── HwndWrapper.cs
│ │ │ └── SliderEx.cs
│ │ ├── Document.cs
│ │ ├── IDocument.cs
│ │ ├── ILayoutItem.cs
│ │ ├── IModule.cs
│ │ ├── IPersistedDocument.cs
│ │ ├── ITool.cs
│ │ ├── IWindow.cs
│ │ ├── LayoutItemBase.cs
│ │ ├── Markup
│ │ │ └── TranslateExtension.cs
│ │ ├── Menus
│ │ │ ├── CommandMenuItemDefinition.cs
│ │ │ ├── ExcludeMenuDefinition.cs
│ │ │ ├── ExcludeMenuItemDefinition.cs
│ │ │ ├── ExcludeMenuItemGroupDefinition.cs
│ │ │ ├── MenuBarDefinition.cs
│ │ │ ├── MenuDefinition.cs
│ │ │ ├── MenuDefinitionBase.cs
│ │ │ ├── MenuItemDefinition.cs
│ │ │ ├── MenuItemGroupDefinition.cs
│ │ │ └── TextMenuItemDefinition.cs
│ │ ├── ModuleBase.cs
│ │ ├── PersistedDocument.cs
│ │ ├── RelayCommand.cs
│ │ ├── Results
│ │ │ ├── IOpenResult.cs
│ │ │ ├── LambdaResult.cs
│ │ │ ├── OpenDocumentResult.cs
│ │ │ ├── OpenResultBase.cs
│ │ │ ├── Show.cs
│ │ │ ├── ShowCommonDialogResult.cs
│ │ │ ├── ShowDialogResult.cs
│ │ │ ├── ShowToolResult.cs
│ │ │ └── ShowWindowResult.cs
│ │ ├── Services
│ │ │ ├── EditorFileType.cs
│ │ │ ├── ExtensionMethods.cs
│ │ │ ├── IEditorProvider.cs
│ │ │ ├── IInputManager.cs
│ │ │ ├── IMainWindow.cs
│ │ │ ├── IResourceManager.cs
│ │ │ ├── IShell.cs
│ │ │ ├── InputBindingTrigger.cs
│ │ │ ├── InputManager.cs
│ │ │ ├── PaneLocation.cs
│ │ │ ├── ResourceManager.cs
│ │ │ ├── ServiceProvider.cs
│ │ │ └── SettingsPropertyChangedEventManager.cs
│ │ ├── ShaderEffects
│ │ │ ├── GrayscaleEffect.cs
│ │ │ ├── GrayscaleEffect.ps
│ │ │ ├── ShaderEffectBase.cs
│ │ │ └── ShaderEffectUtility.cs
│ │ ├── Themes
│ │ │ ├── BlueTheme.cs
│ │ │ ├── DarkTheme.cs
│ │ │ ├── ITheme.cs
│ │ │ ├── IThemeManager.cs
│ │ │ ├── LightTheme.cs
│ │ │ └── ThemeManager.cs
│ │ ├── Threading
│ │ │ └── TaskUtility.cs
│ │ ├── Tool.cs
│ │ ├── ToolBars
│ │ │ ├── CommandToolBarItemDefinition.cs
│ │ │ ├── ExcludeToolBarDefinition.cs
│ │ │ ├── ExcludeToolBarItemDefinition.cs
│ │ │ ├── ExcludeToolBarItemGroupDefinition.cs
│ │ │ ├── ToolBarDefinition.cs
│ │ │ ├── ToolBarItemDefinition.cs
│ │ │ └── ToolBarItemGroupDefinition.cs
│ │ ├── Utils
│ │ │ └── ItemsControlUtility.cs
│ │ ├── VisualTreeUtility.cs
│ │ ├── Win32
│ │ │ └── NativeMethods.cs
│ │ └── WindowBase.cs
│ ├── Gemini.csproj
│ ├── Modules
│ │ ├── MainMenu
│ │ │ ├── Behaviors
│ │ │ │ └── MenuBehavior.cs
│ │ │ ├── Controls
│ │ │ │ ├── MenuEx.cs
│ │ │ │ └── MenuItemEx.cs
│ │ │ ├── Converters
│ │ │ │ └── CultureInfoNameConverter.cs
│ │ │ ├── IMenu.cs
│ │ │ ├── IMenuBuilder.cs
│ │ │ ├── MenuBuilder.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── Models
│ │ │ │ ├── CommandMenuItem.cs
│ │ │ │ ├── MenuItemBase.cs
│ │ │ │ ├── MenuItemSeparator.cs
│ │ │ │ ├── MenuModel.cs
│ │ │ │ ├── StandardMenuItem.cs
│ │ │ │ └── TextMenuItem.cs
│ │ │ ├── Resources
│ │ │ │ └── Styles.xaml
│ │ │ ├── ViewModels
│ │ │ │ ├── MainMenuSettingsViewModel.cs
│ │ │ │ └── MainMenuViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── MainMenuSettingsView.xaml
│ │ │ │ ├── MainMenuSettingsView.xaml.cs
│ │ │ │ ├── MainMenuView.xaml
│ │ │ │ └── MainMenuView.xaml.cs
│ │ ├── MainWindow
│ │ │ ├── ViewModels
│ │ │ │ └── MainWindowViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── MainWindowView.xaml
│ │ │ │ └── MainWindowView.xaml.cs
│ │ ├── Settings
│ │ │ ├── Commands
│ │ │ │ ├── OpenSettingsCommandDefinition.cs
│ │ │ │ └── OpenSettingsCommandHandler.cs
│ │ │ ├── ISettingsEditor.cs
│ │ │ ├── ISettingsEditorAsync.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── SampleData
│ │ │ │ └── SettingsViewModelSampleData.xaml
│ │ │ ├── ViewModels
│ │ │ │ ├── SettingsEditorWrapper.cs
│ │ │ │ ├── SettingsPageViewModel.cs
│ │ │ │ └── SettingsViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── SettingsView.xaml
│ │ │ │ └── SettingsView.xaml.cs
│ │ ├── Shell
│ │ │ ├── Commands
│ │ │ │ ├── CloseFileCommandDefinition.cs
│ │ │ │ ├── CloseFileCommandHandler.cs
│ │ │ │ ├── ExitCommandDefinition.cs
│ │ │ │ ├── ExitCommandHandler.cs
│ │ │ │ ├── NewFileCommandHandler.cs
│ │ │ │ ├── NewFileCommandListDefinition.cs
│ │ │ │ ├── OpenFileCommandDefinition.cs
│ │ │ │ ├── OpenFileCommandHandler.cs
│ │ │ │ ├── SaveAllFilesCommandDefinition.cs
│ │ │ │ ├── SaveAllFilesCommandHandler.cs
│ │ │ │ ├── SaveFileAsCommandDefinition.cs
│ │ │ │ ├── SaveFileCommandDefinition.cs
│ │ │ │ ├── SwitchToDocumentCommandListDefinition.cs
│ │ │ │ ├── SwitchToDocumentListCommandHandler.cs
│ │ │ │ ├── ViewFullscreenCommandDefinition.cs
│ │ │ │ └── ViewFullscreenCommandHandler.cs
│ │ │ ├── Controls
│ │ │ │ ├── LayoutInitializer.cs
│ │ │ │ ├── PanesStyleSelector.cs
│ │ │ │ └── PanesTemplateSelector.cs
│ │ │ ├── Converters
│ │ │ │ ├── NullableValueConverter.cs
│ │ │ │ └── TruncateMiddleConverter.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── Services
│ │ │ │ ├── ILayoutItemStatePersister.cs
│ │ │ │ └── LayoutItemStatePersister.cs
│ │ │ ├── ToolBarDefinitions.cs
│ │ │ ├── ViewModels
│ │ │ │ └── ShellViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── IShellView.cs
│ │ │ │ ├── LayoutUtility.cs
│ │ │ │ ├── ShellView.xaml
│ │ │ │ └── ShellView.xaml.cs
│ │ ├── StatusBar
│ │ │ ├── IStatusBar.cs
│ │ │ ├── IStatusBarView.cs
│ │ │ ├── ViewModels
│ │ │ │ ├── StatusBarItemViewModel.cs
│ │ │ │ └── StatusBarViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── StatusBarView.xaml
│ │ │ │ └── StatusBarView.xaml.cs
│ │ ├── ToolBars
│ │ │ ├── Controls
│ │ │ │ ├── CustomToggleButton.cs
│ │ │ │ ├── MainToolBar.cs
│ │ │ │ ├── ToolBarBase.cs
│ │ │ │ ├── ToolBarTrayContainer.cs
│ │ │ │ └── ToolPaneToolBar.cs
│ │ │ ├── IToolBar.cs
│ │ │ ├── IToolBarBuilder.cs
│ │ │ ├── IToolBars.cs
│ │ │ ├── Models
│ │ │ │ ├── CommandToolBarItem.cs
│ │ │ │ ├── ToolBarItemBase.cs
│ │ │ │ ├── ToolBarItemSeparator.cs
│ │ │ │ └── ToolBarModel.cs
│ │ │ ├── Module.cs
│ │ │ ├── Resources
│ │ │ │ └── Styles.xaml
│ │ │ ├── ToolBarBuilder.cs
│ │ │ ├── ToolBarDefinitions.cs
│ │ │ ├── ViewModels
│ │ │ │ └── ToolBarsViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── IToolBarView.cs
│ │ │ │ ├── ToolBarsView.xaml
│ │ │ │ └── ToolBarsView.xaml.cs
│ │ ├── Toolbox
│ │ │ ├── Commands
│ │ │ │ ├── ViewToolboxCommandDefinition.cs
│ │ │ │ └── ViewToolboxCommandHandler.cs
│ │ │ ├── Design
│ │ │ │ └── DesignTimeToolboxViewModel.cs
│ │ │ ├── IToolbox.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── Models
│ │ │ │ └── ToolboxItem.cs
│ │ │ ├── Services
│ │ │ │ ├── IToolboxService.cs
│ │ │ │ └── ToolboxService.cs
│ │ │ ├── ToolboxDragDrop.cs
│ │ │ ├── ToolboxItemAttribute.cs
│ │ │ ├── ViewModels
│ │ │ │ ├── ToolboxItemViewModel.cs
│ │ │ │ └── ToolboxViewModel.cs
│ │ │ └── Views
│ │ │ │ ├── ToolboxView.xaml
│ │ │ │ └── ToolboxView.xaml.cs
│ │ └── UndoRedo
│ │ │ ├── Commands
│ │ │ ├── RedoCommandDefinition.cs
│ │ │ ├── UndoCommandDefinition.cs
│ │ │ ├── ViewHistoryCommandDefinition.cs
│ │ │ └── ViewHistoryCommandHandler.cs
│ │ │ ├── Design
│ │ │ └── DesignTimeHistoryViewModel.cs
│ │ │ ├── IHistoryTool.cs
│ │ │ ├── IUndoRedoManager.cs
│ │ │ ├── IUndoableAction.cs
│ │ │ ├── MenuDefinitions.cs
│ │ │ ├── Services
│ │ │ └── UndoRedoManager.cs
│ │ │ ├── ToolBarDefinitions.cs
│ │ │ ├── ViewModels
│ │ │ ├── HistoryItemType.cs
│ │ │ ├── HistoryItemViewModel.cs
│ │ │ └── HistoryViewModel.cs
│ │ │ └── Views
│ │ │ ├── HistoryView.xaml
│ │ │ └── HistoryView.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.fr.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ ├── Resources.zh-Hans.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Resources
│ │ └── Icons
│ │ │ ├── FullScreen.png
│ │ │ ├── Gemini-32.png
│ │ │ ├── Open.png
│ │ │ ├── Redo.png
│ │ │ ├── Save.png
│ │ │ ├── SaveAll.png
│ │ │ └── Undo.png
│ ├── Themes
│ │ ├── Generic.xaml
│ │ └── VS2013
│ │ │ ├── BlueTheme.xaml
│ │ │ ├── Controls
│ │ │ ├── Button.xaml
│ │ │ ├── CheckBox.xaml
│ │ │ ├── ColorCanvas.xaml
│ │ │ ├── ComboBox.xaml
│ │ │ ├── Converters
│ │ │ │ └── TreeViewIndentConverter.cs
│ │ │ ├── Focus.xaml
│ │ │ ├── Label.xaml
│ │ │ ├── Menu.xaml
│ │ │ ├── Merged.xaml
│ │ │ ├── ScrollBar.xaml
│ │ │ ├── Slider.xaml
│ │ │ ├── TextBox.xaml
│ │ │ ├── Toolbar.xaml
│ │ │ ├── Tooltip.xaml
│ │ │ ├── TreeView.xaml
│ │ │ ├── Window.xaml
│ │ │ └── WindowCommands.xaml
│ │ │ ├── DarkTheme.xaml
│ │ │ └── LightTheme.xaml
│ └── app.config
└── NuGet.config
└── version.json
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [tgjones]
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | runs-on: windows-latest
8 |
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v1
12 |
13 | - name: Install .NET Core
14 | uses: actions/setup-dotnet@v1
15 | with:
16 | dotnet-version: 7.0.x
17 |
18 | - name: Version
19 | uses: aarnott/nbgv@v0.4.0
20 | with:
21 | setAllVars: true
22 |
23 | - name: Pack
24 | run: dotnet pack src --configuration Release --output build/packages
25 |
26 | - name: Upload Artifacts
27 | uses: actions/upload-artifact@v1
28 | with:
29 | name: Packages
30 | path: build/packages
31 |
32 | - name: Publish to NuGet
33 | shell: bash
34 | if: github.event_name == 'push'
35 | run: dotnet nuget push build/packages/**/*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}}
36 |
--------------------------------------------------------------------------------
/doc/gemini-demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-demo.png
--------------------------------------------------------------------------------
/doc/gemini-everything-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-everything-blue.png
--------------------------------------------------------------------------------
/doc/gemini-everything-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-everything-light.png
--------------------------------------------------------------------------------
/doc/gemini-module-codeeditor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-codeeditor.png
--------------------------------------------------------------------------------
/doc/gemini-module-errorlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-errorlist.png
--------------------------------------------------------------------------------
/doc/gemini-module-grapheditor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-grapheditor.png
--------------------------------------------------------------------------------
/doc/gemini-module-inspector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-inspector.png
--------------------------------------------------------------------------------
/doc/gemini-module-mainmenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-mainmenu.png
--------------------------------------------------------------------------------
/doc/gemini-module-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-output.png
--------------------------------------------------------------------------------
/doc/gemini-module-propertygrid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-propertygrid.png
--------------------------------------------------------------------------------
/doc/gemini-module-shell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-shell.png
--------------------------------------------------------------------------------
/doc/gemini-module-statusbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-statusbar.png
--------------------------------------------------------------------------------
/doc/gemini-module-toolbars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-toolbars.png
--------------------------------------------------------------------------------
/doc/gemini-module-toolbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-toolbox.png
--------------------------------------------------------------------------------
/doc/gemini-module-undoredo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/doc/gemini-module-undoredo.png
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tim Jones
4 | https://github.com/tgjones/gemini
5 | Apache-2.0
6 |
7 |
8 |
9 | true
10 | snupkg
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Demo
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Commands/OpenGraphCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 |
3 | namespace Gemini.Demo.Modules.FilterDesigner.Commands
4 | {
5 | [CommandDefinition]
6 | public class OpenGraphCommandDefinition : CommandDefinition
7 | {
8 | public const string CommandName = "File.OpenGraph";
9 |
10 | public override string Name
11 | {
12 | get { return CommandName; }
13 | }
14 |
15 | public override string Text
16 | {
17 | get { return "Open Graph"; }
18 | }
19 |
20 | public override string ToolTip
21 | {
22 | get { return "Open Graph"; }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Commands/OpenGraphCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Demo.Modules.FilterDesigner.ViewModels;
5 | using Gemini.Framework.Commands;
6 | using Gemini.Framework.Services;
7 | using Gemini.Modules.Inspector;
8 |
9 | namespace Gemini.Demo.Modules.FilterDesigner.Commands
10 | {
11 | [CommandHandler]
12 | public class OpenGraphCommandHandler : CommandHandlerBase
13 | {
14 | private readonly IShell _shell;
15 |
16 | [ImportingConstructor]
17 | public OpenGraphCommandHandler(IShell shell)
18 | {
19 | _shell = shell;
20 | }
21 |
22 | public override Task Run(Command command)
23 | {
24 | return _shell.OpenDocumentAsync(new GraphViewModel(IoC.Get()));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Design/DesignTimeGraphViewModel.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Demo.Modules.FilterDesigner.ViewModels;
2 |
3 | namespace Gemini.Demo.Modules.FilterDesigner.Design
4 | {
5 | public class DesignTimeGraphViewModel : GraphViewModel
6 | {
7 | public DesignTimeGraphViewModel()
8 | : base(null)
9 | {
10 |
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Demo.Modules.FilterDesigner.Commands;
3 | using Gemini.Framework.Menus;
4 |
5 | namespace Gemini.Demo.Modules.FilterDesigner
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition OpenGraphMenuItem = new CommandMenuItemDefinition(
11 | Gemini.Modules.MainMenu.MenuDefinitions.FileNewOpenMenuGroup, 2);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Resources/Styles.xaml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Resources/action_add_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Modules/FilterDesigner/Resources/action_add_16xLG.png
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Resources/active_x_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Modules/FilterDesigner/Resources/active_x_16xLG.png
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Resources/color_swatch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Modules/FilterDesigner/Resources/color_swatch.png
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Resources/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Modules/FilterDesigner/Resources/image.png
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Sample.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Demo.Modules.FilterDesigner.ViewModels;
5 | using Gemini.Demo.Modules.SampleBrowser;
6 | using Gemini.Framework.Services;
7 | using Gemini.Modules.Inspector;
8 | using Gemini.Modules.Toolbox;
9 |
10 | namespace Gemini.Demo.Modules.FilterDesigner
11 | {
12 | [Export(typeof(ISample))]
13 | public class Sample : ISample
14 | {
15 | public string Name => "Filter Designer";
16 |
17 | public async Task Activate(IShell shell)
18 | {
19 | await shell.OpenDocumentAsync(IoC.Get());
20 | shell.ShowTool();
21 | shell.ShowTool();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ShaderEffects/AddEffect.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Gemini.Demo.Modules.FilterDesigner.ShaderEffects
5 | {
6 | internal class AddEffect : ShaderEffectBase
7 | {
8 | public static readonly DependencyProperty Input1Property = RegisterPixelShaderSamplerProperty(
9 | "Input1", typeof(AddEffect), 0);
10 |
11 | public Brush Input1
12 | {
13 | get { return (Brush) GetValue(Input1Property); }
14 | set { SetValue(Input1Property, value); }
15 | }
16 |
17 | public static readonly DependencyProperty Input2Property = RegisterPixelShaderSamplerProperty(
18 | "Input2", typeof(AddEffect), 1);
19 |
20 | public Brush Input2
21 | {
22 | get { return (Brush) GetValue(Input2Property); }
23 | set { SetValue(Input2Property, value); }
24 | }
25 |
26 | public AddEffect()
27 | {
28 | UpdateShaderValue(Input1Property);
29 | UpdateShaderValue(Input2Property);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ShaderEffects/AddEffect.fx:
--------------------------------------------------------------------------------
1 | sampler2D input1 : register(s0);
2 | sampler2D input2 : register(s1);
3 |
4 | float4 main(float2 uv : TEXCOORD) : COLOR
5 | {
6 | float4 color1 = tex2D(input1, uv);
7 | float4 color2 = tex2D(input2, uv);
8 | return color1 + color2;
9 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ShaderEffects/MultiplyEffect.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Gemini.Demo.Modules.FilterDesigner.ShaderEffects
5 | {
6 | internal class MultiplyEffect : ShaderEffectBase
7 | {
8 | public static readonly DependencyProperty Input1Property = RegisterPixelShaderSamplerProperty(
9 | "Input1", typeof(MultiplyEffect), 0);
10 |
11 | public Brush Input1
12 | {
13 | get { return (Brush) GetValue(Input1Property); }
14 | set { SetValue(Input1Property, value); }
15 | }
16 |
17 | public static readonly DependencyProperty Input2Property = RegisterPixelShaderSamplerProperty(
18 | "Input2", typeof(MultiplyEffect), 1);
19 |
20 | public Brush Input2
21 | {
22 | get { return (Brush) GetValue(Input2Property); }
23 | set { SetValue(Input2Property, value); }
24 | }
25 |
26 | public MultiplyEffect()
27 | {
28 | UpdateShaderValue(Input1Property);
29 | UpdateShaderValue(Input2Property);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ShaderEffects/MultiplyEffect.fx:
--------------------------------------------------------------------------------
1 | sampler2D input1 : register(s0);
2 | sampler2D input2 : register(s1);
3 |
4 | float4 main(float2 uv : TEXCOORD) : COLOR
5 | {
6 | float4 color1 = tex2D(input1, uv);
7 | float4 color2 = tex2D(input2, uv);
8 | return color1 * color2;
9 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ShaderEffects/ShaderEffectBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media.Effects;
3 | using Gemini.Demo.Modules.FilterDesigner.Util;
4 |
5 | namespace Gemini.Demo.Modules.FilterDesigner.ShaderEffects
6 | {
7 | internal class ShaderEffectBase : ShaderEffect, IDisposable
8 | {
9 | [ThreadStatic]
10 | private static PixelShader _shader;
11 |
12 | private static PixelShader Shader
13 | {
14 | get { return (_shader ?? (_shader = ShaderEffectUtility.GetPixelShader(typeof(T).Name))); }
15 | }
16 |
17 | protected ShaderEffectBase()
18 | {
19 | PixelShader = Shader;
20 | }
21 |
22 | void IDisposable.Dispose()
23 | {
24 | PixelShader = null;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Util/BitmapUtility.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Windows.Media.Imaging;
3 |
4 | namespace Gemini.Demo.Modules.FilterDesigner.Util
5 | {
6 | internal static class BitmapUtility
7 | {
8 | public static BitmapSource CreateFromBytes(byte[] bytes)
9 | {
10 | using (var stream = new MemoryStream(bytes))
11 | {
12 | var result = new BitmapImage();
13 | result.BeginInit();
14 | result.CacheOption = BitmapCacheOption.OnLoad;
15 | result.StreamSource = stream;
16 | result.EndInit();
17 | result.Freeze();
18 |
19 | return result;
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/Util/ShaderEffectUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media.Effects;
3 |
4 | namespace Gemini.Demo.Modules.FilterDesigner.Util
5 | {
6 | internal static class ShaderEffectUtility
7 | {
8 | public static PixelShader GetPixelShader(string name)
9 | {
10 | return new PixelShader
11 | {
12 | UriSource = new Uri(AppDomain.CurrentDomain.BaseDirectory + "Modules/FilterDesigner/ShaderEffects/" + name + ".ps", UriKind.Absolute)
13 | };
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/ConnectorDirection.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels
2 | {
3 | public enum ConnectorDirection
4 | {
5 | Input,
6 | Output
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/Elements/Add.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using System.Windows.Media.Effects;
3 | using Gemini.Demo.Modules.FilterDesigner.ShaderEffects;
4 | using Gemini.Modules.Toolbox;
5 |
6 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels.Elements
7 | {
8 | [ToolboxItem(typeof(GraphViewModel), "Add", "Maths", "pack://application:,,,/Modules/FilterDesigner/Resources/action_add_16xLG.png")]
9 | public class Add : ShaderEffectElement
10 | {
11 | protected override Effect GetEffect()
12 | {
13 | return new AddEffect
14 | {
15 | Input1 = new ImageBrush(InputConnectors[0].Value),
16 | Input2 = new ImageBrush(InputConnectors[1].Value)
17 | };
18 | }
19 |
20 | public Add()
21 | {
22 | AddInputConnector("Left", Colors.DarkSeaGreen);
23 | AddInputConnector("Right", Colors.DarkSeaGreen);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/Elements/ColorInput.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 | using Gemini.Modules.Toolbox;
4 |
5 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels.Elements
6 | {
7 | [ToolboxItem(typeof(GraphViewModel), "Color", "Generators", "pack://application:,,,/Modules/FilterDesigner/Resources/color_swatch.png")]
8 | public class ColorInput : DynamicElement
9 | {
10 | private Color _color;
11 | public Color Color
12 | {
13 | get { return _color; }
14 | set
15 | {
16 | _color = value;
17 | UpdatePreviewImage();
18 | NotifyOfPropertyChange(() => Color);
19 | }
20 | }
21 |
22 | public ColorInput()
23 | {
24 | Color = Colors.Red;
25 | UpdatePreviewImage();
26 | }
27 |
28 | protected override void Draw(DrawingContext drawingContext, Rect bounds)
29 | {
30 | drawingContext.DrawRectangle(new SolidColorBrush(Color), null, bounds);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/Elements/ImageSource.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using System.Windows.Media.Imaging;
3 | using Gemini.Modules.Toolbox;
4 |
5 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels.Elements
6 | {
7 | [ToolboxItem(typeof(GraphViewModel), "Image Source", "Generators", "pack://application:,,,/Modules/FilterDesigner/Resources/image.png")]
8 | public class ImageSource : ElementViewModel
9 | {
10 | private BitmapSource _bitmap;
11 | public BitmapSource Bitmap
12 | {
13 | get { return _bitmap; }
14 | set
15 | {
16 | _bitmap = value;
17 | NotifyOfPropertyChange(() => PreviewImage);
18 | RaiseOutputChanged();
19 | }
20 | }
21 |
22 | public override BitmapSource PreviewImage
23 | {
24 | get { return Bitmap; }
25 | }
26 |
27 | public ImageSource()
28 | {
29 | SetOutputConnector("Output", Colors.DarkSeaGreen, () => Bitmap);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/Elements/Multiply.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using System.Windows.Media.Effects;
3 | using Gemini.Demo.Modules.FilterDesigner.ShaderEffects;
4 | using Gemini.Modules.Toolbox;
5 |
6 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels.Elements
7 | {
8 | [ToolboxItem(typeof(GraphViewModel), "Multiply", "Maths", "pack://application:,,,/Modules/FilterDesigner/Resources/active_x_16xLG.png")]
9 | public class Multiply : ShaderEffectElement
10 | {
11 | protected override Effect GetEffect()
12 | {
13 | return new MultiplyEffect
14 | {
15 | Input1 = new ImageBrush(InputConnectors[0].Value),
16 | Input2 = new ImageBrush(InputConnectors[1].Value)
17 | };
18 | }
19 |
20 | public Multiply()
21 | {
22 | AddInputConnector("Left", Colors.DarkSeaGreen);
23 | AddInputConnector("Right", Colors.DarkSeaGreen);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/FilterDesigner/ViewModels/Elements/ShaderEffectElement.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 | using System.Windows.Media.Effects;
4 |
5 | namespace Gemini.Demo.Modules.FilterDesigner.ViewModels.Elements
6 | {
7 | public abstract class ShaderEffectElement : DynamicElement
8 | {
9 | protected override void PrepareDrawingVisual(DrawingVisual drawingVisual)
10 | {
11 | drawingVisual.Effect = GetEffect();
12 | }
13 |
14 | protected override void Draw(DrawingContext drawingContext, Rect bounds)
15 | {
16 | drawingContext.DrawRectangle(
17 | new SolidColorBrush(Colors.Transparent), null,
18 | bounds);
19 | }
20 |
21 | protected abstract Effect GetEffect();
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Commands/ViewHelixCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 |
3 | namespace Gemini.Demo.Modules.Home.Commands
4 | {
5 | [CommandDefinition]
6 | public class ViewHelixCommandDefinition : CommandDefinition
7 | {
8 | public const string CommandName = "View.Helix";
9 |
10 | public override string Name
11 | {
12 | get { return CommandName; }
13 | }
14 |
15 | public override string Text
16 | {
17 | get { return "Helix"; }
18 | }
19 |
20 | public override string ToolTip
21 | {
22 | get { return "Helix"; }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Commands/ViewHelixCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Demo.Modules.Home.ViewModels;
5 | using Gemini.Framework;
6 | using Gemini.Framework.Commands;
7 | using Gemini.Framework.Services;
8 | using Gemini.Framework.Threading;
9 |
10 | namespace Gemini.Demo.Modules.Home.Commands
11 | {
12 | [CommandHandler]
13 | public class ViewHelixCommandHandler : CommandHandlerBase
14 | {
15 | private readonly IShell _shell;
16 |
17 | [ImportingConstructor]
18 | public ViewHelixCommandHandler(IShell shell)
19 | {
20 | _shell = shell;
21 | }
22 |
23 | public override Task Run(Command command)
24 | {
25 | return _shell.OpenDocumentAsync((IDocument) IoC.GetInstance(typeof(HelixViewModel), null));
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Commands/ViewHomeCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 |
3 | namespace Gemini.Demo.Modules.Home.Commands
4 | {
5 | [CommandDefinition]
6 | public class ViewHomeCommandDefinition : CommandDefinition
7 | {
8 | public const string CommandName = "View.Home";
9 |
10 | public override string Name
11 | {
12 | get { return CommandName; }
13 | }
14 |
15 | public override string Text
16 | {
17 | get { return "Home"; }
18 | }
19 |
20 | public override string ToolTip
21 | {
22 | get { return "Home"; }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Commands/ViewHomeCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Caliburn.Micro;
3 | using Gemini.Demo.Modules.Home.ViewModels;
4 | using Gemini.Framework.Commands;
5 | using Gemini.Framework.Results;
6 |
7 | namespace Gemini.Demo.Modules.Home.Commands
8 | {
9 | [CommandHandler]
10 | public class ViewHomeCommandHandler : CommandHandlerBase
11 | {
12 | public override async Task Run(Command command)
13 | {
14 | await Show.Document().ExecuteAsync();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/ViewModels/IDemoScript.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Demo.Modules.Home.ViewModels
2 | {
3 | public interface IDemoScript
4 | {
5 | void Execute(HelixViewModel viewModel);
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Views/HelixView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Demo.Modules.Home.Views
4 | {
5 | ///
6 | /// Interaction logic for HelixView.xaml
7 | ///
8 | public partial class HelixView : UserControl, IHelixView
9 | {
10 | public ICSharpCode.AvalonEdit.TextEditor TextEditor
11 | {
12 | get { return CodeEditor; }
13 | }
14 |
15 | public HelixView()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Views/HomeView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Demo.Modules.Home.Views
4 | {
5 | ///
6 | /// Interaction logic for HomeView.xaml
7 | ///
8 | public partial class HomeView : UserControl
9 | {
10 | public HomeView()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Home/Views/IHelixView.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Demo.Modules.Home.Views
2 | {
3 | public interface IHelixView
4 | {
5 | ICSharpCode.AvalonEdit.TextEditor TextEditor { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/SampleBrowser/ISample.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Gemini.Framework.Services;
3 |
4 | namespace Gemini.Demo.Modules.SampleBrowser
5 | {
6 | public interface ISample
7 | {
8 | string Name { get; }
9 | Task Activate(IShell shell);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/SampleBrowser/Module.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Demo.Modules.SampleBrowser.ViewModels;
5 | using Gemini.Framework;
6 |
7 | namespace Gemini.Demo.Modules.SampleBrowser
8 | {
9 | [Export(typeof(IModule))]
10 | public class Module : ModuleBase
11 | {
12 | public override Task PostInitializeAsync()
13 | {
14 | return Shell.OpenDocumentAsync(IoC.Get());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/SampleBrowser/ViewModels/SampleBrowserViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework;
3 | using Gemini.Framework.Services;
4 |
5 | namespace Gemini.Demo.Modules.SampleBrowser.ViewModels
6 | {
7 | [Export(typeof(SampleBrowserViewModel))]
8 | public class SampleBrowserViewModel : Document
9 | {
10 | private readonly IShell _shell;
11 | private readonly ISample[] _samples;
12 |
13 | public override string DisplayName
14 | {
15 | get { return "Sample Browser"; }
16 | }
17 |
18 | public ISample[] Samples
19 | {
20 | get { return _samples; }
21 | }
22 |
23 | [ImportingConstructor]
24 | public SampleBrowserViewModel([Import] IShell shell,
25 | [ImportMany] ISample[] samples)
26 | {
27 | _shell = shell;
28 | _samples = samples;
29 | }
30 |
31 | public void Activate(ISample sample)
32 | {
33 | sample.Activate(_shell);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/SampleBrowser/Views/SampleBrowserView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Demo.Modules.SampleBrowser.Views
4 | {
5 | public partial class SampleBrowserView : UserControl
6 | {
7 | public SampleBrowserView()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Shell/Views/DemoApplicationSettingsView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 | Confirm application exit
12 |
13 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/Shell/Views/DemoApplicationSettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Gemini.Demo.Modules.Shell.Views
17 | {
18 | ///
19 | /// Interaction logic for DemoApplicationSettingsView.xaml
20 | ///
21 | public partial class DemoApplicationSettingsView : UserControl
22 | {
23 | public DemoApplicationSettingsView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/TextEditor/Views/EditorView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Modules/TextEditor/Views/EditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 |
4 | namespace Gemini.Demo.Modules.TextEditor.Views
5 | {
6 | public partial class EditorView : UserControl
7 | {
8 | public EditorView()
9 | {
10 | InitializeComponent();
11 | Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
4 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Properties/PublishProfiles/FolderProfileNetCore31.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | Debug
9 | Any CPU
10 | bin\Debug\netcoreapp3.1\publish\
11 | FileSystem
12 | netcoreapp3.1
13 | true
14 | false
15 | true
16 |
17 | win-x64
18 | true
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Properties/Resources.de.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Properties/Resources.de.Designer.cs
--------------------------------------------------------------------------------
/src/Gemini.Demo/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | True
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Gemini.Demo/Resources/Splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Demo/Resources/Splash.png
--------------------------------------------------------------------------------
/src/Gemini.Demo/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | True
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeCompiler/Gemini.Modules.CodeCompiler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-windows;net7.0-windows;net462
5 | core WPF MVVM AvalonDock Caliburn Micro Visual Studio IDE Shell C# compile Roslyn
6 | CodeCompiler module for Gemini, providing C# code compilation using Roslyn.
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeCompiler/ICodeCompiler.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 |
5 | namespace Gemini.Modules.CodeCompiler
6 | {
7 | public interface ICodeCompiler
8 | {
9 | Assembly Compile(
10 | IEnumerable syntaxTrees,
11 | IEnumerable references,
12 | string outputName);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Commands/ShowEndOfLineCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.CodeEditor.Properties;
3 | using System;
4 |
5 | namespace Gemini.Modules.CodeEditor.Commands
6 | {
7 | [CommandDefinition]
8 | public class ShowEndOfLineCommandDefinition : CommandDefinition
9 | {
10 | public const string CommandName = "CodeEditor.ShowEndOfLine";
11 |
12 | public override string Name => CommandName;
13 |
14 | public override string Text => Resources.ShowEndOfLineCommandText;
15 |
16 | public override string ToolTip => Resources.ShowEndOfLineCommandToolTip;
17 |
18 | public override Uri IconSource => new Uri("pack://application:,,,/Gemini.Modules.CodeEditor;component/Resources/Icons/ShowEndOfLine.png");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Commands/ShowLineNumbersCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.CodeEditor.Properties;
3 | using System;
4 |
5 | namespace Gemini.Modules.CodeEditor.Commands
6 | {
7 | [CommandDefinition]
8 | public class ShowLineNumbersCommandDefinition : CommandDefinition
9 | {
10 | public const string CommandName = "CodeEditor.ShowLineNumbers";
11 |
12 | public override string Name => CommandName;
13 |
14 | public override string Text => Resources.ShowLineNumbersCommandText;
15 |
16 | public override string ToolTip => Resources.ShowLineNumbersCommandToolTip;
17 |
18 | public override Uri IconSource => new Uri("pack://application:,,,/Gemini.Modules.CodeEditor;component/Resources/Icons/ShowLineNumbers.png");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Commands/ShowSpacesCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.CodeEditor.Properties;
3 | using System;
4 |
5 | namespace Gemini.Modules.CodeEditor.Commands
6 | {
7 | [CommandDefinition]
8 | public class ShowSpacesCommandDefinition : CommandDefinition
9 | {
10 | public const string CommandName = "CodeEditor.ShowSpaces";
11 |
12 | public override string Name => CommandName;
13 |
14 | public override string Text => Resources.ShowSpacesCommandText;
15 |
16 | public override string ToolTip => Resources.ShowSpacesCommandToolTip;
17 |
18 | public override Uri IconSource => new Uri("pack://application:,,,/Gemini.Modules.CodeEditor;component/Resources/Icons/ShowSpaces.png");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Commands/ShowTabsCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.CodeEditor.Properties;
3 | using System;
4 |
5 | namespace Gemini.Modules.CodeEditor.Commands
6 | {
7 | [CommandDefinition]
8 | public class ShowTabsCommandDefinition : CommandDefinition
9 | {
10 | public const string CommandName = "CodeEditor.ShowTabs";
11 |
12 | public override string Name => CommandName;
13 |
14 | public override string Text => Resources.ShowTabsCommandText;
15 |
16 | public override string ToolTip => Resources.ShowTabsCommandToolTip;
17 |
18 | public override Uri IconSource => new Uri("pack://application:,,,/Gemini.Modules.CodeEditor;component/Resources/Icons/ShowTabs.png");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Commands/WordWrapCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.CodeEditor.Properties;
3 | using System;
4 |
5 | namespace Gemini.Modules.CodeEditor.Commands
6 | {
7 | [CommandDefinition]
8 | public class WordWrapCommandDefinition : CommandDefinition
9 | {
10 | public const string CommandName = "CodeEditor.WordWrap";
11 |
12 | public override string Name => CommandName;
13 |
14 | public override string Text => Resources.WordWrapCommandText;
15 |
16 | public override string ToolTip => Resources.WordWrapCommandToolTip;
17 |
18 | public override Uri IconSource => new Uri("pack://application:,,,/Gemini.Modules.CodeEditor;component/Resources/Icons/WordWrap.png");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/ILanguageDefinition.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using ICSharpCode.AvalonEdit.Highlighting;
3 |
4 | namespace Gemini.Modules.CodeEditor
5 | {
6 | public interface ILanguageDefinition
7 | {
8 | string Name { get; }
9 | IEnumerable FileExtensions { get; set; }
10 | IHighlightingDefinition SyntaxHighlighting { get; }
11 | string CustomSyntaxHighlightingFileName { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
4 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | False
7 |
8 |
9 | False
10 |
11 |
12 | False
13 |
14 |
15 | False
16 |
17 |
18 | False
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/Find.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/Find.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowEndOfLine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowEndOfLine.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowLineNumbers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowLineNumbers.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowSpaces.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowSpaces.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowTabs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/ShowTabs.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Resources/Icons/WordWrap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.CodeEditor/Resources/Icons/WordWrap.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Views/CodeEditorSettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Gemini.Modules.CodeEditor.Views
17 | {
18 | ///
19 | /// Interaction logic for CodeEditorSettingsView.xaml
20 | ///
21 | public partial class CodeEditorSettingsView : UserControl
22 | {
23 | public CodeEditorSettingsView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Views/CodeEditorView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Views/CodeEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 | using ICSharpCode.AvalonEdit;
4 |
5 | namespace Gemini.Modules.CodeEditor.Views
6 | {
7 | public partial class CodeEditorView : UserControl, ICodeEditorView
8 | {
9 | public TextEditor TextEditor
10 | {
11 | get { return CodeEditor; }
12 | }
13 |
14 | public CodeEditorView()
15 | {
16 | InitializeComponent();
17 | Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
18 | }
19 |
20 | public void ApplySettings()
21 | {
22 | CodeEditor?.ApplySettings();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.CodeEditor/Views/ICodeEditorView.cs:
--------------------------------------------------------------------------------
1 | using ICSharpCode.AvalonEdit;
2 |
3 | namespace Gemini.Modules.CodeEditor.Views
4 | {
5 | public interface ICodeEditorView
6 | {
7 | TextEditor TextEditor { get; }
8 |
9 | void ApplySettings();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Commands/ToggleErrorsCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Gemini.Framework.Commands;
3 |
4 | namespace Gemini.Modules.ErrorList.Commands
5 | {
6 | [CommandDefinition]
7 | public class ToggleErrorsCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "ErrorList.ToggleErrors";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return "[NotUsed]"; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return "[NotUsed]"; }
24 | }
25 |
26 | public override Uri IconSource
27 | {
28 | get { return new Uri("pack://application:,,,/Gemini.Modules.ErrorList;component/Resources/Error.png"); }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Commands/ToggleMessagesCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Gemini.Framework.Commands;
3 |
4 | namespace Gemini.Modules.ErrorList.Commands
5 | {
6 | [CommandDefinition]
7 | public class ToggleMessagesCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "ErrorList.ToggleMessages";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return "[NotUsed]"; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return "[NotUsed]"; }
24 | }
25 |
26 | public override Uri IconSource
27 | {
28 | get { return new Uri("pack://application:,,,/Gemini.Modules.ErrorList;component/Resources/Message.png"); }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Commands/ToggleWarningsCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Gemini.Framework.Commands;
3 |
4 | namespace Gemini.Modules.ErrorList.Commands
5 | {
6 | [CommandDefinition]
7 | public class ToggleWarningsCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "ErrorList.ToggleWarnings";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return "[NotUsed]"; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return "[NotUsed]"; }
24 | }
25 |
26 | public override Uri IconSource
27 | {
28 | get { return new Uri("pack://application:,,,/Gemini.Modules.ErrorList;component/Resources/Warning.png"); }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Commands/ViewErrorListCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.ErrorList.Properties;
3 |
4 | namespace Gemini.Modules.ErrorList.Commands
5 | {
6 | [CommandDefinition]
7 | public class ViewErrorListCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "View.ErrorList";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return Resources.ViewErrorListCommandText; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return Resources.ViewErrorListCommandToolTip; }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Commands/ViewErrorListCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Gemini.Framework.Commands;
4 | using Gemini.Framework.Services;
5 | using Gemini.Framework.Threading;
6 |
7 | namespace Gemini.Modules.ErrorList.Commands
8 | {
9 | [CommandHandler]
10 | public class ViewErrorListCommandHandler : CommandHandlerBase
11 | {
12 | private readonly IShell _shell;
13 |
14 | [ImportingConstructor]
15 | public ViewErrorListCommandHandler(IShell shell)
16 | {
17 | _shell = shell;
18 | }
19 |
20 | public override Task Run(Command command)
21 | {
22 | _shell.ShowTool();
23 | return TaskUtility.Completed;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Design/DesignTimeErrorListViewModel.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Modules.ErrorList.ViewModels;
2 |
3 | namespace Gemini.Modules.ErrorList.Design
4 | {
5 | public class DesignTimeErrorListViewModel : ErrorListViewModel
6 | {
7 | public DesignTimeErrorListViewModel()
8 | {
9 | Items.Add(new ErrorListItem
10 | {
11 | ItemType = ErrorListItemType.Error,
12 | Number = 1,
13 | Description = "This is an error.",
14 | Path = "File1.txt",
15 | Line = 42,
16 | Column = 24
17 | });
18 | Items.Add(new ErrorListItem
19 | {
20 | ItemType = ErrorListItemType.Warning,
21 | Number = 2,
22 | Description = "This is a warning.",
23 | Path = "File1.txt",
24 | Line = 1,
25 | Column = 2
26 | });
27 | Items.Add(new ErrorListItem
28 | {
29 | ItemType = ErrorListItemType.Message,
30 | Number = 3,
31 | Description = "This is a message.",
32 | });
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/ErrorListItemType.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.ErrorList
2 | {
3 | public enum ErrorListItemType
4 | {
5 | Error,
6 | Warning,
7 | Message
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/IErrorList.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 | using Gemini.Framework;
3 |
4 | namespace Gemini.Modules.ErrorList
5 | {
6 | public interface IErrorList : ITool
7 | {
8 | bool ShowErrors { get; set; }
9 | bool ShowWarnings { get; set; }
10 | bool ShowMessages { get; set; }
11 |
12 | IObservableCollection Items { get; }
13 |
14 | void AddItem(ErrorListItemType itemType, string description,
15 | string path = null, int? line = null, int? column = null,
16 | System.Action onClick = null);
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework.Menus;
3 | using Gemini.Modules.ErrorList.Commands;
4 |
5 | namespace Gemini.Modules.ErrorList
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition ViewErrorListMenuItem = new CommandMenuItemDefinition(
11 | MainMenu.MenuDefinitions.ViewToolsMenuGroup, 0);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly:ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
4 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Gemini.Modules.ErrorList.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Resources/Error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.ErrorList/Resources/Error.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Resources/Message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.ErrorList/Resources/Message.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Resources/Warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.ErrorList/Resources/Warning.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.ErrorList/Views/ErrorListView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 | using System.Windows.Input;
3 |
4 | namespace Gemini.Modules.ErrorList.Views
5 | {
6 | ///
7 | /// Interaction logic for ErrorListView.xaml
8 | ///
9 | public partial class ErrorListView : UserControl
10 | {
11 | public ErrorListView()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void OnDataGridMouseDoubleClick(object sender, MouseButtonEventArgs e)
17 | {
18 | var dataGrid = (DataGrid) sender;
19 | if (dataGrid.SelectedItems == null || dataGrid.SelectedItems.Count != 1)
20 | return;
21 |
22 | var errorListItem = (ErrorListItem) dataGrid.SelectedItem;
23 | if (errorListItem.OnClick != null)
24 | errorListItem.OnClick();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionDragCompletedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | public class ConnectionDragCompletedEventArgs : ConnectionDragEventArgs
6 | {
7 | private readonly object _connection;
8 |
9 | public object Connection
10 | {
11 | get { return _connection; }
12 | }
13 |
14 | internal ConnectionDragCompletedEventArgs(RoutedEvent routedEvent, object source,
15 | ElementItem elementItem, object connection, ConnectorItem sourceConnectorItem)
16 | : base(routedEvent, source, elementItem, sourceConnectorItem)
17 | {
18 | _connection = connection;
19 | }
20 | }
21 |
22 | public delegate void ConnectionDragCompletedEventHandler(object sender, ConnectionDragCompletedEventArgs e);
23 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionDragEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | public abstract class ConnectionDragEventArgs : RoutedEventArgs
6 | {
7 | private readonly ElementItem _elementItem;
8 | private readonly ConnectorItem _sourceConnectorItem;
9 |
10 | public ElementItem ElementItem
11 | {
12 | get { return _elementItem; }
13 | }
14 |
15 | public ConnectorItem SourceConnector
16 | {
17 | get { return _sourceConnectorItem; }
18 | }
19 |
20 | protected ConnectionDragEventArgs(RoutedEvent routedEvent, object source,
21 | ElementItem elementItem, ConnectorItem sourceConnectorItem)
22 | : base(routedEvent, source)
23 | {
24 | _elementItem = elementItem;
25 | _sourceConnectorItem = sourceConnectorItem;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionDragStartedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | public class ConnectionDragStartedEventArgs : ConnectionDragEventArgs
6 | {
7 | public object Connection { get; set; }
8 |
9 | public ConnectionDragStartedEventArgs(RoutedEvent routedEvent, object source,
10 | ElementItem elementItem, ConnectorItem connectorItem)
11 | : base(routedEvent, source, elementItem, connectorItem)
12 | {
13 | }
14 | }
15 |
16 | public delegate void ConnectionDragStartedEventHandler(object sender, ConnectionDragStartedEventArgs e);
17 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionDraggingEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | public class ConnectionDraggingEventArgs : ConnectionDragEventArgs
6 | {
7 | private readonly object _connection;
8 |
9 | public object Connection
10 | {
11 | get { return _connection; }
12 | }
13 |
14 | internal ConnectionDraggingEventArgs(RoutedEvent routedEvent, object source,
15 | ElementItem elementItem, object connection, ConnectorItem connectorItem)
16 | : base(routedEvent, source, elementItem, connectorItem)
17 | {
18 | _connection = connection;
19 | }
20 | }
21 |
22 | public delegate void ConnectionDraggingEventHandler(object sender, ConnectionDraggingEventArgs e);
23 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionItem.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Input;
4 | using System.Windows.Media;
5 | using Gemini.Framework;
6 |
7 | namespace Gemini.Modules.GraphEditor.Controls
8 | {
9 | public class ConnectionItem : ListBoxItem
10 | {
11 | static ConnectionItem()
12 | {
13 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ConnectionItem),
14 | new FrameworkPropertyMetadata(typeof(ConnectionItem)));
15 | }
16 |
17 | private GraphControl ParentGraphControl
18 | {
19 | get { return VisualTreeUtility.FindParent(this); }
20 | }
21 |
22 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
23 | {
24 | ParentGraphControl.UnselectAll();
25 | base.OnMouseLeftButtonDown(e);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectionItemsControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Controls.Primitives;
8 | using System.Windows.Input;
9 |
10 | namespace Gemini.Modules.GraphEditor.Controls
11 | {
12 | public class ConnectionItemsControl : ListBox
13 | {
14 | public ConnectionItemsControl()
15 | {
16 | SelectionMode = SelectionMode.Extended;
17 | }
18 |
19 | protected override DependencyObject GetContainerForItemOverride()
20 | {
21 | return new ConnectionItem();
22 |
23 | }
24 |
25 | protected override bool IsItemItsOwnContainerOverride(object item)
26 | {
27 | return item is ConnectionItem;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectorItemDragCompletedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | internal class ConnectorItemDragCompletedEventArgs : RoutedEventArgs
6 | {
7 | public ConnectorItemDragCompletedEventArgs(RoutedEvent routedEvent, object source) :
8 | base(routedEvent, source)
9 | {
10 | }
11 | }
12 |
13 | internal delegate void ConnectorItemDragCompletedEventHandler(object sender, ConnectorItemDragCompletedEventArgs e);
14 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectorItemDragStartedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | internal class ConnectorItemDragStartedEventArgs : RoutedEventArgs
6 | {
7 | public bool Cancel { get; set; }
8 |
9 | internal ConnectorItemDragStartedEventArgs(RoutedEvent routedEvent, object source)
10 | : base(routedEvent, source)
11 | {
12 | }
13 | }
14 |
15 | internal delegate void ConnectorItemDragStartedEventHandler(object sender, ConnectorItemDragStartedEventArgs e);
16 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ConnectorItemDraggingEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace Gemini.Modules.GraphEditor.Controls
4 | {
5 | internal class ConnectorItemDraggingEventArgs : RoutedEventArgs
6 | {
7 | private readonly double _horizontalChange;
8 |
9 | private readonly double _verticalChange;
10 |
11 | public ConnectorItemDraggingEventArgs(RoutedEvent routedEvent, object source, double horizontalChange, double verticalChange) :
12 | base(routedEvent, source)
13 | {
14 | _horizontalChange = horizontalChange;
15 | _verticalChange = verticalChange;
16 | }
17 |
18 | public double HorizontalChange
19 | {
20 | get { return _horizontalChange; }
21 | }
22 |
23 | public double VerticalChange
24 | {
25 | get { return _verticalChange; }
26 | }
27 | }
28 |
29 | internal delegate void ConnectorItemDraggingEventHandler(object sender, ConnectorItemDraggingEventArgs e);
30 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Controls/ElementItemsControl.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace Gemini.Modules.GraphEditor.Controls
5 | {
6 | public class ElementItemsControl : ListBox
7 | {
8 | protected override DependencyObject GetContainerForItemOverride()
9 | {
10 | return new ElementItem();
11 | }
12 |
13 | protected override bool IsItemItsOwnContainerOverride(object item)
14 | {
15 | return item is ElementItem;
16 | }
17 |
18 | public ElementItemsControl()
19 | {
20 | SelectionMode = SelectionMode.Extended;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Converters/ColorToBrushConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows.Media;
5 |
6 | namespace Gemini.Modules.GraphEditor.Converters
7 | {
8 | public class ColorToBrushConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | return new SolidColorBrush((Color) value);
13 | }
14 |
15 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | throw new NotImplementedException();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Module.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework;
3 |
4 | namespace Gemini.Modules.GraphEditor
5 | {
6 | [Export(typeof(IModule))]
7 | public class Module : ModuleBase
8 | {
9 |
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
4 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Gemini.Modules.GraphEditor.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.GraphEditor/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Commands/ViewInspectorCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.Inspector.Properties;
3 |
4 | namespace Gemini.Modules.Inspector.Commands
5 | {
6 | [CommandDefinition]
7 | public class ViewInspectorCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "View.Inspector";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return Resources.ViewInspectorCommandText; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return Resources.ViewInspectorCommandToolTip; }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Commands/ViewInspectorCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Gemini.Framework.Commands;
4 | using Gemini.Framework.Services;
5 | using Gemini.Framework.Threading;
6 |
7 | namespace Gemini.Modules.Inspector.Commands
8 | {
9 | [CommandHandler]
10 | public class ViewInspectorCommandHandler : CommandHandlerBase
11 | {
12 | private readonly IShell _shell;
13 |
14 | [ImportingConstructor]
15 | public ViewInspectorCommandHandler(IShell shell)
16 | {
17 | _shell = shell;
18 | }
19 |
20 | public override Task Run(Command command)
21 | {
22 | _shell.ShowTool();
23 | return TaskUtility.Completed;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Controls/InspectorItemTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using Gemini.Modules.Inspector.Inspectors;
4 |
5 | namespace Gemini.Modules.Inspector.Controls
6 | {
7 | public class InspectorItemTemplateSelector : DataTemplateSelector
8 | {
9 | public DataTemplate LabelledTemplate { get; set; }
10 | public DataTemplate DefaultTemplate { get; set; }
11 |
12 | public override DataTemplate SelectTemplate(object item, DependencyObject container)
13 | {
14 | if (item is ILabelledInspector)
15 | return LabelledTemplate;
16 | return DefaultTemplate;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Conventions/EnumPropertyEditorBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using Gemini.Modules.Inspector.Inspectors;
4 |
5 | namespace Gemini.Modules.Inspector.Conventions
6 | {
7 | public class EnumPropertyEditorBuilder : PropertyEditorBuilder
8 | {
9 | public override bool IsApplicable(PropertyDescriptor propertyDescriptor)
10 | {
11 | return typeof(Enum).IsAssignableFrom(propertyDescriptor.PropertyType);
12 | }
13 |
14 | public override IEditor BuildEditor(PropertyDescriptor propertyDescriptor)
15 | {
16 | return new EnumEditorViewModel(propertyDescriptor.PropertyType);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Conventions/PropertyEditorBuilder.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using Gemini.Modules.Inspector.Inspectors;
3 |
4 | namespace Gemini.Modules.Inspector.Conventions
5 | {
6 | public abstract class PropertyEditorBuilder
7 | {
8 | public abstract bool IsApplicable(PropertyDescriptor propertyDescriptor);
9 | public abstract IEditor BuildEditor(PropertyDescriptor propertyDescriptor);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Conventions/StandardPropertyEditorBuilder.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using Gemini.Modules.Inspector.Inspectors;
3 |
4 | namespace Gemini.Modules.Inspector.Conventions
5 | {
6 | public class StandardPropertyEditorBuilder : PropertyEditorBuilder
7 | where TEditor : IEditor, new()
8 | {
9 | public override bool IsApplicable(PropertyDescriptor propertyDescriptor)
10 | {
11 | return propertyDescriptor.PropertyType == typeof(T);
12 | }
13 |
14 | public override IEditor BuildEditor(PropertyDescriptor propertyDescriptor)
15 | {
16 | return new TEditor();
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/IInspectableObject.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Gemini.Modules.Inspector.Inspectors;
3 |
4 | namespace Gemini.Modules.Inspector
5 | {
6 | public interface IInspectableObject
7 | {
8 | IEnumerable Inspectors { get; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/IInspectorTool.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Gemini.Framework;
3 |
4 | namespace Gemini.Modules.Inspector
5 | {
6 | public interface IInspectorTool : ITool
7 | {
8 | event EventHandler SelectedObjectChanged;
9 | IInspectableObject SelectedObject { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/InspectableObject.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Gemini.Modules.Inspector.Inspectors;
3 |
4 | namespace Gemini.Modules.Inspector
5 | {
6 | public class InspectableObject : IInspectableObject
7 | {
8 | public IEnumerable Inspectors { get; set; }
9 |
10 | public InspectableObject(IEnumerable inspectors)
11 | {
12 | Inspectors = inspectors;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/InspectableObjectBuilder.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector
2 | {
3 | public class InspectableObjectBuilder : InspectorBuilder
4 | {
5 | public InspectableObject ToInspectableObject()
6 | {
7 | return new InspectableObject(Inspectors);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/BitmapSourceEditorView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
10 |
11 |
13 |
14 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/BitmapSourceEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for BitmapSourceEditorView.xaml
19 | ///
20 | public partial class BitmapSourceEditorView : UserControl
21 | {
22 | public BitmapSourceEditorView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/BitmapSourceEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Windows.Media.Imaging;
3 | using Caliburn.Micro;
4 | using Gemini.Framework.Results;
5 | using Microsoft.Win32;
6 |
7 | namespace Gemini.Modules.Inspector.Inspectors
8 | {
9 | public class BitmapSourceEditorViewModel : EditorBase, ILabelledInspector
10 | {
11 | public IEnumerable Choose()
12 | {
13 | var fileDialog = new OpenFileDialog();
14 | yield return Show.CommonDialog(fileDialog);
15 |
16 | using (var stream = fileDialog.OpenFile())
17 | {
18 | var result = new BitmapImage();
19 | result.BeginInit();
20 | result.CacheOption = BitmapCacheOption.OnLoad;
21 | result.StreamSource = stream;
22 | result.EndInit();
23 | result.Freeze();
24 |
25 | Value = result;
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/CheckBoxEditorView.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/CheckBoxEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for CheckBoxEditorView.xaml
19 | ///
20 | public partial class CheckBoxEditorView : UserControl
21 | {
22 | public CheckBoxEditorView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/CheckBoxEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public class CheckBoxEditorViewModel : EditorBase, ILabelledInspector
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/CollapsibleGroupBuilder.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public class CollapsibleGroupBuilder : InspectorBuilder
4 | {
5 | internal CollapsibleGroupViewModel ToCollapsibleGroup(string name)
6 | {
7 | return new CollapsibleGroupViewModel(name, Inspectors);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/CollapsibleGroupView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for CollapsibleGroupView.xaml
19 | ///
20 | public partial class CollapsibleGroupView : UserControl
21 | {
22 | public CollapsibleGroupView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/ColorEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 |
3 | namespace Gemini.Modules.Inspector.Inspectors
4 | {
5 | public class ColorEditorViewModel : SelectiveUndoEditorBase, ILabelledInspector
6 | {
7 | private bool _usingAlphaChannel = true;
8 |
9 | public bool UsingAlphaChannel
10 | {
11 | get { return _usingAlphaChannel; }
12 |
13 | set
14 | {
15 | if (_usingAlphaChannel == value)
16 | return;
17 |
18 | _usingAlphaChannel = value;
19 |
20 | NotifyOfPropertyChange(() => UsingAlphaChannel);
21 | }
22 | }
23 |
24 | public void Opened()
25 | {
26 | OnBeginEdit();
27 | }
28 |
29 | public void Closed()
30 | {
31 | OnEndEdit();
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/EnumEditorView.xaml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/EnumEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for EnumEditorView.xaml
19 | ///
20 | public partial class EnumEditorView : UserControl
21 | {
22 | public EnumEditorView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/IEditor.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public interface IEditor : IInspector
4 | {
5 | BoundPropertyDescriptor BoundPropertyDescriptor { get; set; }
6 | bool CanReset { get; }
7 | void Reset();
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/IInspector.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public interface IInspector
4 | {
5 | string Name { get; }
6 | bool IsReadOnly { get; }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/ILabelledInspector.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public interface ILabelledInspector
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/InspectorBase.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 |
3 | namespace Gemini.Modules.Inspector.Inspectors
4 | {
5 | public abstract class InspectorBase : PropertyChangedBase, IInspector
6 | {
7 | public abstract string Name { get; }
8 | public abstract bool IsReadOnly { get; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/Point3DEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Modules.Inspector.Inspectors
4 | {
5 | ///
6 | /// Interaction logic for Point3DEditorView.xaml
7 | ///
8 | public partial class Point3DEditorView : UserControl
9 | {
10 | public Point3DEditorView()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/RangeEditorView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/RangeEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for RangeEditorView.xaml
19 | ///
20 | public partial class RangeEditorView : UserControl
21 | {
22 | public RangeEditorView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/RangeEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public class RangeEditorViewModel : SelectiveUndoEditorBase, ILabelledInspector
4 | {
5 | private readonly T _minimum;
6 | private readonly T _maximum;
7 |
8 | public T Minimum
9 | {
10 | get { return _minimum; }
11 | }
12 |
13 | public T Maximum
14 | {
15 | get { return _maximum; }
16 | }
17 |
18 | public RangeEditorViewModel(T minimum, T maximum)
19 | {
20 | _minimum = minimum;
21 | _maximum = maximum;
22 | }
23 |
24 | public void DragStarted()
25 | {
26 | OnBeginEdit();
27 | }
28 |
29 | public void DragCompleted()
30 | {
31 | OnEndEdit();
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/TextBoxEditorView.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/TextBoxEditorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.Inspector.Inspectors
16 | {
17 | ///
18 | /// Interaction logic for TextBoxEditorView.xaml
19 | ///
20 | public partial class TextBoxEditorView : UserControl
21 | {
22 | public TextBoxEditorView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Inspectors/TextBoxEditorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Inspector.Inspectors
2 | {
3 | public class TextBoxEditorViewModel : EditorBase, ILabelledInspector
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework.Menus;
3 | using Gemini.Modules.Inspector.Commands;
4 |
5 | namespace Gemini.Modules.Inspector
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition ViewInspectorMenuItem = new CommandMenuItemDefinition(
11 | MainMenu.MenuDefinitions.ViewPropertiesMenuGroup, 1);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Markup;
3 |
4 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
5 |
6 | [assembly: XmlnsDefinition("http://schemas.timjones.io/gemini", "Gemini.Modules.Inspector.Controls")]
7 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Properties/Resources.de.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.Inspector/Properties/Resources.de.Designer.cs
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Resources/eyedropper_16xLG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.Inspector/Resources/eyedropper_16xLG.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Util/ExpressionUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using System.Reflection;
4 |
5 | namespace Gemini.Modules.Inspector.Util
6 | {
7 | internal static class ExpressionUtility
8 | {
9 | public static string GetPropertyName(Expression> expression)
10 | {
11 | return GetPropertyNameInternal(expression);
12 | }
13 |
14 | private static string GetPropertyNameInternal(LambdaExpression expression)
15 | {
16 | var member = expression.Body as MemberExpression;
17 | if (member == null)
18 | throw new ArgumentException(string.Format(
19 | "Expression '{0}' refers to a method, not a property.",
20 | expression));
21 |
22 | var propertyInfo = member.Member as PropertyInfo;
23 | if (propertyInfo == null)
24 | throw new ArgumentException(string.Format(
25 | "Expression '{0}' refers to a field, not a property.",
26 | expression));
27 |
28 | return propertyInfo.Name;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Util/ScreenShotUtility.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using System.Drawing.Imaging;
3 | using System.Windows;
4 |
5 | namespace Gemini.Modules.Inspector.Util
6 | {
7 | public class ScreenShotUtility
8 | {
9 | public static Bitmap Take()
10 | {
11 | int screenX = (int) SystemParameters.VirtualScreenWidth;
12 | int screenY = (int) SystemParameters.VirtualScreenHeight;
13 |
14 | var ret = new Bitmap(screenX, screenY, PixelFormat.Format32bppRgb);
15 |
16 | using (var graphics = Graphics.FromImage(ret))
17 | {
18 | graphics.CopyFromScreen((int) SystemParameters.VirtualScreenLeft, (int) SystemParameters.VirtualScreenTop, 0, 0,
19 | new System.Drawing.Size((int) SystemParameters.VirtualScreenWidth, (int) SystemParameters.VirtualScreenHeight),
20 | CopyPixelOperation.SourceCopy);
21 | }
22 |
23 | return ret;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Views/InspectorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Modules.Inspector.Views
4 | {
5 | ///
6 | /// Interaction logic for InspectorView.xaml
7 | ///
8 | public partial class InspectorView : UserControl
9 | {
10 | public InspectorView()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Inspector/Win32/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Runtime.InteropServices;
4 | using System.Windows;
5 |
6 | namespace Gemini.Modules.Inspector.Win32
7 | {
8 | internal static class NativeMethods
9 | {
10 | [StructLayout(LayoutKind.Sequential)]
11 | public struct NativePoint
12 | {
13 | public int X;
14 | public int Y;
15 | }
16 |
17 | [DllImport("user32.dll", EntryPoint = "GetCursorPos")]
18 | public static extern bool GetCursorPos(out NativePoint point);
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Commands/ViewOutputCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.Output.Properties;
3 |
4 | namespace Gemini.Modules.Output.Commands
5 | {
6 | [CommandDefinition]
7 | public class ViewOutputCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "View.Output";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return Resources.ViewOutputCommandText; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return Resources.ViewOutputCommandToolTip; }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Commands/ViewOutputCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Gemini.Framework.Commands;
4 | using Gemini.Framework.Services;
5 | using Gemini.Framework.Threading;
6 |
7 | namespace Gemini.Modules.Output.Commands
8 | {
9 | [CommandHandler]
10 | public class ViewOutputCommandHandler : CommandHandlerBase
11 | {
12 | private readonly IShell _shell;
13 |
14 | [ImportingConstructor]
15 | public ViewOutputCommandHandler(IShell shell)
16 | {
17 | _shell = shell;
18 | }
19 |
20 | public override Task Run(Command command)
21 | {
22 | _shell.ShowTool();
23 | return TaskUtility.Completed;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/IOutput.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using Gemini.Framework;
3 |
4 | namespace Gemini.Modules.Output
5 | {
6 | public interface IOutput : ITool
7 | {
8 | TextWriter Writer { get; }
9 | void AppendLine(string text);
10 | void Append(string text);
11 | void Clear();
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework.Menus;
3 | using Gemini.Modules.Output.Commands;
4 |
5 | namespace Gemini.Modules.Output
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition ViewOutputMenuItem = new CommandMenuItemDefinition(
11 | MainMenu.MenuDefinitions.ViewToolsMenuGroup, 1);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Properties/Resources.de.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.Output/Properties/Resources.de.Designer.cs
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/ViewModels/OutputWriter.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Text;
3 |
4 | namespace Gemini.Modules.Output.ViewModels
5 | {
6 | internal class OutputWriter : TextWriter
7 | {
8 | private readonly IOutput _output;
9 |
10 | public override Encoding Encoding
11 | {
12 | get { return Encoding.Default; }
13 | }
14 |
15 | public OutputWriter(IOutput output)
16 | {
17 | _output = output;
18 | }
19 |
20 | public override void WriteLine()
21 | {
22 | _output.AppendLine(string.Empty);
23 | }
24 |
25 | public override void WriteLine(string value)
26 | {
27 | _output.AppendLine(value);
28 | }
29 |
30 | public override void Write(string value)
31 | {
32 | _output.Append(value);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Views/IOutputView.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Output.Views
2 | {
3 | public interface IOutputView
4 | {
5 | void Clear();
6 | void ScrollToEnd();
7 | void AppendText(string text);
8 | void SetText(string text);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Views/OutputView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
18 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.Output/Views/OutputView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Modules.Output.Views
4 | {
5 | ///
6 | /// Interaction logic for OutputView.xaml
7 | ///
8 | public partial class OutputView : UserControl, IOutputView
9 | {
10 | public OutputView()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | public void ScrollToEnd()
16 | {
17 | outputText.ScrollToEnd();
18 | }
19 |
20 | public void Clear()
21 | {
22 | outputText.Clear();
23 | }
24 |
25 | public void AppendText(string text)
26 | {
27 | outputText.AppendText(text);
28 | ScrollToEnd();
29 | }
30 |
31 | public void SetText(string text)
32 | {
33 | outputText.Text = text;
34 | ScrollToEnd();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/Commands/ViewPropertyGridCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Modules.PropertyGrid.Properties;
3 |
4 | namespace Gemini.Modules.PropertyGrid.Commands
5 | {
6 | [CommandDefinition]
7 | public class ViewPropertyGridCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "View.PropertiesWindow";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return Resources.ViewPropertyGridCommandText; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return Resources.ViewPropertyGridCommandToolTip; }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/Commands/ViewPropertyGridCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Gemini.Framework.Commands;
4 | using Gemini.Framework.Services;
5 | using Gemini.Framework.Threading;
6 |
7 | namespace Gemini.Modules.PropertyGrid.Commands
8 | {
9 | [CommandHandler]
10 | public class ViewPropertyGridCommandHandler : CommandHandlerBase
11 | {
12 | private readonly IShell _shell;
13 |
14 | [ImportingConstructor]
15 | public ViewPropertyGridCommandHandler(IShell shell)
16 | {
17 | _shell = shell;
18 | }
19 |
20 | public override Task Run(Command command)
21 | {
22 | _shell.ShowTool();
23 | return TaskUtility.Completed;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/IPropertyGrid.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework;
2 |
3 | namespace Gemini.Modules.PropertyGrid
4 | {
5 | public interface IPropertyGrid : ITool
6 | {
7 | object SelectedObject { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework.Menus;
3 | using Gemini.Modules.PropertyGrid.Commands;
4 |
5 | namespace Gemini.Modules.PropertyGrid
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition ViewPropertyGridMenuItem = new CommandMenuItemDefinition(
11 | MainMenu.MenuDefinitions.ViewPropertiesMenuGroup, 0);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/Resources/Icons/Properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini.Modules.PropertyGrid/Resources/Icons/Properties.png
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/Views/PropertyGridView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Gemini.Modules.PropertyGrid/Views/PropertyGridView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Modules.PropertyGrid.Views
4 | {
5 | ///
6 | /// Interaction logic for PropertyGridView.xaml
7 | ///
8 | public partial class PropertyGridView : UserControl
9 | {
10 | public PropertyGridView()
11 | {
12 | // The following line simply forces Visual Studio to copy the
13 | // WPF Toolkit DLL to the output folder.
14 | _propertyGrid = null;
15 |
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Behaviors/KeyboardFocusBehavior.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Input;
3 | using Microsoft.Xaml.Behaviors;
4 |
5 | namespace Gemini.Framework.Behaviors
6 | {
7 | public class KeyboardFocusBehavior : Behavior
8 | {
9 | protected override void OnAttached()
10 | {
11 | if (!AssociatedObject.IsLoaded)
12 | AssociatedObject.Loaded += (sender, e) => { Keyboard.Focus(AssociatedObject); };
13 | else
14 | Keyboard.Focus(AssociatedObject);
15 |
16 | base.OnAttached();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/CommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Commands
4 | {
5 | public abstract class CommandDefinition : CommandDefinitionBase
6 | {
7 | public override Uri IconSource
8 | {
9 | get { return null; }
10 | }
11 |
12 | public sealed override bool IsList
13 | {
14 | get { return false; }
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/CommandDefinitionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 |
4 | namespace Gemini.Framework.Commands
5 | {
6 | [MetadataAttribute]
7 | [AttributeUsage(AttributeTargets.Class)]
8 | public class CommandDefinitionAttribute : ExportAttribute
9 | {
10 | public CommandDefinitionAttribute()
11 | : base(typeof(CommandDefinitionBase))
12 | {
13 |
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/CommandDefinitionBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Commands
4 | {
5 | public abstract class CommandDefinitionBase
6 | {
7 | public abstract string Name { get; }
8 | public abstract string Text { get; }
9 | public abstract string ToolTip { get; }
10 | public abstract Uri IconSource { get; }
11 | public abstract bool IsList { get; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/CommandHandlerAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 |
4 | namespace Gemini.Framework.Commands
5 | {
6 | [MetadataAttribute]
7 | [AttributeUsage(AttributeTargets.Class)]
8 | public class CommandHandlerAttribute : ExportAttribute
9 | {
10 | public CommandHandlerAttribute()
11 | : base(typeof(ICommandHandler))
12 | {
13 |
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/CommandListDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Commands
4 | {
5 | public abstract class CommandListDefinition : CommandDefinitionBase
6 | {
7 | public override sealed string Text
8 | {
9 | get { return "[NotUsed]"; }
10 | }
11 |
12 | public override sealed string ToolTip
13 | {
14 | get { return "[NotUsed]"; }
15 | }
16 |
17 | public override sealed Uri IconSource
18 | {
19 | get { return null; }
20 | }
21 |
22 | public override sealed bool IsList
23 | {
24 | get { return true; }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ExcludeCommandKeyboardShortcut.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Commands
2 | {
3 | public class ExcludeCommandKeyboardShortcut
4 | {
5 | private readonly CommandKeyboardShortcut _keyboardShortcut;
6 |
7 | public CommandKeyboardShortcut KeyboardShortcut
8 | {
9 | get { return _keyboardShortcut; }
10 | }
11 |
12 | public ExcludeCommandKeyboardShortcut(CommandKeyboardShortcut keyboardShortcut)
13 | {
14 | _keyboardShortcut = keyboardShortcut;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 |
4 | namespace Gemini.Framework.Commands
5 | {
6 | public interface ICommandHandler : ICommandHandler
7 | where TCommandDefinition : CommandDefinition
8 | {
9 | void Update(Command command);
10 | Task Run(Command command);
11 | }
12 |
13 | public interface ICommandListHandler : ICommandHandler
14 | where TCommandDefinition : CommandListDefinition
15 | {
16 | void Populate(Command command, List commands);
17 | Task Run(Command command);
18 | }
19 |
20 | public interface ICommandHandler
21 | {
22 |
23 | }
24 |
25 | public interface ICommandListHandler : ICommandHandler
26 | {
27 |
28 | }
29 |
30 | public abstract class CommandHandlerBase : ICommandHandler
31 | where TCommandDefinition : CommandDefinition
32 | {
33 | public virtual void Update(Command command)
34 | {
35 |
36 | }
37 |
38 | public abstract Task Run(Command command);
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandKeyGestureService.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Input;
3 |
4 | namespace Gemini.Framework.Commands
5 | {
6 | public interface ICommandKeyGestureService
7 | {
8 | void BindKeyGestures(UIElement uiElement);
9 | KeyGesture GetPrimaryKeyGesture(CommandDefinitionBase commandDefinition);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandRerouter.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Commands
2 | {
3 | public interface ICommandRerouter
4 | {
5 | object GetHandler(CommandDefinitionBase commandDefinition);
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandRouter.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Commands
2 | {
3 | public interface ICommandRouter
4 | {
5 | CommandHandlerWrapper GetCommandHandler(CommandDefinitionBase commandDefinition);
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Commands
4 | {
5 | public interface ICommandService
6 | {
7 | CommandDefinitionBase GetCommandDefinition(Type commandDefinitionType);
8 | Command GetCommand(CommandDefinitionBase commandDefinition);
9 | TargetableCommand GetTargetableCommand(Command command);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Commands/ICommandUiItem.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Commands
2 | {
3 | public interface ICommandUiItem
4 | {
5 | CommandDefinitionBase CommandDefinition { get; }
6 | void Update(CommandHandlerWrapper commandHandler);
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Controls/ExpanderEx.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace Gemini.Framework.Controls
5 | {
6 | public class ExpanderEx : Expander
7 | {
8 | static ExpanderEx()
9 | {
10 | DefaultStyleKeyProperty.OverrideMetadata(typeof(ExpanderEx),
11 | new FrameworkPropertyMetadata(typeof(ExpanderEx)));
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Controls/HwndMouse.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using Gemini.Framework.Win32;
3 |
4 | namespace Gemini.Framework.Controls
5 | {
6 | public static class HwndMouse
7 | {
8 | public static Point GetCursorPosition()
9 | {
10 | var point = new NativeMethods.NativePoint();
11 | NativeMethods.GetCursorPos(ref point);
12 | return new Point(point.X, point.Y);
13 | }
14 |
15 | public static void SetCursorPosition(Point point)
16 | {
17 | NativeMethods.SetCursorPos((int) point.X, (int) point.Y);
18 | }
19 |
20 | public static void ShowCursor()
21 | {
22 | NativeMethods.ShowCursor(true);
23 | }
24 |
25 | public static void HideCursor()
26 | {
27 | NativeMethods.ShowCursor(false);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Controls/SliderEx.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Windows.Controls;
3 | using System.Windows.Controls.Primitives;
4 |
5 | namespace Gemini.Framework.Controls
6 | {
7 | ///
8 | /// Slider that exposes the thumb drag started / completed events directly
9 | /// to allow Caliburn Micro to attach to the messages.
10 | ///
11 | public class SliderEx : Slider
12 | {
13 | [Category("Behavior")]
14 | public event DragStartedEventHandler ThumbDragStarted;
15 |
16 | [Category("Behavior")]
17 | public event DragCompletedEventHandler ThumbDragCompleted;
18 |
19 | protected override void OnThumbDragStarted(DragStartedEventArgs e)
20 | {
21 | if (ThumbDragStarted != null)
22 | ThumbDragStarted(this, e);
23 |
24 | base.OnThumbDragStarted(e);
25 | }
26 |
27 | protected override void OnThumbDragCompleted(DragCompletedEventArgs e)
28 | {
29 | if (ThumbDragCompleted != null)
30 | ThumbDragCompleted(this, e);
31 |
32 | base.OnThumbDragCompleted(e);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/IDocument.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Modules.UndoRedo;
2 |
3 | namespace Gemini.Framework
4 | {
5 | public interface IDocument : ILayoutItem
6 | {
7 | IUndoRedoManager UndoRedoManager { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ILayoutItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Input;
4 | using Caliburn.Micro;
5 |
6 | namespace Gemini.Framework
7 | {
8 | public interface ILayoutItem : IScreen
9 | {
10 | Guid Id { get; }
11 | string ContentId { get; }
12 | ICommand CloseCommand { get; }
13 | Uri IconSource { get; }
14 | bool IsSelected { get; set; }
15 | bool ShouldReopenOnStart { get; }
16 | void LoadState(BinaryReader reader);
17 | void SaveState(BinaryWriter writer);
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/IModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using System.Windows;
5 |
6 | namespace Gemini.Framework
7 | {
8 | public interface IModule
9 | {
10 | IEnumerable GlobalResourceDictionaries { get; }
11 | IEnumerable DefaultDocuments { get; }
12 | IEnumerable DefaultTools { get; }
13 |
14 | void PreInitialize();
15 | void Initialize();
16 | Task PostInitializeAsync();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/IPersistedDocument.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Gemini.Framework
4 | {
5 | public interface IPersistedDocument : IDocument
6 | {
7 | bool IsNew { get; }
8 | string FileName { get; }
9 | string FilePath { get; }
10 |
11 | Task New(string fileName);
12 | Task Load(string filePath);
13 | Task Save(string filePath);
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ITool.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Services;
2 |
3 | namespace Gemini.Framework
4 | {
5 | public interface ITool : ILayoutItem
6 | {
7 | PaneLocation PreferredLocation { get; }
8 | double PreferredWidth { get; }
9 | double PreferredHeight { get; }
10 |
11 | bool IsVisible { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/IWindow.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 |
3 | namespace Gemini.Framework
4 | {
5 | public interface IWindow : IActivate, IDeactivate, INotifyPropertyChangedEx
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Markup/TranslateExtension.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Markup;
2 |
3 | namespace Gemini.Framework.Markup
4 | {
5 | public sealed class TranslateExtension : StaticExtension
6 | {
7 | public TranslateExtension(string member)
8 | : base(member)
9 | {
10 |
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/CommandMenuItemDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Caliburn.Micro;
4 | using Gemini.Framework.Commands;
5 |
6 | namespace Gemini.Framework.Menus
7 | {
8 | public class CommandMenuItemDefinition : MenuItemDefinition
9 | where TCommandDefinition : CommandDefinitionBase
10 | {
11 | private readonly CommandDefinitionBase _commandDefinition;
12 | private readonly KeyGesture _keyGesture;
13 |
14 | public override string Text => _commandDefinition.Text;
15 |
16 | public override Uri IconSource => _commandDefinition.IconSource;
17 |
18 | public override KeyGesture KeyGesture => _keyGesture;
19 |
20 | public override CommandDefinitionBase CommandDefinition => _commandDefinition;
21 |
22 | public CommandMenuItemDefinition(MenuItemGroupDefinition group, int sortOrder)
23 | : base(group, sortOrder)
24 | {
25 | _commandDefinition = IoC.Get().GetCommandDefinition(typeof(TCommandDefinition));
26 | _keyGesture = IoC.Get().GetPrimaryKeyGesture(_commandDefinition);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/ExcludeMenuDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Menus
2 | {
3 | [System.Diagnostics.DebuggerDisplay("Exclude {MenuDefinitionToExclude}")]
4 | public class ExcludeMenuDefinition
5 | {
6 | public MenuDefinition MenuDefinitionToExclude { get; private set; }
7 |
8 | public ExcludeMenuDefinition(MenuDefinition menuDefinition)
9 | {
10 | MenuDefinitionToExclude = menuDefinition;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/ExcludeMenuItemDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Menus
2 | {
3 | [System.Diagnostics.DebuggerDisplay("Exclude {MenuItemDefinitionToExclude}")]
4 | public class ExcludeMenuItemDefinition
5 | {
6 | public MenuItemDefinition MenuItemDefinitionToExclude { get; private set; }
7 |
8 | public ExcludeMenuItemDefinition(MenuItemDefinition menuItemDefinition)
9 | {
10 | MenuItemDefinitionToExclude = menuItemDefinition;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/ExcludeMenuItemGroupDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Menus
2 | {
3 | [System.Diagnostics.DebuggerDisplay("Exclude {MenuItemGroupDefinitionToExclude}")]
4 | public class ExcludeMenuItemGroupDefinition
5 | {
6 | public MenuItemGroupDefinition MenuItemGroupDefinitionToExclude { get; private set; }
7 |
8 | public ExcludeMenuItemGroupDefinition(MenuItemGroupDefinition menuItemGroupDefinition)
9 | {
10 | MenuItemGroupDefinitionToExclude = menuItemGroupDefinition;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/MenuBarDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Menus
2 | {
3 | public class MenuBarDefinition
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/MenuDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Gemini.Framework.Commands;
4 |
5 | namespace Gemini.Framework.Menus
6 | {
7 | public class MenuDefinition : MenuDefinitionBase
8 | {
9 | private readonly int _sortOrder;
10 | private readonly string _text;
11 |
12 | public MenuBarDefinition MenuBar { get; private set; }
13 |
14 | public override int SortOrder => _sortOrder;
15 |
16 | public override string Text => _text;
17 |
18 | public override Uri IconSource => null;
19 |
20 | public override KeyGesture KeyGesture => null;
21 |
22 | public override CommandDefinitionBase CommandDefinition => null;
23 |
24 | public MenuDefinition(MenuBarDefinition menuBar, int sortOrder, string text)
25 | {
26 | MenuBar = menuBar;
27 | _sortOrder = sortOrder;
28 | _text = text;
29 | }
30 |
31 | public MenuDefinition SetDynamicExclusionPredicate(
32 | Predicate predicate)
33 | {
34 | DynamicExclusionPredicate = predicate;
35 | return this;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/MenuDefinitionBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Gemini.Framework.Commands;
4 |
5 | namespace Gemini.Framework.Menus
6 | {
7 | [System.Diagnostics.DebuggerDisplay("{Text}")]
8 | public abstract class MenuDefinitionBase
9 | {
10 | public abstract int SortOrder { get; }
11 | public abstract string Text { get; }
12 | public abstract Uri IconSource { get; }
13 | public abstract KeyGesture KeyGesture { get; }
14 | public abstract CommandDefinitionBase CommandDefinition { get; }
15 |
16 | ///
17 | /// An optional predicate which is called using this instance,
18 | /// which when it returns true, informs that the menu should be
19 | /// excluded from view
20 | ///
21 | public Predicate DynamicExclusionPredicate { get; protected set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/MenuItemDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Menus
4 | {
5 | public abstract class MenuItemDefinition : MenuDefinitionBase
6 | {
7 | private readonly int _sortOrder;
8 |
9 | public MenuItemGroupDefinition Group { get; private set; }
10 |
11 | public override int SortOrder => _sortOrder;
12 |
13 | protected MenuItemDefinition(MenuItemGroupDefinition group, int sortOrder)
14 | {
15 | Group = group;
16 | _sortOrder = sortOrder;
17 | }
18 |
19 | public MenuItemDefinition SetDynamicExclusionPredicate(
20 | Predicate predicate)
21 | {
22 | DynamicExclusionPredicate = predicate;
23 | return this;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/MenuItemGroupDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Menus
4 | {
5 | public class MenuItemGroupDefinition
6 | {
7 | private readonly int _sortOrder;
8 |
9 | public MenuDefinitionBase Parent { get; private set; }
10 |
11 | public int SortOrder => _sortOrder;
12 |
13 | public MenuItemGroupDefinition(MenuDefinitionBase parent, int sortOrder)
14 | {
15 | Parent = parent;
16 | _sortOrder = sortOrder;
17 | }
18 |
19 | ///
20 | /// An optional predicate which is called using this instance,
21 | /// which when it returns true, informs that the menu should be
22 | /// excluded from view
23 | ///
24 | public Predicate DynamicExclusionPredicate { get; protected set; }
25 |
26 | public MenuItemGroupDefinition SetDynamicExclusionPredicate(
27 | Predicate predicate)
28 | {
29 | DynamicExclusionPredicate = predicate;
30 | return this;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Menus/TextMenuItemDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 | using Gemini.Framework.Commands;
4 |
5 | namespace Gemini.Framework.Menus
6 | {
7 | public class TextMenuItemDefinition : MenuItemDefinition
8 | {
9 | private readonly string _text;
10 | private readonly Uri _iconSource;
11 |
12 | public override string Text => _text;
13 |
14 | public override Uri IconSource => _iconSource;
15 |
16 | public override KeyGesture KeyGesture => null;
17 |
18 | public override CommandDefinitionBase CommandDefinition => null;
19 |
20 | public TextMenuItemDefinition(MenuItemGroupDefinition group, int sortOrder, string text, Uri iconSource = null)
21 | : base(group, sortOrder)
22 | {
23 | _text = text;
24 | _iconSource = iconSource;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Results/IOpenResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Caliburn.Micro;
3 |
4 | namespace Gemini.Framework.Results
5 | {
6 | public interface IOpenResult : IResult
7 | {
8 | Action OnConfigure { get; set; }
9 | Action OnShutDown { get; set; }
10 |
11 | //void SetData(TData data);
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Results/LambdaResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Caliburn.Micro;
3 |
4 | namespace Gemini.Framework.Results
5 | {
6 | public class LambdaResult : IResult
7 | {
8 | private readonly Action _lambda;
9 |
10 | public LambdaResult(Action lambda)
11 | {
12 | _lambda = lambda;
13 | }
14 |
15 | public void Execute(CoroutineExecutionContext context)
16 | {
17 | _lambda(context);
18 |
19 | var completedHandler = Completed;
20 | if (completedHandler != null)
21 | completedHandler(this, new ResultCompletionEventArgs());
22 | }
23 |
24 | public event EventHandler Completed;
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Results/ShowCommonDialogResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Caliburn.Micro;
3 | using Microsoft.Win32;
4 |
5 | namespace Gemini.Framework.Results
6 | {
7 | public class ShowCommonDialogResult : IResult
8 | {
9 | public event EventHandler Completed;
10 |
11 | private readonly CommonDialog _commonDialog;
12 |
13 | public ShowCommonDialogResult(CommonDialog commonDialog)
14 | {
15 | _commonDialog = commonDialog;
16 | }
17 |
18 | public void Execute(CoroutineExecutionContext context)
19 | {
20 | var result = _commonDialog.ShowDialog().GetValueOrDefault(false);
21 | Completed(this, new ResultCompletionEventArgs { WasCancelled = !result });
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/EditorFileType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gemini.Framework.Services
4 | {
5 | public class EditorFileType
6 | {
7 | public string Name { get; set; }
8 | public string FileExtension { get; set; }
9 | public Uri IconSource { get; set; }
10 |
11 | public EditorFileType(string name, string fileExtension, Uri iconSource = null)
12 | {
13 | Name = name;
14 | FileExtension = fileExtension;
15 | IconSource = iconSource;
16 | }
17 |
18 | public EditorFileType()
19 | {
20 |
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/ExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using System.Reflection;
4 | using Caliburn.Micro;
5 |
6 | namespace Gemini.Framework.Services
7 | {
8 | public static class ExtensionMethods
9 | {
10 | public static string GetExecutingAssemblyName()
11 | {
12 | return Assembly.GetExecutingAssembly().GetAssemblyName();
13 | }
14 |
15 | public static string GetPropertyName(Expression> property)
16 | {
17 | return property.GetMemberInfo().Name;
18 | }
19 |
20 | public static string GetPropertyName(Expression> property)
21 | {
22 | return property.GetMemberInfo().Name;
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/IEditorProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 |
4 | namespace Gemini.Framework.Services
5 | {
6 | public interface IEditorProvider
7 | {
8 | IEnumerable FileTypes { get; }
9 |
10 | bool CanCreateNew { get; }
11 |
12 | bool Handles(string path);
13 |
14 | IDocument Create();
15 |
16 | Task New(IDocument document, string name);
17 | Task Open(IDocument document, string path);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/IInputManager.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Input;
3 |
4 | namespace Gemini.Framework.Services
5 | {
6 | public interface IInputManager
7 | {
8 | void SetShortcut(DependencyObject view, InputGesture gesture, object handler);
9 | void SetShortcut(InputGesture gesture, object handler);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/IMainWindow.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Gemini.Framework.Services
5 | {
6 | public interface IMainWindow
7 | {
8 | WindowState WindowState { get; set; }
9 | double Width { get; set; }
10 | double Height { get; set; }
11 |
12 | string Title { get; set; }
13 | ImageSource Icon { get; set; }
14 |
15 | IShell Shell { get; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/IResourceManager.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Windows.Media.Imaging;
3 |
4 | namespace Gemini.Framework.Services
5 | {
6 | public interface IResourceManager
7 | {
8 | Stream GetStream(string relativeUri, string assemblyName);
9 | BitmapImage GetBitmap(string relativeUri, string assemblyName);
10 | BitmapImage GetBitmap(string relativeUri);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/IShell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Modules.MainMenu;
5 | using Gemini.Modules.StatusBar;
6 | using Gemini.Modules.ToolBars;
7 |
8 | namespace Gemini.Framework.Services
9 | {
10 | public interface IShell : IGuardClose, IDeactivate
11 | {
12 | event EventHandler ActiveDocumentChanging;
13 | event EventHandler ActiveDocumentChanged;
14 |
15 | bool ShowFloatingWindowsInTaskbar { get; set; }
16 |
17 | IMenu MainMenu { get; }
18 | IToolBars ToolBars { get; }
19 | IStatusBar StatusBar { get; }
20 |
21 | // TODO: Rename this to ActiveItem.
22 | ILayoutItem ActiveLayoutItem { get; set; }
23 |
24 | // TODO: Rename this to SelectedDocument.
25 | IDocument ActiveItem { get; }
26 |
27 | IObservableCollection Documents { get; }
28 | IObservableCollection Tools { get; }
29 |
30 | bool RegisterTool(ITool tool);
31 | void ShowTool() where TTool : ITool;
32 | void ShowTool(ITool model);
33 |
34 | Task OpenDocumentAsync(IDocument model);
35 | Task CloseDocumentAsync(IDocument document);
36 |
37 | void Close();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/PaneLocation.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.Services
2 | {
3 | public enum PaneLocation
4 | {
5 | Left,
6 | Right,
7 | Bottom
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Services/ServiceProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 | using Caliburn.Micro;
4 |
5 | namespace Gemini.Framework.Services
6 | {
7 | ///
8 | /// Used for interop with code that requires an IServiceProvider. This class
9 | /// defers to the MEF container to resolve services.
10 | ///
11 | [Export(typeof(IServiceProvider))]
12 | public class ServiceProvider : IServiceProvider
13 | {
14 | ///
15 | /// Looks up the specified service.
16 | ///
17 | public object GetService(Type serviceType)
18 | {
19 | return IoC.GetInstance(serviceType, null);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ShaderEffects/GrayscaleEffect.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Gemini.Framework.ShaderEffects
5 | {
6 | public class GrayscaleEffect : ShaderEffectBase
7 | {
8 | public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GrayscaleEffect), 0);
9 |
10 | public Brush Input
11 | {
12 | get { return (Brush) GetValue(InputProperty); }
13 | set { SetValue(InputProperty, value); }
14 | }
15 |
16 | public GrayscaleEffect()
17 | {
18 | UpdateShaderValue(InputProperty);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ShaderEffects/GrayscaleEffect.ps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tgjones/gemini/1a20a571916cb643e43d400e46098902db84bed2/src/Gemini/Framework/ShaderEffects/GrayscaleEffect.ps
--------------------------------------------------------------------------------
/src/Gemini/Framework/ShaderEffects/ShaderEffectBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media.Effects;
3 |
4 | namespace Gemini.Framework.ShaderEffects
5 | {
6 | public class ShaderEffectBase : ShaderEffect, IDisposable
7 | where T : ShaderEffectBase
8 | {
9 | [ThreadStatic]
10 | private static PixelShader _shader;
11 |
12 | private static PixelShader Shader
13 | {
14 | get { return (_shader ?? (_shader = ShaderEffectUtility.GetPixelShader(typeof(T).Name))); }
15 | }
16 |
17 | protected ShaderEffectBase()
18 | {
19 | PixelShader = Shader;
20 | }
21 |
22 | void IDisposable.Dispose()
23 | {
24 | PixelShader = null;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ShaderEffects/ShaderEffectUtility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media.Effects;
3 |
4 | namespace Gemini.Framework.ShaderEffects
5 | {
6 | internal static class ShaderEffectUtility
7 | {
8 | public static PixelShader GetPixelShader(string name)
9 | {
10 | return new PixelShader
11 | {
12 | UriSource = new Uri(@"pack://application:,,,/Gemini;component/Framework/ShaderEffects/" + name + ".ps")
13 | };
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Themes/ITheme.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Gemini.Framework.Themes
5 | {
6 | public interface ITheme
7 | {
8 | ///
9 | /// Name of the theme, used in menus and settings.
10 | ///
11 | string Name { get; }
12 |
13 | ///
14 | /// Resources to be added to Application.Resources.
15 | ///
16 | IEnumerable ApplicationResources { get; }
17 |
18 | ///
19 | /// Resources to be added to the main window's Window.Resources collection.
20 | ///
21 | IEnumerable MainWindowResources { get; }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/Threading/TaskUtility.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Gemini.Framework.Threading
4 | {
5 | public class TaskUtility
6 | {
7 | public static readonly Task Completed = Task.FromResult(true);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ToolBars/ExcludeToolBarDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.ToolBars
2 | {
3 | public class ExcludeToolBarDefinition
4 | {
5 | private readonly ToolBarDefinition _toolBarDefinitionToExclude;
6 | public ToolBarDefinition ToolBarDefinitionToExclude
7 | {
8 | get { return _toolBarDefinitionToExclude; }
9 | }
10 |
11 | public ExcludeToolBarDefinition(ToolBarDefinition toolBarDefinition)
12 | {
13 | _toolBarDefinitionToExclude = toolBarDefinition;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ToolBars/ExcludeToolBarItemDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.ToolBars
2 | {
3 | public class ExcludeToolBarItemDefinition
4 | {
5 | private readonly ToolBarItemDefinition _toolBarItemDefinitionToExclude;
6 | public ToolBarItemDefinition ToolBarItemDefinitionToExclude
7 | {
8 | get { return _toolBarItemDefinitionToExclude; }
9 | }
10 |
11 | public ExcludeToolBarItemDefinition(ToolBarItemDefinition ToolBarItemDefinition)
12 | {
13 | _toolBarItemDefinitionToExclude = ToolBarItemDefinition;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ToolBars/ExcludeToolBarItemGroupDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.ToolBars
2 | {
3 | public class ExcludeToolBarItemGroupDefinition
4 | {
5 | private readonly ToolBarItemGroupDefinition _toolBarItemGroupDefinitionToExclude;
6 | public ToolBarItemGroupDefinition ToolBarItemGroupDefinitionToExclude
7 | {
8 | get { return _toolBarItemGroupDefinitionToExclude; }
9 | }
10 |
11 | public ExcludeToolBarItemGroupDefinition(ToolBarItemGroupDefinition toolBarItemGroupDefinition)
12 | {
13 | _toolBarItemGroupDefinitionToExclude = toolBarItemGroupDefinition;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ToolBars/ToolBarDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.ToolBars
2 | {
3 | public class ToolBarDefinition
4 | {
5 | private readonly int _sortOrder;
6 | private readonly string _name;
7 |
8 | public int SortOrder
9 | {
10 | get { return _sortOrder; }
11 | }
12 |
13 | public string Name
14 | {
15 | get { return _name; }
16 | }
17 |
18 | public ToolBarDefinition(int sortOrder, string name)
19 | {
20 | _sortOrder = sortOrder;
21 | _name = name;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/ToolBars/ToolBarItemGroupDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Framework.ToolBars
2 | {
3 | public class ToolBarItemGroupDefinition
4 | {
5 | private readonly ToolBarDefinition _toolBar;
6 | private readonly int _sortOrder;
7 |
8 | public ToolBarDefinition ToolBar
9 | {
10 | get { return _toolBar; }
11 | }
12 |
13 | public int SortOrder
14 | {
15 | get { return _sortOrder; }
16 | }
17 |
18 | public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder)
19 | {
20 | _toolBar = toolBar;
21 | _sortOrder = sortOrder;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/VisualTreeUtility.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 |
4 | namespace Gemini.Framework
5 | {
6 | public static class VisualTreeUtility
7 | {
8 | public static T FindParent(DependencyObject child)
9 | where T : DependencyObject
10 | {
11 | var parentObject = VisualTreeHelper.GetParent(child);
12 |
13 | if (parentObject == null)
14 | return null;
15 |
16 | var parent = parentObject as T;
17 | if (parent != null)
18 | return parent;
19 |
20 | return FindParent(parentObject);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Gemini/Framework/WindowBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Caliburn.Micro;
3 |
4 | namespace Gemini.Framework
5 | {
6 | public abstract class WindowBase : Screen, IWindow
7 | {
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/IMenu.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 | using Gemini.Modules.MainMenu.Models;
3 |
4 | namespace Gemini.Modules.MainMenu
5 | {
6 | public interface IMenu : IObservableCollection
7 | {
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/IMenuBuilder.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Menus;
2 | using Gemini.Modules.MainMenu.Models;
3 |
4 | namespace Gemini.Modules.MainMenu
5 | {
6 | public interface IMenuBuilder
7 | {
8 | void BuildMenuBar(MenuBarDefinition menuBarDefinition, MenuModel result);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Models/MenuItemBase.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using Caliburn.Micro;
4 |
5 | namespace Gemini.Modules.MainMenu.Models
6 | {
7 | public class MenuItemBase : PropertyChangedBase, IEnumerable
8 | {
9 | #region Static stuff
10 |
11 | public static MenuItemBase Separator => new MenuItemSeparator();
12 |
13 | #endregion
14 |
15 | #region Properties
16 |
17 | public IObservableCollection Children { get; private set; }
18 | = new BindableCollection();
19 |
20 | #endregion
21 |
22 | #region Constructors
23 |
24 | protected MenuItemBase()
25 | {
26 | }
27 |
28 | #endregion
29 |
30 | public void Add(params MenuItemBase[] menuItems)
31 | => menuItems.Apply(Children.Add);
32 |
33 | public IEnumerator GetEnumerator()
34 | => Children.GetEnumerator();
35 |
36 | IEnumerator IEnumerable.GetEnumerator()
37 | => GetEnumerator();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Models/MenuItemSeparator.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.MainMenu.Models
2 | {
3 | public class MenuItemSeparator : MenuItemBase
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Models/MenuModel.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 |
3 | namespace Gemini.Modules.MainMenu.Models
4 | {
5 | public class MenuModel : BindableCollection, IMenu
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Models/StandardMenuItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace Gemini.Modules.MainMenu.Models
5 | {
6 | public abstract class StandardMenuItem : MenuItemBase
7 | {
8 | public abstract string Text { get; }
9 | public abstract Uri IconSource { get; }
10 | public abstract string InputGestureText { get; }
11 | public abstract ICommand Command { get; }
12 | public abstract bool IsChecked { get; }
13 | public abstract bool IsVisible { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Views/MainMenuSettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Gemini.Modules.MainMenu.Views
4 | {
5 | ///
6 | /// Interaction logic for MainMenuSettingsView.xaml
7 | ///
8 | public partial class MainMenuSettingsView : UserControl
9 | {
10 | public MainMenuSettingsView()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Views/MainMenuView.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainMenu/Views/MainMenuView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Gemini.Modules.MainMenu.Views
16 | {
17 | ///
18 | /// Interaction logic for MainMenuView.xaml
19 | ///
20 | public partial class MainMenuView : UserControl
21 | {
22 | public MainMenuView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/MainWindow/Views/MainWindowView.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.MainWindow.Views
2 | {
3 | public partial class MainWindowView
4 | {
5 | public MainWindowView()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/Commands/OpenSettingsCommandDefinition.cs:
--------------------------------------------------------------------------------
1 | using Gemini.Framework.Commands;
2 | using Gemini.Properties;
3 |
4 | namespace Gemini.Modules.Settings.Commands
5 | {
6 | [CommandDefinition]
7 | public class OpenSettingsCommandDefinition : CommandDefinition
8 | {
9 | public const string CommandName = "Tools.Options";
10 |
11 | public override string Name
12 | {
13 | get { return CommandName; }
14 | }
15 |
16 | public override string Text
17 | {
18 | get { return Resources.ToolsOptionsCommandText; }
19 | }
20 |
21 | public override string ToolTip
22 | {
23 | get { return Resources.ToolsOptionsCommandToolTip; }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/Commands/OpenSettingsCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Threading.Tasks;
3 | using Caliburn.Micro;
4 | using Gemini.Framework.Commands;
5 | using Gemini.Framework.Threading;
6 | using Gemini.Modules.Settings.ViewModels;
7 |
8 | namespace Gemini.Modules.Settings.Commands
9 | {
10 | [CommandHandler]
11 | public class OpenSettingsCommandHandler : CommandHandlerBase
12 | {
13 | private readonly IWindowManager _windowManager;
14 |
15 | [ImportingConstructor]
16 | public OpenSettingsCommandHandler(IWindowManager windowManager)
17 | {
18 | _windowManager = windowManager;
19 | }
20 |
21 | public override async Task Run(Command command)
22 | {
23 | await _windowManager.ShowDialogAsync(IoC.Get());
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/ISettingsEditor.cs:
--------------------------------------------------------------------------------
1 | namespace Gemini.Modules.Settings
2 | {
3 | public interface ISettingsEditor
4 | {
5 | string SettingsPageName { get; }
6 | string SettingsPagePath { get; }
7 |
8 | void ApplyChanges();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/ISettingsEditorAsync.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Gemini.Modules.Settings
4 | {
5 | public interface ISettingsEditorAsync
6 | {
7 | string SettingsPageName { get; }
8 | string SettingsPagePath { get; }
9 |
10 | Task ApplyChangesAsync();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/MenuDefinitions.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Gemini.Framework.Menus;
3 | using Gemini.Modules.Settings.Commands;
4 |
5 | namespace Gemini.Modules.Settings
6 | {
7 | public static class MenuDefinitions
8 | {
9 | [Export]
10 | public static readonly MenuItemDefinition OpenSettingsMenuItem = new CommandMenuItemDefinition(
11 | MainMenu.MenuDefinitions.ToolsOptionsMenuGroup, 0);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/ViewModels/SettingsEditorWrapper.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Gemini.Modules.Settings.ViewModels
4 | {
5 | internal sealed class SettingsEditorWrapper : ISettingsEditorAsync
6 | {
7 | private readonly ISettingsEditor _editor;
8 |
9 | public SettingsEditorWrapper(ISettingsEditor editor)
10 | {
11 | _editor = editor;
12 | }
13 |
14 | public string SettingsPageName => _editor.SettingsPageName;
15 |
16 | public string SettingsPagePath => _editor.SettingsPagePath;
17 |
18 | public ISettingsEditor ViewModel => _editor;
19 |
20 | public Task ApplyChangesAsync()
21 | {
22 | _editor.ApplyChanges();
23 | return Task.CompletedTask;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Gemini/Modules/Settings/ViewModels/SettingsPageViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Gemini.Modules.Settings.ViewModels
4 | {
5 | public class SettingsPageViewModel
6 | {
7 | public SettingsPageViewModel()
8 | {
9 | Children = new List();
10 | Editors = new List