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<string, ItemTemplate>).GetMethod ("set_Item", new Type[] { typeof(string), typeof(ItemTemplate) });
if (string.IsNullOrEmpty(_template))
loadTemplate ();
else
- loadTemplate (IFace.CreateInstance (_template));
+ loadTemplate (IFace.CreateTemplateInstance (_template, this.GetType()));
}
}
/// <summary>
} 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
}
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)) {
/// on the first instance creation of a IML item.
/// </summary>
public Dictionary<String, Instantiator> Instantiators = new Dictionary<string, Instantiator>();
+ public Dictionary<String, Instantiator> Templates = new Dictionary<string, Instantiator> ();
/// <summary>
/// default templates dic by metadata token
/// </summary>
#region Load/Save
+ /// <summary>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
+ /// </summary>
+ /// <returns>The template stream</returns>
+ 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;
+ }
/// <summary>Open file or find a resource from path string</summary>
/// <returns>A file or resource stream</returns>
/// <param name="path">This could be a normal file path, or an embedded ressource ID
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 {
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);
}
}
/// <summary>
+ /// Create an instance of a GraphicObject linked to this interface but not added to the GraphicTree
+ /// </summary>
+ /// <returns>new instance of graphic object created</returns>
+ /// <param name="path">path of the iml file to load</param>
+ 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);
+ }
+ }
+ /// <summary>
/// Fetch instantiator from cache or create it.
/// </summary>
/// <returns>new Instantiator</returns>
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
/// <summary>
/// Initializes a new instance of the <see cref="Crow.ItemTemplate"/> class by parsing the file passed as argument.
/// <param name="_dataType">type this item will be choosen for, or member of the data item</param>
/// <param name="_fetchDataMethod">for hierarchical data, method to call for children fetching</param>
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;
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B6D911CD-1D09-42FC-B300-9187190F2AE1}</ProjectGuid>
<OutputType>Exe</OutputType>
- <RootNamespace>Crow.Coding</RootNamespace>
+ <RootNamespace>CrowIDE</RootNamespace>
<AssemblyName>CrowIDE</AssemblyName>
<OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath>
<IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath>
<Folder Include="src\ProjectTree\msbuild\" />
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="images\save.svg" />
<EmbeddedResource Include="IDE.style" />
+ <EmbeddedResource Include="icons\**\*.svg"/>
+
+ <EmbeddedResource Include="images\save.svg" />
<EmbeddedResource Include="ui\MembersView.template">
<LogicalName>Crow.Coding.MembersView.template</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="ui\DockWindows\winProperties.crow" />
<EmbeddedResource Include="ui\DockWindows\winToolbox.crow" />
<EmbeddedResource Include="ui\DockWindows\toolboxBut.template" />
- <EmbeddedResource Include="icons\toolbox\bar-chart.svg" />
- <EmbeddedResource Include="icons\toolbox\bar-menu.svg" />
- <EmbeddedResource Include="icons\toolbox\bullets.svg" />
- <EmbeddedResource Include="icons\toolbox\calendar.svg" />
- <EmbeddedResource Include="icons\toolbox\check-square-1.svg" />
- <EmbeddedResource Include="icons\toolbox\database.svg" />
- <EmbeddedResource Include="icons\toolbox\ellipsis.svg" />
- <EmbeddedResource Include="icons\toolbox\file-code.svg" />
- <EmbeddedResource Include="icons\toolbox\grab.svg" />
- <EmbeddedResource Include="icons\toolbox\hash.svg" />
- <EmbeddedResource Include="icons\toolbox\line-list.svg" />
- <EmbeddedResource Include="icons\toolbox\list.svg" />
- <EmbeddedResource Include="icons\toolbox\package.svg" />
- <EmbeddedResource Include="icons\toolbox\pointer.svg" />
- <EmbeddedResource Include="icons\toolbox\puzzle-piece.svg" />
- <EmbeddedResource Include="icons\toolbox\refresh-file.svg" />
- <EmbeddedResource Include="icons\toolbox\sliders.svg" />
- <EmbeddedResource Include="icons\toolbox\split-browser-1.svg" />
- <EmbeddedResource Include="icons\toolbox\table.svg" />
- <EmbeddedResource Include="icons\toolbox\tasks.svg" />
- <EmbeddedResource Include="icons\toolbox\picture-file.svg" />
- <EmbeddedResource Include="icons\toolbox\warning.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Button.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TextBox.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Label.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.CheckBox.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Spinner.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Container.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Group.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.HorizontalStack.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.VerticalStack.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Splitter.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.ListBox.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.ComboBox.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TreeView.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TabView.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Docker.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Window.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Slider.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.ProgressBar.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Grid.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Image.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TemplatedContainer.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TemplatedGroup.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.IMLContainer.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Wrapper.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.ColorPicker.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Border.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.GroupBox.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.ScrollBar.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Menu.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.MenuItem.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Shape.svg" />
- <EmbeddedResource Include="icons\toolbox\padding.svg" />
- <EmbeddedResource Include="icons\toolbox\modal-list.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Scroller.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.FileDialog.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.TabItem.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.Expandable.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.DirectoryView.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.MessageBox.svg" />
- <EmbeddedResource Include="icons\toolbox\options.svg" />
- <EmbeddedResource Include="icons\toolbox\Crow.RadioButton.svg" />
- <EmbeddedResource Include="icons\move-arrows.svg">
- <LogicalName>icons.move-arrows.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\eraser.svg">
- <LogicalName>icons.eraser.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\light-bulb.svg">
- <LogicalName>icons.light-bulb.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\pin.svg">
- <LogicalName>icons.pin.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\paint-brush.svg">
- <LogicalName>icons.paint-brush.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\tools.svg">
- <LogicalName>icons.tools.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\trash.svg">
- <LogicalName>icons.trash.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\zoom-in.svg">
- <LogicalName>icons.zoom-in.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\zoom-out.svg">
- <LogicalName>icons.zoom-out.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\search.svg">
- <LogicalName>icons.search.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\curly-brackets.svg">
- <LogicalName>icons.curly-brackets.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\compile.svg">
- <LogicalName>icons.compile.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\edit.svg">
- <LogicalName>icons.edit.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\text-file.svg" />
- <EmbeddedResource Include="icons\undo.svg">
- <LogicalName>icons.undo.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\redo.svg">
- <LogicalName>icons.redo.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\sign-out.svg">
- <LogicalName>icons.sign-out.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\file.svg">
- <LogicalName>icons.file.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\palette.svg">
- <LogicalName>icons.palette.svg</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="ui\editors\EditPane.template">
<LogicalName>Crow.Coding.EditPane.template</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="ui\editors\SvgEdit.itemp" />
<EmbeddedResource Include="ui\DockWindows\winGTExplorer.crow" />
<EmbeddedResource Include="ui\DockWindows\GTreeExpITemp.crow" />
- <EmbeddedResource Include="icons\copy-file.svg">
- <LogicalName>icons.copy-file.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\paste-on-document.svg">
- <LogicalName>icons.paste-on-document.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\scissors.svg">
- <LogicalName>icons.scissors.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\question.svg">
- <LogicalName>icons.question.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\blank-file.svg">
- <LogicalName>icons.blank-file.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\cs-file.svg">
- <LogicalName>icons.cs-file.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\xml-file.svg">
- <LogicalName>icons.xml-file.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\save.svg">
- <LogicalName>icons.save.svg</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\open.svg">
- <LogicalName>icons.open.svg</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="ui\NewFile.crow" />
<EmbeddedResource Include="ui\DockWindows\winSchema.crow" />
<EmbeddedResource Include="ui\DockWindows\WinSchemaItem.template" />
-//
+//
// HelloCube.cs
//
// Author:
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};
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;
instFileDlg = Instantiator.CreateFromImlFragment
(MainIFace, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
- /*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);*/
}
void loadProjProps () {
- loadWindow ("#Crow.Coding.ui.ProjectProperties.crow");
+ loadWindow ("#CrowIDE.ui.ProjectProperties.crow");
}
void compileSolution () {
//ProjectItem pi = CurrentSolution.SelectedItem;
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<Crow.Command> (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)]
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<GraphicObject> GetChildren(this GraphicObject go){
Type goType = go.GetType();
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; }
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
};
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 () {
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);
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;
}
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");
}
}
}
<Label Text="Error" Background="Red"/>
</TabItem>
</ItemTemplate>
-<ItemTemplate Path="#Crow.Coding.ui.editors.SvgEdit.itemp" DataType=".svg"/>
-<ItemTemplate Path="#Crow.Coding.ui.editors.SrcEdit.itemp" DataType=".cs"/>
-<ItemTemplate Path="#Crow.Coding.ui.editors.SrcEdit.itemp" DataType=".style"/>
-<ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".crow"/>
-<ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".itemp"/>
-<ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".template"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.SvgEdit.itemp" DataType=".svg"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.SrcEdit.itemp" DataType=".cs"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.SrcEdit.itemp" DataType=".style"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.IMLEdit.itemp" DataType=".crow"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.IMLEdit.itemp" DataType=".itemp"/>
+<ItemTemplate Path="#CrowIDE.ui.editors.IMLEdit.itemp" DataType=".template"/>
<ItemTemplate DataType=".goml">
<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
- <IMLContainer Path="#Crow.Coding.ui.editors.TextEditor.crow"/>
+ <IMLContainer Path="#CrowIDE.ui.editors.TextEditor.crow"/>
</TabItem>
</ItemTemplate>
</HorizontalStack>
</VerticalStack>
<Splitter/>
- <IMLContainer Path="#Crow.Coding.ui.editors.SourceEditor.crow"/>
+ <IMLContainer Path="#CrowIDE.ui.editors.SourceEditor.crow"/>
<Splitter Visible="{../editor.HasError}"/>
<Label DataSource="{../editor.Error}" Text="{}"
Visible="{../editor.HasError}"
<?xml version="1.0" encoding="UTF-8" ?>
<TabItem QueryClose="OnQueryClose" IsSelected="{²IsSelected}" Template="#Crow.Coding.EditTabItem.template">
- <IMLContainer Path="#Crow.Coding.ui.editors.SourceEditor.crow"/>
+ <IMLContainer Path="#CrowIDE.ui.editors.SourceEditor.crow"/>
</TabItem>
\ No newline at end of file