Skip to content

Commit

Permalink
Update ProfiledNodeViewModel.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaylo-matov committed Sep 24, 2024
1 parent 41253a7 commit 2c1a889
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions TuneUp/ProfiledNodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,6 @@ internal set
/// </summary>
public bool IsGroupExecutionTime => NodeModel == null && GroupModel == null;

/// <summary>
/// Getting the original name before graph author renamed the node
/// </summary>
private static string GetOriginalName(NodeModel node)
{
if (node == null) return string.Empty;
// For dummy node, return the current name so that does not appear to be renamed
if (node is DummyNode)
{
return node.Name;
}
if (node.IsCustomFunction)
{
// If the custom node is not loaded, return the current name so that does not appear to be renamed
if ((node as Function).State == ElementState.Error && (node as Function).Definition.IsProxy)
{
return node.Name;
}
// If the custom node is loaded, return original name as usual
var customNodeFunction = node as Function;
return customNodeFunction?.Definition.DisplayName;
}

var function = node as DSFunctionBase;
if (function != null)
return function.Controller.Definition.DisplayName;

var nodeType = node.GetType();
var elNameAttrib = nodeType.GetCustomAttributes<NodeNameAttribute>(false).FirstOrDefault();
if (elNameAttrib != null)
return elNameAttrib.Name;

return nodeType.FullName;
}

/// <summary>
/// Prefix string of execution time.
/// </summary>
Expand Down

0 comments on commit 2c1a889

Please sign in to comment.