--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<path fill="#dddddd" d="M0 8l4.9 1.4h0.1v-0.1l7.1-5.3-1.1 1.2-6.2 6.6 0.2 3.2 2.9-3.2 2.1 4.2 6-16z"></path>
+</svg>
proj = FlattenProjects.FirstOrDefault (p=>p.FullPath == projectFullPath);
return proj != null;
}
+ public bool TryGetContainingProject (string fullPath, out Project containingProject) {
+ containingProject = FlattenProjects.FirstOrDefault (p => p.ContainsFile (fullPath));
+ return containingProject != null;
+ }
+
public Document CurrentDocument {
get => currentDocument;
protected void loadPlugins () {
if (string.IsNullOrEmpty (PluginsDirecory))
PluginsDirecory = Path.Combine (
- Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), ".config", "CrowEdit", "Plugins");
+ Environment.GetFolderPath (Environment.SpecialFolder.UserProfile), ".config", "CrowEdit", "plugins");
foreach (string pluginDir in Directory.GetDirectories (PluginsDirecory)) {
Plugin plugin = new Plugin (pluginDir);
public event EventHandler Unselected;
public virtual bool IsSelected {
- get { return isSelected; }
+ get => isSelected;
set {
if (value == isSelected)
return;
namespace CrowEditBase
{
public abstract class Document : CrowEditComponent {
+ protected Project project;
public Document (string fullPath) {
initCommands ();
FullPath = fullPath;
+ App.TryGetContainingProject (FullPath, out project);
}
public event EventHandler CloseEvent;
public void SelectDocument () => IsSelected = true;
}
}
}
+ public virtual bool ContainsFile (string fullPath) => false;
public bool HasChildren => subProjects?.Count > 0;
public string FullPath { get ; private set; }
pn.Parent = null;
children.Remove (pn);
}
-
+ /*public override bool IsSelected {
+ get => base.IsSelected;
+ set {
+ base.IsSelected = value;
+ if (isSelected) {
+ TreeNode pn = Parent;
+ while (pn != null) {
+ pn.IsExpanded = true;
+ pn = pn.Parent;
+ }
+ }
+ }
+ }*/
public virtual bool IsExpanded {
get { return isExpanded; }
set {
CMDEventHistoryBackward = new Command("back.", currentEventHistoryGoBack, "#icons.previous.svg", false);
CMDEventHistoryForward = new Command("forw.", currentEventHistoryGoForward, "#icons.forward-arrow.svg", false);
}
-
- public Command CMDOptions_SelectCrowAssemblyLocation => new Command ("...",
- () => {
- FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
- <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
- ShowFiles='true' ShowHidden='true' />");
- dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
- dlg.DataSource = this;
- }
- );
-
public void LoadIML (string imlSource) {
if (CurrentState == Status.Running)
delSetSource (imlSource);
CurrentState = Status.Paused;
}
public override string ConfigurationWindowPath => "#CECrowPlugin.ui.winConfiguration.crow";
- public Command CMDOptions_SelectCrowDbgAssemblyLocation => new Command ("...",
- () => {
+ public Command CMDOptions_SelectCrowAssemblyLocation => new Command ("...",
+ () => {
FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
- <FileDialog Caption='Select Crow dll' CurrentDirectory='{CrowDbgAssemblyLocation}'
+ <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
ShowFiles='true' ShowHidden='true' />");
dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
dlg.DataSource = this;
}
);
+
protected override void onStateChange(Status previousState, Status newState)
{
base.onStateChange(previousState, newState);
</HorizontalStack>
<HorizontalStack Height="Fit">
<TextBox Height="Fit" Text="{²CrowDbgAssemblyLocation}" Margin="2"/>
- <Button Command="{CMDOptions_SelectCrowDbgAssemblyLocation}" MinimumSize="0,0"/>
+ <Button Command="{CMDOptions_SelectCrowAssemblyLocation}" MinimumSize="0,0"/>
</HorizontalStack>
<Label Background="Red" Foreground="White" Margin="5" Width="Stretched" Text="{ServiceErrorMessage}"
IsVisible="{ServiceIsInError}"/>
Load ();
commands = new CommandGroup (CMDLoad, CMDUnload, CMDReload);
+ if (OutputKind != OutputKind.DynamicallyLinkedLibrary)
+ commands.Add (new Command ("Set as startup",() => solutionProject.StartupProject = this));
+
foreach (string target in defaultTargets)
Commands.Add (new Crow.Command (target, () => Build (target)));
}
CommandGroup commands;
+ public Command CMDSetAsStartupProject;
public override CommandGroup Commands => commands;
}
return false;
}
- }
-
+ }
+ public bool IsStartupProject => solutionProject.StartupProject == this;
+ public override bool ContainsFile (string fullPath) =>
+ rootNode.Flatten.OfType<ProjectItemNode> ().Any (f => f.FullPath == fullPath);
void populateTreeNodes ()
{
}
public override string Name => Path.GetFileNameWithoutExtension (FullPath);
public override string Icon => "#icons.file_type_sln2.svg";
+ public Project StartupProject {
+ get => Flatten.FirstOrDefault (p => p.FullPath == UserConfig.Get<string> ("StartupProject"));
+ set {
+ if (value == StartupProject)
+ return;
+
+ StartupProject?.NotifyValueChanged ("IsStartupProject", false);
+ if (value == null)
+ UserConfig.Set ("StartupProject", "");
+ else {
+ UserConfig.Set ("StartupProject", value.FullPath);
+ value.NotifyValueChanged("IsStartupProject", true);
+ }
+ NotifyValueChanged ("StartupProject", StartupProject);
+ }
+ }
public override void Load () {
projectCollection = new ProjectCollection (
null,
--- /dev/null
+<?xml version="1.0"?>
+<Expandable Caption="{Caption}" IsExpanded="{²IsExpanded}" BubbleMouseEvent="None" ContextCommands="{Commands}">
+ <HorizontalStack Height="Fit">
+ <Shape Foreground="DimGrey" Background="Transparent"
+ Path="M 5.5,0 L 5.5,11 G" Size="11,11" Width="11" Height="Stretched" KeepProportions="false" Margin="0"/>
+ <VerticalStack Height="Fit" Name="ItemsContainer"/>
+ </HorizontalStack>
+ <Template>
+ <VerticalStack>
+ <ListItem Margin="1" IsSelected="{²IsSelected}"
+ Selected="{Background=RoyalBlue}"
+ Unselected="{Background=Transparent}">
+ <HorizontalStack Spacing="5" MouseDoubleClick="./onClickForExpand">
+ <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+ Path="{./Image}"
+ Visible="{./IsExpandable}"
+ SvgSub="{./IsExpanded}"
+ MouseEnter="{Background=LightGrey}"
+ MouseLeave="{Background=Transparent}"/>
+ <Image Style="TreeIcon"
+ Path="{Icon}" SvgSub="{IconSub}"/>
+ <Label Style="TreeLabel" Text="{./Caption}"/>
+ <Image Style="TreeIcon" Path="#icons.startup.svg" IsVisible="{IsStartupProject}"/>
+ </HorizontalStack>
+ </ListItem>
+ <Container Name="Content" Visible="false"/>
+ </VerticalStack>
+ </Template>
+</Expandable>
+
</ItemTemplate>
- <ItemTemplate DataType="CERoslynPlugin.MSBuildProject" Data="Children" Path="#CrowEditBase.ui.TreeExpandable.template" />
+ <ItemTemplate DataType="CERoslynPlugin.MSBuildProject" Data="Children" Path="#CERoslynPlugin.ui.MSBuildProjectNode.template" />
<ItemTemplate DataType="CrowEditBase.VirtualNode" Data="Childs" Path="#CrowEditBase.ui.TreeExpandable.template" />
<ItemTemplate DataType="CrowEditBase.Project" Data="SubProjects" Path="#CrowEditBase.ui.TreeExpandable.template" />