From 2221764b06e69a2b77207cfa609141b3a06c8baa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 23 Feb 2018 12:07:22 +0100 Subject: [PATCH] crowIDE wip, lock layouting for items loading in tg --- Crow.csproj | 5 +- Crow.sln | 41 +++- CrowIDE/CrowIDE.csproj | 11 +- CrowIDE/src/CrowIDE.cs | 15 +- CrowIDE/src/INetProject.cs | 35 +++ CrowIDE/src/ImlVisualEditor.cs | 1 + CrowIDE/src/Project.cs | 261 +++++++++++++++-------- CrowIDE/src/ProjectNodes.cs | 24 ++- CrowIDE/src/Solution.cs | 4 + CrowIDE/ui/CrowIDE.crow | 2 +- CrowIDE/ui/MemberView.crow | 2 +- CrowIDE/ui/MembersView.template | 20 +- CrowIDE/ui/MenuItem.template | 34 +-- Icons/frame.svg | 66 ++++++ Templates/ContextMenu.template | 2 +- Tests/GraphicObjects/TechBorder.cs | 88 ++++++++ Tests/Tests.csproj | 11 +- src/CompilerServices/CompilerServices.cs | 24 +-- src/GraphicObjects/TemplatedGroup.cs | 4 +- src/Interface.cs | 18 +- 20 files changed, 506 insertions(+), 162 deletions(-) create mode 100644 CrowIDE/src/INetProject.cs create mode 100644 Icons/frame.svg create mode 100644 Tests/GraphicObjects/TechBorder.cs diff --git a/Crow.csproj b/Crow.csproj index af3df9f1..6a4c56b3 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -24,15 +24,15 @@ crow.key 8.0.30703 2.0 - 0.7 + 0.5 true full true - DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 false $(SolutionDir)build\Debug + DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 true @@ -361,6 +361,7 @@ + Crow.DefaultItem.template diff --git a/Crow.sln b/Crow.sln index 156e43df..61aaa3af 100644 --- a/Crow.sln +++ b/Crow.sln @@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Test", "Crow.Test\Crow.Test.csproj", "{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Coding", "..\gts\CrowEdit\Crow.Coding\Crow.Coding.csproj", "{78842EE4-8A2F-4C75-AEC6-C95F15AD3994}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -19,31 +23,47 @@ Global {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Release|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU + {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.StandardHeader = $1 $1.Text = @\n${FileName}\n \nAuthor:\n ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) 2013-2017 Jean-Philippe Bruyère\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. - $1.IncludeInNewFiles = True $0.DotNetNamingPolicy = $2 - $2.DirectoryNamespaceAssociation = None - $2.ResourceNamePolicy = FileFormatDefault $0.TextStylePolicy = $3 - $3.FileWidth = 120 - $3.TabsToSpaces = False $3.EolMarker = Unix - $3.inheritsSet = VisualStudio - $3.inheritsScope = text/plain $3.scope = text/x-csharp $0.CSharpFormattingPolicy = $4 $4.AfterDelegateDeclarationParameterComma = True - $4.inheritsSet = Mono - $4.inheritsScope = text/x-csharp $4.scope = text/x-csharp + $4.IndentSwitchSection = False + $4.NewLinesForBracesInProperties = False + $4.NewLinesForBracesInAccessors = False + $4.NewLinesForBracesInAnonymousMethods = False + $4.NewLinesForBracesInControlBlocks = False + $4.NewLinesForBracesInAnonymousTypes = False + $4.NewLinesForBracesInObjectCollectionArrayInitializers = False + $4.NewLinesForBracesInLambdaExpressionBody = False + $4.NewLineForElse = False + $4.NewLineForCatch = False + $4.NewLineForFinally = False + $4.NewLineForMembersInObjectInit = False + $4.NewLineForMembersInAnonymousTypes = False + $4.NewLineForClausesInQuery = False + $4.SpacingAfterMethodDeclarationName = True + $4.SpaceAfterMethodCallName = True + $4.SpaceBeforeOpenSquareBracket = True $0.VersionControlPolicy = $5 $5.CommitMessageStyle = $6 $6.Indent = @\t @@ -51,8 +71,7 @@ Global $6.LastFilePostfix = "@:\n " $6.LineAlign = 0 $6.Wrap = False - $5.inheritsSet = Mono description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n - version = 0.7 + version = 0.5 EndGlobalSection EndGlobal diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 63ab331e..10944136 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -73,6 +73,10 @@ {C2980F9B-4798-4C05-99E2-E174810F7C7B} Crow + + {78842EE4-8A2F-4C75-AEC6-C95F15AD3994} + Crow.Coding + @@ -104,6 +108,7 @@ + @@ -146,6 +151,9 @@ Crow.TabItem.template + + Crow.MenuItem.template + @@ -166,8 +174,5 @@ - - Crow.MenuItem.template - diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 2ad1fa75..905468a9 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -182,13 +182,14 @@ namespace CrowIDE { if (e.Key == OpenTK.Input.Key.Escape) { Quit (null, null); - return; - } -// else if (e.Key == OpenTK.Input.Key.F4) { -// loadWindow ("#CrowIDE.ui.MemberView.crow"); -// } else if (e.Key == OpenTK.Input.Key.F5) { -// loadWindow ("#CrowIDE.ui.GTreeExplorer.crow"); -// } else if (e.Key == OpenTK.Input.Key.F6) { + } else if (e.Key == OpenTK.Input.Key.F5) { + try { + CurrentSolution.StartupProject.Compile (); + } catch (Exception ex) { + Console.WriteLine (ex.ToString ()); + } + + }// else if (e.Key == OpenTK.Input.Key.F6) { // loadWindow ("#CrowIDE.ui.LQIsExplorer.crow"); // } else if (e.Key == OpenTK.Input.Key.F7) { // loadWindow ("#CrowIDE.ui.CSProjExplorer.crow"); diff --git a/CrowIDE/src/INetProject.cs b/CrowIDE/src/INetProject.cs new file mode 100644 index 00000000..53d81a1f --- /dev/null +++ b/CrowIDE/src/INetProject.cs @@ -0,0 +1,35 @@ +// +// INetProject.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; + +namespace Crow.Coding +{ + public interface INetProject + { + + } +} + diff --git a/CrowIDE/src/ImlVisualEditor.cs b/CrowIDE/src/ImlVisualEditor.cs index 55c7b0c6..fe116f78 100644 --- a/CrowIDE/src/ImlVisualEditor.cs +++ b/CrowIDE/src/ImlVisualEditor.cs @@ -286,6 +286,7 @@ namespace CrowIDE return; hr = SelectedItem.ScreenCoordinates(SelectedItem.getSlot ()); hr.Inflate (1); + gr.LineWidth = 2; gr.SetSourceColor (Color.Yellow); gr.SetDash (new double[]{ 5.0, 3.0 },0.0); gr.Rectangle (hr, 1.0); diff --git a/CrowIDE/src/Project.cs b/CrowIDE/src/Project.cs index e2690b7c..40f14f80 100644 --- a/CrowIDE/src/Project.cs +++ b/CrowIDE/src/Project.cs @@ -31,6 +31,7 @@ using System.Linq; using Microsoft.CSharp; using System.CodeDom.Compiler; using Crow; +using System.Text.RegularExpressions; namespace CrowIDE { @@ -49,11 +50,15 @@ namespace CrowIDE XmlNode nodeProject; XmlNode nodeProps; XmlNodeList nodesItems; + SolutionProject solutionProject; + public Solution solution; public List Commands; public CompilerResults CompilationResults; public List dependantProjects = new List(); public Project ParentProject = null; + List rootItems; + List flattenNodes; public string Name { get { return solutionProject.ProjectName; } @@ -77,12 +82,75 @@ namespace CrowIDE public string Path { get { return System.IO.Path.Combine (solution.SolutionFolder, solutionProject.RelativePath.Replace('\\','/')); } } - - - #region Project properties public string RootDir { get { return System.IO.Path.GetDirectoryName (Path); } } + + + + public List RootItems { + get { return rootItems; } + } + + void buildTreeNodes(){ + ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace); + List items = new List (); + foreach (XmlNode i in nodesItems) { + foreach (XmlNode f in i.ChildNodes) { + items.Add (new ProjectItem (this, f)); + } + } + + flattenNodes = new List (); + + ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References"); + root.ChildNodes.Add (refs); + + foreach (ProjectItem pn in items) { + switch (pn.Type) { + case ItemType.Reference: + refs.ChildNodes.Add (pn); + flattenNodes.Add (pn); + break; + case ItemType.ProjectReference: + ProjectReference pr = new ProjectReference (pn); + refs.ChildNodes.Add (pr); + flattenNodes.Add (pr); + break; + case ItemType.Compile: + case ItemType.None: + case ItemType.EmbeddedResource: + ProjectNode curNode = root; + string[] folds = pn.Path.Split ('/'); + for (int i = 0; i < folds.Length - 1; i++) { + ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup); + if (nextNode == null) { + nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]); + curNode.ChildNodes.Add (nextNode); + } + curNode = nextNode; + } + ProjectNode f = null; + switch (pn.Extension) { + case ".crow": + case ".template": + f = new ImlProjectItem (pn); + break; + default: + f = new ProjectFile (pn); + break; + } + curNode.ChildNodes.Add (f); + flattenNodes.Add (f); + break; + } + } + root.SortChilds (); + + rootItems = root.ChildNodes; + } + + #region Project properties public string ToolsVersion { get { return nodeProject?.Attributes ["ToolsVersion"]?.Value; } } @@ -128,70 +196,18 @@ namespace CrowIDE public string IntermediateOutputPath { get { return nodeProps["IntermediateOutputPath"]?.InnerText; } } - #endregion - - public List Items { - get { - List tmp = new List (); - foreach (XmlNode i in nodesItems) { - foreach (XmlNode f in i.ChildNodes) { - tmp.Add (new ProjectItem (this, f)); - } - } - return tmp; - } + public string StartupObject { + get { return nodeProps["StartupObject"]?.InnerText; } + } + public bool DebugSymbols { + get { return nodeProps["DebugSymbols"] == null ? false : bool.Parse( nodeProps["DebugSymbols"]?.InnerText); } + } + public int WarningLevel { + get { return nodeProps["WarningLevel"] == null ? 0 : int.Parse(nodeProps["WarningLevel"]?.InnerText); } } - public List RootItems { - get { - ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace); - List items = Items; - - ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References"); - root.ChildNodes.Add (refs); - - foreach (ProjectItem pn in items) { - switch (pn.Type) { - case ItemType.Reference: - refs.ChildNodes.Add (pn); - break; - case ItemType.ProjectReference: - refs.ChildNodes.Add (new ProjectReference(pn)); - break; - case ItemType.Compile: - case ItemType.None: - case ItemType.EmbeddedResource: - ProjectNode curNode = root; - string[] folds = pn.Path.Split ('/'); - for (int i = 0; i < folds.Length - 1; i++) { - ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup); - if (nextNode == null) { - nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]); - curNode.ChildNodes.Add (nextNode); - } - curNode = nextNode; - } - switch (pn.Extension) { - case ".crow": - case ".template": - curNode.ChildNodes.Add (new ImlProjectItem(pn)); - break; - default: - curNode.ChildNodes.Add (pn); - break; - } - - - break; - } - } - root.SortChilds (); - - return root.ChildNodes; - } + #endregion - } - SolutionProject solutionProject; public Project (Solution sol, SolutionProject sp) { solutionProject = sp; @@ -225,39 +241,58 @@ namespace CrowIDE if (ProjectGuid != solutionProject.ProjectGuid) throw new Exception ("Project GUID not matching with solution"); + buildTreeNodes (); + IsLoaded = true; } void setAsStartupProject () { solution.StartupProject = this; } - - public void Compile () { + static Regex regexDirTokens = new Regex(@"\$\(([^\)]*)\)|([^\$]*)"); + + string getDirectoryWithTokens (string dir){ + Match m = regexDirTokens.Match (dir); + string tmp = ""; + while (m.Success) + { + if (m.Value == @"$(SolutionDir)") + tmp = System.IO.Path.Combine (tmp, solution.SolutionFolder); + else if (m.Value == @"$(Configuration)") + tmp = System.IO.Path.Combine (tmp, "Debug"); + else + tmp = System.IO.Path.Combine (tmp, m.Value); + + if (tmp.EndsWith (@"\")||tmp.EndsWith (@"/")) + tmp = tmp.Remove (tmp.Length - 1); + + m = m.NextMatch(); + } + return tmp; + } + public string Compile () { + GetStyling (); + if (ParentProject != null) ParentProject.Compile (); CSharpCodeProvider cp = new CSharpCodeProvider(); CompilerParameters parameters = new CompilerParameters(); - foreach (ProjectItem pi in Items.Where (pp=>pp.Type == ItemType.ProjectReference)) { - ProjectReference pr = new ProjectReference (pi); + foreach (ProjectReference pr in flattenNodes.OfType()) { Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID); if (p == null) throw new Exception ("referenced project not found"); - p.Compile (); - parameters.ReferencedAssemblies.Add (pr.DisplayName); + parameters.ReferencedAssemblies.Add (p.Compile ()); } - foreach (ProjectItem pi in Items.Where (p=>p.Type == ItemType.Reference)) { - parameters.ReferencedAssemblies.Add (pi.Path); - } - parameters.ReferencedAssemblies.Add ("System.Core"); - - parameters.GenerateInMemory = true; + string outputDir = getDirectoryWithTokens(this.OutputPath); + string objDir = getDirectoryWithTokens (this.IntermediateOutputPath); - if (!Directory.Exists("testbuild")) - Directory.CreateDirectory ("testbuild"); - parameters.OutputAssembly = "testbuild/" + this.AssemblyName; + Directory.CreateDirectory (outputDir); + Directory.CreateDirectory (objDir); + + parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName); // True - exe file generation, false - dll file generation if (this.OutputType == "Library") { @@ -268,33 +303,89 @@ namespace CrowIDE parameters.GenerateExecutable = true; parameters.CompilerOptions += " /target:exe"; parameters.OutputAssembly += ".exe"; + parameters.MainClass = this.StartupObject; } - parameters.IncludeDebugInformation = true; + parameters.GenerateInMemory = false; + parameters.IncludeDebugInformation = this.DebugSymbols; parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors; - parameters.WarningLevel = 4; + parameters.WarningLevel = this.WarningLevel; parameters.CompilerOptions += " /noconfig"; if (this.AllowUnsafeBlocks) parameters.CompilerOptions += " /unsafe"; parameters.CompilerOptions += " /delaysign+"; + parameters.CompilerOptions += " /debug:full /debug+"; + parameters.CompilerOptions += " /optimize-"; + parameters.CompilerOptions += " /define:\"DEBUG;TRACE\""; + parameters.CompilerOptions += " /nostdlib"; + + + + foreach (ProjectItem pi in flattenNodes.Where (p=>p.Type == ItemType.Reference)) { + + if (string.IsNullOrEmpty (pi.HintPath)) { + parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll"; + continue; + } + parameters.ReferencedAssemblies.Add (pi.Path); + string fullHintPath = System.IO.Path.GetFullPath(System.IO.Path.Combine (RootDir, pi.HintPath.Replace('\\','/'))); + if (File.Exists(fullHintPath)) + File.Copy (fullHintPath, System.IO.Path.Combine(outputDir, System.IO.Path.GetFileName(fullHintPath))); + } + parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll"; + parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll"; + //parameters.ReferencedAssemblies.Add ("System.Core"); + //parameters.ReferencedAssemblies.Add ("mscorlib.dll"); + - foreach (ProjectFile pi in Items.OfType().Where (p => p.Type == ItemType.EmbeddedResource)) { + IEnumerable pfs = flattenNodes.OfType (); + + foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) { string absPath = pi.AbsolutePath; string logicName = pi.LogicalName; if (string.IsNullOrEmpty (logicName)) - parameters.CompilerOptions += string.Format (" /resource:{0}", absPath); + parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath , this.Name + "." + pi.Path.Replace('/','.')); else parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName); } + foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) { + if (pi.CopyToOutputDirectory == CopyToOutputState.Never) + continue; + string source = pi.AbsolutePath; + string target = System.IO.Path.Combine (outputDir, pi.Path); + Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target)); + + if (File.Exists (target)) { + if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) { + if (DateTime.Compare ( + System.IO.File.GetLastWriteTime (source), + System.IO.File.GetLastWriteTime (target)) < 0) + continue; + } + File.Delete (target); + } + System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target); + File.Copy (source, target); + } + string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray(); - - string[] files = Items.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray(); + System.Diagnostics.Debug.WriteLine("---- start compilation of :" + parameters.OutputAssembly); + System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions); CompilationResults = cp.CompileAssemblyFromFile(parameters, files); solution.UpdateErrorList (); + + return parameters.OutputAssembly; } + + + public void GetStyling () { + foreach (ProjectFile pi in flattenNodes.OfType ().Where (pp=>pp.Type == ItemType.EmbeddedResource)) { + Console.WriteLine (pi.Extension); + } + } } } diff --git a/CrowIDE/src/ProjectNodes.cs b/CrowIDE/src/ProjectNodes.cs index 5d13af05..bdabbdd8 100644 --- a/CrowIDE/src/ProjectNodes.cs +++ b/CrowIDE/src/ProjectNodes.cs @@ -119,7 +119,9 @@ namespace CrowIDE 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){ @@ -135,11 +137,18 @@ namespace CrowIDE } } } + public enum CopyToOutputState { + Never, + Always, + PreserveNewest + } public class ProjectFile : ProjectItem { + bool isDirty = false; + object selectedItem; + public ProjectFile (ProjectItem pi) : base (pi.Project, pi.node){ } - object selectedItem; public string LogicalName { get { return node.SelectSingleNode ("LogicalName")?.InnerText; @@ -162,7 +171,16 @@ namespace CrowIDE NotifyValueChanged ("SelectedItem", selectedItem); } } - + public CopyToOutputState CopyToOutputDirectory { + get { + XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory"); + if (xn == null) + return CopyToOutputState.Never; + CopyToOutputState tmp = (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true); + return tmp; + //return xn == null ? CopyToOutputState.Never : (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true); + } + } public void OnQueryClose (object sender, EventArgs e){ Project.solution.CloseItem (this); } diff --git a/CrowIDE/src/Solution.cs b/CrowIDE/src/Solution.cs index d8a7c4e7..c971b847 100644 --- a/CrowIDE/src/Solution.cs +++ b/CrowIDE/src/Solution.cs @@ -309,6 +309,8 @@ namespace CrowIDE{ } )); + Console.WriteLine ("******** CONFIG ***************"); + new Regex("GlobalSection\\(ProjectConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 => { foreach (Match m3 in new Regex("\\s*({[A-F0-9-]+})\\.(.*?)\\.(.*?)\\s+=\\s+(.*?)[\r\n]+").Matches(m2.Groups[1].ToString())) @@ -322,6 +324,8 @@ namespace CrowIDE{ if (p == null) continue; + Console.WriteLine ("{0},{1},{2},{3}",guid,solutionConfig,action,projectConfig); + int iConfigIndex = s.configurations.IndexOf(solutionConfig); if (iConfigIndex == -1) continue; diff --git a/CrowIDE/ui/CrowIDE.crow b/CrowIDE/ui/CrowIDE.crow index 18ffc0c3..079635fe 100644 --- a/CrowIDE/ui/CrowIDE.crow +++ b/CrowIDE/ui/CrowIDE.crow @@ -41,7 +41,7 @@ Data="{Projects}" SelectedItemChanged="onSelectedItemChanged" ItemTemplate="#CrowIDE.ui.ProjectTree.template"/> - diff --git a/CrowIDE/ui/MemberView.crow b/CrowIDE/ui/MemberView.crow index 4b038d9a..6cdfbf31 100644 --- a/CrowIDE/ui/MemberView.crow +++ b/CrowIDE/ui/MemberView.crow @@ -1,5 +1,5 @@  - \ No newline at end of file diff --git a/CrowIDE/ui/MembersView.template b/CrowIDE/ui/MembersView.template index d541fe01..411834c4 100755 --- a/CrowIDE/ui/MembersView.template +++ b/CrowIDE/ui/MembersView.template @@ -3,9 +3,19 @@ - - - + + + + + + diff --git a/CrowIDE/ui/MenuItem.template b/CrowIDE/ui/MenuItem.template index 5752b088..eccad164 100644 --- a/CrowIDE/ui/MenuItem.template +++ b/CrowIDE/ui/MenuItem.template @@ -3,21 +3,25 @@ Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click" IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}" IsEnabled="{./IsEnabled}"> diff --git a/Icons/frame.svg b/Icons/frame.svg new file mode 100644 index 00000000..576d418f --- /dev/null +++ b/Icons/frame.svg @@ -0,0 +1,66 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/Templates/ContextMenu.template b/Templates/ContextMenu.template index 3fb29552..58e71b7c 100644 --- a/Templates/ContextMenu.template +++ b/Templates/ContextMenu.template @@ -14,7 +14,7 @@