Example #1
0
        private void DoInstantiateAt(ComponentAdapter childAdapter, int index, bool useAsInstance)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(useAsInstance);
            }

            var container = (IContentChildList)Component;

            if (null != container)
            {
                container.AddContentChildAt(childAdapter.Component, index);
            }
        }
Example #2
0
        /// <summary>
        /// Instantiates
        /// </summary>
        /// <param name="childAdapter"></param>
        /// <param name="register"></param>
        public virtual void DoInstantiate(ComponentAdapter childAdapter, bool register)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(register);
            }

            var container = Component as IContentChildList;

            if (null == container)
            {
                Debug.LogError(Component.GetType().Name + " cannot host children");
                return;
            }
            container.AddContentChild(childAdapter.Component);
        }
Example #3
0
        /// <summary>
        /// Instantiates
        /// </summary>
        /// <param name="childAdapter"></param>
        /// <param name="register"></param>
        override public void DoInstantiate(ComponentAdapter childAdapter, bool register)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(register);
            }

            var scroller = (Scroller)Component;

            if (null != scroller)
            {
                var group = childAdapter.Component as GroupBase;
                if (null == group)
                {
                    throw new Exception(string.Format(@"Scroller can have only a single child, extending the GroupBase ({0} supplied)", childAdapter.Component));
                }
                scroller.Viewport = group;
            }
        }
Example #4
0
        /// <summary>
        /// Instantiates
        /// </summary>
        /// <param name="childAdapter"></param>
        /// <param name="register"></param>
        override public void DoInstantiate(ComponentAdapter childAdapter, bool register)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(register);
            }

            var scroller = (Scroller)Component;
            if (null != scroller)
            {
                var group = childAdapter.Component as GroupBase;
                if (null == group)
                {
                    throw new Exception(string.Format(@"Scroller can have only a single child, extending the GroupBase ({0} supplied)", childAdapter.Component));
                }
                scroller.Viewport = group;
            }
        }
Example #5
0
        private void DoInstantiateAt(ComponentAdapter childAdapter, int index, bool useAsInstance)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(useAsInstance);
            }

            var container = (IContentChildList)Component;
            if (null != container)
            {
                container.AddContentChildAt(childAdapter.Component, index);
            }
        }
Example #6
0
        /// <summary>
        /// Instantiates
        /// </summary>
        /// <param name="childAdapter"></param>
        /// <param name="register"></param>
        public virtual void DoInstantiate(ComponentAdapter childAdapter, bool register)
        {
            if (!childAdapter.Instantiated)
            {
                childAdapter.DoInstantiate(register);
            }

            var container = Component as IContentChildList;
            if (null == container)
            {
                Debug.LogError(Component.GetType().Name + " cannot host children");
                return;
            }
            container.AddContentChild(childAdapter.Component);
        }