From 76981dce006e02bda96668f2559c9047afe23f8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 18 Dec 2018 07:31:53 +0100 Subject: [PATCH] debug template loading --- Crow/src/CompilerServices/CompilerServices.cs | 1 + Crow/src/GraphicObjects/TemplatedControl.cs | 2 +- Crow/src/Instantiator.cs | 9 +- Crow/src/Interface.cs | 66 ++++++-- Crow/src/ItemTemplate.cs | 20 +-- CrowIDE/CrowIDE.csproj | 151 +----------------- CrowIDE/src/CrowIDE.cs | 56 +++---- CrowIDE/src/Editors/ImlVisualEditor.cs | 6 +- CrowIDE/src/Extensions.cs | 2 +- CrowIDE/src/GraphicObjectDesignContainer.cs | 2 +- CrowIDE/src/Project.cs | 10 +- CrowIDE/src/ProjectTree/ProjectFile.cs | 12 +- CrowIDE/src/ProjectTree/ProjectItem.cs | 6 +- CrowIDE/src/ProjectTree/ProjectNodes.cs | 2 +- CrowIDE/ui/editors/EditPaneItems.template | 14 +- CrowIDE/ui/editors/IMLEdit.itemp | 2 +- CrowIDE/ui/editors/SrcEdit.itemp | 2 +- 17 files changed, 123 insertions(+), 240 deletions(-) diff --git a/Crow/src/CompilerServices/CompilerServices.cs b/Crow/src/CompilerServices/CompilerServices.cs index 80e47e9d..7b95c9d7 100644 --- a/Crow/src/CompilerServices/CompilerServices.cs +++ b/Crow/src/CompilerServices/CompilerServices.cs @@ -97,6 +97,7 @@ namespace Crow.IML internal static EventInfo eiLogicalParentChanged = typeof(GraphicObject).GetEvent("LogicalParentChanged"); internal static MethodInfo miIFaceLoad = typeof(Interface).GetMethod ("CreateInstance", BindingFlags.Instance | BindingFlags.Public); + internal static MethodInfo miIFaceCreateTemplateInst = typeof (Interface).GetMethod ("CreateTemplateInstance", BindingFlags.Instance | BindingFlags.Public); internal static MethodInfo miGetITemp = typeof(Interface).GetMethod ("GetItemTemplate", BindingFlags.Instance | BindingFlags.Public); internal static MethodInfo miAddITemp = typeof(Dictionary).GetMethod ("set_Item", new Type[] { typeof(string), typeof(ItemTemplate) }); diff --git a/Crow/src/GraphicObjects/TemplatedControl.cs b/Crow/src/GraphicObjects/TemplatedControl.cs index 6ecdb496..1f490f11 100644 --- a/Crow/src/GraphicObjects/TemplatedControl.cs +++ b/Crow/src/GraphicObjects/TemplatedControl.cs @@ -76,7 +76,7 @@ namespace Crow if (string.IsNullOrEmpty(_template)) loadTemplate (); else - loadTemplate (IFace.CreateInstance (_template)); + loadTemplate (IFace.CreateTemplateInstance (_template, this.GetType())); } } /// diff --git a/Crow/src/Instantiator.cs b/Crow/src/Instantiator.cs index be534d6c..98852001 100644 --- a/Crow/src/Instantiator.cs +++ b/Crow/src/Instantiator.cs @@ -336,8 +336,11 @@ namespace Crow.IML } else { ctx.il.Emit (OpCodes.Ldarg_1);//load currentInterface ctx.il.Emit (OpCodes.Ldstr, templatePath); //Load template path string - ctx.il.Emit (OpCodes.Callvirt,//call Interface.Load(path) - CompilerServices.miIFaceLoad); + //get declaring type for search fallback assembly + ctx.il.Emit (OpCodes.Ldloc_0); + ctx.il.Emit (OpCodes.Call, CompilerServices.miGetType); + ctx.il.Emit (OpCodes.Callvirt, + CompilerServices.miIFaceCreateTemplateInst); } ctx.il.Emit (OpCodes.Callvirt, CompilerServices.miLoadTmp);//load template } @@ -348,7 +351,7 @@ namespace Crow.IML if (iface.ItemTemplates.ContainsKey (itemTemplatePath)) { itemTemplateIds.Add (new string [] { "default", itemTemplatePath, "" }); } else { - using (Stream stream = iface.GetStreamFromPath (itemTemplatePath)) { + using (Stream stream = iface.GetTemplateStreamFromPath (itemTemplatePath, ctx.CurrentNodeType)) { //itemtemplate files may have multiple root nodes XmlReaderSettings itrSettings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; using (XmlReader itr = XmlReader.Create (stream, itrSettings)) { diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 99e385c9..0c461613 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -355,6 +355,7 @@ namespace Crow /// on the first instance creation of a IML item. /// public Dictionary Instantiators = new Dictionary(); + public Dictionary Templates = new Dictionary (); /// /// default templates dic by metadata token /// @@ -424,6 +425,28 @@ namespace Crow #region Load/Save + /// get template stream from path providing the declaring type for which + /// this template is loaded. If not found in entry assembly, the assembly where the type is defined + /// will be searched + /// + /// The template stream + public virtual Stream GetTemplateStreamFromPath (string path, Type declaringType) + { + Stream s = null; + if (path.StartsWith ("#", StringComparison.Ordinal)) { + string resId = path.Substring (1); + s = Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); + if (s == null) + s = Assembly.GetAssembly (declaringType).GetManifestResourceStream (resId); + if (s == null) + throw new Exception ($"Template not found '{path}'"); + } else { + if (!File.Exists (path)) + throw new FileNotFoundException ("Template not found: ", path); + s = new FileStream (path, FileMode.Open, FileAccess.Read); + } + return s; + } /// Open file or find a resource from path string /// A file or resource stream /// This could be a normal file path, or an embedded ressource ID @@ -434,12 +457,11 @@ namespace Crow if (path.StartsWith ("#", StringComparison.Ordinal)) { string resId = path.Substring (1); - //try/catch added to prevent nunit error - try { - stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); - } catch {} - if (stream == null)//try to find ressource in Crow assembly - stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId); + string assemblyName = resId.Split ('.') [0]; + Assembly a = AppDomain.CurrentDomain.GetAssemblies ().FirstOrDefault (aa => aa.GetName ().Name == assemblyName); + if (a == null) + throw new Exception ($"Assembly '{assemblyName}' not found for ressource '{path}'."); + stream = a.GetManifestResourceStream (resId); if (stream == null) throw new Exception ("Resource not found: " + path); } else { @@ -455,13 +477,16 @@ namespace Crow if (path.StartsWith ("#", StringComparison.Ordinal)) { string resId = path.Substring (1); - //try/catch added to prevent nunit error - stream = Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); - if (stream == null)//try to find ressource in Crow assembly - stream = Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId); - if (stream == null) - throw new Exception("Resource not found: " + path); - Console.WriteLine(Assembly.GetEntryAssembly ().GetName ()); + string assemblyName = resId.Split ('.') [0]; + Assembly a = AppDomain.CurrentDomain.GetAssemblies ().FirstOrDefault (aa => aa.GetName ().Name == assemblyName); + if (a == null) + throw new Exception ($"Assembly '{assemblyName}' not found for ressource '{path}'."); + stream = a.GetManifestResourceStream (resId); + /*foreach (var s in a.GetManifestResourceNames()) { + Console.WriteLine (s); + }*/ + if (stream == null) + throw new Exception ("Resource not found: " + path); } else { if (!File.Exists (path)) throw new FileNotFoundException ("File not found: ", path); @@ -516,6 +541,21 @@ namespace Crow } } /// + /// Create an instance of a GraphicObject linked to this interface but not added to the GraphicTree + /// + /// new instance of graphic object created + /// path of the iml file to load + public virtual GraphicObject CreateTemplateInstance (string path, Type declaringType) + { + try { + if (!Templates.ContainsKey (path)) + Templates [path] = new Instantiator (this, GetTemplateStreamFromPath(path, declaringType), path); + return Templates [path].CreateInstance (); + } catch (Exception ex) { + throw new Exception ("Error loading Template <" + path + ">:", ex); + } + } + /// /// Fetch instantiator from cache or create it. /// /// new Instantiator diff --git a/Crow/src/ItemTemplate.cs b/Crow/src/ItemTemplate.cs index a27ddeaf..1f41e552 100644 --- a/Crow/src/ItemTemplate.cs +++ b/Crow/src/ItemTemplate.cs @@ -96,24 +96,6 @@ namespace Crow string fetchMethodName; string dataTest; - static Stream getItemTemplateStream (string path, Type declaringType) - { - Stream s = null; - if (path.StartsWith ("#", StringComparison.Ordinal)) { - string resId = path.Substring (1); - s = Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); - if (s == null) - s = Assembly.GetAssembly (declaringType).GetManifestResourceStream (resId); - if (s == null) - throw new Exception ($"Item Template not found '{path}'"); - } else { - if (!File.Exists (path)) - throw new FileNotFoundException ("Item Template not found: ", path); - s = new FileStream (path, FileMode.Open, FileAccess.Read); - } - return s; - } - #region CTOR /// /// Initializes a new instance of the class by parsing the file passed as argument. @@ -122,7 +104,7 @@ namespace Crow /// type this item will be choosen for, or member of the data item /// for hierarchical data, method to call for children fetching public ItemTemplate (Interface _iface, string path, Type declaringType, string _dataTest = "TypeOf", string _dataType = "default", string _fetchDataMethod = null) - : base(_iface, getItemTemplateStream(path, declaringType)) { + : base(_iface, _iface.GetTemplateStreamFromPath (path, declaringType)) { strDataType = _dataType; fetchMethodName = _fetchDataMethod; dataTest = _dataTest; diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 59b33cee..fd909ee7 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -7,7 +7,7 @@ 2.0 {B6D911CD-1D09-42FC-B300-9187190F2AE1} Exe - Crow.Coding + CrowIDE CrowIDE $(SolutionDir)build/$(Configuration) $(SolutionDir)build/obj/$(Configuration) @@ -68,8 +68,10 @@ - + + + Crow.Coding.MembersView.template @@ -109,124 +111,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - icons.move-arrows.svg - - - icons.eraser.svg - - - icons.light-bulb.svg - - - icons.pin.svg - - - icons.paint-brush.svg - - - icons.tools.svg - - - icons.trash.svg - - - icons.zoom-in.svg - - - icons.zoom-out.svg - - - icons.search.svg - - - icons.curly-brackets.svg - - - icons.compile.svg - - - icons.edit.svg - - - - icons.undo.svg - - - icons.redo.svg - - - icons.sign-out.svg - - - icons.file.svg - - - icons.palette.svg - Crow.Coding.EditPane.template @@ -239,33 +123,6 @@ - - icons.copy-file.svg - - - icons.paste-on-document.svg - - - icons.scissors.svg - - - icons.question.svg - - - icons.blank-file.svg - - - icons.cs-file.svg - - - icons.xml-file.svg - - - icons.save.svg - - - icons.open.svg - diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 2a791493..ca5a0440 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -1,4 +1,4 @@ -// +// // HelloCube.cs // // Author: @@ -44,40 +44,40 @@ namespace Crow.Coding CMDCompile; void initCommands () { - CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#icons.blank-file.svg"), CanExecute = true}; - CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#icons.open.svg") }; - CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#icons.save.svg"), CanExecute = false}; - CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#icons.save.svg"), CanExecute = false}; - CMDQuit = new Command(new Action(() => app.running = false)) { Caption = "Quit", Icon = new SvgPicture("#icons.sign-out.svg") }; - CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#icons.undo.svg"), CanExecute = false}; - CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#icons.redo.svg"), CanExecute = false}; - //CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#icons.scissors.svg"), CanExecute = false}; - //CMDCopy = new Command(new Action(() => Quit (null, null))) { Caption = "Copy", Icon = new SvgPicture("#icons.copy-file.svg"), CanExecute = false}; - //CMDPaste = new Command(new Action(() => Quit (null, null))) { Caption = "Paste", Icon = new SvgPicture("#icons.paste-on-document.svg"), CanExecute = false}; - CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#icons.question.svg") }; - CMDOptions = new Command(new Action(() => loadWindow("#Crow.Coding.ui.Options.crow"))) { Caption = "Editor Options", Icon = new SvgPicture("#icons.tools.svg") }; + CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#CrowIDE.icons.blank-file.svg"), CanExecute = true}; + CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#CrowIDE.icons.open.svg") }; + CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#CrowIDE.icons.save.svg"), CanExecute = false}; + CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#CrowIDE.icons.save.svg"), CanExecute = false}; + CMDQuit = new Command(new Action(() => app.running = false)) { Caption = "Quit", Icon = new SvgPicture("#CrowIDE.icons.sign-out.svg") }; + CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#CrowIDE.icons.undo.svg"), CanExecute = false}; + CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#CrowIDE.icons.redo.svg"), CanExecute = false}; + //CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#CrowIDE.icons.scissors.svg"), CanExecute = false}; + //CMDCopy = new Command(new Action(() => Quit (null, null))) { Caption = "Copy", Icon = new SvgPicture("#CrowIDE.icons.copy-file.svg"), CanExecute = false}; + //CMDPaste = new Command(new Action(() => Quit (null, null))) { Caption = "Paste", Icon = new SvgPicture("#CrowIDE.icons.paste-on-document.svg"), CanExecute = false}; + CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#CrowIDE.icons.question.svg") }; + CMDOptions = new Command(new Action(() => loadWindow("#CrowIDE.ui.Options.crow"))) { Caption = "Editor Options", Icon = new SvgPicture("#CrowIDE.icons.tools.svg") }; cmdCloseSolution = new Command(new Action(() => closeSolution())) - { Caption = "Close Solution", Icon = new SvgPicture("#icons.paste-on-document.svg"), CanExecute = false}; + { Caption = "Close Solution", Icon = new SvgPicture("#CrowIDE.icons.paste-on-document.svg"), CanExecute = false}; - CMDViewErrors = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow",this))) + CMDViewErrors = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winErrors.crow",this))) { Caption = "Errors pane"}; - CMDViewSolution = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow",this))) + CMDViewSolution = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winSolution.crow",this))) { Caption = "Solution Tree", CanExecute = false}; - CMDViewEditor = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow",this))) + CMDViewEditor = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winEditor.crow",this))) { Caption = "Editor Pane"}; - CMDViewProperties = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winProperties.crow",this))) + CMDViewProperties = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winProperties.crow",this))) { Caption = "Properties"}; - CMDViewDesign = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winDesign.crow",this))) + CMDViewDesign = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winDesign.crow",this))) { Caption = "Quick Design", CanExecute = true}; - CMDViewToolbox = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow",this))) + CMDViewToolbox = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winToolbox.crow",this))) { Caption = "Toolbox", CanExecute = false}; - CMDViewSchema = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winSchema.crow",this))) + CMDViewSchema = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winSchema.crow",this))) { Caption = "IML Shematic View", CanExecute = true}; - CMDViewStyling = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winStyleView.crow",this))) + CMDViewStyling = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winStyleView.crow",this))) { Caption = "Styling Explorer", CanExecute = true}; - CMDViewGTExp = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winGTExplorer.crow",this))) + CMDViewGTExp = new Command(new Action(() => loadWindow ("#CrowIDE.ui.DockWindows.winGTExplorer.crow",this))) { Caption = "Graphic Tree Explorer", CanExecute = true}; CMDCompile = new Command(new Action(() => compileSolution())) { Caption = "Compile", CanExecute = false}; @@ -159,7 +159,7 @@ namespace Crow.Coding initCommands (); - GraphicObject go = Load (@"#Crow.Coding.ui.CrowIDE.crow"); + GraphicObject go = Load (@"#CrowIDE.ui.CrowIDE.crow"); go.DataSource = this; mainDock = go.FindByName ("mainDock") as DockStack; @@ -173,13 +173,13 @@ namespace Crow.Coding instFileDlg = Instantiator.CreateFromImlFragment (MainIFace, ""); - /*DockWindow dw = loadWindow ("#Crow.Coding.ui.DockWindows.winEditor.crow", this) as DockWindow; + /*DockWindow dw = loadWindow ("#CrowIDE.ui.DockWindows.winEditor.crow", this) as DockWindow; dw.DockingPosition = Alignment.Center; dw.Dock (mainDock); - dw = loadWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow", this) as DockWindow; + dw = loadWindow ("#CrowIDE.ui.DockWindows.winSolution.crow", this) as DockWindow; dw.DockingPosition = Alignment.Right; dw.Dock (mainDock); - dw = loadWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow", this) as DockWindow; + dw = loadWindow ("#CrowIDE.ui.DockWindows.winToolbox.crow", this) as DockWindow; dw.DockingPosition = Alignment.Left; dw.Dock (mainDock);*/ @@ -187,7 +187,7 @@ namespace Crow.Coding } void loadProjProps () { - loadWindow ("#Crow.Coding.ui.ProjectProperties.crow"); + loadWindow ("#CrowIDE.ui.ProjectProperties.crow"); } void compileSolution () { //ProjectItem pi = CurrentSolution.SelectedItem; diff --git a/CrowIDE/src/Editors/ImlVisualEditor.cs b/CrowIDE/src/Editors/ImlVisualEditor.cs index 46becb62..a7ba8c67 100644 --- a/CrowIDE/src/Editors/ImlVisualEditor.cs +++ b/CrowIDE/src/Editors/ImlVisualEditor.cs @@ -67,15 +67,15 @@ namespace Crow.Coding void initCommands () { cmdDelete = new Crow.Command (new Action (() => deleteObject (SelectedItem))) - { Caption = "Delete", Icon = new SvgPicture ("#icons.save.svg"), CanExecute = true }; + { Caption = "Delete", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true }; Commands = new List (new Crow.Command[] { cmdDelete }); } void initIcons () { - icoMove = new SvgPicture ("#icons.move-arrows.svg"); + icoMove = new SvgPicture ("#CrowIDE.icons.move-arrows.svg"); // icoStyle = new SvgPicture (); - // icoStyle.Load (IFace, "#icons.palette.svg"); + // icoStyle.Load (IFace, "#CrowIDE.icons.palette.svg"); } [DefaultValue(true)] diff --git a/CrowIDE/src/Extensions.cs b/CrowIDE/src/Extensions.cs index 45873d3e..91084bc0 100644 --- a/CrowIDE/src/Extensions.cs +++ b/CrowIDE/src/Extensions.cs @@ -26,7 +26,7 @@ namespace Crow public static partial class Extensions { public static string GetIcon(this GraphicObject go){ - return "#icons.toolbox." + go.GetType().FullName + ".svg"; + return "#CrowIDE.icons.toolbox." + go.GetType().FullName + ".svg"; } public static List GetChildren(this GraphicObject go){ Type goType = go.GetType(); diff --git a/CrowIDE/src/GraphicObjectDesignContainer.cs b/CrowIDE/src/GraphicObjectDesignContainer.cs index d99b38cb..a8aea097 100644 --- a/CrowIDE/src/GraphicObjectDesignContainer.cs +++ b/CrowIDE/src/GraphicObjectDesignContainer.cs @@ -41,7 +41,7 @@ namespace Crow.Coding public Type CrowType; public string IconPath { - get { return "#icons.toolbox." + CrowType.FullName + ".svg"; } + get { return "#CrowIDE.icons.toolbox." + CrowType.FullName + ".svg"; } } public string DisplayName { get { return CrowType.Name; } diff --git a/CrowIDE/src/Project.cs b/CrowIDE/src/Project.cs index 3b406367..a3ffa636 100644 --- a/CrowIDE/src/Project.cs +++ b/CrowIDE/src/Project.cs @@ -57,18 +57,18 @@ namespace Crow.Coding { solution = sol; - cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#icons.save.svg"), CanExecute = true }; - cmdOpen = new Crow.Command (new Action (() => Load ())) { Caption = "Open", Icon = new SvgPicture ("#icons.open.svg"), CanExecute = false }; + cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true }; + cmdOpen = new Crow.Command (new Action (() => Load ())) { Caption = "Open", Icon = new SvgPicture ("#CrowIDE.icons.open.svg"), CanExecute = false }; cmdCompile = new Crow.Command (new Action (() => Compile ())) { Caption = "Compile", - Icon = "#icons.compile.svg" + Icon = "#CrowIDE.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 ("#icons.blank-file.svg"), + Icon = new SvgPicture ("#CrowIDE.icons.blank-file.svg"), CanExecute = true }; @@ -256,7 +256,7 @@ namespace Crow.Coding { public void AddNewFile () { - Window.Show (CrowIDE.MainIFace, "#Crow.Coding.ui.NewFile.crow", true).DataSource = this; + Window.Show (CrowIDE.MainIFace, "#CrowIDE.ui.NewFile.crow", true).DataSource = this; } public void Load () { diff --git a/CrowIDE/src/ProjectTree/ProjectFile.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs index 8d803faa..294a28f5 100644 --- a/CrowIDE/src/ProjectTree/ProjectFile.cs +++ b/CrowIDE/src/ProjectTree/ProjectFile.cs @@ -49,17 +49,17 @@ namespace Crow.Coding { void initCommands (){ cmdSave = new Crow.Command (new Action (() => Save ())) - { Caption = "Save", Icon = new SvgPicture ("#icons.save.svg"), CanExecute = false }; + { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = false }; cmdSaveAs = new Crow.Command (new Action (() => SaveAs ())) - { Caption = "Save As ..", Icon = new SvgPicture ("#icons.save.svg"), CanExecute = false }; + { Caption = "Save As ..", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = false }; cmdOpen = new Crow.Command (new Action (() => Open ())) - { Caption = "Open", Icon = new SvgPicture ("#icons.open.svg"), CanExecute = true }; + { Caption = "Open", Icon = new SvgPicture ("#CrowIDE.icons.open.svg"), CanExecute = true }; cmdClose = new Crow.Command (new Action (() => OnQueryClose (this,null))) - { Caption = "Close", Icon = new SvgPicture ("#icons.open.svg"), CanExecute = false }; + { Caption = "Close", Icon = new SvgPicture ("#CrowIDE.icons.open.svg"), CanExecute = false }; cmdUndo = new Crow.Command (new Action (() => Undo (null))) - { Caption = "Undo", Icon = new SvgPicture ("#icons.undo.svg"), CanExecute = false }; + { Caption = "Undo", Icon = new SvgPicture ("#CrowIDE.icons.undo.svg"), CanExecute = false }; cmdRedo = new Crow.Command (new Action (() => Redo (null))) - { Caption = "Redo", Icon = new SvgPicture ("#icons.redo.svg"), CanExecute = false }; + { Caption = "Redo", Icon = new SvgPicture ("#CrowIDE.icons.redo.svg"), CanExecute = false }; Commands.Insert (0, cmdOpen); Commands.Insert (1, cmdSave); diff --git a/CrowIDE/src/ProjectTree/ProjectItem.cs b/CrowIDE/src/ProjectTree/ProjectItem.cs index 695e372b..afa3e3ed 100644 --- a/CrowIDE/src/ProjectTree/ProjectItem.cs +++ b/CrowIDE/src/ProjectTree/ProjectItem.cs @@ -48,11 +48,11 @@ namespace Crow.Coding switch (Extension) { case ".cs": - return new SvgPicture("#icons.cs-file.svg"); + return new SvgPicture("#CrowIDE.icons.cs-file.svg"); case ".crow": - return new SvgPicture("#icons.xml-file.svg"); + return new SvgPicture("#CrowIDE.icons.xml-file.svg"); case ".xml": - return new SvgPicture("#icons.xml-file.svg"); + return new SvgPicture("#CrowIDE.icons.xml-file.svg"); default: return base.Icon; } diff --git a/CrowIDE/src/ProjectTree/ProjectNodes.cs b/CrowIDE/src/ProjectTree/ProjectNodes.cs index 5f518ff7..bafb9cbd 100644 --- a/CrowIDE/src/ProjectTree/ProjectNodes.cs +++ b/CrowIDE/src/ProjectTree/ProjectNodes.cs @@ -95,7 +95,7 @@ namespace Crow.Coding case ItemType.ProjectReference: return new SvgPicture("#Crow.Icons.projectRef.svg"); default: - return new SvgPicture("#icons.blank-file.svg"); + return new SvgPicture("#CrowIDE.icons.blank-file.svg"); } } } diff --git a/CrowIDE/ui/editors/EditPaneItems.template b/CrowIDE/ui/editors/EditPaneItems.template index 16db55f6..d9f253e1 100644 --- a/CrowIDE/ui/editors/EditPaneItems.template +++ b/CrowIDE/ui/editors/EditPaneItems.template @@ -4,15 +4,15 @@