示例#1
0
文件: lwf_movie.cs 项目: nask0/lwf
        public Button SearchButtonInstance(int stringId, bool recursive = true)
        {
            if (stringId == -1)
            {
                return(null);
            }

            for (IObject instance = m_instanceHead; instance != null;
                 instance = instance.linkInstance)
            {
                if (instance.IsButton() && m_lwf.GetInstanceNameStringId(
                        instance.instanceId) == stringId)
                {
                    return((Button)instance);
                }
                else if (recursive && instance.IsMovie())
                {
                    Button i = ((Movie)instance).SearchButtonInstance(
                        stringId, recursive);
                    if (i != null)
                    {
                        return(i);
                    }
                }
            }
            return(null);
        }
示例#2
0
文件: lwf_core.cs 项目: osdakira/lwf
        public Button SearchButtonInstanceByInstanceId(int instId)
        {
            if (instId < 0 || instId >= m_instances.Length)
            {
                return(null);
            }
            IObject obj = m_instances[instId];

            while (obj != null)
            {
                if (obj.IsButton())
                {
                    return((Button)obj);
                }
                obj = obj.nextInstance;
            }
            return(null);
        }
示例#3
0
文件: lwf_movie.cs 项目: nask0/lwf
 public Button SearchButtonInstanceByInstanceId(int instId, bool recursive)
 {
     for (IObject instance = m_instanceHead; instance != null;
          instance = instance.linkInstance)
     {
         if (instance.IsButton() && instance.instanceId == instId)
         {
             return((Button)instance);
         }
         else if (recursive && instance.IsMovie())
         {
             Button i = ((Movie)instance).SearchButtonInstanceByInstanceId(
                 instId, recursive);
             if (i != null)
             {
                 return(i);
             }
         }
     }
     return(null);
 }