Exemplo n.º 1
0
        private void Load()
        {
            if (Invalid)
            {
                IsInitialized = false;
            }
            if (!IsInitialized)
            {
                Collection        = new System.Collections.Generic.List <OlapCube>(0);
                _accessCollection = new System.Collections.Generic.Dictionary <string, int>();

                System.Collections.Specialized.StringCollection cubeNames = NativeOlapApi.Cubes(_server.Store.ClientSlot, _server.ServerHandle, _server.LastErrorInternal);
                if (cubeNames != null)
                {
                    for (int i = 0; i < cubeNames.Count; i++)
                    {
                        string cubename = cubeNames[i];
                        Collection.Add(new OlapCube(_server, cubename, _server.ServerHandle));
                        _accessCollection.Add(cubename.ToUpper(), i);
                    }
                }
                else
                {
                    if (_server.LastErrorInternal.Value != 0)
                    {
                        throw new OlapException("Receiving the cubes collection failed!", _server.LastErrorInternal.Value);
                    }
                }
                Invalid       = false;
                IsInitialized = true;
            }
        }