public static List <CubeDef> GetRealCubeList(CubeCollection cubeCollection)
        {
            List <CubeDef> realCubeList = new List <CubeDef>();

            foreach (CubeDef cube in cubeCollection)
            {
                if (cube.Name.StartsWith('$'))
                {
                    continue;
                }
                realCubeList.Add(cube);
            }

            return(realCubeList);
        }
Example #2
0
 // Use this for initialization
 private CubeCollection doIt()
 {
     cubeCollection = new CubeCollection();
     unitManager    = anchor.GetComponent <UnitManager>();
     foreach (GameObject unit in unitManager.units)
     {
         cube   = new Cube();
         cube.x = (int)unit.transform.position.x;
         cube.y = (int)unit.transform.position.y;
         cube.z = (int)unit.transform.position.z;
         //cube.color = new Vector3(unit.GetComponent<Renderer>().material.color.b, unit.GetComponent<Renderer>().material.color.g, unit.GetComponent<Renderer>().material.color.r).ToString();
         cube.color = GetStringFromColor(unit.GetComponent <UnitController>().representation.gameObject.GetComponent <Renderer>().material.color);
         cubeCollection.cubes.Add(cube);
     }
     return(cubeCollection);
 }
        public override void Load_InitData()
        {
            if (Mode != ControlMode.New)
            {
                return;
            }
            ASPxComboBox cbbKeyField;

            try
            {
                cbbKeyField = (ASPxComboBox)this.FindControl("cbbKeyField");
                if (cbbKeyField == null)
                {
                    return;
                }
            }
#if DEBUG
            catch (Exception ex)
            {
                throw ex;
            }
#else
            catch ()
            {
                return;
            }
#endif
            // Load fields
            String connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["OLAPConnection"].ConnectionString;
            using (AdomdConnection conn = new AdomdConnection(connectionString))
            {
                conn.Open();
                // Find a cube
                CubeDef        cubeDef        = null;
                CubeCollection cubeCollection = conn.Cubes;
                int            numOfCube      = cubeCollection.Count - 1;
                for (; numOfCube > 0; numOfCube--)
                {
                    cubeDef = cubeCollection[numOfCube];
                    if (cubeDef.Type == CubeType.Cube)
                    {
                        break;
                    }
                }
                if (this is wcNormalFilter ||
                    this is wcTimeFilter)
                {
                    Olap.DimensionFieldInfoCollection fields = new Olap.DimensionFieldInfoCollection();
                    // Load dimension field
                    DimensionCollection dimCollection = cubeDef.Dimensions;
                    int numOfDim = dimCollection.Count;
                    for (int dimIndex = 0; dimIndex < numOfDim; dimIndex++)
                    {
                        Dimension dim = dimCollection[dimIndex];
                        if (this is wcNormalFilter)
                        {
                            if (dim.UniqueName == "[ARDimTime]" ||
                                dim.DimensionType == DimensionTypeEnum.Measure)
                            {
                                continue;
                            }
                        }
                        else if (this is wcNumFilter)
                        {
                            if (dim.DimensionType != DimensionTypeEnum.Measure)
                            {
                                continue;
                            }
                        }
                        else                         // Date
                        {
                            if (dim.UniqueName != "[ARDimTime]")
                            {
                                continue;
                            }
                        }

                        foreach (Hierarchy hier in dim.Hierarchies)
                        {
                            fields.Add(new Olap.DimensionFieldInfo(hier));
                        }
                    }
                    Helpers.SetDataSource(cbbKeyField, fields, "UniqueName", "Caption");
                }
                else                 // wcNumFilter
                {
                    Olap.MeasureFieldInfoCollection fields = new Olap.MeasureFieldInfoCollection();
                    MeasureCollection measureCollection    = cubeDef.Measures;
                    int numOfMeasure = measureCollection.Count;
                    for (int mIndex = 0; mIndex < numOfMeasure; mIndex++)
                    {
                        Measure m = measureCollection[mIndex];
                        fields.Add(new Olap.MeasureFieldInfo(m));
                    }
                    Helpers.SetDataSource(cbbKeyField, fields, "UniqueName", "Caption");
                }
            }
        }