/// <summary> /// /// </summary> /// <param name="slot_"></param> private void AddSlot(SequenceFunctionSlot slot_) { slot_.IsArray = false; slot_.VariableType = typeof(int); m_Slots.Add(slot_); if (FunctionSlotChanged != null) { FunctionSlotChanged(this, new FunctionSlotChangedEventArg(FunctionSlotChangedType.Added, slot_)); } }
/// <summary> /// /// </summary> /// <param name="node_"></param> public void Load(XmlNode node_) { try { Clear(); int version = int.Parse(node_.Attributes["version"].Value); Name = node_.Attributes["name"].Value; ScriptSourceCode = node_.SelectSingleNode("Code").InnerText; ScriptSourceCodeBackup = ScriptSourceCode; LastScriptSourceCodeCompiled = ""; m_ID = int.Parse(node_.Attributes["id"].Value); if (m_FreeID <= m_ID) { m_FreeID = m_ID + 1; } foreach (XmlNode node in node_.SelectNodes("SlotList/Slot")) { int id = int.Parse(node.Attributes["id"].Value); FunctionSlotType type = (FunctionSlotType)Enum.Parse(typeof(FunctionSlotType), node.Attributes["type"].Value); if (m_NextSlotId <= id) { m_NextSlotId = id + 1; } SequenceFunctionSlot slot = new SequenceFunctionSlot(id, type); slot.Name = node.Attributes["name"].Value; slot.IsArray = bool.Parse(node.Attributes["isArray"].Value); slot.VariableType = Type.GetType(node.Attributes["varType"].Value); m_Slots.Add(slot); } CompilScript(); } catch (System.Exception ex) { LogManager.Instance.WriteException(ex); } }
/// <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="connectionType_"></param> /// <param name="slot_"></param> protected void AddFunctionSlot(int slotId, SlotType connectionType_, SequenceFunctionSlot slot_) { AddSlot(new NodeFunctionSlot(slotId, this, connectionType_, slot_)); }