/// <summary> /// Initializes a new instance of the OlapServer class. /// </summary> /// <param name="store">The Olap store that owns the server.</param> /// <param name="name">The name of the server.</param> public OlapServer(OlapStore store, string name) { _dataareaActive = new BoolPointer(); _lastError = new IntPointer(); _dimensions = null; _serverHandle = 0; _store = store; _name = name; _disposed = false; }
/// <summary> /// Initializes a new instance of the OlapStore class. /// </summary> /// <param name="userName">A user name to establish the client connection.</param> public OlapStore(string userName) { IntPointer lastError = new IntPointer(); _clientSlot = NativeOlapApi.ClientConnect(userName, lastError); if (_clientSlot == 0) { throw new OlapException("Client connect failed!", lastError.Value); } }
/// <summary> /// Frees all resources immediately. /// </summary> public void FreeResources() { if (!_disposed) { _disposed = true; if (ClientSlot != 0) { IntPointer lastError = new IntPointer(); NativeOlapApi.ClientDisconnect(_clientSlot, lastError); _clientSlot = 0; } } }
/// <summary> /// Loads the server collection. /// </summary> private void Load() { if (Invalid) { IsInitialized = false; } if (!IsInitialized) { IntPointer lastError = new IntPointer(); Collection = new System.Collections.Generic.List <OlapServer>(0); System.Collections.Specialized.StringCollection serverNames = NativeOlapApi.Servers(_store.ClientSlot, lastError); if (serverNames != null) { for (int i = 0; i < serverNames.Count; i++) { Collection.Add(new OlapServer(_store, serverNames[i])); } } Invalid = false; IsInitialized = true; } }