Example #1
0
        public void AttachLWF(LWF attachLWF, string attachName,
		int attachDepth = -1, bool reorder = false,
		DetachHandler detachHandler = null)
        {
            if (m_attachedLWFs == null) {
            m_attachedLWFs = new AttachedLWFs();
            m_detachedLWFs = new DetachDict();
            m_attachedLWFList = new AttachedLWFList();
            }

            LWFContainer lwfContainer;
            if (attachLWF.parent != null) {
            attachLWF.parent.m_attachedLWFs.TryGetValue(
                attachLWF.attachName, out lwfContainer);
            DeleteAttachedLWF(attachLWF.parent, lwfContainer, false);
            } else {
            if (m_attachedLWFs.TryGetValue(attachName, out lwfContainer))
                DeleteAttachedLWF(this, lwfContainer);
            }

            if (!reorder && attachDepth >= 0 &&
                attachDepth <= m_attachedLWFList.Count - 1) {
            lwfContainer = m_attachedLWFList[attachDepth];
            if (lwfContainer != null)
                DeleteAttachedLWF(this, lwfContainer);
            }

            lwfContainer = new LWFContainer(this, attachLWF);

            if (attachLWF.interactive == true)
            m_lwf.interactive = true;
            attachLWF.parent = this;
            attachLWF.detachHandler = detachHandler;
            attachLWF.attachName = attachName;
            attachLWF.depth = attachDepth >= 0 ?
            attachDepth : m_attachedLWFList.Count;
            m_attachedLWFs[attachName] = lwfContainer;
            ReorderAttachedLWFList(reorder, attachLWF.depth, lwfContainer);

            m_lwf.isLWFAttached = true;
        }
Example #2
0
 public void SetExecHandler(ExecHandler execHandler)
 {
     ClearExecHandler();
     AddExecHandler(execHandler);
 }
Example #3
0
 public void RemoveExecHandler(ExecHandler execHandler)
 {
     if (m_execHandlers == null)
     return;
     m_execHandlers.RemoveAll(h => h == execHandler);
 }
Example #4
0
 public void AddExecHandler(ExecHandler execHandler)
 {
     if (m_execHandlers == null)
     m_execHandlers = new ExecHandlerList();
     m_execHandlers.Add(execHandler);
 }