Browse files

Implemented showing the solution tree in the solution explorer.

The solution explorer now shows the solution / project tree.
Fixed exception catch on Linux platform to not rethrow if exiting.
  • Loading branch information...
1 parent 3749bf7 commit 5b46b34d0e1a4b53bc4fb12560f511acc1f0c003 @hach-que hach-que committed Jun 24, 2012
View
17 ide/src/Moai.IDE/Moai.IDE.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -10,10 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Moai.IDE</RootNamespace>
<AssemblyName>Moai.IDE</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
- <StartupObject>
- </StartupObject>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -24,6 +21,11 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <EnvironmentVariables>
+ <EnvironmentVariables>
+ <Variable name="LD_LIBRARY_PATH" value="." />
+ </EnvironmentVariables>
+ </EnvironmentVariables>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -34,10 +36,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Newtonsoft.Json.Net35, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\libraries\Newtonsoft.Json.Net35.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -51,6 +49,9 @@
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="Newtonsoft.Json.Net35">
+ <HintPath>..\..\libraries\Newtonsoft.Json.Net35.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\VersionInfo.cs">
View
1 ide/src/Moai.Platform.Linux/LinuxIDE.cs
@@ -51,6 +51,7 @@ protected override void ShowEvent(QShowEvent arg1)
public void Exit()
{
+ LinuxPlatform.ShuttingDown = true;
this.c_Documents.Clear();
QApplication.Quit();
}
View
4 ide/src/Moai.Platform.Linux/LinuxPlatform.cs
@@ -10,6 +10,7 @@ namespace Moai.Platform.Linux
public class LinuxPlatform : IPlatform
{
private static readonly ILog m_Log = LogManager.GetLogger(typeof(LinuxPlatform));
+ internal static bool ShuttingDown = false;
public LinuxPlatform()
{
@@ -32,7 +33,8 @@ public void RunIDE(IIDE ide)
catch (Exception e)
{
m_Log.Error("An exception occurred while running the Linux platform.", e);
- throw new ApplicationException("The application is unable to continue due to an inconsistant Qt state.", e);
+ if (!LinuxPlatform.ShuttingDown)
+ throw new ApplicationException("The application is unable to continue due to an inconsistant Qt state.", e);
}
}
View
17 ide/src/Moai.Platform.Linux/Moai.Platform.Linux.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -10,7 +10,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Moai.Platform.Linux</RootNamespace>
<AssemblyName>Moai.Platform.Linux</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -44,18 +43,18 @@
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
- <Reference Include="qt-dotnet">
- <HintPath>..\..\..\..\..\..\..\..\usr\lib\mono\gac\qt-dotnet\4.5.0.0__194a23ba31c08164\qt-dotnet.dll</HintPath>
- </Reference>
- <Reference Include="qscintilla">
- <HintPath>..\..\..\..\..\..\..\..\usr\lib\mono\gac\qscintilla\2.2.0.0__194a23ba31c08164\qscintilla.dll</HintPath>
- </Reference>
<Reference Include="log4net">
<HintPath>..\..\libraries\log4net.dll</HintPath>
</Reference>
<Reference Include="qtwebkit">
<HintPath>..\..\..\..\..\..\..\..\usr\lib\mono\gac\qtwebkit\2.2.0.0__194a23ba31c08164\qtwebkit.dll</HintPath>
</Reference>
+ <Reference Include="qt-dotnet">
+ <HintPath>..\..\..\..\..\..\..\..\usr\lib\mono\gac\qt-dotnet\4.5.0.0__194a23ba31c08164\qt-dotnet.dll</HintPath>
+ </Reference>
+ <Reference Include="qscintilla">
+ <HintPath>..\..\..\..\..\..\..\..\usr\lib\mono\gac\qscintilla\2.2.0.0__194a23ba31c08164\qscintilla.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\VersionInfo.cs">
@@ -126,4 +125,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
555 ide/src/Moai.Platform.Linux/Tools/SolutionExplorerTool.cs
@@ -6,132 +6,529 @@
using Moai.Platform.Management;
using Moai.Platform.Linux.UI;
using Qyoto;
+using log4net;
namespace Moai.Platform.Linux.Tools
{
public partial class SolutionExplorerTool : Tool
{
+ private static readonly ILog m_Log = LogManager.GetLogger(typeof(SolutionExplorerTool));
+
+ private SolutionModel m_CurrentModel = null;
+ private LinuxImageList m_LinuxImageList = null;
+
public SolutionExplorerTool()
{
InitializeComponent();
this.Title = "Solution Explorer";
+
+ // Set the image list.
+ this.m_LinuxImageList = Associations.ImageList as LinuxImageList;
+
+ // Set the solution model.
+ m_Log.Debug("Setting solution model to tool window.");
+ this.c_TreeView.HeaderHidden = true;
+ this.m_CurrentModel = new SolutionModel(this);
+ LinuxNativePool.Instance.Retain(this.m_CurrentModel);
+ this.c_TreeView.SetModel(this.m_CurrentModel);
+ m_Log.Debug("Solution model has been initialized.");
+
+ }
+
+ ~SolutionExplorerTool()
+ {
+ //LinuxNativePool.Instance.Release();
}
public override void OnSolutionLoaded()
{
- this.ReloadTree();
+ base.OnSolutionLoaded();
+
+ this.m_CurrentModel.Refresh();
}
public override void OnSolutionUnloaded()
{
- this.ReloadTree();
+ base.OnSolutionLoaded();
+
+ this.m_CurrentModel.Refresh();
}
- protected override void MousePressEvent(Qyoto.QMouseEvent arg1)
+ public override ToolPosition DefaultState
{
- //
- //this.SetMinimumSize(16777215, 16777215);
+ get
+ {
+ return ToolPosition.DockRight;
+ }
}
- protected override void ShowEvent(Qyoto.QShowEvent arg1)
+ private class SolutionModel : QAbstractItemModel
{
- //this.Resize(600, this.Height());
+ private static readonly ILog m_Log = LogManager.GetLogger(typeof(SolutionModel));
- //this.Widget().Resize(250, 16777215);
- //this.SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);
- //this.Widget().SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding);
- //this.SetGeometry(0, 0, 250, this.Widget().Height());
- }
+ private SolutionExplorerTool m_ExplorerTool = null;
+ private SolutionItem m_RootItem = new SolutionItem();
- public void ReloadTree()
- {
- // Search the tree node for events to disconnect from.
- /*if (this.c_SolutionTree.Nodes.Count > 0)
+ /// <summary>
+ /// Creates a new solution model based on the current system.
+ /// </summary>
+ public SolutionModel(SolutionExplorerTool tool)
+ {
+ m_Log.Debug("Creating new solution model.");
+ this.m_ExplorerTool = tool;
+ }
+
+ public void Refresh()
+ {
+ this.Reset();
+ }
+
+ public override QModelIndex Index(int row, int column, QModelIndex parent)
{
- foreach (TreeNode tn in this.c_SolutionTree.Nodes[0].Nodes)
+ string start = "Index at " + row + ", " + column + " requested with parent " + this.SerializeModelIndex(parent) + "";
+
+ if (!this.HasIndex(row, column, parent))
{
- if (tn.Tag is Project)
- {
- (tn.Tag as Project).FileAdded -= new EventHandler(OnReloadRequired);
- (tn.Tag as Project).FileRemoved -= new EventHandler(OnReloadRequired);
- }
+ m_Log.Debug(start + " (answer: empty).");
+ return new QModelIndex();
+ }
+
+ SolutionItem parentItem;
+ if (!parent.IsValid())
+ parentItem = this.m_RootItem;
+ else
+ parentItem = parent.InternalPointer() as SolutionItem;
+
+ SolutionItem childItem = parentItem[row];
+ if (childItem != null)
+ {
+ QModelIndex model = this.CreateIndex(row, column, childItem);
+ m_Log.Debug(start + " (answer: " + this.SerializeModelIndex(model) + ").");
+ return model;
+ }
+ else
+ {
+ m_Log.Debug(start + " (answer: empty).");
+ return new QModelIndex();
+ }
+ }
+
+ public override QModelIndex Parent(QModelIndex child)
+ {
+ string start = "Parent of " + this.SerializeModelIndex(child) + " requested";
+
+ if (!child.IsValid())
+ {
+ m_Log.Debug(start + " (answer: empty).");
+ return new QModelIndex();
+ }
+
+ SolutionItem childItem = child.InternalPointer() as SolutionItem;
+ SolutionItem parentItem = childItem.Parent;
+
+ if (parentItem == this.m_RootItem || parentItem == null)
+ {
+ // FIXME: This can cause weirdness with broken trees as the root node
+ // will be placed under folders if the structure is incorrect!
+ m_Log.Debug(start + " (answer: empty).");
+ return new QModelIndex();
}
- }*/
- // Fill the solution explorer with the tree nodes.
- /*try
+ QModelIndex result = this.CreateIndex(parentItem.Index, 0, parentItem);
+ m_Log.Debug(start + " (answer: " + this.SerializeModelIndex(result) + ").");
+ return result;
+ }
+
+ public override int RowCount(QModelIndex parent)
{
- this.c_TreeStore.Clear();
- if (Central.Manager.ActiveSolution != null)
- this.Wrap(Central.Manager.ActiveSolution);
- this.c_TreeView.ExpandAll();
+ string start = "Row count of " + this.SerializeModelIndex(parent) + " requested";
+
+ SolutionItem parentItem;
+ if (parent.Column() > 0)
+ {
+ m_Log.Debug(start + " (answer: 0).");
+ return 0;
+ }
+
+ if (!parent.IsValid())
+ parentItem = this.m_RootItem;
+ else
+ parentItem = parent.InternalPointer() as SolutionItem;
+
+ m_Log.Debug(start + " (answer: " + parentItem.Count + ").");
+ return parentItem.Count;
}
- catch (Exception e)
+
+ public override int ColumnCount(QModelIndex parent)
{
- }*/
+ m_Log.Debug("Column count of " + this.SerializeModelIndex(parent) + " requested (answer: 1).");
+
+ return 1;
+ }
- // Search the tree node for events to listen to.
- /*if (this.c_SolutionTree.Nodes.Count > 0)
+ public override QVariant Data(QModelIndex index, int role)
{
- foreach (TreeNode tn in this.c_SolutionTree.Nodes[0].Nodes)
+ string start = "Data of " + this.SerializeModelIndex(index) + " requested with role " + role;
+
+ if (!index.IsValid())
+ {
+ m_Log.Debug(start + " (answer: empty).");
+ return new QVariant();
+ }
+
+ if (role != (int)ItemDataRole.DisplayRole && role != (int)ItemDataRole.DecorationRole)
{
- if (tn.Tag is Project)
+ m_Log.Debug(start + " (answer: empty).");
+ return new QVariant();
+ }
+
+ if (index.Column() == 0)
+ {
+ if (role == (int)ItemDataRole.DisplayRole)
+ {
+ m_Log.Debug(start + " (answer: \"" + (index.InternalPointer() as SolutionItem).Text + "\").");
+ return (index.InternalPointer() as SolutionItem).Text;
+ }
+ else if (role ==(int)ItemDataRole.DecorationRole)
{
- (tn.Tag as Project).FileAdded += new EventHandler(OnReloadRequired);
- (tn.Tag as Project).FileRemoved += new EventHandler(OnReloadRequired);
+ string key = (index.InternalPointer() as SolutionItem).ImageKey;
+ System.Drawing.Image image = this.m_ExplorerTool.m_LinuxImageList[key];
+ if (image == null)
+ m_Log.Error("No association icon found for image key '" + key + "'.");
+ else
+ {
+ m_Log.Debug(start + " (answer: <qicon>).");
+ return LinuxImageList.ConvertToQIcon(image);
+ }
}
}
- }
- */
- }
- /*
- private TreeIter Wrap(Solution solution)
- {
- TreeIter ti = this.c_TreeStore.AppendValues(new SolutionTreeNode(solution));
- foreach (Project p in solution.Projects)
- this.Wrap(ti, p);
- return ti;
- }
+ m_Log.Debug(start + " (answer: empty).");
+ return new QVariant();
+ }
- private TreeIter Wrap(TreeIter parent, Project project)
- {
- TreeIter ti = this.c_TreeStore.AppendValues(parent, new ProjectTreeNode(project));
- foreach (File f in project.Files)
+ public override uint Flags(QModelIndex index)
{
- if (f is Folder)
- this.Wrap(ti, f as Folder);
- else
- this.c_TreeStore.AppendValues(ti, new FileTreeNode(f));
+ m_Log.Debug("Flags of " + this.SerializeModelIndex(index) + " requested.");
+
+ if (!index.IsValid())
+ return 0;
+
+ return (uint)(ItemFlag.ItemIsEnabled | ItemFlag.ItemIsSelectable);
}
- return ti;
- }
- private TreeIter Wrap(TreeIter parent, Folder folder)
- {
- TreeIter ti = this.c_TreeStore.AppendValues(parent, new FileTreeNode(folder));
- foreach (File f in folder.Files)
+ private string SerializeModelIndex(QModelIndex index)
{
- if (f is Folder)
- this.Wrap(ti, f as Folder);
- else
- this.c_TreeStore.AppendValues(ti, new FileTreeNode(f));
- }
- return ti;
- }
+ if (index == null)
+ return "<null>";
+ else if (!index.IsValid())
+ return "<invalid>";
- private void t_DataFunc(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
- {
- BaseTreeNode node = model.GetValue(iter, 0) as BaseTreeNode;
- (cell as CellRendererText).Text = node.Text;
- }
- */
+ return "<valid>";
+ //return "(" + this.SerializeModelIndex(index.Parent()) + ", " + index.Row() + ", " + index.Column() + ")";
+ }
- public override ToolPosition DefaultState
- {
- get
+ private class SolutionItem
{
- return ToolPosition.DockRight;
+ private static readonly ILog m_Log = LogManager.GetLogger(typeof(SolutionModel));
+
+ private bool m_IsRoot = false;
+ private Solution m_Solution = null;
+ private Project m_Project = null;
+ private File m_File = null;
+
+ /// <summary>
+ /// Creates a new item object representing the root node.
+ /// </summary>
+ public SolutionItem()
+ {
+ m_Log.Debug("Creating new solution item to represent root node.");
+ this.m_IsRoot = true;
+ }
+
+ /// <summary>
+ /// Creates a new item object representing the solution information.
+ /// </summary>
+ /// <param name='solution'>The solution to represent.</param>
+ public SolutionItem(Solution solution)
+ {
+ if (solution == null)
+ throw new ArgumentNullException("solution");
+ try
+ {
+ m_Log.Debug("Creating new solution item to represent solution '" + solution.SolutionInfo.Name + "'.");
+ }
+ catch
+ {
+ m_Log.Debug("Creating new solution item to represent solution '<unknown>'.");
+ }
+ this.m_Solution = solution;
+ }
+
+ /// <summary>
+ /// Creates a new item object representing the project information.
+ /// </summary>
+ /// <param name='project'>The project to represent.</param>
+ public SolutionItem(Project project)
+ {
+ if (project == null)
+ throw new ArgumentNullException("project");
+ try
+ {
+ m_Log.Debug("Creating new solution item to represent project '" + project.ProjectInfo.Name + "'.");
+ }
+ catch
+ {
+ m_Log.Debug("Creating new solution item to represent project '<unknown>'.");
+ }
+ this.m_Project = project;
+ }
+
+ /// <summary>
+ /// Creates a new item object representing the file or folder information.
+ /// </summary>
+ /// <param name='project'>The file or folder to represent.</param>
+ public SolutionItem(File file)
+ {
+ if (file == null)
+ throw new ArgumentNullException("file");
+ try
+ {
+ m_Log.Debug("Creating new solution item to represent file '" + file.FileInfo.Name + "'.");
+ }
+ catch
+ {
+ m_Log.Debug("Creating new solution item to represent file '<unknown>'.");
+ }
+ this.m_File = file;
+ }
+
+ /// <summary>
+ /// The image that represents this solution item.
+ /// </summary>
+ public string ImageKey
+ {
+ get
+ {
+ m_Log.Debug("Retrieving image information for " + this.ToString() + " (answer: \"image\").");
+ if (this.m_IsRoot)
+ return "NotFound";
+ else if (this.m_Solution != null)
+ return (this.m_Solution.GetSyncData() as FileSyncData).ImageKey;
+ else if (this.m_Project != null)
+ return (this.m_Project.GetSyncData() as FileSyncData).ImageKey;
+ else if (this.m_File != null)
+ return (this.m_File.GetSyncData() as FileSyncData).ImageKey;
+ else
+ return "NotFound";
+ }
+ }
+
+ /// <summary>
+ /// The text that represents this solution item.
+ /// </summary>
+ public string Text
+ {
+ get
+ {
+ m_Log.Debug("Retrieving text information for " + this.ToString() + ".");
+ if (this.m_IsRoot)
+ return "<root>";
+ else if (this.m_Solution != null)
+ return (this.m_Solution.GetSyncData() as FileSyncData).Text;
+ else if (this.m_Project != null)
+ return (this.m_Project.GetSyncData() as FileSyncData).Text;
+ else if (this.m_File != null)
+ return (this.m_File.GetSyncData() as FileSyncData).Text;
+ else
+ return "<unknown>";
+ }
+ }
+
+ /// <summary>
+ /// The parent solution item of this solution item.
+ /// </summary>
+ public SolutionItem Parent
+ {
+ get
+ {
+ m_Log.Debug("Retrieving parent of " + this.ToString() + ".");
+ return this.FindImmediateParent();
+ }
+ }
+
+ /// <summary>
+ /// The index of this solution item within it's parent.
+ /// </summary>
+ public int Index
+ {
+ get
+ {
+ m_Log.Debug("Retrieving index of " + this.ToString() + ".");
+ SolutionItem parent = this.Parent;
+ if (parent.m_Solution != null)
+ return parent.m_Solution.Projects.IndexOf(this.m_Project);
+ else if (parent.m_Project != null)
+ return parent.m_Project.Files.IndexOf(this.m_File);
+ else if (parent.m_File != null && parent.m_File is Folder)
+ return (parent.m_File as Folder).Files.IndexOf(this.m_File);
+ else
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// The total number of children this solution item has.
+ /// </summary>
+ public int Count
+ {
+ get
+ {
+ m_Log.Debug("Retrieving children count of " + this.ToString() + ".");
+ if (this.m_IsRoot)
+ return (Central.Manager.ActiveSolution != null) ? 1 : 0;
+ else if (this.m_Solution != null)
+ return this.m_Solution.Projects.Count;
+ else if (this.m_Project != null)
+ return this.m_Project.Files.Count;
+ else if (this.m_File != null && this.m_File is Folder)
+ return (this.m_File as Folder).Files.Count;
+ else
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets the child item at the specified index.
+ /// </summary>
+ public SolutionItem this[int index]
+ {
+ get
+ {
+ if (index < 0 || index >= this.Count)
+ throw new ArgumentOutOfRangeException("index");
+ m_Log.Debug("Retrieving child of " + this.ToString() + " at index " + index + ".");
+ if (this.m_IsRoot && Central.Manager.ActiveSolution != null)
+ return new SolutionItem(Central.Manager.ActiveSolution);
+ else if (this.m_Solution != null)
+ return new SolutionItem(this.m_Solution.Projects[index]);
+ else if (this.m_Project != null)
+ return new SolutionItem(this.m_Project.Files[index]);
+ else if (this.m_File != null && this.m_File is Folder)
+ return new SolutionItem((this.m_File as Folder).Files[index]);
+ else
+ throw new InvalidOperationException("There is not SolutionItem that currently represents the state.");
+ }
+ }
+
+ private SolutionItem FindImmediateParent()
+ {
+ // Check to see if this is the root node.
+ if (this.m_IsRoot)
+ return null;
+
+ // Check solution to see if it's loaded.
+ if (Central.Manager.ActiveSolution == null)
+ return null;
+ if (this.m_Solution != null)
+ return new SolutionItem();
+
+ // Are we a project?
+ if (this.m_Project != null)
+ return new SolutionItem(Central.Manager.ActiveSolution);
+
+ // Check directly in projects.
+ foreach (Project p in Central.Manager.ActiveSolution.Projects)
+ {
+ if (p.Files.Contains(this.m_File))
+ return new SolutionItem(p);
+ }
+
+ // Recursively check files and folders.
+ foreach (Project p in Central.Manager.ActiveSolution.Projects)
+ {
+ foreach (File f in p.Files)
+ {
+ if (f is Folder)
+ {
+ Folder parent = this.FindImmediateParentFolder(f as Folder, this.m_File);
+ if (parent != null)
+ return new SolutionItem(parent);
+ }
+ }
+ }
+
+ // Otherwise, we don't know what the parent is.
+ return null;
+ }
+
+ private Folder FindImmediateParentFolder(Folder root, File file)
+ {
+ foreach (File f in root.Files)
+ {
+ if (f == file)
+ return root;
+ else if (f is Folder)
+ {
+ Folder parent = this.FindImmediateParentFolder(f as Folder, file);
+ if (parent != null)
+ return parent;
+ }
+ }
+
+ return null;
+ }
+
+ #region Operators
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is SolutionItem))
+ return false;
+ else if (obj == null)
+ return false;
+
+ return (this == obj as SolutionItem);
+ }
+
+ public static bool operator ==(SolutionItem a, SolutionItem b)
+ {
+ if (object.ReferenceEquals(a, b))
+ return true;
+ else if ((object)a == null || (object)b == null)
+ return false;
+
+ return (a.m_IsRoot == b.m_IsRoot &&
+ a.m_File == b.m_File &&
+ a.m_Project == b.m_Project &&
+ a.m_Solution == b.m_Solution);
+ }
+
+ public static bool operator!=(SolutionItem a, SolutionItem b)
+ {
+ return !(a == b);
+ }
+
+ public override string ToString()
+ {
+ try
+ {
+ if (this.m_Solution != null)
+ return string.Format("[Solution: Name={0}]", this.m_Solution.SolutionInfo.Name);
+ else if (this.m_Project != null)
+ return string.Format("[Project: Name={0}]", this.m_Project.ProjectInfo.Name);
+ else if (this.m_File != null)
+ return string.Format("[File: Name={0}]", this.m_File.FileInfo.Name);
+ else
+ return "[Unknown]";
+ }
+ catch
+ {
+ return "[Unknown-Exception]";
+ }
+ }
+
+ #endregion
}
}
}

0 comments on commit 5b46b34

Please sign in to comment.