From: Jean-Philippe Bruyère Date: Sun, 11 Mar 2018 12:20:27 +0000 (+0100) Subject: split ProjectNode classes in separate files X-Git-Tag: 0.7.3~4^2~12 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=1c2da8cc925b78687b87d3168322bc1088ae10cd;p=jp%2Fcrow.git split ProjectNode classes in separate files --- 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/icons/copy-file.svg b/CrowIDE/icons/copy-file.svg new file mode 100644 index 00000000..63c2dd37 --- /dev/null +++ b/CrowIDE/icons/copy-file.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/open.svg b/CrowIDE/icons/open.svg new file mode 100644 index 00000000..bd8d7d9b --- /dev/null +++ b/CrowIDE/icons/open.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/paste-on-document.svg b/CrowIDE/icons/paste-on-document.svg new file mode 100644 index 00000000..b0a705ee --- /dev/null +++ b/CrowIDE/icons/paste-on-document.svg @@ -0,0 +1,6 @@ + + + + + + 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/icons/save.svg b/CrowIDE/icons/save.svg new file mode 100644 index 00000000..6aa6714e --- /dev/null +++ b/CrowIDE/icons/save.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/scissors.svg b/CrowIDE/icons/scissors.svg new file mode 100644 index 00000000..4b5a2255 --- /dev/null +++ b/CrowIDE/icons/scissors.svg @@ -0,0 +1,6 @@ + + + + + + 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/ProjectNodes.cs b/CrowIDE/src/ProjectNodes.cs deleted file mode 100644 index 1c4c8b26..00000000 --- a/CrowIDE/src/ProjectNodes.cs +++ /dev/null @@ -1,466 +0,0 @@ -// -// 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 (); - } - #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; - string source; - string origSource; - object selectedItem; - int curLine, curColumn; - - internal ReaderWriterLockSlim srcEditMtx = new ReaderWriterLockSlim(); - - public Dictionary RegisteredEditors = new Dictionary(); - List undoStack = new List(); - List redoStack = new List(); - - public Crow.Command cmdSave, cmdSaveAs, cmdOpen, cmdUndo, cmdRedo; - - public ProjectFile (ProjectItem pi) - : base (pi.Project, pi.node) { - - cmdSave = new Crow.Command (new Action (() => Save ())) - { 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 }; - cmdOpen = new Crow.Command (new Action (() => Open ())) - { 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 }; - 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); - - //Commands.Add (cmdUndo); - //Commands.Add (cmdRedo); - } - - public string ResourceID { - get { - return Type != ItemType.EmbeddedResource ? null : - node.SelectSingleNode ("LogicalName") == null ? - Project.Name + "." + Path.Replace ('/', '.') : - LogicalName; - } - } - public string LogicalName { - get { - return node.SelectSingleNode ("LogicalName")?.InnerText; - } - } - - public void UnregisterEditor (object editor){ - lock(RegisteredEditors){ - RegisteredEditors.Remove (editor); - } - } - public void RegisterEditor (object editor) { - lock(RegisteredEditors){ - RegisteredEditors.Add (editor, false); - } - } - public void UpdateSource (object sender, string newSrc){ - System.Diagnostics.Debug.WriteLine ("update source by {0}", sender); - Source = newSrc; - signalOtherRegisteredEditors (sender); - } - void signalOtherRegisteredEditors (object sender) { - lock (RegisteredEditors) { - object[] keys = RegisteredEditors.Keys.ToArray (); - foreach (object editor in keys) { - if (editor != sender) - RegisteredEditors [editor] = false; - } - } - } - public string Source { - get { - if (!isOpened) - Open (); - else { - if (DateTime.Compare ( - accessTime, - System.IO.File.GetLastWriteTime (AbsolutePath)) < 0) - Console.WriteLine ("File has been modified outside CrowIDE"); - } - return source; - } - set { - if (source == value) - return; - - srcEditMtx.EnterWriteLock (); - - undoStack.Add (source); - cmdUndo.CanExecute = true; - redoStack.Clear (); - cmdRedo.CanExecute = false; - source = value; - - NotifyValueChanged ("Source", source); - NotifyValueChanged ("IsDirty", IsDirty); - - cmdSave.CanExecute = cmdSaveAs.CanExecute = IsDirty; - - srcEditMtx.ExitWriteLock (); - } - } - public bool IsDirty { - get { return source != origSource; } - } - public int CurrentColumn{ - get { return curColumn; } - set { - if (curColumn == value) - return; - curColumn = value; - NotifyValueChanged ("CurrentColumn", curColumn); - } - } - public int CurrentLine{ - get { return curLine; } - set { - if (curLine == value) - return; - curLine = value; - NotifyValueChanged ("CurrentLine", curLine); - } - } - - public object SelectedItem { - get { return selectedItem; } - set { - if (selectedItem == value) - return; - selectedItem= value; - Project.solution.SelectedItemElement = value; - NotifyValueChanged ("SelectedItem", selectedItem); - } - } - - public CopyToOutputState CopyToOutputDirectory { - get { - XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory"); - return xn == null ? CopyToOutputState.Never : - (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true); - } - } - - public void Open () { - accessTime = System.IO.File.GetLastWriteTime (AbsolutePath); - using (StreamReader sr = new StreamReader (AbsolutePath)) { - source = sr.ReadToEnd (); - } - isOpened = true; - origSource = source; - NotifyValueChanged ("IsDirty", false); - } - public void Save () { - if (!IsDirty) - return; - using (StreamWriter sw = new StreamWriter (AbsolutePath)) { - sw.Write (source); - } - origSource = source; - NotifyValueChanged ("IsDirty", false); - } - public void SaveAs () { - if (!IsDirty) - return; - using (StreamWriter sw = new StreamWriter (AbsolutePath)) { - sw.Write (source); - } - origSource = source; - NotifyValueChanged ("IsDirty", false); - } - public void Close () { - origSource = null; - isOpened = false; - Project.solution.CloseItem (this); - } - public void Undo(object sender){ - undo(); - signalOtherRegisteredEditors (sender); - } - public void Redo(object sender){ - redo(); - signalOtherRegisteredEditors (sender); - } - - void undo () { - if (undoStack.Count == 0) - return; - - srcEditMtx.EnterWriteLock (); - string step = undoStack [undoStack.Count -1]; - redoStack.Add (source); - cmdRedo.CanExecute = true; - undoStack.RemoveAt(undoStack.Count -1); - - source = step; - - NotifyValueChanged ("Source", source); - NotifyValueChanged ("IsDirty", IsDirty); - cmdSave.CanExecute = IsDirty; - - if (undoStack.Count == 0) - cmdUndo.CanExecute = false; - srcEditMtx.ExitWriteLock (); - } - - void redo () { - if (redoStack.Count == 0) - return; - srcEditMtx.EnterWriteLock (); - string step = redoStack [redoStack.Count -1]; - undoStack.Add (source); - cmdUndo.CanExecute = true; - redoStack.RemoveAt(redoStack.Count -1); - source = step; - NotifyValueChanged ("Source", source); - NotifyValueChanged ("IsDirty", IsDirty); - cmdSave.CanExecute = IsDirty; - - if (redoStack.Count == 0) - cmdRedo.CanExecute = false; - srcEditMtx.ExitWriteLock (); - - } - - - public void OnQueryClose (object sender, EventArgs e){ - if (IsDirty) { - MessageBox mb = MessageBox.ShowModal (CrowIDE.MainIFace, - MessageBox.Type.YesNoCancel, $"{DisplayName} has unsaved changes.\nSave it now?"); - mb.Yes += onClickSaveAndCloseNow; - mb.No += onClickCloseNow; - } else - Close (); - } - - void onClickCloseNow (object sender, EventArgs e) - { - Close (); - } - - void onClickSaveAndCloseNow (object sender, EventArgs e) - { - Save (); - 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/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/ProjectTree/ProjectFile.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs new file mode 100644 index 00000000..2c3dbbe4 --- /dev/null +++ b/CrowIDE/src/ProjectTree/ProjectFile.cs @@ -0,0 +1,290 @@ +// +// 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 ProjectFile : ProjectItem { + protected bool isOpened = false; + DateTime accessTime; + string source; + string origSource; + object selectedItem; + int curLine, curColumn; + + internal ReaderWriterLockSlim srcEditMtx = new ReaderWriterLockSlim(); + + public Dictionary RegisteredEditors = new Dictionary(); + List undoStack = new List(); + List redoStack = new List(); + + public Crow.Command cmdSave, cmdSaveAs, cmdOpen, cmdUndo, cmdRedo; + + void initCommands (){ + cmdSave = new Crow.Command (new Action (() => Save ())) + { 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 }; + cmdOpen = new Crow.Command (new Action (() => Open ())) + { 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 }; + 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); + } + public ProjectFile () { + initCommands(); + } + public ProjectFile (ProjectItem pi) + : base (pi.Project, pi.node) { + initCommands (); + } + + public string ResourceID { + get { + return Type != ItemType.EmbeddedResource ? null : + node.SelectSingleNode ("LogicalName") == null ? + Project.Name + "." + Path.Replace ('/', '.') : + LogicalName; + } + } + public string LogicalName { + get { + return node.SelectSingleNode ("LogicalName")?.InnerText; + } + } + + public void UnregisterEditor (object editor){ + lock(RegisteredEditors){ + RegisteredEditors.Remove (editor); + } + } + public void RegisterEditor (object editor) { + lock(RegisteredEditors){ + RegisteredEditors.Add (editor, false); + } + } + public void UpdateSource (object sender, string newSrc){ + System.Diagnostics.Debug.WriteLine ("update source by {0}", sender); + Source = newSrc; + signalOtherRegisteredEditors (sender); + } + void signalOtherRegisteredEditors (object sender) { + lock (RegisteredEditors) { + object[] keys = RegisteredEditors.Keys.ToArray (); + foreach (object editor in keys) { + if (editor != sender) + RegisteredEditors [editor] = false; + } + } + } + public string Source { + get { + if (!isOpened) + Open (); + else { + if (DateTime.Compare ( + accessTime, + System.IO.File.GetLastWriteTime (AbsolutePath)) < 0) + Console.WriteLine ("File has been modified outside CrowIDE"); + } + return source; + } + set { + if (source == value) + return; + + srcEditMtx.EnterWriteLock (); + + undoStack.Add (source); + cmdUndo.CanExecute = true; + redoStack.Clear (); + cmdRedo.CanExecute = false; + source = value; + + NotifyValueChanged ("Source", source); + NotifyValueChanged ("IsDirty", IsDirty); + + cmdSave.CanExecute = cmdSaveAs.CanExecute = IsDirty; + + srcEditMtx.ExitWriteLock (); + } + } + public bool IsDirty { + get { return source != origSource; } + } + public int CurrentColumn{ + get { return curColumn; } + set { + if (curColumn == value) + return; + curColumn = value; + NotifyValueChanged ("CurrentColumn", curColumn); + } + } + public int CurrentLine{ + get { return curLine; } + set { + if (curLine == value) + return; + curLine = value; + NotifyValueChanged ("CurrentLine", curLine); + } + } + + public object SelectedItem { + get { return selectedItem; } + set { + if (selectedItem == value) + return; + selectedItem= value; + Project.solution.SelectedItemElement = value; + NotifyValueChanged ("SelectedItem", selectedItem); + } + } + + public CopyToOutputState CopyToOutputDirectory { + get { + XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory"); + return xn == null ? CopyToOutputState.Never : + (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true); + } + } + + public void Open () { + accessTime = System.IO.File.GetLastWriteTime (AbsolutePath); + using (StreamReader sr = new StreamReader (AbsolutePath)) { + source = sr.ReadToEnd (); + } + isOpened = true; + origSource = source; + NotifyValueChanged ("IsDirty", false); + } + public void Save () { + if (!IsDirty) + return; + using (StreamWriter sw = new StreamWriter (AbsolutePath)) { + sw.Write (source); + } + origSource = source; + NotifyValueChanged ("IsDirty", false); + } + public void SaveAs () { + if (!IsDirty) + return; + using (StreamWriter sw = new StreamWriter (AbsolutePath)) { + sw.Write (source); + } + origSource = source; + NotifyValueChanged ("IsDirty", false); + } + public void Close () { + origSource = null; + isOpened = false; + Project.solution.CloseItem (this); + } + public void Undo(object sender){ + undo(); + signalOtherRegisteredEditors (sender); + } + public void Redo(object sender){ + redo(); + signalOtherRegisteredEditors (sender); + } + + void undo () { + if (undoStack.Count == 0) + return; + + srcEditMtx.EnterWriteLock (); + string step = undoStack [undoStack.Count -1]; + redoStack.Add (source); + cmdRedo.CanExecute = true; + undoStack.RemoveAt(undoStack.Count -1); + + source = step; + + NotifyValueChanged ("Source", source); + NotifyValueChanged ("IsDirty", IsDirty); + cmdSave.CanExecute = IsDirty; + + if (undoStack.Count == 0) + cmdUndo.CanExecute = false; + srcEditMtx.ExitWriteLock (); + } + + void redo () { + if (redoStack.Count == 0) + return; + srcEditMtx.EnterWriteLock (); + string step = redoStack [redoStack.Count -1]; + undoStack.Add (source); + cmdUndo.CanExecute = true; + redoStack.RemoveAt(redoStack.Count -1); + source = step; + NotifyValueChanged ("Source", source); + NotifyValueChanged ("IsDirty", IsDirty); + cmdSave.CanExecute = IsDirty; + + if (redoStack.Count == 0) + cmdRedo.CanExecute = false; + srcEditMtx.ExitWriteLock (); + + } + + + public void OnQueryClose (object sender, EventArgs e){ + if (IsDirty) { + MessageBox mb = MessageBox.ShowModal (CrowIDE.MainIFace, + MessageBox.Type.YesNoCancel, $"{DisplayName} has unsaved changes.\nSave it now?"); + mb.Yes += onClickSaveAndCloseNow; + mb.No += onClickCloseNow; + } else + Close (); + } + + void onClickCloseNow (object sender, EventArgs e) + { + Close (); + } + + void onClickSaveAndCloseNow (object sender, EventArgs e) + { + Save (); + Close (); + } + } +} + 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/DockWindows/GTreeExpITemp.crow b/CrowIDE/ui/DockWindows/GTreeExpITemp.crow new file mode 100644 index 00000000..1037312a --- /dev/null +++ b/CrowIDE/ui/DockWindows/GTreeExpITemp.crow @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/CrowIDE/ui/DockWindows/winEditor.crow b/CrowIDE/ui/DockWindows/winEditor.crow index f87d34f2..8ba392d4 100644 --- a/CrowIDE/ui/DockWindows/winEditor.crow +++ b/CrowIDE/ui/DockWindows/winEditor.crow @@ -1,5 +1,5 @@  - + diff --git a/CrowIDE/ui/DockWindows/winErrors.crow b/CrowIDE/ui/DockWindows/winErrors.crow index ff7bafdb..82ecc170 100644 --- a/CrowIDE/ui/DockWindows/winErrors.crow +++ b/CrowIDE/ui/DockWindows/winErrors.crow @@ -1,5 +1,5 @@  - + + + +