├── .gitattributes ├── .gitignore ├── FlowDesigner ├── FileAccess │ ├── FileAccess.csproj │ ├── FileReadModel.cs │ ├── FileReadViewModel.cs │ ├── Images │ │ └── File.png │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Styles │ │ └── FileReadDataTemplate.xaml ├── FlowControl │ ├── Adorners │ │ └── RubberbandAdorner.cs │ ├── AttachedProperties │ │ ├── DragAndDropProps.cs │ │ ├── ItemConnectProps.cs │ │ ├── PluginAttribute.cs │ │ └── SelectionProps.cs │ ├── Controls │ │ ├── Connector.cs │ │ ├── DesignerCanvas.cs │ │ ├── DragThumb.cs │ │ ├── NameLabel.cs │ │ └── ZoomBox.cs │ ├── Converters │ │ ├── BoolToVisibilityConverter.cs │ │ ├── ConnectionPathConverter.cs │ │ └── ImageUrlConverter.cs │ ├── FlowControl.csproj │ ├── Helpers │ │ ├── DragObject.cs │ │ ├── PointHelper.cs │ │ ├── ToolBoxData.cs │ │ └── WeakINPCEventHandler.cs │ ├── Messenger │ │ ├── Mediator.cs │ │ └── MediatorMessageSinkAttribute.cs │ ├── Models │ │ ├── Connection.cs │ │ ├── DesignerItem.cs │ │ ├── DesignerItemBase.cs │ │ ├── DiagramItem.cs │ │ └── Orientation.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── Resources │ │ └── Styles │ │ │ ├── DesignerItems.xaml │ │ │ ├── Expander.xaml │ │ │ ├── GroupBox.xaml │ │ │ ├── NameLabel.xaml │ │ │ ├── ScrollBar.xaml │ │ │ ├── ScrollViewer.xaml │ │ │ ├── Shared.xaml │ │ │ ├── ToolTip.xaml │ │ │ └── ZoomBox.xaml │ ├── Services │ │ ├── ApplicationServicesProvider.cs │ │ └── Contracts │ │ │ ├── IEditorService.cs │ │ │ ├── IMessageBoxService.cs │ │ │ └── IStorageService.cs │ ├── StyleSelectors │ │ └── DesignerItemsControlItemStyleSelector.cs │ ├── UserControls │ │ ├── DiagramControl.xaml │ │ └── DiagramControl.xaml.cs │ └── ViewModels │ │ ├── ConnectorInfoBase.cs │ │ ├── ConnectorViewModel.cs │ │ ├── DesignerItemViewModelBase.cs │ │ ├── DiagramViewModel.cs │ │ ├── FullyCreatedConnectorInfo.cs │ │ ├── IDiagramViewModel.cs │ │ ├── INPCBase.cs │ │ ├── NameLabelViewModel.cs │ │ ├── PartCreatedConnectionInfo.cs │ │ ├── SelectableDesignerItemViewModelBase.cs │ │ └── SimpleCommand.cs ├── FlowDesigner.sln └── FlowDesigner │ ├── App.xaml │ ├── App.xaml.cs │ ├── FlowDesigner.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Popups │ ├── PopupWindow.xaml │ └── PopupWindow.xaml.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── Services │ ├── ApplicationServices.cs │ └── Implentation │ │ ├── WPFEditorService.cs │ │ ├── WPFMessageBoxService.cs │ │ └── WPFStorageService.cs │ ├── UserControls │ ├── ToolBoxControl.xaml │ └── ToolBoxControl.xaml.cs │ └── ViewModels │ ├── MainWindowViewModel.cs │ └── ToolBoxViewModel.cs ├── Img ├── FD_Main.png ├── QD_Main.png ├── QD_Run.png └── QD_SQL.png ├── QueryDesigner ├── CommonFiles │ ├── DataAccess.dll │ ├── FastReport.Bars.dll │ ├── FastReport.Editor.dll │ ├── FastReport.dll │ ├── Oracle.DataAccess.dll │ ├── OracleAccess.dll │ ├── RM.ReportEngine.dll │ ├── ShapePanel.dll │ ├── Skynet.WinFormsUI.Docking.dll │ ├── log4net.dll │ ├── oci.dll │ └── ociw32.dll ├── Design.png ├── FileRegister │ ├── FileInfo.cs │ ├── FileRegister.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Register.cs │ └── file.ico ├── FormsDesigner │ ├── AssemblyInfo.cs │ ├── FormsDesigner.csproj │ ├── FormsDesigner │ │ ├── Commands │ │ │ ├── AbstractFormsDesignerCommand.cs │ │ │ ├── AlignBottom.cs │ │ │ ├── AlignHorizontalCenters.cs │ │ │ ├── AlignLeft.cs │ │ │ ├── AlignRight.cs │ │ │ ├── AlignToGrid.cs │ │ │ ├── AlignTop.cs │ │ │ ├── AlignVerticalCenters.cs │ │ │ ├── BringToFront.cs │ │ │ ├── CenterHorizontally.cs │ │ │ ├── CenterVertically.cs │ │ │ ├── DesignerVerbSubmenuBuilder.cs │ │ │ ├── HorizSpaceConcatenate.cs │ │ │ ├── HorizSpaceDecrease.cs │ │ │ ├── HorizSpaceIncrease.cs │ │ │ ├── HorizSpaceMakeEqual.cs │ │ │ ├── LineUpIcons.cs │ │ │ ├── LockControls.cs │ │ │ ├── SendToBack.cs │ │ │ ├── ShowProperties.cs │ │ │ ├── SizeToControl.cs │ │ │ ├── SizeToControlHeight.cs │ │ │ ├── SizeToControlWidth.cs │ │ │ ├── SizeToGrid.cs │ │ │ ├── VertSpaceConcatenate.cs │ │ │ ├── VertSpaceDecrease.cs │ │ │ ├── VertSpaceIncrease.cs │ │ │ ├── VertSpaceMakeEqual.cs │ │ │ ├── ViewCode.cs │ │ │ └── ViewTabOrder.cs │ │ ├── Core │ │ │ ├── AbstractCheckableMenuCommand.cs │ │ │ ├── AbstractCommand.cs │ │ │ ├── AbstractMenuCommand.cs │ │ │ ├── ICheckableMenuCommand.cs │ │ │ ├── ICommand.cs │ │ │ ├── IMementoCapable.cs │ │ │ ├── IMenuCommand.cs │ │ │ ├── IStatusUpdate.cs │ │ │ ├── LoggingService.cs │ │ │ ├── MenuCommand.cs │ │ │ ├── MessageService.cs │ │ │ ├── Properties.cs │ │ │ ├── PropertyChangedEventArgs.cs │ │ │ └── PropertyChangedEventHandler.cs │ │ ├── DesignPanel.cs │ │ ├── FormKeyHandler.cs │ │ ├── FormsDesignerViewContent.cs │ │ ├── Gui │ │ │ ├── AbstractBaseViewContent.cs │ │ │ ├── AbstractPadContent.cs │ │ │ ├── AbstractSecondaryViewContent.cs │ │ │ ├── AbstractViewContent.cs │ │ │ ├── Action!2.cs │ │ │ ├── Action!3.cs │ │ │ ├── Action.cs │ │ │ ├── DefaultObjectCreator.cs │ │ │ ├── Func!1.cs │ │ │ ├── Func!2.cs │ │ │ ├── Func!3.cs │ │ │ ├── Func!4.cs │ │ │ ├── IBaseViewContent.cs │ │ │ ├── ICanBeDirty.cs │ │ │ ├── IClipboardHandler.cs │ │ │ ├── IDEContainer.cs │ │ │ ├── IHasPropertyContainer.cs │ │ │ ├── IObjectCreator.cs │ │ │ ├── IPropertyValueCreator.cs │ │ │ ├── ISecondaryViewContent.cs │ │ │ ├── IStringValueFilter.cs │ │ │ ├── IViewContent.cs │ │ │ ├── IWorkbench.cs │ │ │ ├── IWorkbenchLayout.cs │ │ │ ├── IWorkbenchWindow.cs │ │ │ ├── NativeMethods.cs │ │ │ ├── PropertyContainer.cs │ │ │ ├── PropertyPad.cs │ │ │ ├── SaveEventArgs.cs │ │ │ ├── SaveEventHandler.cs │ │ │ ├── ViewContentEventArgs.cs │ │ │ ├── ViewContentEventHandler.cs │ │ │ └── WorkbenchSingleton.cs │ │ ├── HostSurface.cs │ │ ├── IDesignerGenerator.cs │ │ ├── IDesignerLoaderProvider.cs │ │ ├── IPadContent.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ ├── Resources.cs │ │ │ └── Settings.cs │ │ ├── Services │ │ │ ├── AbstractService.cs │ │ │ ├── DefaultServiceContainer.cs │ │ │ ├── DesignerEventService.cs │ │ │ ├── DesignerSerializationService.cs │ │ │ ├── IMessageService.cs │ │ │ ├── IService.cs │ │ │ ├── MenuCommandService.cs │ │ │ ├── MenuService.cs │ │ │ ├── NameCreationService.cs │ │ │ ├── PropertyService.cs │ │ │ ├── PropertyValueUIService.cs │ │ │ ├── ServiceManager.cs │ │ │ ├── ToolboxEventArgs.cs │ │ │ ├── ToolboxEventHandler.cs │ │ │ ├── ToolboxService.cs │ │ │ ├── TypeResolutionService.cs │ │ │ └── UIService.cs │ │ ├── UndoRedo │ │ │ ├── FormsDesignerUndoEngine.cs │ │ │ └── IUndoHandler.cs │ │ ├── Xml │ │ │ ├── XmlDesignerGenerator.cs │ │ │ ├── XmlFormReader.cs │ │ │ └── XmlLoader.cs │ │ ├── XmlDesignerLoader.cs │ │ └── XmlDesignerLoaderProvider.cs │ └── Global.cs ├── QueryApplication │ ├── App.config │ ├── FormQueryResult.Designer.cs │ ├── FormQueryResult.cs │ ├── FormQueryResult.resx │ ├── FrmMain.Designer.cs │ ├── FrmMain.cs │ ├── FrmMain.resx │ ├── Method.cs │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── QueryLauncher.csproj ├── QueryDataAccess │ ├── DataAccess │ │ ├── AbstractDataAccess.cs │ │ ├── CmdParameter.cs │ │ ├── CmdParameterCollection.cs │ │ ├── ConnectionList.cs │ │ ├── ConstructorCache.cs │ │ ├── DataAccessFactory.cs │ │ ├── DatabaseType.cs │ │ ├── IDataAccess.cs │ │ └── TypeToDbType.cs │ ├── DataAccessSQL.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── QueryDAO.cs │ └── QueryDataAccess.csproj ├── QueryDesigner.sln ├── QueryDesigner │ ├── App.config │ ├── Compare.cs │ ├── FormAbout.Designer.cs │ ├── FormAbout.cs │ ├── FormAbout.resx │ ├── FormAllFunction.Designer.cs │ ├── FormAllFunction.cs │ ├── FormAllFunction.resx │ ├── FormContent.Designer.cs │ ├── FormContent.cs │ ├── FormContent.resx │ ├── FormDataSource.Designer.cs │ ├── FormDataSource.cs │ ├── FormDataSource.resx │ ├── FormEditField.Designer.cs │ ├── FormEditField.cs │ ├── FormEditField.resx │ ├── FormFields.Designer.cs │ ├── FormFields.cs │ ├── FormFields.resx │ ├── FormFunction.Designer.cs │ ├── FormFunction.cs │ ├── FormFunction.resx │ ├── FormMain.Designer.cs │ ├── FormMain.cs │ ├── FormMain.resx │ ├── FormNewProject.Designer.cs │ ├── FormNewProject.cs │ ├── FormNewProject.resx │ ├── FormNewStyle.Designer.cs │ ├── FormNewStyle.cs │ ├── FormNewStyle.resx │ ├── FormProperties.Designer.cs │ ├── FormProperties.cs │ ├── FormProperties.resx │ ├── FormQueryData.Designer.cs │ ├── FormQueryData.cs │ ├── FormQueryData.resx │ ├── FormQueryResult.Designer.cs │ ├── FormQueryResult.cs │ ├── FormQueryResult.resx │ ├── FormSelectFiled.Designer.cs │ ├── FormSelectFiled.cs │ ├── FormSelectFiled.resx │ ├── FormSelectTable.Designer.cs │ ├── FormSelectTable.cs │ ├── FormSelectTable.resx │ ├── FormSetAliasName.Designer.cs │ ├── FormSetAliasName.cs │ ├── FormSetAliasName.resx │ ├── FormStyle.Designer.cs │ ├── FormStyle.cs │ ├── FormStyle.resx │ ├── FormToolBox.Designer.cs │ ├── FormToolBox.cs │ ├── FormToolBox.resx │ ├── Images │ │ ├── 0.bmp │ │ ├── 1.bmp │ │ ├── 10.bmp │ │ ├── 11.bmp │ │ ├── 12.bmp │ │ ├── 13.bmp │ │ ├── 14.bmp │ │ ├── 15.bmp │ │ ├── 16.bmp │ │ ├── 17.bmp │ │ ├── 18.bmp │ │ ├── 19.bmp │ │ ├── 2.bmp │ │ ├── 20.bmp │ │ ├── 21.bmp │ │ ├── 22.bmp │ │ ├── 23.bmp │ │ ├── 24.bmp │ │ ├── 25.bmp │ │ ├── 26.bmp │ │ ├── 27.bmp │ │ ├── 28.bmp │ │ ├── 29.bmp │ │ ├── 3.bmp │ │ ├── 30.bmp │ │ ├── 31.bmp │ │ ├── 32.bmp │ │ ├── 33.bmp │ │ ├── 34.bmp │ │ ├── 35.bmp │ │ ├── 36.bmp │ │ ├── 37.bmp │ │ ├── 38.bmp │ │ ├── 39.bmp │ │ ├── 4.bmp │ │ ├── 40.bmp │ │ ├── 41.bmp │ │ ├── 42.bmp │ │ ├── 43.bmp │ │ ├── 44.bmp │ │ ├── 45.bmp │ │ ├── 46.bmp │ │ ├── 47.bmp │ │ ├── 48.bmp │ │ ├── 49.bmp │ │ ├── 5.bmp │ │ ├── 50.bmp │ │ ├── 51.bmp │ │ ├── 52.bmp │ │ ├── 53.bmp │ │ ├── 54.bmp │ │ ├── 55.bmp │ │ ├── 56.bmp │ │ ├── 57.bmp │ │ ├── 58.bmp │ │ ├── 59.bmp │ │ ├── 6.bmp │ │ ├── 60.bmp │ │ ├── 61.bmp │ │ ├── 62.bmp │ │ ├── 63.bmp │ │ ├── 64.bmp │ │ ├── 65.bmp │ │ ├── 66.bmp │ │ ├── 67.bmp │ │ ├── 68.bmp │ │ ├── 69.bmp │ │ ├── 7.bmp │ │ ├── 70.bmp │ │ ├── 71.bmp │ │ ├── 72.bmp │ │ ├── 73.bmp │ │ ├── 74.bmp │ │ ├── 75.bmp │ │ ├── 76.bmp │ │ ├── 77.bmp │ │ ├── 8.bmp │ │ ├── 9.bmp │ │ └── ICON │ │ │ ├── Main.ico │ │ │ ├── Property.ico │ │ │ └── Tool.ico │ ├── Method.cs │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ ├── Settings.settings │ │ └── licenses.licx │ ├── QueryDAO.cs │ ├── QueryDesigner.csproj │ ├── QueryDesigner.ico │ └── Resources │ │ ├── Design.png │ │ ├── Main.ico │ │ └── Search.PNG ├── QueryException │ ├── BaseApplicationException.cs │ ├── ExceptionConst.cs │ ├── ExceptionManager.cs │ ├── ExceptionManagerExceptions.cs │ ├── ExceptionManagerSectionHandler.cs │ ├── InterfaceDefinitions.cs │ ├── LogonException.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── QueryException.csproj ├── README.md ├── Setup1 │ └── Setup1.vdproj ├── SnControl │ ├── AssemblyInfo.cs │ ├── Delete.png │ ├── Global.cs │ ├── Properties │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ └── licenses.licx │ ├── Search.png │ ├── Search │ │ ├── Column.cs │ │ ├── Columns.cs │ │ └── Search.cs │ ├── SnControl.csproj │ ├── SnControl.dll.licenses │ └── SnControl │ │ ├── ChangeType.cs │ │ ├── ChangedEventArgs.cs │ │ ├── ChangedType.cs │ │ ├── ConChangedEventArgs.cs │ │ ├── DataSetType.cs │ │ ├── FieldItem.cs │ │ ├── FieldsCollections.cs │ │ ├── FrmParamProp.cs │ │ ├── FrmParamProp.resx │ │ ├── FrmSelectField.cs │ │ ├── FrmSelectField.resx │ │ ├── FrmSelectFunction.cs │ │ ├── ICommonAttribute.cs │ │ ├── ParamComboBox.cs │ │ ├── ParamDateTimePicker.cs │ │ ├── ParamEditor.cs │ │ ├── ParamItem.cs │ │ ├── ParamRadioButton.cs │ │ ├── ParamTextBox.cs │ │ ├── ParamsCollections.cs │ │ ├── Resize.cs │ │ ├── SQLParamCollections.cs │ │ ├── SQLParamItem.cs │ │ ├── SnDataSet.cs │ │ ├── SnPage.cs │ │ ├── Solution.cs │ │ ├── SolutionInstance.cs │ │ ├── StatTextBox.cs │ │ ├── StatType.cs │ │ ├── StyleFormat.cs │ │ ├── TitlePanel.cs │ │ ├── XmlSolutionGenerator.cs │ │ └── XmlSolutionReader.cs ├── WinFormsUI │ └── WinFormsUI │ │ ├── Docking │ │ ├── AutoHideStripBase.cs │ │ ├── DockAreasEditor.cs │ │ ├── DockContent.cs │ │ ├── DockContentCollection.cs │ │ ├── DockContentEventArgs.cs │ │ ├── DockContentHandler.cs │ │ ├── DockOutlineBase.cs │ │ ├── DockPane.SplitterControl.cs │ │ ├── DockPane.cs │ │ ├── DockPaneCaptionBase.cs │ │ ├── DockPaneCollection.cs │ │ ├── DockPaneStripBase.cs │ │ ├── DockPanel.AutoHideWindow.cs │ │ ├── DockPanel.DockDragHandler.cs │ │ ├── DockPanel.DragHandler.cs │ │ ├── DockPanel.FocusManager.cs │ │ ├── DockPanel.MdiClientController.cs │ │ ├── DockPanel.Persistor.cs │ │ ├── DockPanel.SplitterDragHandler.cs │ │ ├── DockPanel.bmp │ │ ├── DockPanel.cs │ │ ├── DockPanelExtender.cs │ │ ├── DockPanelSkin.cs │ │ ├── DockWindow.SplitterControl.cs │ │ ├── DockWindow.cs │ │ ├── DockWindowCollection.cs │ │ ├── DragForm.cs │ │ ├── DummyControl.cs │ │ ├── Enums.cs │ │ ├── FloatWindow.cs │ │ ├── FloatWindowCollection.cs │ │ ├── Helpers │ │ │ ├── DockHelper.cs │ │ │ ├── DrawHelper.cs │ │ │ ├── ResourceHelper.cs │ │ │ └── Win32Helper.cs │ │ ├── InertButtonBase.cs │ │ ├── Interfaces.cs │ │ ├── Localization.cs │ │ ├── Measures.cs │ │ ├── NestedDockingStatus.cs │ │ ├── NestedPaneCollection.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Resources │ │ │ ├── DockIndicator_PaneDiamond.bmp │ │ │ ├── DockIndicator_PaneDiamond_Bottom.bmp │ │ │ ├── DockIndicator_PaneDiamond_Hotspot.bmp │ │ │ ├── DockIndicator_PaneDiamond_HotspotIndex.bmp │ │ │ ├── DockIndicator_PaneDiamond_Left.bmp │ │ │ ├── DockIndicator_PaneDiamond_Right.bmp │ │ │ ├── DockIndicator_PaneDiamond_Top.bmp │ │ │ ├── DockIndicator_PanelBottom.bmp │ │ │ ├── DockIndicator_PanelBottom_Active.bmp │ │ │ ├── DockIndicator_PanelFill.bmp │ │ │ ├── DockIndicator_PanelFill_Active.bmp │ │ │ ├── DockIndicator_PanelLeft.bmp │ │ │ ├── DockIndicator_PanelLeft_Active.bmp │ │ │ ├── DockIndicator_PanelRight.bmp │ │ │ ├── DockIndicator_PanelRight_Active.bmp │ │ │ ├── DockIndicator_PanelTop.bmp │ │ │ ├── DockIndicator_PanelTop_Active.bmp │ │ │ ├── DockPane_AutoHide.bmp │ │ │ ├── DockPane_Close.bmp │ │ │ ├── DockPane_Dock.bmp │ │ │ ├── DockPane_Option.bmp │ │ │ ├── DockPane_OptionOverflow.bmp │ │ │ └── Dockindicator_PaneDiamond_Fill.bmp │ │ ├── SplitterBase.cs │ │ ├── SplitterControl.cs │ │ ├── Strings.Designer.cs │ │ ├── Strings.resx │ │ ├── VS2005AutoHideStrip.cs │ │ ├── VS2005DockPaneCaption.cs │ │ ├── VS2005DockPaneStrip.cs │ │ ├── VisibleNestedPaneCollection.cs │ │ └── Win32 │ │ │ ├── Enums.cs │ │ │ └── NativeMethods.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── WinFormsUI.csproj └── 查询设计器2014版本V1.3.docx └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /FlowDesigner/FileAccess/FileReadModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using FlowControl; 6 | 7 | namespace FileAccess 8 | { 9 | public class FileReadModel : INPCBase 10 | { 11 | private string filePath = ""; 12 | public string FilePath 13 | { 14 | get 15 | { 16 | return filePath; 17 | } 18 | set 19 | { 20 | filePath = value; 21 | NotifyChanged("FilePath"); 22 | } 23 | } 24 | public string Encoding { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FlowDesigner/FileAccess/FileReadViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | using FlowControl; 3 | 4 | namespace FileAccess 5 | { 6 | [Plugin(ImageUrl = "Images/File.png", DataTemplatePath = "Styles/FileReadDataTemplate.xaml")] 7 | public class FileReadViewModel : DesignerItemViewModelBase 8 | { 9 | public FileReadModel model = new FileReadModel(); 10 | 11 | public FileReadViewModel() 12 | { 13 | Init(); 14 | } 15 | 16 | public FileReadViewModel(int id, DiagramViewModel parent, double left, double top, string setting1) 17 | : base(id, parent, left, top) 18 | { 19 | Init(); 20 | } 21 | 22 | private void Init() 23 | { 24 | this.ShowConnectors = false; 25 | } 26 | 27 | public override void ExecuteShowEditorCommand(object parameter) 28 | { 29 | var param = parameter as FileReadViewModel; 30 | FileReadModel data = new FileReadModel(); 31 | data.FilePath = param.model.FilePath; 32 | if (this.ShowEditor(data)) 33 | { 34 | this.model.FilePath = data.FilePath; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FlowDesigner/FileAccess/Images/File.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackQChen/Designer/4345dfbc5a57d316a6e065b77e81ccbf9f627c86/FlowDesigner/FileAccess/Images/File.png -------------------------------------------------------------------------------- /FlowDesigner/FileAccess/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("FileAccess")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("FileAccess")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("40807dab-6e6b-4037-8f5e-b50407a6d011")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /FlowDesigner/FileAccess/Styles/FileReadDataTemplate.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/AttachedProperties/PluginAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FlowControl 4 | { 5 | public class PluginAttribute : Attribute 6 | { 7 | public string ImageUrl 8 | { 9 | get; 10 | set; 11 | } 12 | 13 | public string DataTemplatePath 14 | { 15 | get; 16 | set; 17 | } 18 | 19 | public PluginAttribute() 20 | { 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Controls/Connector.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | using System.Windows.Input; 4 | using System.Windows.Media; 5 | 6 | namespace FlowControl 7 | { 8 | public class Connector : Control 9 | { 10 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) 11 | { 12 | base.OnMouseLeftButtonDown(e); 13 | DesignerCanvas canvas = GetDesignerCanvas(this); 14 | if (canvas != null) 15 | { 16 | canvas.SourceConnector = this; 17 | } 18 | } 19 | 20 | public ConnectorOrientation Orientation { get; set; } 21 | 22 | private DesignerCanvas GetDesignerCanvas(DependencyObject element) 23 | { 24 | while (element != null && !(element is DesignerCanvas)) 25 | element = VisualTreeHelper.GetParent(element); 26 | return element as DesignerCanvas; 27 | } 28 | } 29 | 30 | 31 | public enum ConnectorOrientation 32 | { 33 | None = 0, 34 | Left = 1, 35 | Right = 2 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Controls/NameLabel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace FlowControl 4 | { 5 | public class NameLabel : System.Windows.Controls.Label 6 | { 7 | protected override void OnMouseDoubleClick(System.Windows.Input.MouseButtonEventArgs e) 8 | { 9 | var viewModel = new NameLabelViewModel(); 10 | var data = this.DataContext as DesignerItemViewModelBase; 11 | viewModel.Label = data.Label; 12 | if (ApplicationServicesProvider.Instance.Provider.EditorService.ShowDialog(viewModel) == true) 13 | { 14 | data.Label = viewModel.Label; 15 | } 16 | base.OnMouseDoubleClick(e); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Converters/BoolToVisibilityConverter.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.Data; 7 | using System.Windows.Media; 8 | using System.Windows.Media.Imaging; 9 | 10 | namespace FlowControl 11 | { 12 | [ValueConversion(typeof(bool), typeof(Visibility))] 13 | public class BoolToVisibilityConverter : IValueConverter 14 | { 15 | static BoolToVisibilityConverter() 16 | { 17 | Instance = new BoolToVisibilityConverter(); 18 | } 19 | 20 | public static BoolToVisibilityConverter Instance 21 | { 22 | get; 23 | private set; 24 | } 25 | 26 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 27 | { 28 | return ((bool)value) ? Visibility.Visible : Visibility.Collapsed; 29 | } 30 | 31 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Converters/ConnectionPathConverter.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.Data; 7 | using System.Windows.Media; 8 | using System.Windows.Media.Imaging; 9 | 10 | namespace FlowControl 11 | { 12 | [ValueConversion(typeof(List), typeof(PathSegmentCollection))] 13 | public class ConnectionPathConverter : IValueConverter 14 | { 15 | static ConnectionPathConverter() 16 | { 17 | Instance = new ConnectionPathConverter(); 18 | } 19 | 20 | public static ConnectionPathConverter Instance 21 | { 22 | get; 23 | private set; 24 | } 25 | 26 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 27 | { 28 | List points = (List)value; 29 | var pfc = new PathFigureCollection(); 30 | var start = points[0]; 31 | var end = points[1]; 32 | var length = (start - end).Length; 33 | var _connectionExtensionLength = length / 2.0; 34 | var startextend = new Point(start.X + _connectionExtensionLength, start.Y); 35 | var endextend = new Point(end.X - _connectionExtensionLength - 30, end.Y); 36 | var figure = new PathFigure() { IsClosed = false, StartPoint = start }; 37 | figure.Segments.Add(new BezierSegment(startextend, endextend, end, true)); 38 | pfc.Add(figure); 39 | return new PathGeometry(pfc); 40 | } 41 | 42 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Converters/ImageUrlConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | using System.Windows.Media; 7 | using System.Windows.Media.Imaging; 8 | 9 | namespace FlowControl 10 | { 11 | [ValueConversion(typeof(string), typeof(ImageSource))] 12 | public class ImageUrlConverter : IValueConverter 13 | { 14 | static ImageUrlConverter() 15 | { 16 | Instance = new ImageUrlConverter(); 17 | } 18 | 19 | public static ImageUrlConverter Instance 20 | { 21 | get; 22 | private set; 23 | } 24 | 25 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 26 | { 27 | Uri imagePath = new Uri(value.ToString(), UriKind.RelativeOrAbsolute); 28 | ImageSource source = new BitmapImage(imagePath); 29 | return source; 30 | } 31 | 32 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 33 | { 34 | throw new NotImplementedException(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Helpers/DragObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace FlowControl 8 | { 9 | // Wraps info of the dragged object into a class 10 | public class DragObject 11 | { 12 | public Size? DesiredSize { get; set; } 13 | public Type ContentType { get; set; } 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Helpers/PointHelper.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.Data; 7 | using System.Windows.Media; 8 | using System.Windows.Media.Imaging; 9 | 10 | 11 | namespace FlowControl 12 | { 13 | public class PointHelper 14 | { 15 | public static Point GetPointForConnector(FullyCreatedConnectorInfo connector) 16 | { 17 | Point point = new Point(); 18 | 19 | switch (connector.Orientation) 20 | { 21 | case ConnectorOrientation.Left: 22 | point = new Point(connector.DataItem.Left - ConnectorInfoBase.ConnectorWidth, connector.DataItem.Top + (DesignerItemViewModelBase.ItemHeight / 2)); 23 | break; 24 | case ConnectorOrientation.Right: 25 | point = new Point(connector.DataItem.Left + DesignerItemViewModelBase.ItemWidth + (ConnectorInfoBase.ConnectorWidth), connector.DataItem.Top + (DesignerItemViewModelBase.ItemHeight / 2)); 26 | break; 27 | } 28 | return point; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Helpers/ToolBoxData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl.Helpers 7 | { 8 | public class ToolBoxData 9 | { 10 | public string ImageUrl { get; private set; } 11 | public Type Type { get; private set; } 12 | 13 | public ToolBoxData(string imageUrl, Type type) 14 | { 15 | this.ImageUrl = imageUrl; 16 | this.Type = type; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Helpers/WeakINPCEventHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | 9 | namespace FlowControl.Helpers 10 | { 11 | //[DebuggerNonUserCode] 12 | public sealed class WeakINPCEventHandler 13 | { 14 | private readonly WeakReference _targetReference; 15 | private readonly MethodInfo _method; 16 | 17 | public WeakINPCEventHandler(PropertyChangedEventHandler callback) 18 | { 19 | _method = callback.Method; 20 | _targetReference = new WeakReference(callback.Target, true); 21 | } 22 | 23 | //[DebuggerNonUserCode] 24 | public void Handler(object sender, PropertyChangedEventArgs e) 25 | { 26 | var target = _targetReference.Target; 27 | if (target != null) 28 | { 29 | var callback = (Action)Delegate.CreateDelegate(typeof(Action), target, _method, true); 30 | if (callback != null) 31 | { 32 | callback(sender, e); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Messenger/MediatorMessageSinkAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | /// 9 | /// This attribute allows a method to be targeted as a recipient for a message. 10 | /// It requires that the Type is registered with the MessageMediator through the 11 | /// method 12 | /// 13 | [AttributeUsage(AttributeTargets.Method)] 14 | public sealed class MediatorMessageSinkAttribute : Attribute 15 | { 16 | /// 17 | /// Message key 18 | /// 19 | public object MessageKey { get; private set; } 20 | 21 | /// 22 | /// Default constructor 23 | /// 24 | public MediatorMessageSinkAttribute() 25 | { 26 | MessageKey = null; 27 | } 28 | 29 | /// 30 | /// Constructor that takes a message key 31 | /// 32 | /// Message Key 33 | public MediatorMessageSinkAttribute(string messageKey) 34 | { 35 | MessageKey = messageKey; 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Models/Connection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FlowControl 4 | { 5 | public class Connection : DesignerItemBase 6 | { 7 | public Connection(int id, int sourceId, Orientation sourceOrientation, 8 | Type sourceType, int sinkId, Orientation sinkOrientation, Type sinkType) 9 | : base(id) 10 | { 11 | this.SourceId = sourceId; 12 | this.SourceOrientation = sourceOrientation; 13 | this.SourceType = sourceType; 14 | this.SinkId = sinkId; 15 | this.SinkOrientation = sinkOrientation; 16 | this.SinkType = sinkType; 17 | } 18 | 19 | public int SourceId { get; private set; } 20 | public Orientation SourceOrientation { get; private set; } 21 | public Type SourceType { get; private set; } 22 | public int SinkId { get; private set; } 23 | public Orientation SinkOrientation { get; private set; } 24 | public Type SinkType { get; private set; } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Models/DesignerItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | public abstract class DesignerItem : DesignerItemBase 9 | { 10 | public DesignerItem(int id, double left, double top) 11 | : base(id) 12 | { 13 | this.Left = left; 14 | this.Top = top; 15 | } 16 | 17 | public double Left { get; private set; } 18 | public double Top { get; private set; } 19 | 20 | public string Setting { get; set; } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Models/DesignerItemBase.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace FlowControl 3 | { 4 | public abstract class DesignerItemBase 5 | { 6 | public DesignerItemBase() 7 | { 8 | } 9 | 10 | public DesignerItemBase(int id) 11 | { 12 | this.Id = id; 13 | } 14 | 15 | public int Id { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Models/DiagramItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace FlowControl 5 | { 6 | public class DiagramItem : DesignerItemBase 7 | { 8 | public DiagramItem() 9 | { 10 | this.DesignerItems = new List(); 11 | this.ConnectionIds = new List(); 12 | } 13 | 14 | public List DesignerItems { get; set; } 15 | public List ConnectionIds { get; set; } 16 | } 17 | 18 | 19 | public class DiagramItemData 20 | { 21 | public DiagramItemData(int itemId, Type itemType) 22 | { 23 | this.ItemId = itemId; 24 | this.ItemType = itemType; 25 | } 26 | 27 | public int ItemId { get; set; } 28 | public Type ItemType { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Models/Orientation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | public enum Orientation 9 | { 10 | None = 0, 11 | Left = 1, 12 | Right = 2 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FlowControl.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Resources/Styles/GroupBox.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 47 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Resources/Styles/NameLabel.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Resources/Styles/ScrollViewer.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 43 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Resources/Styles/ToolTip.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 37 | 38 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Services/ApplicationServicesProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FlowControl 4 | { 5 | 6 | /// 7 | /// Simple service interface 8 | /// 9 | public interface IServiceProvider 10 | { 11 | IEditorService EditorService { get; } 12 | IMessageBoxService MessageBoxService { get; } 13 | IStorageService StorageService { get; } 14 | } 15 | 16 | /// 17 | /// Simple service locator helper 18 | /// 19 | public class ApplicationServicesProvider 20 | { 21 | private static Lazy instance = new Lazy(() => new ApplicationServicesProvider()); 22 | private IServiceProvider serviceProvider; 23 | 24 | private ApplicationServicesProvider() 25 | { 26 | } 27 | 28 | static ApplicationServicesProvider() 29 | { 30 | } 31 | 32 | public void SetNewServiceProvider(IServiceProvider provider) 33 | { 34 | serviceProvider = provider; 35 | } 36 | 37 | public IServiceProvider Provider 38 | { 39 | get { return serviceProvider; } 40 | } 41 | 42 | public static ApplicationServicesProvider Instance 43 | { 44 | get { return instance.Value; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Services/Contracts/IEditorService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | public interface IEditorService 9 | { 10 | bool? ShowDialog(object dataContextForPopup); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/Services/Contracts/IStorageService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | public interface IStorageService 9 | { 10 | //delete methods 11 | void DeleteConnection(int connectionId); 12 | void DeleteDiagramItem(int diagramId); 13 | 14 | //save methods 15 | int SaveConnection(Connection connection); 16 | int SaveDiagram(DiagramItem diagramItem); 17 | int SaveDiagramItem(DiagramItemData diagramItemData); 18 | 19 | //fetch methods 20 | IEnumerable FetchAllDiagram(); 21 | DiagramItem FetchDiagram(int itemId); 22 | Connection FetchConnection(int connectionId); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/StyleSelectors/DesignerItemsControlItemStyleSelector.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 | 8 | namespace FlowControl 9 | { 10 | public class DesignerItemsControlItemStyleSelector : StyleSelector 11 | { 12 | static DesignerItemsControlItemStyleSelector() 13 | { 14 | Instance = new DesignerItemsControlItemStyleSelector(); 15 | } 16 | 17 | public static DesignerItemsControlItemStyleSelector Instance 18 | { 19 | get; 20 | private set; 21 | } 22 | 23 | 24 | public override Style SelectStyle(object item, DependencyObject container) 25 | { 26 | ItemsControl itemsControl = ItemsControl.ItemsControlFromItemContainer(container); 27 | if (itemsControl == null) 28 | throw new InvalidOperationException("DesignerItemsControlItemStyleSelector : Could not find ItemsControl"); 29 | 30 | if(item is DesignerItemViewModelBase) 31 | { 32 | return (Style)itemsControl.FindResource("designerItemStyle"); 33 | } 34 | if (item is ConnectorViewModel) 35 | { 36 | return (Style)itemsControl.FindResource("connectorItemStyle"); 37 | } 38 | return null; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/UserControls/DiagramControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | 4 | namespace FlowControl 5 | { 6 | /// 7 | /// Interaction logic for DiagramControl.xaml 8 | /// 9 | public partial class DiagramControl : UserControl 10 | { 11 | public DiagramControl() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | 17 | private void DesignerCanvas_Loaded(object sender, RoutedEventArgs e) 18 | { 19 | DesignerCanvas myDesignerCanvas = sender as DesignerCanvas; 20 | zoomBox.DesignerCanvas = myDesignerCanvas; 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/ConnectorInfoBase.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace FlowControl 3 | { 4 | public abstract class ConnectorInfoBase : INPCBase 5 | { 6 | private static double connectorWidth = 8; 7 | private static double connectorHeight = 8; 8 | 9 | public ConnectorInfoBase(ConnectorOrientation orientation) 10 | { 11 | this.Orientation = orientation; 12 | } 13 | 14 | public ConnectorOrientation Orientation { get; private set; } 15 | 16 | public static double ConnectorWidth 17 | { 18 | get { return connectorWidth; } 19 | } 20 | 21 | public static double ConnectorHeight 22 | { 23 | get { return connectorHeight; } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/FullyCreatedConnectorInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace FlowControl 8 | { 9 | public class FullyCreatedConnectorInfo : ConnectorInfoBase 10 | { 11 | private bool showConnectors = false; 12 | 13 | public FullyCreatedConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation) 14 | : base(orientation) 15 | { 16 | this.DataItem = dataItem; 17 | } 18 | 19 | public DesignerItemViewModelBase DataItem { get; private set; } 20 | 21 | public bool ShowConnectors 22 | { 23 | get 24 | { 25 | return showConnectors; 26 | } 27 | set 28 | { 29 | if (showConnectors != value) 30 | { 31 | showConnectors = value; 32 | NotifyChanged("ShowConnectors"); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/IDiagramViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Collections.ObjectModel; 6 | 7 | namespace FlowControl 8 | { 9 | public interface IDiagramViewModel 10 | { 11 | SimpleCommand AddItemCommand { get; } 12 | SimpleCommand RemoveItemCommand { get; } 13 | SimpleCommand ClearSelectedItemsCommand { get; } 14 | List SelectedItems { get; } 15 | ObservableCollection Items { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/INPCBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.ComponentModel; 6 | 7 | namespace FlowControl 8 | { 9 | public abstract class INPCBase : INotifyPropertyChanged 10 | { 11 | #region INotifyPropertyChanged Implementation 12 | /// 13 | /// Occurs when any properties are changed on this object. 14 | /// 15 | public event PropertyChangedEventHandler PropertyChanged; 16 | 17 | 18 | /// 19 | /// A helper method that raises the PropertyChanged event for a property. 20 | /// 21 | /// The names of the properties that changed. 22 | public virtual void NotifyChanged(params string[] propertyNames) 23 | { 24 | foreach (string name in propertyNames) 25 | { 26 | OnPropertyChanged(new PropertyChangedEventArgs(name)); 27 | } 28 | } 29 | 30 | /// 31 | /// Raises the PropertyChanged event. 32 | /// 33 | /// Event arguments. 34 | protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) 35 | { 36 | if (this.PropertyChanged != null) 37 | { 38 | this.PropertyChanged(this, e); 39 | } 40 | } 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/NameLabelViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace FlowControl 7 | { 8 | public class NameLabelViewModel 9 | { 10 | public string Label { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /FlowDesigner/FlowControl/ViewModels/PartCreatedConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace FlowControl 8 | { 9 | public class PartCreatedConnectionInfo : ConnectorInfoBase 10 | { 11 | public Point CurrentLocation { get; private set; } 12 | 13 | public PartCreatedConnectionInfo(Point currentLocation) : base(ConnectorOrientation.None) 14 | { 15 | this.CurrentLocation = currentLocation; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /FlowDesigner/FlowDesigner/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /FlowDesigner/FlowDesigner/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace FlowDesigner 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /FlowDesigner/FlowDesigner/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace FlowDesigner 4 | { 5 | public partial class MainWindow : Window 6 | { 7 | private MainWindowViewModel windowViewModel; 8 | 9 | public MainWindow() 10 | { 11 | InitializeComponent(); 12 | 13 | windowViewModel = new MainWindowViewModel(); 14 | this.DataContext = windowViewModel; 15 | this.Loaded += new RoutedEventHandler(Window_Loaded); 16 | } 17 | 18 | 19 | /// 20 | /// This shows you how you can create diagram items in code, which means you can 21 | /// 22 | /// 23 | /// 24 | void Window_Loaded(object sender, RoutedEventArgs e) 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /FlowDesigner/FlowDesigner/Popups/PopupWindow.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 17 | 20 |