Skip to content

Commit

Permalink
Refactored GetTreeItemType method
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Oct 3, 2013
1 parent 819391d commit b7f6911
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions CanvasDiagram.Editor/TreeEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,11 @@ public static class TreeEditor

public static TreeItemType GetTreeItemType(string uid)
{
if (string.IsNullOrEmpty(uid))
return TreeItemType.None;

if (StringUtil.StartsWith(uid, Constants.TagHeaderSolution))
return TreeItemType.Solution;

if (StringUtil.StartsWith(uid, Constants.TagHeaderProject))
return TreeItemType.Project;

if (StringUtil.StartsWith(uid, Constants.TagHeaderDiagram))
return TreeItemType.Diagram;

return TreeItemType.None;
return string.IsNullOrEmpty(uid) ? TreeItemType.None :
StringUtil.StartsWith(uid, Constants.TagHeaderSolution) ? TreeItemType.Solution :
StringUtil.StartsWith(uid, Constants.TagHeaderProject) ? TreeItemType.Project :
StringUtil.StartsWith(uid, Constants.TagHeaderDiagram) ? TreeItemType.Diagram :
TreeItemType.None;
}

public static void SelectPreviousItem(ITree tree, bool selectParent)
Expand Down

0 comments on commit b7f6911

Please sign in to comment.