Beispiel #1
0
        //
        public void Setup(Action <Exception> cb)
        {
            // Cleanup any existing internal modules
            if (MessageStream != null)
            {
                MessageStream.Dispose();
            }


            // Instantiate Singletons
            UnityApplicationState.Instantiate();
            HttpRequestManager.Instantiate();


            // Create a shared cookie container
            Cookies = new CookieContainer();


            // Initialize mage internal modules
            EventManager  = new EventManager();
            CommandCenter = new Command.CommandCenter();
            MessageStream = new MessageStream();

            Session   = new Session();
            Archivist = new Archivist();


            // Set endpoints
            CommandCenter.SetEndpoint(baseUrl, appName, headers);
            MessageStream.SetEndpoint(baseUrl, headers);

            cb(null);
        }