Ejemplo n.º 1
0
        /// <summary>
        /// Call to the login window.
        /// </summary>
        public void CallLogin()
        {
            LoginWin Login = new LoginWin();

            this.Close();
            Login.Show();
        }
Ejemplo n.º 2
0
 public static void RemoveComponent()
 {
     if (_Instance != null)
     {
         _Instance._RemoveComponent();
     }
     _Instance = null;
 }
Ejemplo n.º 3
0
//	private int addressId;
//	private float m_delayConnectSecond;

//	#if UNITY_EDITOR
//	private readonly string[,] ServerTypeDic = {
//		{"测试服务器", "http://127.0.0.1:8080"}
//	};
//	#else
//	private readonly string[,] ServerTypeDic = {
//	{"正式服务器", "http://127.0.0.1:8080"}
//	};
//	#endif
    public static void InitComponent()
    {
        if (_Instance == null)
        {
            _Instance = new LoginWin();
        }
        _Instance._InitComponent();
    }
Ejemplo n.º 4
0
        private void btnOSBLELogin_Click(object sender, RoutedEventArgs e)
        {
            LoginWin lw = new LoginWin();

            lw.LoginAttemptCompleted += new EventHandler(OSBLELoginAttemptCompleted);
            //lw.LoginAttemptCompleted += new LoginWindow.LoginAttemptCompletedDelegate(OSBLELoginAttemptCompleted);
            lw.Show();
        }
Ejemplo n.º 5
0
 public void OnGUI()
 {
     if (Input.GetMouseButtonDown(0))//先这么写
     {
         LoginWin.RemoveComponent();
         LuaManager.Instance.CallLuaFunByName("Game.initLoadUI");
         //    MagusSceneManager.Instance.SetNextScene(SceneID.Game);
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBoxResult.Yes == MessageBox.Show("Oturumu kapatmak istiyor musunuz?", "", MessageBoxButton.YesNo, MessageBoxImage.Question))
     {
         LoginWin win = new LoginWin();
         win.Show();
         Close();
     }
 }
Ejemplo n.º 7
0
        void OSBLELoginAttemptCompleted(object sender, EventArgs e)
        {
            LoginWin lw = sender as LoginWin;

            ChemProV.Logic.OSBLE.OSBLEState state = lw.State;

            // Set the global
            Core.App.OSBLEState = state;

            if (state.IsLoggedIn)
            {
                NormalOsbleIcon.Visibility = System.Windows.Visibility.Collapsed;
                LoggedInOsble.Visibility   = System.Windows.Visibility.Visible;
            }
        }
Ejemplo n.º 8
0
 public void InitFairyGUI()
 {
     //重命名根节点
     GRoot.inst.displayObject.parent.gameObject.name = "FairyGUI";
     GRoot.inst.displayObject.gameObject.name        = "UIROOT";
     Stage.inst.stage.GetRenderCamera().allowMSAA = true;
     //分辨率适配
     //1280*720 6s:1334*750 1920*1080 iphonex:2436*1125
     GRoot.inst.SetContentScaleFactor(1334, 750, FairyGUI.UIContentScaler.ScreenMatchMode.MatchWidth);
     UIConfig.defaultFont = "hwxs";
     //基础ui
     LoginWin.InitComponent();
     //loadingui
     //messagebox
     //transitionwin
 }
Ejemplo n.º 9
0
        private void LoginCheck()
        {
            LoginWin login = new LoginWin();

            login.Owner = this;

            bool?result = login.ShowDialog();

            if (result == true)
            {
                frame_content.Navigate(new Uri("view/Pages/Home.xaml", UriKind.Relative));

                if (login.CheckBox.IsChecked == (bool?)true)
                {
                    loginVM.SetBool(true);
                }
            }
        }
Ejemplo n.º 10
0
 public bool Login(LoginInfo logininfo)
 {
     if (winshow == true)
     {
         return(false);
     }
     try
     {
         winshow      = true;
         loginSucceed = false;
         logininfo.RrrorInformation = "";//清空信息
         loginWin              = new LoginWin(logininfo);
         loginWin.Title        = (string)Application.Current.Resources["strLogin"];
         loginWin.Parachanged += Win_Parachanged;
         loginWin.ShowDialog();
         return(loginSucceed);
     }
     finally
     {
         winshow = false;
     }
 }
Ejemplo n.º 11
0
        private static async System.Threading.Tasks.Task UpgradeAccount(LoginWin login)
        {
            await Store.LoadData(login);

            AccountWin account = login.Account;

            AccountDataItem accountUWP = new AccountDataItem(login.LocalAccountId)
            {
                AccountId               = login.AccountId,
                AutoLogin               = login.AutoLogin,
                CurrentChangeNumber     = account.CurrentChangeNumber,
                CurrentSemesterId       = account.School.ActiveSemesterIdentifier,
                DeviceId                = login.DeviceId,
                LocalAccountId          = login.LocalAccountId,
                LocalToken              = login.Password,
                PremiumAccountExpiresOn = account.PremiumAccountExpiresOn,
                RememberPassword        = login.RememberPassword,
                RememberUsername        = login.RememberUsername,
                Username                = login.Username,
                WeekOneStartsOn         = account.WeekOneStartsOn,
                Version = account.Version
            };

            // Save account (need to do this so there's a folder for everything else)
            await AccountsManager.Save(accountUWP);

            try
            {
                AccountDataStore dataStoreUWP = await AccountDataStore.Get(login.LocalAccountId);

                // Transfer the Changes
                PartialChanges existingChanges = await account.GetPartialChanges();

                await AccountDataStore.ChangedItems.ImportChangesAsync(login.LocalAccountId, existingChanges.Changes.Keys.ToArray(), existingChanges.Deletes.Keys.ToArray());

                try
                {
                    // Transfer images to upload
                    string[] imagesToUpload = (await account.GetAllImagesToUpload()).ToArray();
                    await dataStoreUWP.AddImagesToUploadAsync(imagesToUpload);

                    // Transfer stored images
                    StorageFolder oldImagesFolder = await login.GetImagesFolder();

                    IFolder newImagesFolderPortable = await PowerPlannerAppDataLibrary.DataLayer.FileHelper.GetOrCreateImagesFolder(login.LocalAccountId);

                    StorageFolder newImagesFolder = await StorageFolder.GetFolderFromPathAsync(newImagesFolderPortable.Path);

                    foreach (StorageFile existingImage in await oldImagesFolder.GetFilesAsync())
                    {
                        await existingImage.MoveAsync(newImagesFolder);
                    }
                }

                catch { }

                // Get all the existing items
                BaseItem[] syncItems = account.GetAllItemsInSendingFormat();

                // Translate them to the universal sync language
                BaseDataItem[] uwpItems = PowerPlannerAppDataLibrary.SyncLayer.Sync.GetSyncItemsAsDataItems(syncItems);

                // And then input those into the new database
                await dataStoreUWP.ImportItemsAsync(uwpItems);
            }

            catch (Exception ex)
            {
                try
                {
                    TelemetryExtension.Current?.TrackException(ex);
                }

                catch { }

                await AccountsManager.Delete(login.LocalAccountId);
            }
        }
Ejemplo n.º 12
0
        private void LogOut(object sender, RoutedEventArgs e)
        {
            LoginWin win = new LoginWin();

            win.Show(); Close();
        }
Ejemplo n.º 13
0
 public LoginViewModel(LoginWin loginWin)
 {
     this.loginWin = loginWin;
     this.loginWin.LoginBtn.Click    += Login_Click;
     this.loginWin.RegisterBtn.Click += Register_Click;
 }