示例#1
0
        public TreeViewColumn(ADOTabularLevel level)
            : base(null)
        {
            _column = level;
            Description = level.Column.Description;
            DataTypeName = level.Column.DataTypeName;

            MetadataImage = MetadataImages.Column;
        }
示例#2
0
        private void ProcessHierarchy(XmlReader rdr, ADOTabularTable table, string eEntityType)
        {
            var    hierName          = "";
            string hierCap           = null;
            var    hierHidden        = false;
            ADOTabularHierarchy hier = null;
            ADOTabularLevel     lvl  = null;
            string lvlName           = "";
            string lvlCaption        = "";
            string lvlRef            = "";

            while (!(rdr.NodeType == XmlNodeType.EndElement &&
                     rdr.LocalName == "Hierarchy"))
            {
                if (rdr.NodeType == XmlNodeType.Element &&
                    rdr.LocalName == "Hierarchy")
                {
                    while (rdr.MoveToNextAttribute())
                    {
                        switch (rdr.LocalName)
                        {
                        case "Hidden":
                            hierHidden = bool.Parse(rdr.Value);
                            break;

                        case "Name":
                            hierName = rdr.Value;
                            break;

                        case "Caption":
                            hierCap = rdr.Value;
                            break;
                        }
                    }
                    string structure = GetHierarchStructure(table, hierName, hierCap);
                    hier = new ADOTabularHierarchy(table, hierName, hierName, hierCap ?? hierName, "", hierHidden, ADOTabularObjectType.Hierarchy, "", structure);
                    table.Columns.Add(hier);
                    rdr.Read();
                }

                while (!(rdr.NodeType == XmlNodeType.EndElement &&
                         rdr.LocalName == "Level"))
                {
                    if ((rdr.NodeType == XmlNodeType.Element) &&
                        (rdr.LocalName == "Level"))
                    {
                        while (rdr.MoveToNextAttribute())
                        {
                            switch (rdr.LocalName)
                            {
                            case "Name":
                                lvlName = rdr.Value;
                                break;

                            case "Caption":
                                lvlCaption = rdr.Value;
                                break;
                            }
                        }
                    }

                    if ((rdr.NodeType == XmlNodeType.Element) &&
                        (rdr.LocalName == "PropertyRef"))
                    {
                        while (rdr.MoveToNextAttribute())
                        {
                            switch (rdr.LocalName)
                            {
                            case "Name":
                                lvlRef = rdr.Value;
                                break;
                            }
                        }
                    }

                    rdr.Read();
                } //End of Level

                lvl           = new ADOTabularLevel(table.Columns.GetByPropertyRef(lvlRef));
                lvl.LevelName = lvlName;
                lvl.Caption   = lvlCaption;
                hier.Levels.Add(lvl);
                lvlName    = "";
                lvlCaption = "";
                lvlRef     = "";
                while (true)
                {
                    if (rdr.NodeType == XmlNodeType.Element && rdr.LocalName == "Level")
                    {
                        break;
                    }
                    if (rdr.NodeType == XmlNodeType.EndElement && rdr.LocalName == "Hierarchy")
                    {
                        break;
                    }
                    rdr.Read();
                }
            }
        }
        private void ProcessHierarchy(XmlReader rdr, ADOTabularTable table,string eEntityType)
        {
            var hierName = "";
            string hierCap = null;
            var hierHidden = false;
            ADOTabularHierarchy hier = null;
            ADOTabularLevel lvl = null;
            string lvlName = "";
            string lvlCaption = "";
            string lvlRef = "";

            while (!(rdr.NodeType == XmlNodeType.EndElement
                    && rdr.LocalName == "Hierarchy"))
            {
                if (rdr.NodeType == XmlNodeType.Element
                    && rdr.LocalName == "Hierarchy")
                {
                    while (rdr.MoveToNextAttribute())
                    {
                        switch (rdr.LocalName)
                        {
                            case "Hidden":
                                hierHidden = bool.Parse(rdr.Value);
                                break;
                            case "Name":
                                hierName = rdr.Value;
                                break;
                            case "Caption":
                                hierCap = rdr.Value;
                                break;
                        }
                    }
                    hier = new ADOTabularHierarchy(table, hierName, hierName, hierCap ?? hierName, "", hierHidden, ADOTabularColumnType.Hierarchy, "", _hierStructure[table.Caption][hierCap ?? hierName]);
                    table.Columns.Add(hier);
                    rdr.Read();
                }

                while (!(rdr.NodeType == XmlNodeType.EndElement
                    && rdr.LocalName == "Level"))
                {
                    if ((rdr.NodeType == XmlNodeType.Element)
                        && (rdr.LocalName == "Level"))
                    {
                        while (rdr.MoveToNextAttribute())
                        {
                            switch (rdr.LocalName)
                            {
                                case "Name":
                                    lvlName = rdr.Value;
                                    break;
                                case "Caption":
                                    lvlCaption = rdr.Value;
                                    break;
                            }
                        }
                    }

                    if ((rdr.NodeType == XmlNodeType.Element)
                        && (rdr.LocalName == "PropertyRef"))
                    {
                        while (rdr.MoveToNextAttribute())
                        {
                            switch (rdr.LocalName)
                            {
                                case "Name":
                                    lvlRef = rdr.Value;
                                    break;
                            }
                        }
                    }

                    rdr.Read();
                } //End of Level

                lvl = new ADOTabularLevel(table.Columns.GetByPropertyRef(lvlRef));
                lvl.LevelName = lvlName;
                lvl.Caption = lvlCaption;
                hier.Levels.Add(lvl);
                lvlName = "";
                lvlCaption = "";
                lvlRef = "";
                while ( true )
                {
                    if (rdr.NodeType == XmlNodeType.Element && rdr.LocalName == "Level") break;
                    if (rdr.NodeType == XmlNodeType.EndElement && rdr.LocalName == "Hierarchy") break;
                    rdr.Read();
                }
            }
        }