From 1c2da8cc925b78687b87d3168322bc1088ae10cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 11 Mar 2018 13:20:27 +0100 Subject: [PATCH] split ProjectNode classes in separate files --- CrowIDE/CrowIDE.csproj | 24 +- CrowIDE/icons/blank-file.svg | 6 + CrowIDE/{ui => }/icons/copy-file.svg | 0 .../{ui/icons/outbox.svg => icons/open.svg} | 0 CrowIDE/{ui => }/icons/paste-on-document.svg | 0 CrowIDE/icons/question.svg | 7 + .../{ui/icons/inbox.svg => icons/save.svg} | 0 CrowIDE/{ui => }/icons/scissors.svg | 0 CrowIDE/icons/toolbox/Crow.Border.svg | 2 +- CrowIDE/icons/toolbox/Crow.Button.svg | 2 +- CrowIDE/icons/toolbox/Crow.CheckBox.svg | 2 +- CrowIDE/icons/toolbox/Crow.ColorPicker.svg | 2 +- CrowIDE/icons/toolbox/Crow.ComboBox.svg | 4 +- CrowIDE/icons/toolbox/Crow.Container.svg | 2 +- CrowIDE/icons/toolbox/Crow.DirectoryView.svg | 2 +- CrowIDE/icons/toolbox/Crow.Docker.svg | 2 +- CrowIDE/icons/toolbox/Crow.Expandable.svg | 2 +- CrowIDE/icons/toolbox/Crow.FileDialog.svg | 6 +- CrowIDE/icons/toolbox/Crow.Grid.svg | 2 +- CrowIDE/icons/toolbox/Crow.Group.svg | 8 +- CrowIDE/icons/toolbox/Crow.GroupBox.svg | 10 +- .../icons/toolbox/Crow.HorizontalStack.svg | 2 +- CrowIDE/icons/toolbox/Crow.IMLContainer.svg | 6 +- CrowIDE/icons/toolbox/Crow.Image.svg | 6 +- CrowIDE/icons/toolbox/Crow.Label.svg | 4 +- CrowIDE/icons/toolbox/Crow.ListBox.svg | 12 +- CrowIDE/icons/toolbox/Crow.Menu.svg | 12 +- CrowIDE/icons/toolbox/Crow.MenuItem.svg | 4 +- CrowIDE/icons/toolbox/Crow.MessageBox.svg | 6 +- CrowIDE/icons/toolbox/Crow.ProgressBar.svg | 4 +- CrowIDE/icons/toolbox/Crow.RadioButton.svg | 4 +- CrowIDE/icons/toolbox/Crow.ScrollBar.svg | 4 +- CrowIDE/icons/toolbox/Crow.Scroller.svg | 2 +- CrowIDE/icons/toolbox/Crow.Shape.svg | 2 +- CrowIDE/icons/toolbox/Crow.Slider.svg | 2 +- CrowIDE/icons/toolbox/Crow.Spinner.svg | 4 +- CrowIDE/icons/toolbox/Crow.Splitter.svg | 6 +- CrowIDE/icons/toolbox/Crow.TabItem.svg | 2 +- CrowIDE/icons/toolbox/Crow.TabView.svg | 2 +- .../icons/toolbox/Crow.TemplatedContainer.svg | 2 +- CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg | 2 +- CrowIDE/icons/toolbox/Crow.TextBox.svg | 4 +- CrowIDE/icons/toolbox/Crow.TreeView.svg | 2 +- CrowIDE/icons/toolbox/Crow.VerticalStack.svg | 2 +- CrowIDE/icons/toolbox/Crow.Window.svg | 2 +- CrowIDE/icons/toolbox/Crow.Wrapper.svg | 6 +- CrowIDE/icons/toolbox/bar-chart.svg | 10 +- CrowIDE/icons/toolbox/bar-menu.svg | 6 +- CrowIDE/icons/toolbox/bullets.svg | 12 +- CrowIDE/icons/toolbox/calendar.svg | 6 +- CrowIDE/icons/toolbox/check-square-1.svg | 4 +- CrowIDE/icons/toolbox/database.svg | 8 +- CrowIDE/icons/toolbox/ellipsis.svg | 6 +- .../icons/toolbox/exclamation-circle-1.svg | 6 +- CrowIDE/icons/toolbox/exclamation-circle.svg | 2 +- CrowIDE/icons/toolbox/file-code.svg | 8 +- CrowIDE/icons/toolbox/grab.svg | 2 +- CrowIDE/icons/toolbox/hard-drive-1.svg | 4 +- CrowIDE/icons/toolbox/hash.svg | 2 +- CrowIDE/icons/toolbox/info.svg | 4 +- CrowIDE/icons/toolbox/layout.svg | 2 +- CrowIDE/icons/toolbox/line-list.svg | 16 +- CrowIDE/icons/toolbox/list.svg | 12 +- CrowIDE/icons/toolbox/modal-list.svg | 14 +- CrowIDE/icons/toolbox/options.svg | 10 +- CrowIDE/icons/toolbox/package.svg | 2 +- CrowIDE/icons/toolbox/padding.svg | 84 +++---- CrowIDE/icons/toolbox/picture-file.svg | 6 +- CrowIDE/icons/toolbox/pointer.svg | 2 +- CrowIDE/icons/toolbox/puzzle-piece.svg | 2 +- CrowIDE/icons/toolbox/refresh-file.svg | 6 +- CrowIDE/icons/toolbox/sliders.svg | 12 +- CrowIDE/icons/toolbox/split-browser-1.svg | 2 +- CrowIDE/icons/toolbox/table.svg | 2 +- CrowIDE/icons/toolbox/tasks.svg | 12 +- CrowIDE/icons/toolbox/warning.svg | 2 +- CrowIDE/src/CrowIDE.cs | 22 +- CrowIDE/src/Editors/Parsers/XMLParser.cs | 11 +- CrowIDE/src/Project.cs | 56 ++--- CrowIDE/src/ProjectTree/ImlProjectItem.cs | 68 ++++++ .../ProjectFile.cs} | 208 ++---------------- CrowIDE/src/ProjectTree/ProjectItem.cs | 76 +++++++ CrowIDE/src/ProjectTree/ProjectNodes.cs | 134 +++++++++++ CrowIDE/src/ProjectTree/ProjectReference.cs | 51 +++++ .../ui/{ => DockWindows}/GTreeExpITemp.crow | 2 +- CrowIDE/ui/DockWindows/winEditor.crow | 2 +- CrowIDE/ui/DockWindows/winErrors.crow | 2 +- .../winGTExplorer.crow} | 11 +- CrowIDE/ui/DockWindows/winProperties.crow | 2 +- CrowIDE/ui/DockWindows/winSolution.crow | 2 +- CrowIDE/ui/DockWindows/winToolbox.crow | 9 +- CrowIDE/ui/NewFile.crow | 5 + CrowIDE/ui/ProjectTree.template | 5 + Default.style | 2 + Templates/DockWindow.template | 9 +- src/GraphicObjects/Window.cs | 8 + src/Interface.cs | 20 +- 97 files changed, 679 insertions(+), 479 deletions(-) create mode 100644 CrowIDE/icons/blank-file.svg rename CrowIDE/{ui => }/icons/copy-file.svg (100%) rename CrowIDE/{ui/icons/outbox.svg => icons/open.svg} (100%) rename CrowIDE/{ui => }/icons/paste-on-document.svg (100%) create mode 100644 CrowIDE/icons/question.svg rename CrowIDE/{ui/icons/inbox.svg => icons/save.svg} (100%) rename CrowIDE/{ui => }/icons/scissors.svg (100%) create mode 100644 CrowIDE/src/ProjectTree/ImlProjectItem.cs rename CrowIDE/src/{ProjectNodes.cs => ProjectTree/ProjectFile.cs} (62%) create mode 100644 CrowIDE/src/ProjectTree/ProjectItem.cs create mode 100644 CrowIDE/src/ProjectTree/ProjectNodes.cs create mode 100644 CrowIDE/src/ProjectTree/ProjectReference.cs rename CrowIDE/ui/{ => DockWindows}/GTreeExpITemp.crow (98%) rename CrowIDE/ui/{GTreeExplorer.crow => DockWindows/winGTExplorer.crow} (78%) create mode 100644 CrowIDE/ui/NewFile.crow diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 399e0d99..205e7f19 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -93,7 +93,6 @@ src\InterfaceControler.cs - @@ -115,6 +114,11 @@ + + + + + @@ -127,6 +131,7 @@ + @@ -135,8 +140,6 @@ Crow.Coding.MembersView.template - - @@ -147,14 +150,9 @@ - - - - - Crow.TabItem.template @@ -273,6 +271,16 @@ Crow.Coding.ui.SvgEdit.itemp + + + + + + + + + + diff --git a/CrowIDE/icons/blank-file.svg b/CrowIDE/icons/blank-file.svg new file mode 100644 index 00000000..8136979e --- /dev/null +++ b/CrowIDE/icons/blank-file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/ui/icons/copy-file.svg b/CrowIDE/icons/copy-file.svg similarity index 100% rename from CrowIDE/ui/icons/copy-file.svg rename to CrowIDE/icons/copy-file.svg diff --git a/CrowIDE/ui/icons/outbox.svg b/CrowIDE/icons/open.svg similarity index 100% rename from CrowIDE/ui/icons/outbox.svg rename to CrowIDE/icons/open.svg diff --git a/CrowIDE/ui/icons/paste-on-document.svg b/CrowIDE/icons/paste-on-document.svg similarity index 100% rename from CrowIDE/ui/icons/paste-on-document.svg rename to CrowIDE/icons/paste-on-document.svg diff --git a/CrowIDE/icons/question.svg b/CrowIDE/icons/question.svg new file mode 100644 index 00000000..fb8e3d3f --- /dev/null +++ b/CrowIDE/icons/question.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/ui/icons/inbox.svg b/CrowIDE/icons/save.svg similarity index 100% rename from CrowIDE/ui/icons/inbox.svg rename to CrowIDE/icons/save.svg diff --git a/CrowIDE/ui/icons/scissors.svg b/CrowIDE/icons/scissors.svg similarity index 100% rename from CrowIDE/ui/icons/scissors.svg rename to CrowIDE/icons/scissors.svg diff --git a/CrowIDE/icons/toolbox/Crow.Border.svg b/CrowIDE/icons/toolbox/Crow.Border.svg index 9337dee7..09eb7ac7 100644 --- a/CrowIDE/icons/toolbox/Crow.Border.svg +++ b/CrowIDE/icons/toolbox/Crow.Border.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Button.svg b/CrowIDE/icons/toolbox/Crow.Button.svg index 34c2a56f..01f5c6c3 100644 --- a/CrowIDE/icons/toolbox/Crow.Button.svg +++ b/CrowIDE/icons/toolbox/Crow.Button.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.CheckBox.svg b/CrowIDE/icons/toolbox/Crow.CheckBox.svg index c6415d81..2f0b0834 100644 --- a/CrowIDE/icons/toolbox/Crow.CheckBox.svg +++ b/CrowIDE/icons/toolbox/Crow.CheckBox.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.ColorPicker.svg b/CrowIDE/icons/toolbox/Crow.ColorPicker.svg index d2a3f6ea..517a26a9 100644 --- a/CrowIDE/icons/toolbox/Crow.ColorPicker.svg +++ b/CrowIDE/icons/toolbox/Crow.ColorPicker.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.ComboBox.svg b/CrowIDE/icons/toolbox/Crow.ComboBox.svg index 7ed51330..1cb88fa2 100644 --- a/CrowIDE/icons/toolbox/Crow.ComboBox.svg +++ b/CrowIDE/icons/toolbox/Crow.ComboBox.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.Container.svg b/CrowIDE/icons/toolbox/Crow.Container.svg index a0015fa1..d7d1dc8a 100644 --- a/CrowIDE/icons/toolbox/Crow.Container.svg +++ b/CrowIDE/icons/toolbox/Crow.Container.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.DirectoryView.svg b/CrowIDE/icons/toolbox/Crow.DirectoryView.svg index 587450a0..90294692 100644 --- a/CrowIDE/icons/toolbox/Crow.DirectoryView.svg +++ b/CrowIDE/icons/toolbox/Crow.DirectoryView.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Docker.svg b/CrowIDE/icons/toolbox/Crow.Docker.svg index 1831febd..e38a283e 100644 --- a/CrowIDE/icons/toolbox/Crow.Docker.svg +++ b/CrowIDE/icons/toolbox/Crow.Docker.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Expandable.svg b/CrowIDE/icons/toolbox/Crow.Expandable.svg index 3dd36991..1c56d56d 100644 --- a/CrowIDE/icons/toolbox/Crow.Expandable.svg +++ b/CrowIDE/icons/toolbox/Crow.Expandable.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.FileDialog.svg b/CrowIDE/icons/toolbox/Crow.FileDialog.svg index a495640c..25142ea0 100644 --- a/CrowIDE/icons/toolbox/Crow.FileDialog.svg +++ b/CrowIDE/icons/toolbox/Crow.FileDialog.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/Crow.Grid.svg b/CrowIDE/icons/toolbox/Crow.Grid.svg index acf15945..6151f971 100644 --- a/CrowIDE/icons/toolbox/Crow.Grid.svg +++ b/CrowIDE/icons/toolbox/Crow.Grid.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Group.svg b/CrowIDE/icons/toolbox/Crow.Group.svg index e679974d..eae67f63 100644 --- a/CrowIDE/icons/toolbox/Crow.Group.svg +++ b/CrowIDE/icons/toolbox/Crow.Group.svg @@ -2,8 +2,8 @@ - - - - + + + + diff --git a/CrowIDE/icons/toolbox/Crow.GroupBox.svg b/CrowIDE/icons/toolbox/Crow.GroupBox.svg index b2c1d03a..e4697799 100644 --- a/CrowIDE/icons/toolbox/Crow.GroupBox.svg +++ b/CrowIDE/icons/toolbox/Crow.GroupBox.svg @@ -2,9 +2,9 @@ - - - - - + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg b/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg index 62ea4755..f8e70257 100644 --- a/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg +++ b/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.IMLContainer.svg b/CrowIDE/icons/toolbox/Crow.IMLContainer.svg index 81f85248..b5687bac 100644 --- a/CrowIDE/icons/toolbox/Crow.IMLContainer.svg +++ b/CrowIDE/icons/toolbox/Crow.IMLContainer.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/Crow.Image.svg b/CrowIDE/icons/toolbox/Crow.Image.svg index f17cce6a..11356c0e 100644 --- a/CrowIDE/icons/toolbox/Crow.Image.svg +++ b/CrowIDE/icons/toolbox/Crow.Image.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/Crow.Label.svg b/CrowIDE/icons/toolbox/Crow.Label.svg index 56c8c34e..65bb85b7 100644 --- a/CrowIDE/icons/toolbox/Crow.Label.svg +++ b/CrowIDE/icons/toolbox/Crow.Label.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.ListBox.svg b/CrowIDE/icons/toolbox/Crow.ListBox.svg index f466e3ba..40d16734 100644 --- a/CrowIDE/icons/toolbox/Crow.ListBox.svg +++ b/CrowIDE/icons/toolbox/Crow.ListBox.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Menu.svg b/CrowIDE/icons/toolbox/Crow.Menu.svg index 9d0bf4a3..b6b21119 100644 --- a/CrowIDE/icons/toolbox/Crow.Menu.svg +++ b/CrowIDE/icons/toolbox/Crow.Menu.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.MenuItem.svg b/CrowIDE/icons/toolbox/Crow.MenuItem.svg index 68932e22..c8bd8470 100644 --- a/CrowIDE/icons/toolbox/Crow.MenuItem.svg +++ b/CrowIDE/icons/toolbox/Crow.MenuItem.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.MessageBox.svg b/CrowIDE/icons/toolbox/Crow.MessageBox.svg index 3e608eb0..16ebd72c 100644 --- a/CrowIDE/icons/toolbox/Crow.MessageBox.svg +++ b/CrowIDE/icons/toolbox/Crow.MessageBox.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/Crow.ProgressBar.svg b/CrowIDE/icons/toolbox/Crow.ProgressBar.svg index 63057a7b..884f1854 100644 --- a/CrowIDE/icons/toolbox/Crow.ProgressBar.svg +++ b/CrowIDE/icons/toolbox/Crow.ProgressBar.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.RadioButton.svg b/CrowIDE/icons/toolbox/Crow.RadioButton.svg index c84374af..6c33e84b 100644 --- a/CrowIDE/icons/toolbox/Crow.RadioButton.svg +++ b/CrowIDE/icons/toolbox/Crow.RadioButton.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.ScrollBar.svg b/CrowIDE/icons/toolbox/Crow.ScrollBar.svg index eab0c583..91a1f847 100644 --- a/CrowIDE/icons/toolbox/Crow.ScrollBar.svg +++ b/CrowIDE/icons/toolbox/Crow.ScrollBar.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.Scroller.svg b/CrowIDE/icons/toolbox/Crow.Scroller.svg index b36551be..bbc97197 100644 --- a/CrowIDE/icons/toolbox/Crow.Scroller.svg +++ b/CrowIDE/icons/toolbox/Crow.Scroller.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Shape.svg b/CrowIDE/icons/toolbox/Crow.Shape.svg index 2ebd68fc..de5dd372 100644 --- a/CrowIDE/icons/toolbox/Crow.Shape.svg +++ b/CrowIDE/icons/toolbox/Crow.Shape.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Slider.svg b/CrowIDE/icons/toolbox/Crow.Slider.svg index f3c62960..fe41c2ba 100644 --- a/CrowIDE/icons/toolbox/Crow.Slider.svg +++ b/CrowIDE/icons/toolbox/Crow.Slider.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Spinner.svg b/CrowIDE/icons/toolbox/Crow.Spinner.svg index 3a3dc5d3..5fa848ac 100644 --- a/CrowIDE/icons/toolbox/Crow.Spinner.svg +++ b/CrowIDE/icons/toolbox/Crow.Spinner.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.Splitter.svg b/CrowIDE/icons/toolbox/Crow.Splitter.svg index be8fb02e..9fcd9dd7 100644 --- a/CrowIDE/icons/toolbox/Crow.Splitter.svg +++ b/CrowIDE/icons/toolbox/Crow.Splitter.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/Crow.TabItem.svg b/CrowIDE/icons/toolbox/Crow.TabItem.svg index 0b5bd9ca..a9aaed33 100644 --- a/CrowIDE/icons/toolbox/Crow.TabItem.svg +++ b/CrowIDE/icons/toolbox/Crow.TabItem.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.TabView.svg b/CrowIDE/icons/toolbox/Crow.TabView.svg index 8d9f794a..942358b4 100644 --- a/CrowIDE/icons/toolbox/Crow.TabView.svg +++ b/CrowIDE/icons/toolbox/Crow.TabView.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg b/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg index a4b3a4f7..34a0aa26 100644 --- a/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg +++ b/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg b/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg index d83ab4df..14ea6f37 100644 --- a/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg +++ b/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.TextBox.svg b/CrowIDE/icons/toolbox/Crow.TextBox.svg index 98abb7b9..c1fc2bb2 100644 --- a/CrowIDE/icons/toolbox/Crow.TextBox.svg +++ b/CrowIDE/icons/toolbox/Crow.TextBox.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/Crow.TreeView.svg b/CrowIDE/icons/toolbox/Crow.TreeView.svg index 33b0cda6..b863291b 100644 --- a/CrowIDE/icons/toolbox/Crow.TreeView.svg +++ b/CrowIDE/icons/toolbox/Crow.TreeView.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.VerticalStack.svg b/CrowIDE/icons/toolbox/Crow.VerticalStack.svg index b58772bc..c3c3ec9c 100644 --- a/CrowIDE/icons/toolbox/Crow.VerticalStack.svg +++ b/CrowIDE/icons/toolbox/Crow.VerticalStack.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Window.svg b/CrowIDE/icons/toolbox/Crow.Window.svg index ae8f3aba..74b0a24b 100644 --- a/CrowIDE/icons/toolbox/Crow.Window.svg +++ b/CrowIDE/icons/toolbox/Crow.Window.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/Crow.Wrapper.svg b/CrowIDE/icons/toolbox/Crow.Wrapper.svg index 88506a12..9e69e415 100644 --- a/CrowIDE/icons/toolbox/Crow.Wrapper.svg +++ b/CrowIDE/icons/toolbox/Crow.Wrapper.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/bar-chart.svg b/CrowIDE/icons/toolbox/bar-chart.svg index 08c633ba..ff86c961 100644 --- a/CrowIDE/icons/toolbox/bar-chart.svg +++ b/CrowIDE/icons/toolbox/bar-chart.svg @@ -2,9 +2,9 @@ - - - - - + + + + + diff --git a/CrowIDE/icons/toolbox/bar-menu.svg b/CrowIDE/icons/toolbox/bar-menu.svg index 0bbb97d8..87ec0610 100644 --- a/CrowIDE/icons/toolbox/bar-menu.svg +++ b/CrowIDE/icons/toolbox/bar-menu.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/bullets.svg b/CrowIDE/icons/toolbox/bullets.svg index 1f8c5697..81fb1f06 100644 --- a/CrowIDE/icons/toolbox/bullets.svg +++ b/CrowIDE/icons/toolbox/bullets.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/calendar.svg b/CrowIDE/icons/toolbox/calendar.svg index 35df970f..9ceaa1ea 100644 --- a/CrowIDE/icons/toolbox/calendar.svg +++ b/CrowIDE/icons/toolbox/calendar.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/check-square-1.svg b/CrowIDE/icons/toolbox/check-square-1.svg index fca782c5..e198007c 100644 --- a/CrowIDE/icons/toolbox/check-square-1.svg +++ b/CrowIDE/icons/toolbox/check-square-1.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/database.svg b/CrowIDE/icons/toolbox/database.svg index bd2d1820..65a8f065 100644 --- a/CrowIDE/icons/toolbox/database.svg +++ b/CrowIDE/icons/toolbox/database.svg @@ -2,8 +2,8 @@ - - - - + + + + diff --git a/CrowIDE/icons/toolbox/ellipsis.svg b/CrowIDE/icons/toolbox/ellipsis.svg index 6e1cc428..cff94ccf 100644 --- a/CrowIDE/icons/toolbox/ellipsis.svg +++ b/CrowIDE/icons/toolbox/ellipsis.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/exclamation-circle-1.svg b/CrowIDE/icons/toolbox/exclamation-circle-1.svg index 8b2f3185..cc1b2689 100644 --- a/CrowIDE/icons/toolbox/exclamation-circle-1.svg +++ b/CrowIDE/icons/toolbox/exclamation-circle-1.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/exclamation-circle.svg b/CrowIDE/icons/toolbox/exclamation-circle.svg index fd1a2581..b140e7c8 100644 --- a/CrowIDE/icons/toolbox/exclamation-circle.svg +++ b/CrowIDE/icons/toolbox/exclamation-circle.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/file-code.svg b/CrowIDE/icons/toolbox/file-code.svg index 3727328f..a2fd2d19 100644 --- a/CrowIDE/icons/toolbox/file-code.svg +++ b/CrowIDE/icons/toolbox/file-code.svg @@ -2,8 +2,8 @@ - - - - + + + + diff --git a/CrowIDE/icons/toolbox/grab.svg b/CrowIDE/icons/toolbox/grab.svg index a0b75804..25bc5719 100644 --- a/CrowIDE/icons/toolbox/grab.svg +++ b/CrowIDE/icons/toolbox/grab.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/hard-drive-1.svg b/CrowIDE/icons/toolbox/hard-drive-1.svg index 7bab2e5f..a71a5248 100644 --- a/CrowIDE/icons/toolbox/hard-drive-1.svg +++ b/CrowIDE/icons/toolbox/hard-drive-1.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/hash.svg b/CrowIDE/icons/toolbox/hash.svg index 401536c6..82196fbc 100644 --- a/CrowIDE/icons/toolbox/hash.svg +++ b/CrowIDE/icons/toolbox/hash.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/info.svg b/CrowIDE/icons/toolbox/info.svg index af12b4be..a8c90f4c 100644 --- a/CrowIDE/icons/toolbox/info.svg +++ b/CrowIDE/icons/toolbox/info.svg @@ -2,6 +2,6 @@ - - + + diff --git a/CrowIDE/icons/toolbox/layout.svg b/CrowIDE/icons/toolbox/layout.svg index c3ab446c..3d59d765 100644 --- a/CrowIDE/icons/toolbox/layout.svg +++ b/CrowIDE/icons/toolbox/layout.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/line-list.svg b/CrowIDE/icons/toolbox/line-list.svg index f9b157c3..ec15f7b8 100644 --- a/CrowIDE/icons/toolbox/line-list.svg +++ b/CrowIDE/icons/toolbox/line-list.svg @@ -2,12 +2,12 @@ - - - - - - - - + + + + + + + + diff --git a/CrowIDE/icons/toolbox/list.svg b/CrowIDE/icons/toolbox/list.svg index 117a58ca..9aad88fa 100644 --- a/CrowIDE/icons/toolbox/list.svg +++ b/CrowIDE/icons/toolbox/list.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/modal-list.svg b/CrowIDE/icons/toolbox/modal-list.svg index 6e0e527b..f1d8f70b 100644 --- a/CrowIDE/icons/toolbox/modal-list.svg +++ b/CrowIDE/icons/toolbox/modal-list.svg @@ -2,11 +2,11 @@ - - - - - - - + + + + + + + diff --git a/CrowIDE/icons/toolbox/options.svg b/CrowIDE/icons/toolbox/options.svg index a149a350..a56f6bed 100644 --- a/CrowIDE/icons/toolbox/options.svg +++ b/CrowIDE/icons/toolbox/options.svg @@ -2,9 +2,9 @@ - - - - - + + + + + diff --git a/CrowIDE/icons/toolbox/package.svg b/CrowIDE/icons/toolbox/package.svg index 7ee34042..07f8b37e 100644 --- a/CrowIDE/icons/toolbox/package.svg +++ b/CrowIDE/icons/toolbox/package.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/padding.svg b/CrowIDE/icons/toolbox/padding.svg index 5ef0f28b..d93b2464 100644 --- a/CrowIDE/icons/toolbox/padding.svg +++ b/CrowIDE/icons/toolbox/padding.svg @@ -2,46 +2,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/picture-file.svg b/CrowIDE/icons/toolbox/picture-file.svg index f0b3f7f8..c45a6ad2 100644 --- a/CrowIDE/icons/toolbox/picture-file.svg +++ b/CrowIDE/icons/toolbox/picture-file.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/pointer.svg b/CrowIDE/icons/toolbox/pointer.svg index d0ec0712..605c0e28 100644 --- a/CrowIDE/icons/toolbox/pointer.svg +++ b/CrowIDE/icons/toolbox/pointer.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/puzzle-piece.svg b/CrowIDE/icons/toolbox/puzzle-piece.svg index 889dfe8d..b09c47e4 100644 --- a/CrowIDE/icons/toolbox/puzzle-piece.svg +++ b/CrowIDE/icons/toolbox/puzzle-piece.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/refresh-file.svg b/CrowIDE/icons/toolbox/refresh-file.svg index 77bfdfa5..248e4203 100644 --- a/CrowIDE/icons/toolbox/refresh-file.svg +++ b/CrowIDE/icons/toolbox/refresh-file.svg @@ -2,7 +2,7 @@ - - - + + + diff --git a/CrowIDE/icons/toolbox/sliders.svg b/CrowIDE/icons/toolbox/sliders.svg index 7a7b4c8b..81f72d18 100644 --- a/CrowIDE/icons/toolbox/sliders.svg +++ b/CrowIDE/icons/toolbox/sliders.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/split-browser-1.svg b/CrowIDE/icons/toolbox/split-browser-1.svg index 019cf269..4dfd93a3 100644 --- a/CrowIDE/icons/toolbox/split-browser-1.svg +++ b/CrowIDE/icons/toolbox/split-browser-1.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/table.svg b/CrowIDE/icons/toolbox/table.svg index b5466286..0b421224 100644 --- a/CrowIDE/icons/toolbox/table.svg +++ b/CrowIDE/icons/toolbox/table.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/icons/toolbox/tasks.svg b/CrowIDE/icons/toolbox/tasks.svg index c8ba6a78..8793c884 100644 --- a/CrowIDE/icons/toolbox/tasks.svg +++ b/CrowIDE/icons/toolbox/tasks.svg @@ -2,10 +2,10 @@ - - - - - - + + + + + + diff --git a/CrowIDE/icons/toolbox/warning.svg b/CrowIDE/icons/toolbox/warning.svg index 7e0d4c6f..f5a25735 100644 --- a/CrowIDE/icons/toolbox/warning.svg +++ b/CrowIDE/icons/toolbox/warning.svg @@ -2,5 +2,5 @@ - + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 588700b8..1be7d1ad 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -46,18 +46,18 @@ namespace Crow.Coding CMDCompile; void initCommands () { - CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#Crow.Coding.ui.icons.blank-file.svg"), CanExecute = false}; + CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#Crow.Coding.ui.icons.blank-file.svg"), CanExecute = true}; CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#Crow.Coding.ui.icons.outbox.svg")}; CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false}; CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false}; CMDQuit = new Command(new Action(() => Quit (null, null))) { Caption = "Quit", Icon = new SvgPicture("#Crow.Coding.ui.icons.sign-out.svg")}; - CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#Crow.Coding.ui.icons.reply.svg"), CanExecute = false}; - CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#Crow.Coding.ui.icons.share-arrow.svg"), CanExecute = false}; - CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#Crow.Coding.ui.icons.scissors.svg"), CanExecute = false}; - CMDCopy = new Command(new Action(() => Quit (null, null))) { Caption = "Copy", Icon = new SvgPicture("#Crow.Coding.ui.icons.copy-file.svg"), CanExecute = false}; - CMDPaste = new Command(new Action(() => Quit (null, null))) { Caption = "Paste", Icon = new SvgPicture("#Crow.Coding.ui.icons.paste-on-document.svg"), CanExecute = false}; - CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#Crow.Coding.ui.icons.question.svg")}; - CMDOptions = new Command(new Action(() => openOptionsDialog())) { Caption = "Editor Options", Icon = new SvgPicture("#Crow.Coding.ui.icons.tools.svg")}; + CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#Crow.Coding.icons.undo.svg"), CanExecute = false}; + CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#Crow.Coding.icons.redo.svg"), CanExecute = false}; + CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#Crow.Coding.icons.scissors.svg"), CanExecute = false}; + CMDCopy = new Command(new Action(() => Quit (null, null))) { Caption = "Copy", Icon = new SvgPicture("#Crow.Coding.icons.copy-file.svg"), CanExecute = false}; + CMDPaste = new Command(new Action(() => Quit (null, null))) { Caption = "Paste", Icon = new SvgPicture("#Crow.Coding.icons.paste-on-document.svg"), CanExecute = false}; + CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#Crow.Coding.icons.question.svg")}; + CMDOptions = new Command(new Action(() => openOptionsDialog())) { Caption = "Editor Options", Icon = new SvgPicture("#Crow.Coding.icons.tools.svg")}; cmdCloseSolution = new Command(new Action(() => closeSolution())) { Caption = "Close Solution", Icon = new SvgPicture("#Crow.Coding.ui.icons.paste-on-document.svg"), CanExecute = true}; @@ -72,7 +72,7 @@ namespace Crow.Coding CMDViewToolbox = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow"))) { Caption = "Toolbox"}; - CMDViewGTExp = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.GTreeExplorer.crow"))) { Caption = "Graphic Tree Explorer"}; + CMDViewGTExp = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winGTExplorer.crow"))) { Caption = "Graphic Tree Explorer"}; CMDViewProps = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.MemberView.crow"))) { Caption = "Properties View"}; CMDCompile = new Command(new Action(() => compileSolution())) { Caption = "Compile"}; CMDViewProj = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.CSProjExplorer.crow"))) { Caption = "Project Explorer"}; @@ -83,7 +83,9 @@ namespace Crow.Coding AddWidget (instFileDlg.CreateInstance()).DataSource = this; } void openOptionsDialog(){} - void newFile() {} + void newFile() { + currentSolution.OpenedItems.AddElement(new ProjectFile()); + } void saveFileDialog() {} void undo() {} void redo() {} diff --git a/CrowIDE/src/Editors/Parsers/XMLParser.cs b/CrowIDE/src/Editors/Parsers/XMLParser.cs index b1c50f2a..8e95408e 100644 --- a/CrowIDE/src/Editors/Parsers/XMLParser.cs +++ b/CrowIDE/src/Editors/Parsers/XMLParser.cs @@ -25,6 +25,7 @@ namespace Crow.Coding AttributeValueClosing = BufferParser.TokenType.StringLitteralClosing, AttributeValue = BufferParser.TokenType.StringLitteral, XMLDecl = BufferParser.TokenType.Preprocessor, + Doctype = BufferParser.TokenType.Keyword, ElementStart = 50, ElementEnd = 51, } @@ -162,7 +163,15 @@ namespace Crow.Coding curState = States.BlockComment; saveAndResetCurrentTok (TokenType.BlockComment); break; - default: + case 'D': + case 'd': + string tmp = Read (7); + currentTok += tmp; + if (!string.Equals (tmp, "DOCTYPE", StringComparison.OrdinalIgnoreCase)) + throw new ParserException (currentLine, currentColumn, "Expecting 'doctype'"); + saveAndResetCurrentTok (TokenType.Doctype); + break; + default: throw new ParserException (currentLine, currentColumn, "error"); } break; diff --git a/CrowIDE/src/Project.cs b/CrowIDE/src/Project.cs index 38e38493..6aeb5be7 100644 --- a/CrowIDE/src/Project.cs +++ b/CrowIDE/src/Project.cs @@ -52,6 +52,34 @@ namespace Crow.Coding XmlNode nodeProps; XmlNodeList nodesItems; SolutionProject solutionProject; + Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile; + + #region CTOR + public Project (Solution sol, SolutionProject sp) { + solutionProject = sp; + + solution = sol; + + cmdSave = new Crow.Command (new Action (() => Save ())) + { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.icons.save.svg"), CanExecute = true }; + cmdOpen = new Crow.Command (new Action (() => Load ())) + { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.icons.open.svg"), CanExecute = false }; + cmdCompile = new Crow.Command (new Action (() => Compile ())) { + Caption = "Compile", + Icon = "#Crow.Coding.icons.compile.svg" + }; + cmdSetAsStartProj = new Crow.Command (new Action (() => setAsStartupProject ())) { + Caption = "Set as Startup Project" + }; + cmdNewFile = new Crow.Command (new Action (() => AddNewFile ())) { + Caption = "Add New File", Icon = new SvgPicture ("#Crow.Coding.icons.blank-file.svg"), CanExecute = true + }; + + Commands = new List (new Crow.Command[] {cmdOpen,cmdSave,cmdSetAsStartProj,cmdCompile,cmdNewFile}); + + Load (); + } + #endregion public Solution solution; public List Commands; @@ -216,35 +244,9 @@ namespace Crow.Coding #endregion - Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile; - - public Project (Solution sol, SolutionProject sp) { - solutionProject = sp; - - solution = sol; - - cmdSave = new Crow.Command (new Action (() => Save ())) - { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = true }; - cmdOpen = new Crow.Command (new Action (() => Load ())) - { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.ui.icons.outbox.svg"), CanExecute = false }; - cmdCompile = new Crow.Command (new Action (() => Compile ())) { - Caption = "Compile", - Icon = "#Crow.Coding.icons.compile.svg" - }; - cmdSetAsStartProj = new Crow.Command (new Action (() => setAsStartupProject ())) { - Caption = "Set as Startup Project" - }; - cmdNewFile = new Crow.Command (new Action (() => AddNewFile ())) { - Caption = "Add New File" - }; - - Commands = new List (new Crow.Command[] {cmdOpen,cmdSave,cmdSetAsStartProj,cmdCompile,cmdNewFile}); - - Load (); - } public void AddNewFile () { - + Window.Show(CrowIDE.MainIFace, "#Crow.Coding.ui.NewFile.crow",true).DataSource = this; } public void Load () { diff --git a/CrowIDE/src/ProjectTree/ImlProjectItem.cs b/CrowIDE/src/ProjectTree/ImlProjectItem.cs new file mode 100644 index 00000000..7ce24ad7 --- /dev/null +++ b/CrowIDE/src/ProjectTree/ImlProjectItem.cs @@ -0,0 +1,68 @@ +// +// ProjectNodes.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using System.IO; +using Crow; +using System.Threading; + +namespace Crow.Coding +{ + public class ImlProjectItem : ProjectFile + { + #region CTOR + public ImlProjectItem (ProjectItem pi) : base (pi){ + } + #endregion + + GraphicObject instance; + + /// + /// instance created with an instantiator from the source by a DesignInterface, + /// for now, the one in ImlVisualEditor + /// + public GraphicObject Instance { + get { return instance; } + set { + if (instance == value) + return; + instance = value; + NotifyValueChanged ("Instance", instance); + } + } + + public List GraphicTree { + get { return new List (new GraphicObject[] {instance}); } + } + + void GTView_SelectedItemChanged (object sender, SelectionChangeEventArgs e){ + SelectedItem = e.NewValue; + } + } +} + diff --git a/CrowIDE/src/ProjectNodes.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs similarity index 62% rename from CrowIDE/src/ProjectNodes.cs rename to CrowIDE/src/ProjectTree/ProjectFile.cs index 1c4c8b26..2c3dbbe4 100644 --- a/CrowIDE/src/ProjectNodes.cs +++ b/CrowIDE/src/ProjectTree/ProjectFile.cs @@ -32,154 +32,7 @@ using Crow; using System.Threading; namespace Crow.Coding -{ - public enum ItemType { - ReferenceGroup, - Reference, - ProjectReference, - VirtualGroup, - Folder, - None, - Compile, - EmbeddedResource, - } - public enum CopyToOutputState { - Never, - Always, - PreserveNewest - } - public class ProjectNode : IValueChange - { - #region IValueChange implementation - public event EventHandler ValueChanged; - public virtual void NotifyValueChanged(string MemberName, object _value) - { - ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); - } - #endregion - - #region CTOR - public ProjectNode (Project project, ItemType _type, string _name) : this(project){ - type = _type; - name = _name; - initCommands (); - } - public ProjectNode (Project project){ - Project = project; - initCommands (); - } - #endregion - - void initCommands () { - Commands = new List (); - } - - ProjectNode parent; - bool isExpanded; - ItemType type; - string name; - List childNodes = new List(); - - public Project Project; - public List Commands;//list of command available for that node - - public ProjectNode Parent { - get { return parent; } - set { parent = value; } - } - public virtual ItemType Type { - get { return type; } - } - public virtual string DisplayName { - get { return name; } - } - public List ChildNodes { - get { return childNodes; } - } - public void AddChild (ProjectNode pn) { - childNodes.Add(pn); - pn.Parent = this; - } - public void RemoveChild (ProjectNode pn){ - pn.Parent = null; - childNodes.Remove (pn); - } - public void SortChilds () { - foreach (ProjectNode pn in childNodes) - pn.SortChilds (); - childNodes = childNodes.OrderBy(c=>c.Type).ThenBy(cn=>cn.DisplayName).ToList(); - } - - public bool IsExpanded - { - get { return isExpanded; } - set - { - if (value == isExpanded) - return; - isExpanded = value; - NotifyValueChanged ("IsExpanded", isExpanded); - } - } - - public override string ToString () - { - return DisplayName; - } - } - public class ProjectItem : ProjectNode { - #region CTOR - public ProjectItem (Project project, XmlNode _node) : base (project){ - node = _node; - } - #endregion - - public XmlNode node; - - public string Extension { - get { return System.IO.Path.GetExtension (Path); } - } - public string Path { - get { - return node.Attributes["Include"]?.Value.Replace('\\','/'); - } - } - public string AbsolutePath { - get { - return System.IO.Path.Combine (Project.RootDir, Path); - } - } - public override ItemType Type { - get { - return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true); - } - } - public override string DisplayName { - get { - return Type == ItemType.Reference ? - Path : - Path.Split ('/').LastOrDefault(); - } - } - public string HintPath { - get { return node.SelectSingleNode ("HintPath")?.InnerText; } - } - } - public class ProjectReference : ProjectItem { - public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){ - } - public string ProjectGUID { - get { - return node.SelectSingleNode ("Project")?.InnerText; - } - } - public override string DisplayName { - get { - return node.SelectSingleNode ("Name").InnerText; - } - } - } - +{ public class ProjectFile : ProjectItem { protected bool isOpened = false; DateTime accessTime; @@ -196,25 +49,27 @@ namespace Crow.Coding public Crow.Command cmdSave, cmdSaveAs, cmdOpen, cmdUndo, cmdRedo; - public ProjectFile (ProjectItem pi) - : base (pi.Project, pi.node) { - + void initCommands (){ cmdSave = new Crow.Command (new Action (() => Save ())) - { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; + { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; cmdSaveAs = new Crow.Command (new Action (() => SaveAs ())) - { Caption = "Save As ..", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; + { Caption = "Save As ..", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; cmdOpen = new Crow.Command (new Action (() => Open ())) - { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.ui.icons.outbox.svg"), CanExecute = false }; + { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.ui.icons.outbox.svg"), CanExecute = false }; cmdUndo = new Crow.Command (new Action (() => Undo (null))) - { Caption = "Undo", Icon = new SvgPicture ("#Crow.Coding.icons.undo.svg"), CanExecute = false }; + { Caption = "Undo", Icon = new SvgPicture ("#Crow.Coding.icons.undo.svg"), CanExecute = false }; cmdRedo = new Crow.Command (new Action (() => Redo (null))) - { Caption = "Redo", Icon = new SvgPicture ("#Crow.Coding.icons.redo.svg"), CanExecute = false }; - - Commands.Insert (0, cmdOpen); - Commands.Insert (1, cmdSave); + { Caption = "Redo", Icon = new SvgPicture ("#Crow.Coding.icons.redo.svg"), CanExecute = false }; - //Commands.Add (cmdUndo); - //Commands.Add (cmdRedo); + Commands.Insert (0, cmdOpen); + Commands.Insert (1, cmdSave); + } + public ProjectFile () { + initCommands(); + } + public ProjectFile (ProjectItem pi) + : base (pi.Project, pi.node) { + initCommands (); } public string ResourceID { @@ -431,36 +286,5 @@ namespace Crow.Coding Close (); } } - public class ImlProjectItem : ProjectFile - { - #region CTOR - public ImlProjectItem (ProjectItem pi) : base (pi){ - } - #endregion - - GraphicObject instance; - - /// - /// instance created with an instantiator from the source by a DesignInterface, - /// for now, the one in ImlVisualEditor - /// - public GraphicObject Instance { - get { return instance; } - set { - if (instance == value) - return; - instance = value; - NotifyValueChanged ("Instance", instance); - } - } - - public List GraphicTree { - get { return new List (new GraphicObject[] {instance}); } - } - - void GTView_SelectedItemChanged (object sender, SelectionChangeEventArgs e){ - SelectedItem = e.NewValue; - } - } } diff --git a/CrowIDE/src/ProjectTree/ProjectItem.cs b/CrowIDE/src/ProjectTree/ProjectItem.cs new file mode 100644 index 00000000..7a30a8e1 --- /dev/null +++ b/CrowIDE/src/ProjectTree/ProjectItem.cs @@ -0,0 +1,76 @@ +// +// ProjectNodes.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using System.IO; +using Crow; +using System.Threading; + +namespace Crow.Coding +{ + public class ProjectItem : ProjectNode { + #region CTOR + public ProjectItem() {} + public ProjectItem (Project project, XmlNode _node) : base (project){ + node = _node; + } + #endregion + + public XmlNode node; + + public string Extension { + get { return System.IO.Path.GetExtension (Path); } + } + public string Path { + get { + return node.Attributes["Include"]?.Value.Replace('\\','/'); + } + } + public string AbsolutePath { + get { + return System.IO.Path.Combine (Project.RootDir, Path); + } + } + public override ItemType Type { + get { + return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true); + } + } + public override string DisplayName { + get { + return Type == ItemType.Reference ? + Path : + Path.Split ('/').LastOrDefault(); + } + } + public string HintPath { + get { return node.SelectSingleNode ("HintPath")?.InnerText; } + } + } +} + diff --git a/CrowIDE/src/ProjectTree/ProjectNodes.cs b/CrowIDE/src/ProjectTree/ProjectNodes.cs new file mode 100644 index 00000000..b9c855f1 --- /dev/null +++ b/CrowIDE/src/ProjectTree/ProjectNodes.cs @@ -0,0 +1,134 @@ +// +// ProjectNodes.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using System.IO; +using Crow; +using System.Threading; + +namespace Crow.Coding +{ + public enum ItemType { + ReferenceGroup, + Reference, + ProjectReference, + VirtualGroup, + Folder, + None, + Compile, + EmbeddedResource, + } + public enum CopyToOutputState { + Never, + Always, + PreserveNewest + } + public class ProjectNode : IValueChange + { + #region IValueChange implementation + public event EventHandler ValueChanged; + public virtual void NotifyValueChanged(string MemberName, object _value) + { + ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); + } + #endregion + + #region CTOR + public ProjectNode (Project project, ItemType _type, string _name) : this(project){ + type = _type; + name = _name; + initCommands (); + } + public ProjectNode (Project project){ + Project = project; + initCommands (); + } + public ProjectNode (){ + initCommands (); + } + #endregion + + void initCommands () { + Commands = new List (); + } + + ProjectNode parent; + bool isExpanded; + ItemType type; + string name; + List childNodes = new List(); + + public Project Project; + public List Commands;//list of command available for that node + + public ProjectNode Parent { + get { return parent; } + set { parent = value; } + } + public virtual ItemType Type { + get { return type; } + } + public virtual string DisplayName { + get { return name; } + } + public List ChildNodes { + get { return childNodes; } + } + public void AddChild (ProjectNode pn) { + childNodes.Add(pn); + pn.Parent = this; + } + public void RemoveChild (ProjectNode pn){ + pn.Parent = null; + childNodes.Remove (pn); + } + public void SortChilds () { + foreach (ProjectNode pn in childNodes) + pn.SortChilds (); + childNodes = childNodes.OrderBy(c=>c.Type).ThenBy(cn=>cn.DisplayName).ToList(); + } + + public bool IsExpanded + { + get { return isExpanded; } + set + { + if (value == isExpanded) + return; + isExpanded = value; + NotifyValueChanged ("IsExpanded", isExpanded); + } + } + + public override string ToString () + { + return DisplayName; + } + } +} + diff --git a/CrowIDE/src/ProjectTree/ProjectReference.cs b/CrowIDE/src/ProjectTree/ProjectReference.cs new file mode 100644 index 00000000..84870746 --- /dev/null +++ b/CrowIDE/src/ProjectTree/ProjectReference.cs @@ -0,0 +1,51 @@ +// +// ProjectNodes.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using System.IO; +using Crow; +using System.Threading; + +namespace Crow.Coding +{ + public class ProjectReference : ProjectItem { + public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){ + } + public string ProjectGUID { + get { + return node.SelectSingleNode ("Project")?.InnerText; + } + } + public override string DisplayName { + get { + return node.SelectSingleNode ("Name").InnerText; + } + } + } +} + diff --git a/CrowIDE/ui/GTreeExpITemp.crow b/CrowIDE/ui/DockWindows/GTreeExpITemp.crow similarity index 98% rename from CrowIDE/ui/GTreeExpITemp.crow rename to CrowIDE/ui/DockWindows/GTreeExpITemp.crow index d3447366..1037312a 100644 --- a/CrowIDE/ui/GTreeExpITemp.crow +++ b/CrowIDE/ui/DockWindows/GTreeExpITemp.crow @@ -13,7 +13,7 @@ SvgSub="{./IsExpanded}" MouseEnter="{Background=LightGray}" MouseLeave="{Background=Transparent}"/> - +