Example #1
0
 public TreeViewColumn(ADOTabularHierarchy hier, IGlobalOptions options, IEventAggregator eventAggregator)
     : base(null, options, eventAggregator)
 {
     Options       = options;
     Column        = hier;
     MetadataImage = MetadataImages.Hierarchy;
 }
Example #2
0
 public TreeViewColumn(ADOTabularHierarchy hier, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
     : base(hier.Table, null, options, eventAggregator, metadataPane)
 {
     Options       = options;
     Column        = hier;
     Description   = hier.Description;
     MetadataImage = MetadataImages.Hierarchy;
 }
Example #3
0
 public TreeViewColumn(ADOTabularHierarchy hier)
     : base(null)
 {
     _column = hier;
     MetadataImage = MetadataImages.Hierarchy;
 }
Example #4
0
 public TreeViewColumn(ADOTabularHierarchy hier)
     : base(null)
 {
     _column       = hier;
     MetadataImage = MetadataImages.Hierarchy;
 }
        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();
                }
            }
        }