/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> public NodeSlotVar(int slotId_, SequenceNode node_, string text_, SlotType connectionType_, Type type_ = null, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null, bool saveValue_ = true) : base(slotId_, node_, text_, connectionType_, type_, controlType_, tag_) { m_SaveValue = saveValue_; object val = null; if (type_ == typeof(bool)) { val = true; } else if (type_ == typeof(sbyte) || type_ == typeof(char) || type_ == typeof(short) || type_ == typeof(int) || type_ == typeof(long) || type_ == typeof(byte) || type_ == typeof(ushort) || type_ == typeof(uint) || type_ == typeof(ulong) || type_ == typeof(float) || type_ == typeof(double)) { val = Convert.ChangeType(0, type_); } else if (type_ == typeof(string)) { val = string.Empty; } m_Value = new ValueContainer(type_, val); }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> public NodeSlot(int slotId_, SequenceNode node_, string text_, SlotType connectionType_, Type type_ = null, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) : this(slotId_, node_, connectionType_, controlType_, tag_) { Text = text_; VariableType = type_; }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="connectionType_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> protected NodeSlot(int slotId_, SequenceNode node_, SlotType connectionType_, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) { ConnectedNodes = new List <NodeSlot>(); ID = slotId_; Node = node_; ConnectionType = connectionType_; ControlType = controlType_; Tag = tag_; }
/// <summary> /// /// </summary> /// <param name="slotId"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="saveInternalValue_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> protected void AddSlot(int slotId, string text_, SlotType connectionType_, Type type_ = null, bool saveInternalValue_ = true, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) { if (connectionType_ == SlotType.VarIn || connectionType_ == SlotType.VarOut) { AddSlot(new NodeSlotVar(slotId, this, text_, connectionType_, type_, controlType_, tag_, saveInternalValue_)); } else { AddSlot(new NodeSlot(slotId, this, text_, connectionType_, type_, controlType_, tag_)); } }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="connectionType_"></param> /// <param name="slot_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> /// <param name="saveValue_"></param> public NodeFunctionSlot( int slotId_, SequenceNode node_, SlotType connectionType_, SequenceFunctionSlot slot_, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null, bool saveValue_ = true) : base(slotId_, node_, slot_.Name, connectionType_, slot_.VariableType, controlType_, tag_, saveValue_) { m_FuncSlot = slot_; m_FuncSlot.PropertyChanged += new PropertyChangedEventHandler(OnFunctionSlotPropertyChanged); }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="connectionType_"></param> /// <param name="slot_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> /// <param name="saveValue_"></param> public NodeFunctionSlot( int slotId_, SequenceNode node_, SlotType connectionType_, SequenceFunctionSlot slot_, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null, bool saveValue_ = true) : base(slotId_, node_, slot_.Name, connectionType_, slot_.VariableType, controlType_, tag_, saveValue_) { m_FuncSlot = slot_; m_FuncSlot.PropertyChanged += new PropertyChangedEventHandler(OnFunctionSlotPropertyChanged); }
/// <summary> /// Control to be used in BPS Logic Builder for the field or property. /// </summary> /// <param name="controlType"></param> public VariableEditorControlAttribute(VariableControlType controlType) { this.ControlType = controlType; }
/// <summary> /// /// </summary> /// <param name="slotId"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="saveInternalValue_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> protected void AddSlot(int slotId, string text_, SlotType connectionType_, Type type_ = null, bool saveInternalValue_ = true, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) { if (connectionType_ == SlotType.VarIn || connectionType_ == SlotType.VarOut) { AddSlot(new NodeSlotVar(slotId, this, text_, connectionType_, type_, controlType_, tag_, saveInternalValue_)); } else { AddSlot(new NodeSlot(slotId, this, text_, connectionType_, type_, controlType_, tag_)); } }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> public NodeSlotVar(int slotId_, SequenceNode node_, string text_, SlotType connectionType_, Type type_ = null, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null, bool saveValue_ = true) : base(slotId_, node_, text_, connectionType_, type_, controlType_, tag_) { m_SaveValue = saveValue_; object val = null; if (type_ == typeof(bool)) { val = true; } else if (type_ == typeof(sbyte) || type_ == typeof(char) || type_ == typeof(short) || type_ == typeof(int) || type_ == typeof(long) || type_ == typeof(byte) || type_ == typeof(ushort) || type_ == typeof(uint) || type_ == typeof(ulong) || type_ == typeof(float) || type_ == typeof(double)) { val = Convert.ChangeType(0, type_); } else if (type_ == typeof(string)) { val = string.Empty; } m_Value = new ValueContainer(type_, val); }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="connectionType_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> protected NodeSlot(int slotId_, SequenceNode node_, SlotType connectionType_, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) { ConnectedNodes = new List<NodeSlot>(); ID = slotId_; Node = node_; ConnectionType = connectionType_; ControlType = controlType_; Tag = tag_; }
/// <summary> /// /// </summary> /// <param name="slotId_"></param> /// <param name="node_"></param> /// <param name="text_"></param> /// <param name="connectionType_"></param> /// <param name="type_"></param> /// <param name="controlType_"></param> /// <param name="tag_"></param> public NodeSlot(int slotId_, SequenceNode node_, string text_, SlotType connectionType_, Type type_ = null, VariableControlType controlType_ = VariableControlType.ReadOnly, object tag_ = null) : this(slotId_, node_, connectionType_, controlType_, tag_) { Text = text_; VariableType = type_; }