コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="componentWrapperList"></param>
        /// <returns></returns>
        internal static List <ControlItem> BuildComponentWrapperList(Dictionary <object, ComponentWrapper> componentWrapperList)
        {
            var comp = componentWrapperList;
            List <ControlItem> serializeObjectList = new List <ControlItem>();

            foreach (var key in componentWrapperList.Keys)
            {
                ControlItem serializeObject = BuildControlItemFromComponentWrapper((Control)key, componentWrapperList[key]);
                // serialize the control SerializableControlItem only while we have properties that need to be serialize
                if (serializeObject != null && serializeObject.Properties != null && serializeObject.Properties.Count > 0)
                {
                    serializeObjectList.Add(serializeObject);
                }
            }

            return(serializeObjectList);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="componentWrapper"></param>
        /// <returns></returns>
        static ControlItem BuildControlItemFromComponentWrapper(Control key, ComponentWrapper componentWrapper)
        {
            ControlItem serializeObject = null;

            if (componentWrapper != null)
            {
                // get the isn of the control
                ControlDesignerInfo cdf = ((Control)key).Tag as ControlDesignerInfo;
                // don't save items of the frame
                if (ShouldSerializeControl(cdf))
                {
                    serializeObject     = new ControlItem();
                    serializeObject.Isn = cdf.Isn;
                    // the control type
                    serializeObject.ControlType = cdf.ControlType.ToString();

                    serializeObject.Properties = BuildProperties(componentWrapper, cdf);
                }
            }

            return(serializeObject);
        }