예제 #1
0
        public static MeasureInfo CreateMeasureInfo(Measure measure)
        {
            if (measure == null)
            {
                return(null);
            }
            MeasureInfo info = new MeasureInfo();

            info.Caption          = measure.Caption;
            info.Description      = measure.Description;
            info.Name             = measure.Name;
            info.UniqueName       = measure.UniqueName;
            info.DisplayFolder    = measure.DisplayFolder;
            info.Expression       = measure.Expression;
            info.NumericPrecision = measure.NumericPrecision;
            info.NumericScale     = measure.NumericScale;
            info.Units            = measure.Units;

            // Информация о предках
            if (measure.ParentCube != null)
            {
                info.ParentCubeId = measure.ParentCube.Name;
            }

            // Свойства
            foreach (Property prop in measure.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 MeasureTreeNode(MeasureInfo info)
     : base(info)
 {
     if (String.IsNullOrEmpty(info.Expression))
     {
         Icon = UriResources.Images.Measure16;
     }
     else
     {
         Icon = UriResources.Images.MeasureCalc16;
     }
 }
        public MeasureItemControl(MeasureInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");

            if (String.IsNullOrEmpty(info.Expression))
            {
                Icon = UriResources.Images.Measure16;
            }
            else
            {
                Icon = UriResources.Images.MeasureCalc16;
            }

            m_Info = info;
            Text = info.Caption;
        }
        public static MeasureInfo CreateMeasureInfo(Measure measure)
        {
            if (measure == null)
                return null;
            MeasureInfo info = new MeasureInfo();
            info.Caption = measure.Caption;
            info.Description = measure.Description;
            info.Name = measure.Name;
            info.UniqueName = measure.UniqueName;
            info.DisplayFolder = measure.DisplayFolder;
            info.Expression = measure.Expression;
            info.NumericPrecision = measure.NumericPrecision;
            info.NumericScale = measure.NumericScale;
            info.Units = measure.Units;

            // Информация о предках
            if (measure.ParentCube != null)
            {
                info.ParentCubeId = measure.ParentCube.Name;
            }

            // Свойства
            foreach (Property prop in measure.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 Measure_AreaItemWrapper(MeasureInfo info)
     : base(info)
 {
     UniqueName = info.UniqueName;
 }