Ejemplo n.º 1
0
        public Design(JToken json)
        {
            if (json == null)
            {
                throw new ArgumentNullException(nameof(json));
            }

            var jsonLayoutComponent = json[JsonNames.LayoutComponent];

            if (jsonLayoutComponent != null)
            {
                m_layoutComponent = (LayoutComponent)ComponentFactory.Singleton.Create(jsonLayoutComponent);
            }

            var jsonBlockComponents = json[JsonNames.BlockComponents];

            if (jsonBlockComponents != null)
            {
                var blockComponents = new ComponentList(jsonBlockComponents);
                foreach (var blockComponent in blockComponents)
                {
                    m_layoutComponent.Children.Add(blockComponent);
                }
            }

            var jsonParameters = json[JsonNames.Parameters];

            m_parameters = jsonParameters != null
                ? new DesignParameterCollection(jsonParameters)
                : new DesignParameterCollection();
        }
Ejemplo n.º 2
0
        protected DesignParameterCollection(DesignParameterCollection prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype));
            }

            m_parameters = new Dictionary <string, string>(prototype.m_parameters);
        }
Ejemplo n.º 3
0
        protected Design(Design prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype));
            }

            if (prototype.m_layoutComponent != null)
            {
                m_layoutComponent = (LayoutComponent)prototype.m_layoutComponent.Clone();
            }

            m_parameters = prototype.m_parameters.Clone();
        }
Ejemplo n.º 4
0
 public Design()
 {
     m_parameters = new DesignParameterCollection();
 }