This commit is contained in:
Robert committed 2024-02-23 21:15:34 +01:00
1 parent 49ed0205b7
commit bcf0b74fcc
4 files changed
+36 -35

No files matched your search

@@ -16,9 +16,9 @@ public interface INode : INotifyPropertyChanged, IBreakableModel
Guid Id { get; set; }
/// <summary>
/// Gets
/// Gets or sets the node data with information about this node
/// </summary>
NodeData NodeData { get; set; }
NodeData? NodeData { get; set; }
/// <summary>
/// Gets the name of the node
@@ -42,7 +42,7 @@ public abstract class Node : BreakableModel, INode
}
/// <inheritdoc />
public NodeData NodeData { get; set; }
public NodeData? NodeData { get; set; }
private string _name;
@@ -25,6 +25,8 @@ public abstract class Node<TStorage, TViewModel> : Node<TStorage>, ICustomViewMo
/// <param name="nodeScript"></param>
public virtual TViewModel GetViewModel(NodeScript nodeScript)
{
if (NodeData == null)
throw new ArtemisCoreException("Nodes without node data (default nodes or exit nodes) cannot have custom view models");
return NodeData.Provider.Plugin.Container.Resolve<TViewModel>(args: new object[] {this, nodeScript});
}