/// <summary> /// Search in subtree from iterator (including itself), /// check if user task and native task are compatible,then bind. /// </summary> /// <param name="task">The UITask to bind.</param> /// <param name="name">Name of the node to bind with the UITask.</param> /// <returns>If not possible to bind returns null , if sucessfull return UITask.</returns> public CKLBUITask bindTask(CKLBUITask task, String name = null) { if (name != null) { if (find(name, true)) { task.bind(node_getUITask(m_nodeCpp)); } else { throw new CKLBException("There is not any Node with this name."); } } else { IntPtr ptr = node_searchFirstByTypeID(m_nodeCpp, task.TypeID); if (ptr != IntPtr.Zero) { task.bind(ptr); } else { throw new CKLBException("There is not any Node compatible with this task."); } } return(task); }
/// <summary> /// Try to get the UITask linked to the current Node of the NodeIterator. /// </summary> /// <returns>The UITask if a UITask is effectivly linked to the Node. Else returns null.</returns> public CKLBUITask getAsUITask() { IntPtr ptr = node_getUITask(m_nodeCpp); if (ptr != IntPtr.Zero) { NativeManagement.resetCppError(); CKLBUITask task = new CKLBUITask(NativeManagement.getTypeID(ptr)); NativeManagement.intercepCppError(); task.bind(ptr); return(task); } else { return(null); } }
/// <summary> /// Search in subtree from iterator (including itself), /// check if user task and native task are compatible,then bind. /// </summary> /// <param name="task">The UITask to bind.</param> /// <param name="name">Name of the node to bind with the UITask.</param> /// <returns>If not possible to bind returns null , if sucessfull return UITask.</returns> public CKLBUITask bindTask(CKLBUITask task, String name = null) { if(name != null) { if(find(name, true)) { task.bind(node_getUITask(m_nodeCpp)); } else { throw new CKLBException("There is not any Node with this name."); } } else { IntPtr ptr = node_searchFirstByTypeID(m_nodeCpp, task.TypeID); if(ptr != IntPtr.Zero) { task.bind(ptr); } else { throw new CKLBException("There is not any Node compatible with this task."); } } return task; }
/// <summary> /// Try to get the UITask linked to the current Node of the NodeIterator. /// </summary> /// <returns>The UITask if a UITask is effectivly linked to the Node. Else returns null.</returns> public CKLBUITask getAsUITask() { IntPtr ptr = node_getUITask(m_nodeCpp); if(ptr != IntPtr.Zero) { NativeManagement.resetCppError(); CKLBUITask task = new CKLBUITask(NativeManagement.getTypeID(ptr)); NativeManagement.intercepCppError(); task.bind(ptr); return task; } else { return null; } }