Пример #1
0
        private static List <GridItem> GetGridItem(XElement xElement)
        {
            xElement = xElement.Element("GridItems");
            List <GridItem> list = new List <GridItem>();

            foreach (XElement xeItem in xElement.Elements("GridItem"))
            {
                GridItem gridItem = new GridItem();
                XMLHelper.SetValue(gridItem, xeItem);
                list.Add(gridItem);

                XElement xeISource = xeItem.Element("ReferencedData");

                if (xeISource != null)
                {
                    string             rType         = xeISource.Attribute("Type").Value;
                    string             rDefaultValue = GetValue(xeISource, "DefaultValue");
                    ReferencedDataInfo r             = new ReferencedDataInfo();
                    r.Type                     = rType;
                    r.DefaultValue             = rDefaultValue;
                    r.ReferencedMember         = gridItem.PropertyName;
                    gridItem.ReferenceDataInfo = r;
                }
            }
            return(list);
        }
Пример #2
0
        public void RegisterReferenceData(ReferencedDataInfo r)
        {
            r.OrderInfo = this;
            string propertyName = r.ReferencedName;

            string referencedType = r.Type;

            r.Index            = this.OrderEntity.ReferenceDatas.Count;
            r.ReferencedMember = string.Format("ReferencedData[{0}]", r.Index);

            this.OrderEntity.ReferenceDatas.Add(propertyName, r);

            //if (referencedType == typeof(DateTimeData).Name)
            //{
            //    r.ReferencedMember += ".Text";
            //}
        }
Пример #3
0
        private static DataPanelInfo GetDataPanel(XElement xe)
        {
            DataPanelInfo p = new DataPanelInfo();

            if (xe.Elements("DataFieldItem") == null)
            {
                return(p);
            }
            foreach (XElement item in xe.Elements("DataFieldItem"))
            {
                DataFieldItem dfItem = new DataFieldItem();
                SetValue(dfItem, item);
                dfItem.Order = XMLHelper.RuntimeOrder;
                //dfItem.CType = (ControlType)int.Parse(item.Attribute("CType").Value);
                //dfItem.Name = item.Attribute("Name").Value;
                //dfItem.PropertyDisplayName = item.Attribute("PropertyDisplayName").Value;
                //dfItem.Requited = Convert.ToBoolean(int.Parse(item.Attribute("Requited").Value));
                //dfItem.PropertyName = item.Attribute("PropertyName").Value;

                XElement xeISource = item.Element("ReferencedData");

                if (xeISource != null)
                {
                    ReferencedDataInfo r = new ReferencedDataInfo();
                    SetValue(r, xeISource);

                    string rType         = xeISource.Attribute("Type").Value;
                    string rDefaultValue = GetValue(xeISource, "DefaultValue");
                    r.ReferencedName = dfItem.PropertyName;
                    XMLHelper.RuntimeOrder.RegisterReferenceData(r);
                    dfItem.ReferenceDataInfo = r;
                    r.Parameters             = GetParameters(xeISource);
                }


                p.Items.Add(dfItem);
            }
            return(p);
        }
Пример #4
0
        public void RegisterReferenceData(ReferencedDataInfo r)
        {

            r.OrderInfo = this;
            string propertyName = r.ReferencedName;

            string referencedType = r.Type;
            
            r.Index = this.OrderEntity.ReferenceDatas.Count;
            r.ReferencedMember = string.Format("ReferencedData[{0}]", r.Index);

            this.OrderEntity.ReferenceDatas.Add(propertyName, r);

            //if (referencedType == typeof(DateTimeData).Name)
            //{
            //    r.ReferencedMember += ".Text";
            //}
        }
Пример #5
0
        private static DataPanelInfo GetDataPanel(XElement xe)
        {
            DataPanelInfo p = new DataPanelInfo();
            if (xe.Elements("DataFieldItem") == null)
            {
                return p;
            }
            foreach (XElement item in xe.Elements("DataFieldItem"))
            {
                DataFieldItem dfItem = new DataFieldItem();
                SetValue(dfItem, item);
                dfItem.Order = XMLHelper.RuntimeOrder;
                //dfItem.CType = (ControlType)int.Parse(item.Attribute("CType").Value);
                //dfItem.Name = item.Attribute("Name").Value;
                //dfItem.PropertyDisplayName = item.Attribute("PropertyDisplayName").Value;
                //dfItem.Requited = Convert.ToBoolean(int.Parse(item.Attribute("Requited").Value));
                //dfItem.PropertyName = item.Attribute("PropertyName").Value;

                XElement xeISource = item.Element("ReferencedData");

                if (xeISource != null)
                {
                    ReferencedDataInfo r = new ReferencedDataInfo();
                    SetValue(r, xeISource);

                    string rType = xeISource.Attribute("Type").Value;
                    string rDefaultValue = GetValue(xeISource, "DefaultValue");
                    r.ReferencedName = dfItem.PropertyName;
                    XMLHelper.RuntimeOrder.RegisterReferenceData(r);
                    dfItem.ReferenceDataInfo = r;
                    r.Parameters = GetParameters(xeISource);
                }

                
                p.Items.Add(dfItem);

            }
            return p;
        }
Пример #6
0
        private static List<GridItem> GetGridItem(XElement xElement)
        {
            xElement = xElement.Element("GridItems");
            List<GridItem> list = new List<GridItem>();
            foreach (XElement xeItem in xElement.Elements("GridItem"))
            {
                GridItem gridItem = new GridItem();
                XMLHelper.SetValue(gridItem, xeItem);
                list.Add(gridItem);

                XElement xeISource = xeItem.Element("ReferencedData");

                if (xeISource != null)
                {
                    string rType = xeISource.Attribute("Type").Value;
                    string rDefaultValue = GetValue(xeISource, "DefaultValue");
                    ReferencedDataInfo r = new ReferencedDataInfo();
                    r.Type = rType;
                    r.DefaultValue = rDefaultValue;
                    r.ReferencedMember = gridItem.PropertyName;
                    gridItem.ReferenceDataInfo = r;
                }

            }
            return list;
        }