Exemple #1
0
        public static void LoginAsync(string username, string password,
                                      LoginCallback.LoginSuccessful onSuccess, LoginCallback.LoginFailed onFailure)
        {
            successCallback = onSuccess;
            failureCallback = onFailure;

            string[] args = new string[] { "--Ice.Config=" + CONFIG_FILE };
            comm = Ice.Util.initialize(ref args);

            Ice.ObjectPrx routerPrx = comm.getDefaultRouter();
            router = Glacier2.RouterPrxHelper.checkedCast(routerPrx);
            if (router == null)
            {
                throw new InvalidOperationException(
                          "The target host does not use a Glacier2 router.");
            }

            Glacier2.SessionPrx sessionProxy = router.createSession("CaptainVTank", "");
            sessionFactoryPrx = Main.SessionFactoryPrxHelper.uncheckedCast(sessionProxy);
            sessionFactoryPrx.AdminLogin_async(new LoginCallback(OnLoginSuccess, OnLoginFailure),
                                               username, password, version); // TODO: Use real version.
        }
        public static void LoginAsync(string username, string password,
            LoginCallback.LoginSuccessful onSuccess, LoginCallback.LoginFailed onFailure)
        {
            successCallback = onSuccess;
            failureCallback = onFailure;

            string[] args = new string[] { "--Ice.Config=" + CONFIG_FILE };
            comm = Ice.Util.initialize(ref args);

            Ice.ObjectPrx routerPrx = comm.getDefaultRouter();
            router = Glacier2.RouterPrxHelper.checkedCast(routerPrx);
            if (router == null)
            {
                throw new InvalidOperationException(
                    "The target host does not use a Glacier2 router.");
            }

            Glacier2.SessionPrx sessionProxy = router.createSession("CaptainVTank", "");
            sessionFactoryPrx = Main.SessionFactoryPrxHelper.uncheckedCast(sessionProxy);
            sessionFactoryPrx.AdminLogin_async(new LoginCallback(OnLoginSuccess, OnLoginFailure),
                username, password, version); // TODO: Use real version.
        }