public HierarchyTreeNode(HierarchyInfo info)
     : base(info)
 {
     switch (info.HierarchyOrigin)
     {
         case HierarchyInfoOrigin.AttributeHierarchy:
             Icon = UriResources.Images.AttributeHierarchy16;
             break;
         case HierarchyInfoOrigin.ParentChildHierarchy:
             Icon = UriResources.Images.ParentChildHierarchy16;
             break;
         case HierarchyInfoOrigin.UserHierarchy:
             Icon = UriResources.Images.UserHierarchy16;
             break;
     }
 }
Beispiel #2
0
        public static HierarchyInfo CreateHierarchyInfo(Hierarchy hierarchy)
        {
            if (hierarchy == null)
            {
                return(null);
            }
            HierarchyInfo info = new HierarchyInfo();

            info.Caption       = hierarchy.Caption;
            info.Description   = hierarchy.Description;
            info.DefaultMember = hierarchy.DefaultMember;

            // Информация о предках
            if (hierarchy.ParentDimension != null)
            {
                info.ParentDimensionId = hierarchy.ParentDimension.UniqueName;
                info.CustomProperties.Add(new PropertyInfo(InfoBase.DIMENSION_CAPTION, hierarchy.ParentDimension.Caption));
                if (hierarchy.ParentDimension.ParentCube != null)
                {
                    info.ParentCubeId = hierarchy.ParentDimension.ParentCube.Name;
                    info.CustomProperties.Add(new PropertyInfo(InfoBase.CUBE_CAPTION, hierarchy.ParentDimension.ParentCube.Caption));
                }
            }

            try
            {
                info.DisplayFolder = hierarchy.DisplayFolder;
            }
            catch (System.NotSupportedException)
            {
                // Не поддерживается MSAS 2000
                info.DisplayFolder = String.Empty;
            }
            info.Name            = hierarchy.Name;
            info.HierarchyOrigin = (HierarchyInfoOrigin)(hierarchy.HierarchyOrigin);
            info.UniqueName      = hierarchy.UniqueName;

            // Свойства
            foreach (Property prop in hierarchy.Properties)
            {
                //PropertyInfo pi = new PropertyInfo(prop.Name, prop.Type, prop.Value);
                PropertyInfo pi = new PropertyInfo(prop.Name, prop.Value);
                info.Properties.Add(pi);
            }
            return(info);
        }
        public static HierarchyInfo CreateHierarchyInfo(Hierarchy hierarchy)
        {
            if (hierarchy == null)
                return null;
            HierarchyInfo info = new HierarchyInfo();
            info.Caption = hierarchy.Caption;
            info.Description = hierarchy.Description;
            info.DefaultMember = hierarchy.DefaultMember;

            // Информация о предках
            if (hierarchy.ParentDimension != null)
            {
                info.ParentDimensionId = hierarchy.ParentDimension.UniqueName;
                info.CustomProperties.Add(new PropertyInfo(InfoBase.DIMENSION_CAPTION, hierarchy.ParentDimension.Caption));
                if (hierarchy.ParentDimension.ParentCube != null)
                {
                    info.ParentCubeId = hierarchy.ParentDimension.ParentCube.Name;
                    info.CustomProperties.Add(new PropertyInfo(InfoBase.CUBE_CAPTION, hierarchy.ParentDimension.ParentCube.Caption));
                }
            }

            try
            {
                info.DisplayFolder = hierarchy.DisplayFolder;
            }
            catch (System.NotSupportedException)
            {
                // Не поддерживается MSAS 2000
                info.DisplayFolder = String.Empty;
            }
            info.Name = hierarchy.Name;
            info.HierarchyOrigin = (HierarchyInfoOrigin)(hierarchy.HierarchyOrigin);
            info.UniqueName = hierarchy.UniqueName;

            // Свойства
            foreach (Property prop in hierarchy.Properties)
            {
                //PropertyInfo pi = new PropertyInfo(prop.Name, prop.Type, prop.Value);
                PropertyInfo pi = new PropertyInfo(prop.Name, prop.Value);
                info.Properties.Add(pi);
            }
            return info;
        }
 public Hierarchy_AreaItemWrapper(HierarchyInfo info)
     : base(info)
 {
     UniqueName = info.UniqueName;
 }