public Form1() { InitializeComponent(); //为这个委托变量赋值 changeProgerss = FunChangeProgress; changebtn = FunChangebutton; }
/// <summary> /// Filling the details in the conatct page /// </summary> public void FillTheDetails() { IWantToDropDown.Click(); IWantToDropDownOption.Click(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath(".//*[@id='contactForm']/div[4]/div[2]/div[2]/div/div[1]/button"))); ChangeButton.Click(); ChangeButtonOption.Click(); CurrentBenifitButton.Click(); CurrentBenifitButtonOption.Click(); DedutioPerDay.SendKeys(ExcelOperation.GetData[3]); PayDatePerChange.Click(); EmailID.Clear(); EmailID.SendKeys(ExcelOperation.GetData[4]); PreferedContact.Click(); MessageBox.SendKeys(ExcelOperation.GetData[5]); if (SubmitMessage.Text != "Submit") { throw new Exception(); } }
public void JumpEnd(bool bDie) { //점프 모션이 끝나면 호출 Transform tr = m_PlayerManager.GetCharTR(); if (bDie) { //캐릭터가 죽었을 시에는 현재 남아있는 캐릭터 중 하나로 자동 교체된다. m_EnemyMangaer.Stop(); m_iTmpIndex = m_PlayerManager.DontDie(); } if (m_iTmpIndex >= 0) { int[] iarr = GameManager.instance.ReturnPlayerList(); int iCurList = GameManager.instance.ReturnCurPlayer(); if (m_Change == null) { GameObject UI = GameObject.Find("GameUI").transform.Find("PlayerKey").gameObject; for (int i = 0; i < 2; i++) { GameObject Button = UI.transform.GetChild(i + 4).gameObject; if (Button.activeSelf) { m_Change = Button.GetComponent <ChangeButton>(); break; } } } m_Change.Change(iarr[iCurList], iCurList, m_PlayerManager.GetPlayerData(PLAYER_DATA.PLAYER_CUR_HP), m_PlayerManager.GetPlayerData(PLAYER_DATA.PLAYER_MAX_HP), m_PlayerManager.GetPlayerData(PLAYER_DATA.PLAYER_CUR_SP), m_PlayerManager.GetPlayerData(PLAYER_DATA.PLAYER_MAX_SP)); //캐릭터 버튼 체인지 및 쿨타임 실행 m_PlayerManager.PlayerSet(m_iTmpIndex, tr.position, tr.rotation, JumpEnd); //캐릭터의 위치와 교대하고 m_EnemyMangaer.TrSetting(m_PlayerManager.GetCharTR()); //에너미의 타겟을 새로 설정하고 m_EnemyMangaer.Start(); //코루틴 스타트 m_CallBack(m_PlayerManager.GetCharTR()); //카메라 콜백 함수 재선언 m_bChanging = true; m_Change = null; } else { PlayerDie(); } }
private void SecureSettingsShow() { ChangePassLabel.Show(); OldPasswordTextBox.Show(); NewPasswordTextBox.Show(); ConfirmPasswordTextBox.Show(); ChangeButton.Show(); materialDivider1.Show(); CreateKeyLabel.Show(); SecureKeyDescLabel.Show(); CreateKeyButton.Show(); WarningLabel.Show(); }
public void Previous() { var last = CurrentButton.Value; if (CurrentButton.Previous != null) { CurrentButton = CurrentButton.Previous; } else if (Curcule) { CurrentButton = CurrentButton.List.Last; } ChangeButton.Invoke(last, CurrentButton.Value); }
public void Next() { var last = CurrentButton.Value; if (CurrentButton.Next != null) { CurrentButton = CurrentButton.Next; } else if (Curcule) { CurrentButton = CurrentButton.List.First; } ChangeButton.Invoke(last, CurrentButton.Value); }
void ReleaseDesignerOutlets() { if (ChangeButton != null) { ChangeButton.Dispose(); ChangeButton = null; } if (ChangeColorBtn != null) { ChangeColorBtn.Dispose(); ChangeColorBtn = null; } }
public void ChangeChar() { GameObject cur = UIEventTrigger.current.gameObject; ChangeButton Button = cur.GetComponent <ChangeButton>(); if (Button.ChangeOK && m_bChanging) //바꿔도 됨 { m_Change = Button; m_bChanging = false; //캐릭터 체인지 m_EnemyMangaer.Stop(); //우선 적들을 멈춰 주고 m_iTmpIndex = Button.ListIndex; //버튼의 인덱스를 저장한 다음 m_PlayerManager.JumpStart(); //점프 액션 수행 } }
void ReleaseDesignerOutlets() { if (Button2 != null) { Button2.Dispose(); Button2 = null; } if (ChangeButton != null) { ChangeButton.Dispose(); ChangeButton = null; } if (HiLabel != null) { HiLabel.Dispose(); HiLabel = null; } }
private void ChangeButton_Click(object sender, EventArgs e) { if (LoginContext == IsLogedIn.LoginOk) { LoginBox.Text = ""; Size = new Size(400, 150); LoginBox.Enabled = true; LoginBox.Font = new Font(LoginBox.Font, FontStyle.Regular); LoginBox.Size = new Size(300, 20); LoginBox.Location = new Point(88, 38); LoginContext = IsLogedIn.No; label1.Text = "Identifiant :"; label1.Location = new Point(12, 41); PasswordBox.Hide(); ImageBox.Hide(); ConnectButton.Location = new Point(150, 100); ChangeButton.Hide(); TokenCheckbox.Hide(); } }
/// <summary> /// Initializes the web page. /// </summary> /// <param name="sender">Source of this event.</param> /// <param name="e">Arguments of this event.</param> protected void Page_Load(object sender, EventArgs e) { ConfigurationFile config = ConfigurationFile.Current; CategorizedSettingsElementCollection settings = config.Settings[SettingsCategory]; CategorizedSettingsElement setting; // Setup company logo. setting = settings["CompanyLogo"]; if ((object)setting != null) { LogoImage.ImageUrl = setting.Value; } else { LogoImage.ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(SecurityPortal), EmbeddedCompanyLogo); } // Setup company link. setting = settings["CompanyLink"]; if ((object)setting != null) { LogoLink.NavigateUrl = setting.Value; } else { LogoLink.NavigateUrl = DefaultCompanyLink; } // Setup help link. setting = settings["HelpPage"]; if ((object)setting != null) { HelpLink.NavigateUrl = setting.Value; } else { HelpLink.NavigateUrl = Page.ClientScript.GetWebResourceUrl(typeof(SecurityPortal), EmbeddedHelpFile); } // Setup footer information. setting = settings["FooterText"]; if ((object)setting != null) { FooterLabel.Text = setting.Value; } else { FooterLabel.Text = DefaultFooterText; } HelpImage.ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(SecurityPortal), EmbeddedHelpImage); WarningImage.ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(SecurityPortal), EmbeddedWarningImage); StyleSheet.Attributes["href"] = Page.ClientScript.GetWebResourceUrl(typeof(SecurityPortal), EmbeddedStyleSheet); if (Request[StatusCodeRequestKey] == AccessDeniedStatusCode) { // Show access denied. Page.Title = StaticPageTitle + " :: Access Denied"; AccessDeniedPanel.Visible = true; ContentPlaceHolder.Controls.Add(AccessDeniedPanel); } else if (Request[StatusCodeRequestKey] == PasswordChangeStatusCode) { // Show change password. Page.Title = StaticPageTitle + " :: Change Password"; ChangePasswordPanel.Visible = true; ContentPlaceHolder.Controls.Add(ChangePasswordPanel); // Setup UI. ChangeButton.SetSubmitOnce(); ChangePasswordPanel.DefaultButton = ChangeButton.ID; if (!Page.IsPostBack) { ChangePasswordUsername.Text = GetSavedUsername(); if (string.IsNullOrEmpty(ChangePasswordUsername.Text)) { ChangePasswordUsername.Focus(); } else { ChangePasswordOldPassword.Focus(); } } } else if (Request[StatusCodeRequestKey] == PasswordResetStatusCode) { // Show reset password. Page.Title = StaticPageTitle + " :: Reset Password"; if ((object)ViewState[UsernameKey] == null) { // Check for reset support. ResetPasswordCheckPanel.Visible = true; ContentPlaceHolder.Controls.Add(ResetPasswordCheckPanel); // Setup UI. ResetCheckButton.SetSubmitOnce(); ResetPasswordUsername.Focus(); ResetPasswordCheckPanel.DefaultButton = ResetCheckButton.ID; } else { // Perform password reset. ResetPasswordFinalPanel.Visible = true; ContentPlaceHolder.Controls.Add(ResetPasswordFinalPanel); // Setup UI. ResetFinalButton.SetSubmitOnce(); ResetPasswordSecurityAnswer.Focus(); ResetPasswordFinalPanel.DefaultButton = ResetFinalButton.ID; ResetPasswordSecurityQuestion.Text = ViewState["SecurityQuestion"].ToString(); MessageLabel.Text = string.Empty; } } else if (Request[StatusCodeRequestKey] == UnauthorizedStatusCode || (object)SecurityProviderCache.CurrentProvider == null || !User.Identity.IsAuthenticated) { // Show login. Page.Title = StaticPageTitle + " :: Login"; LoginPanel.Visible = true; ContentPlaceHolder.Controls.Add(LoginPanel); // Setup UI. LoginButton.SetSubmitOnce(); LoginPanel.DefaultButton = LoginButton.ID; ForgotPassword.NavigateUrl = GetRedirectUrl(PasswordResetStatusCode); ChangePassword.NavigateUrl = GetRedirectUrl(PasswordChangeStatusCode); if (!Page.IsPostBack) { LoginUsername.Text = GetSavedUsername(); if (string.IsNullOrEmpty(LoginUsername.Text)) { LoginUsername.Focus(); } else { LoginPassword.Focus(); RememberUsername.Checked = true; } } } else { // Show my account. Page.Title = StaticPageTitle + " :: My Account"; MyAccountPanel.Visible = true; ContentPlaceHolder.Controls.Clear(); ContentPlaceHolder.Controls.Add(MyAccountPanel); // Setup UI. UpdateButton.SetSubmitOnce(); MyAccountPanel.DefaultButton = UpdateButton.ID; if (!Page.IsPostBack) { ISecurityProvider provider = SecurityProviderCache.CurrentProvider; ShowUserData(provider); if (!provider.CanUpdateData) { AccountUserFirstName.Enabled = false; AccountUserLastName.Enabled = false; AccountUserEmailAddress.Enabled = false; AccountUserPhoneNumber.Enabled = false; AccountUserSecurityAnswer.Enabled = false; UpdateButton.Enabled = false; } } } }
private void ConnectButton_Click(object sender, EventArgs e) { switch (LoginContext) { case IsLogedIn.No: if (LoginBox.Text == "" || LoginBox.Text == "Entrez un identifiant") { LoginBox.Text = "Entrez un identifiant"; LoginBox.Focus(); } else { RestRequest Request = new RestRequest($"ranking/search/{LoginBox.Text}/false/true/false"); Request.OnBeforeDeserialization = resp => { resp.ContentType = "application/json"; }; ConnectButton.Text = "..."; var SearchResponse = Client.Execute <SearchResults>(Request).Data; if (SearchResponse.success) { if (SearchResponse.results.Count == 0) { MessageBox.Show("Aucun compte ne correspond à cet identifiant"); } else { LoginBox.Text = SearchResponse.results[0].name; Size = new Size(400, 350); LoginBox.Enabled = false; LoginBox.Font = new Font(LoginBox.Font, FontStyle.Bold); LoginBox.Size = new Size(LoginBox.PreferredSize.Width - 5, LoginBox.PreferredSize.Height); LoginBox.Location = new Point((Size.Width - LoginBox.Size.Width) / 2, 225); LoginContext = IsLogedIn.LoginOk; label1.Text = "Mot de passe :"; label1.Location = new Point(12, 278); PasswordBox.Show(); File.WriteAllBytes(Path.Combine(Directory.GetCurrentDirectory(), LoginBox.Text + "_image.jpg"), new RestClient((SearchResponse.results[0].image.StartsWith("http") ? "" : "http://www.leekwars.com/") + SearchResponse.results[0].image).DownloadData(new RestRequest())); ImageBox.ImageLocation = Path.Combine(Directory.GetCurrentDirectory(), LoginBox.Text + "_image.jpg"); ImageBox.Show(); ConnectButton.Location = new Point(200, 315); ChangeButton.Show(); TokenCheckbox.Show(); PasswordBox.Focus(); } } else { MessageBox.Show("Une erreur est survenue"); } ConnectButton.Text = "Connexion"; } break; case IsLogedIn.LoginOk: if (PasswordBox.Text == "" || PasswordBox.Text == "Entrez un mot de passe") { PasswordBox.Text = "Entrez un mot de passe"; PasswordBox.Focus(); } else { RestRequest Request = new RestRequest($"farmer/login-token/{LoginBox.Text}/{PasswordBox.Text}"); Request.OnBeforeDeserialization = resp => { resp.ContentType = "application/json"; }; ConnectButton.Text = "..."; var LoginResponse = Client.Execute <Login>(Request).Data; if (LoginResponse.success) { if (TokenCheckbox.Checked) { MessageBox.Show(LoginResponse.token, "Token"); } LoginContext = IsLogedIn.PassWordOk; var GUI = new GUI(LoginResponse); GUI.Show(); Hide(); } else { MessageBox.Show("Mauvais mot de passe"); PasswordBox.Focus(); } } ConnectButton.Text = "Connexion"; break; } }
public void ClickChangeButton() { ChangeButton.Click(); }
private void Start() { Instance = this; }
public void SetControlType(AccountType type) { CoinsViewModel model = new CoinsViewModel(_controlType = type).BindToMainModel(); model.InitTemplate(() => { if (model.PayBalance > 0) { int h = 40 * _drawnCoins.Count; StringBuilder template = new StringBuilder(); template.AppendFormat("<ToolTip xmlns ='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'><ToolTip.Style><Style TargetType=\"ToolTip\"><Setter Property=\"OverridesDefaultStyle\" Value=\"True\" /><Setter Property=\"Template\"><Setter.Value><ControlTemplate TargetType=\"ToolTip\"><Border BorderBrush=\"Black\" BorderThickness=\"1\"><Grid Height=\"{0}\" Width=\"140\" Background=\"AntiqueWhite\"><Canvas Margin=\"5,5,5,5\">", h); foreach (KeyValuePair <CoinType, int> coin in _drawnCoins) { template.AppendFormat("<Image x:Name=\"ibar{0}\" Stretch=\"None\" Width=\"100\" Height=\"30\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Left\">", (int)coin.Key); template.Append("<Image.Style><Style TargetType=\"{x:Type Image}\"></Style></Image.Style></Image>"); template.AppendFormat("<Label x:Name=\"lbl{0}\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Right\" FontWeight=\"Normal\" FontStyle=\"Italic\">x{1}</Label>", (int)coin.Key, coin.Value); } template.Append("</Canvas></Grid></Border></ControlTemplate></Setter.Value></Setter></Style></ToolTip.Style></ToolTip>"); ToolTip tooltip = (ToolTip)XamlReader.Parse(template.ToString()); tooltip.AddHandler(LoadedEvent, new RoutedEventHandler((object o, RoutedEventArgs e) => { int i = _drawnCoins.Count - 1; ToolTip tt = o as ToolTip; foreach (KeyValuePair <CoinType, int> coin in _drawnCoins) { Image img = tt.Template.FindName(string.Format("ibar{0}", (int)coin.Key), tt) as Image; Style simg = new Style(typeof(Image)); simg.Setters.Add(new Setter(Image.SourceProperty, ResourceLoadHelper.GetCoinsProgressBarLineImage(AccountType.Customer, (int)coin.Key, new Size(100, 30), coin.Value, 10, (Color)ColorConverter.ConvertFromString("Gold"), (Color)ColorConverter.ConvertFromString("Chocolate")).Source)); img.Style = simg; Label lbl = tt.Template.FindName(string.Format("lbl{0}", (int)coin.Key), tt) as Label; Canvas.SetTop(lbl, 10 + i * 40); Canvas.SetRight(lbl, 0); Canvas.SetTop(img, i-- *40); } _drawnCoins.Clear(); })); return(tooltip); } return(null); }); DataContext = model; switch (_controlType) { case AccountType.Customer: ChangeButton.Visibility = Visibility.Collapsed; Canvas.SetTop(ProgressBar1, 0); Canvas.SetTop(ProgressBar2, 40); Canvas.SetTop(ProgressBar5, 80); Canvas.SetTop(ProgressBar10, 120); break; case AccountType.VendingMachine: DropCoins.Visibility = Visibility.Collapsed; Canvas.SetLeft(ProgressBar1, 0); Canvas.SetLeft(ProgressBar2, 40); Canvas.SetLeft(ProgressBar5, 80); Canvas.SetLeft(ProgressBar10, 120); break; default: break; } ProgressBar1.SetControlType(type, CoinType.coin1); ProgressBar2.SetControlType(type, CoinType.coin2); ProgressBar5.SetControlType(type, CoinType.coin5); ProgressBar10.SetControlType(type, CoinType.coin10); Binding toolTip = new Binding("PutCoinBox.ToolTip"); toolTip.Source = model; toolTip.Mode = BindingMode.OneWay; ChangeButton.SetBinding(Button.ToolTipProperty, toolTip); if (_controlType == AccountType.Customer) { model.DisposeRequest += Dispose; } }
private void SetBtnState (ref Package pack, ref ChangeButton changeBtn, ref UITexture texture) { if (pack.ID == PlayerPrefs.GetString (NameManager.PREF_PLAY_PACKAGE, NameManager.PREF_PLAY_PACKAGE_DEFAULT)) { changeBtn.SetButtons (ButtonState.NONE); texture.material.SetFloat ("_EffectAmount", 1); changeBtn.SetButtons (ButtonState.NONE); return; } else { texture.material.SetFloat ("_EffectAmount", 0); } bool isBuy = IsBuy (pack.ID); bool isDownlaod = IsDownload (pack.ID); if ((pack.IsBuy && pack.IsDownload) || (isBuy && isDownlaod)) { changeBtn.SetButtons (ButtonState.PLAY); } else if (pack.IsBuy || isBuy) { changeBtn.SetButtons (ButtonState.DOWNLOAD); } else { changeBtn.SetButtons (ButtonState.BUY); } }