Ejemplo n.º 1
0
 /// <summary>Checks whether this script node is equal to another script node by comparing their members.</summary>
 public virtual bool MemberwiseEquals(ScriptNode other) {
    if (other == null) return false;
    if (GetType() != other.GetType()) return false;
    if (Title != other.Title) return false;
    if (SourceCode != other.SourceCode) return false;
    return true;
 }
Ejemplo n.º 2
0
 /// <summary>Override this method on derived script nodes to implement the clone operation.</summary>
 protected virtual void CloneOverride(ScriptNode copy) {
    copy.Title = Title;
    copy.SourceCode = SourceCode;
 }
Ejemplo n.º 3
0
 /// <summary/>
 public override bool MemberwiseEquals(ScriptNode other) {
    if (!base.MemberwiseEquals(other)) return false;
    if (Operation != ((OperationNode)other).Operation) return false;
    return true;
 }
Ejemplo n.º 4
0
 /// <summary/>
 protected override void CloneOverride(ScriptNode copy) {
    var operCopy = (OperationNode)copy;
    base.CloneOverride(operCopy);
    operCopy.Operation = Operation;
 }
Ejemplo n.º 5
0
 /// <summary>Creates a new script block from the given script node (recrusive).</summary>
 public static ScriptBlock Create(ScriptNode node, bool deep) {
    var block = new ScriptBlock {
       ScriptNode = node.Clone(false)
    };
    if (deep) {
       foreach (var child in node.Children) {
          block.Items.Add(Create(child, deep));
       }
    }
    return block;
 }
Ejemplo n.º 6
0
      private void _onScriptNodeChanged(ScriptNode oldNode, ScriptNode newNode) {
         if (oldNode != null) {
            oldNode.PropertyChanged -= _onScriptNodePropertyChanged;
         }
         if (newNode != null) {
            newNode.PropertyChanged += _onScriptNodePropertyChanged;
         }

         if (newNode == null || (newNode is InitializationNode)) {
            _nameLabel.Text = "Script name:";
         } else {
            _nameLabel.Text = newNode.GetType().Name.RemoveLast("Node") + " name:";
         }
         _nameField.IsReadOnly = (newNode == null);

         _operationLabel.Show(newNode is OperationNode);
         _operationField.Show(newNode is OperationNode);
         
         _codeField.IsReadOnly = (newNode == null);
      }