Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        protected object GetValue(char code)
        {
            AssistNode test = null;
            AssistNode node = null;

            for (int i = 0; i < _subitemlist.Count; i++)
            {
                test = (AssistNode)_subitemlist[i];
                if (test.Code == code)
                {
                    node = test;
                    break;
                }
            }

            if (node.Value == null)
            {
                node.Value = Activator.CreateInstance(node.Key);
                if (((IStateManager)this).IsTrackingViewState)
                {
                    ((IStateManager)node.Value).TrackViewState();
                }
            }
            return(node.Value);
        }
Exemple #2
0
        private object GetValue(int index)
        {
            AssistNode node = (AssistNode)_subitemlist[index];

            if (node.Value == null)
            {
                node.Value = Activator.CreateInstance(node.Key);
                if (((IStateManager)this).IsTrackingViewState)
                {
                    ((IStateManager)node.Value).TrackViewState();
                }
            }
            return(node.Value);
        }
Exemple #3
0
        /// <summary>
        /// Retrieves the object instance for an assistant node given an
        /// index value.
        /// </summary>
        /// <param name="index">Index value in the assistants node collection</param>
        /// <param name="IsTrackingViewState">Indicates if the parent is currently
        /// tracking viewstate changes</param>
        /// <returns>Object instance based on the node found in the collection</returns>
        protected object GetValue(int index, bool IsTrackingViewState)
        {
            AssistNode node = (AssistNode)list[index];

            if (node.Value == null)
            {
                node.Value = Activator.CreateInstance(node.Key);
                if (IsTrackingViewState)
                {
                    ((IStateManager)node.Value).TrackViewState();
                }
            }
            return(node.Value);
        }