void ReleaseDesignerOutlets() { if (HeroPicker != null) { HeroPicker.Dispose(); HeroPicker = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (SubmitButton != null) { SubmitButton.Dispose(); SubmitButton = null; } if (VillainPicker != null) { VillainPicker.Dispose(); VillainPicker = null; } }
void ReleaseDesignerOutlets() { if (FirstPlayerImageView != null) { FirstPlayerImageView.Dispose(); FirstPlayerImageView = null; } if (FirstPlayerNameLabel != null) { FirstPlayerNameLabel.Dispose(); FirstPlayerNameLabel = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (SecondPlayerImageView != null) { SecondPlayerImageView.Dispose(); SecondPlayerImageView = null; } if (SecondPlayerNameLabel != null) { SecondPlayerNameLabel.Dispose(); SecondPlayerNameLabel = null; } }
private void Form1_Load(object sender, EventArgs e) { Serializer lastSession = new Serializer(entities); StopWorkButton.Enabled = false; Task.Factory.StartNew(async() => { while (running) { if (stopwatch.Running) { ResultLabel.Invoke((MethodInvoker) delegate { ResultLabel.Text = stopwatch.Elapsed.ToString("hh':'mm':'ss"); }); await Task.Delay(50); } else { await Task.Delay(500); } } }); aw = new ActiveWindow(ForegroundChanged); }
void ReleaseDesignerOutlets() { if (BetterAsyncButton != null) { BetterAsyncButton.Dispose(); BetterAsyncButton = null; } if (DownloadedImageView != null) { DownloadedImageView.Dispose(); DownloadedImageView = null; } if (GetButton != null) { GetButton.Dispose(); GetButton = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (ResultTextView != null) { ResultTextView.Dispose(); ResultTextView = null; } }
void DisplayResult(bool result, string description) { if (result == true) { //ResultLabel.Text = "Got it, Thanks!"; ResultLabel.Text = description; // kick off a timer to allow the user to see the result System.Timers.Timer timer = new System.Timers.Timer(); timer.AutoReset = false; timer.Interval = 500; timer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => { Rock.Mobile.Threading.Util.PerformOnUIThread(delegate { Parent.SetupComplete( ); }); }; timer.Start( ); } else { ResultLabel.Text = description; } ResultLabel.SizeToFit( ); View.SetNeedsLayout( ); }
void ReleaseDesignerOutlets() { if (LoginButton != null) { LoginButton.Dispose(); LoginButton = null; } if (PasswordFeild != null) { PasswordFeild.Dispose(); PasswordFeild = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (UserNameFeild != null) { UserNameFeild.Dispose(); UserNameFeild = null; } }
public string GoButt(int maxValue) { var resultText = new StringBuilder(); for (int trial = 2; trial <= maxValue; trial++) { bool isPrime = true; for (int divisor = 2; divisor <= Math.Sqrt(trial); divisor++) { if (trial % divisor == 0) { isPrime = false; break; } } if (isPrime) { resultText.AppendFormat("{0} ", trial); Thread.Sleep(1000); } } PrintInResultLabelDelegate delPrint = new PrintInResultLabelDelegate(Print); ResultLabel.Invoke(delPrint, new object[] { resultText.ToString() }); return(resultText.ToString()); }
void ReleaseDesignerOutlets() { if (CalculateButton != null) { CalculateButton.Dispose(); CalculateButton = null; } if (FirstNumberTextField != null) { FirstNumberTextField.Dispose(); FirstNumberTextField = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (SecondNumberTextField != null) { SecondNumberTextField.Dispose(); SecondNumberTextField = null; } }
public void SetStyle( ) { // setup the text fonts and colors StatusLabel.SetFont(ControlStylingConfig.Font_Bold, 24); StatusLabel.TextColor = ControlStylingConfig.TextField_ActiveTextColor; ResultSymbol.SetFont(PrivateControlStylingConfig.Icon_Font_Secondary, 64); ResultSymbol.TextColor = ControlStylingConfig.TextField_PlaceholderTextColor; ResultCircle.BackgroundColor = ControlStylingConfig.BG_Layer_Color; ResultLabel.SetFont(ControlStylingConfig.Font_Light, 14); ResultLabel.TextColor = ControlStylingConfig.TextField_PlaceholderTextColor; DoneButton.SetFont(ControlStylingConfig.Font_Regular, 14); DoneButton.TextColor = ControlStylingConfig.Button_TextColor; DoneButton.BackgroundColor = ControlStylingConfig.Button_BGColor; // setup the background layer colors //ResultBackground.BackgroundColor = ControlStylingConfig.BG_Layer_Color; //ResultBackground.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; //StatusBackground.BackgroundColor = layerBgColor; //StatusBackground.BorderColor = layerBorderColor; View.BackgroundColor = ControlStylingConfig.BackgroundColor; DoneButton.CornerRadius = 4; }
void ReleaseDesignerOutlets() { if (FilterComboBox != null) { FilterComboBox.Dispose(); FilterComboBox = null; } if (NoResultLabel != null) { NoResultLabel.Dispose(); NoResultLabel = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (SearchTableView != null) { SearchTableView.Dispose(); SearchTableView = null; } }
void ReleaseDesignerOutlets() { if (Build != null) { Build.Dispose(); Build = null; } if (CalculateBtn != null) { CalculateBtn.Dispose(); CalculateBtn = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (TipPercentSegment != null) { TipPercentSegment.Dispose(); TipPercentSegment = null; } }
protected override void OnMessage(Packet packet) { switch (packet.Head) { case Packet.HEADER.GAME_RESULT_RANK: { int playerCount = packet.Pop_Int32(); List <ResultLabel> resultLabels = new List <ResultLabel>(playerCount); for (int i = 0; i < playerCount; i++) { ResultLabel label = Instantiate(resultLabelPrefab, Vector3.zero, Quaternion.identity, this.transform); label.transform.localPosition = new Vector3(0.0f, top.localPosition.y - (interval * i), 0.0f); resultLabels.Add(label); } for (int i = resultLabels.Count; i > 0; i--) { resultLabels[i - 1].Rank.text = i.ToString(); resultLabels[i - 1].Score.text = packet.Pop_Int32().ToString(); resultLabels[i - 1].Nickname.text = packet.Pop_String(packet.Pop_Int32()); } break; } } }
private void Form1_Load(object sender, EventArgs e) { try { var dateNow = new List <string>() { DateTime.Now.ToString(dateForm) }; var loadSessionsSerialization = new Serializer <Session>(sessions, dateNow); sessions = loadSessionsSerialization.ReadEntities(); } catch (FileNotFoundException) { } try { var categories = new CategoriesManager(dateForm, categoriesFileName); categories.ReadCategories(); foreach (var category in categories.categoriesList) { categoriesList.Add(category); categoriesBox.Items.Add(category.categoryName); } } catch (FileNotFoundException) { } categoriesBox.Items.Add(addCat); categoriesBox.Items.Add(delCat); Task.Factory.StartNew(async() => { while (running) { if (stopwatch.Running) { ResultLabel.Invoke((MethodInvoker) delegate { ResultLabel.Text = stopwatch.Elapsed.ToString("hh':'mm':'ss"); }); await Task.Delay(50); } else { await Task.Delay(500); } } }); aw = new ActiveWindow(ForegroundChanged); StartButton.Enabled = false; PauseButton.Enabled = false; StopWorkButton.Enabled = false; }
public UIResultView(object parentView, RectangleF frame, DoneClickDelegate onClick) { View = PlatformView.Create( ); View.AddAsSubview(parentView); View.UserInteractionEnabled = false; StatusLabel = PlatformLabel.Create( ); //StatusBackground = PlatformView.Create( ); ResultSymbol = PlatformLabel.Create( ); ResultLabel = PlatformLabel.Create( ); //ResultBackground = PlatformView.Create( ); ResultCircle = PlatformCircleView.Create( ); ResultCircle.AddAsSubview(parentView); // setup our UI hierarchy //StatusBackground.AddAsSubview( parentView ); //StatusBackground.UserInteractionEnabled = false; //StatusBackground.BorderWidth = .5f; StatusLabel.AddAsSubview(parentView); StatusLabel.UserInteractionEnabled = false; //ResultBackground.AddAsSubview( parentView ); //ResultBackground.UserInteractionEnabled = false; //ResultBackground.BorderWidth = .5f; ResultSymbol.AddAsSubview(parentView); ResultSymbol.UserInteractionEnabled = false; ResultLabel.AddAsSubview(parentView); ResultLabel.UserInteractionEnabled = false; DoneButton = PlatformButton.Create( ); DoneButton.AddAsSubview(parentView); DoneButton.ClickEvent = ( PlatformButton button ) => { if (onClick != null) { onClick( ); } }; // default the view size and opacity SetOpacity(0.00f); SetBounds(frame); // give it a default style SetStyle( ); }
void ReleaseDesignerOutlets() { if (AboutButton != null) { AboutButton.Dispose(); AboutButton = null; } if (FahrenheitField != null) { FahrenheitField.Dispose(); FahrenheitField = null; } if (HistoryButton != null) { HistoryButton.Dispose(); HistoryButton = null; } if (HumidityField != null) { HumidityField.Dispose(); HumidityField = null; } if (HumiditySwitch != null) { HumiditySwitch.Dispose(); HumiditySwitch = null; } if (ImageView1 != null) { ImageView1.Dispose(); ImageView1 = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (WindSlider != null) { WindSlider.Dispose(); WindSlider = null; } if (WindSpeedLabel != null) { WindSpeedLabel.Dispose(); WindSpeedLabel = null; } }
partial void CalculateBtn_TouchUpInside(UIButton sender) { ResultLabel.ResignFirstResponder(); double montant = 0; double.TryParse(Build.Text, out montant); double tipPercent = (10f + (TipPercentSegment.SelectedSegment * 5)) / 100f; double tips = montant * tipPercent; MesTips.Add(tips); ResultLabel.Text = string.Format("le pourboire est de {0:C}", tips); }
private void TransformationButton_Click(object sender, EventArgs e) { ResultLabel.Show(); ResultLabel.Text = "Выберите преобразование"; comboBox1.Show(); comboBox1.SelectedItem = comboBox1.Items[0]; textBox1.Show(); textBox2.Show(); label1.Show(); label2.Show(); OkButton.Show(); mode = "transform"; }
private void Convert(double amount, string from, string to) { //Convert from and to using GetExchangeRate to perform the correct calculation. double convertedAmount = (amount / GetExchangeRate(from)) * GetExchangeRate(to); //Get the correct currency symbols for the currencies selected. Using the region specifiers doesn't work properly. char currencySymbolFrom = GetCurrencySymbol(from); char currencySymbolTo = GetCurrencySymbol(to); //Set up and show the result of the calculation. Not using the 'C' modifier because of the regional currency symbols. ResultLabel.Text = string.Format("{0}{1:N2} {2} is {3}{4:N2} {5}", currencySymbolFrom, amount, from, currencySymbolTo, convertedAmount, to); ResultLabel.Show(); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); Logo.Layer.Position = new CGPoint((View.Bounds.Width - Logo.Bounds.Width) / 2, 25); // Title RockUrlTitle.Layer.Position = new CGPoint((View.Bounds.Width - RockUrlField.Bounds.Width) / 2, View.Bounds.Height * .25f); // because there's no placeholder, we can't SizeToFit the URL Field, so we'll measure the font and then size it. RockUrlField.Bounds = new CGRect(0, 0, View.Bounds.Width * .75f, 0); CGSize size = RockUrlField.SizeThatFits(new CGSize(RockUrlField.Bounds.Width, RockUrlField.Bounds.Height)); RockUrlField.Bounds = new CGRect(RockUrlField.Bounds.X, RockUrlField.Bounds.Y, RockUrlField.Bounds.Width, (float)System.Math.Ceiling(size.Height)); // center the rock URL field and title RockUrlField.Layer.Position = new CGPoint((View.Bounds.Width - RockUrlField.Bounds.Width) / 2, RockUrlTitle.Frame.Bottom + 5); // Title RockAuthKeyTitle.Layer.Position = new CGPoint((View.Bounds.Width - RockUrlField.Bounds.Width) / 2, RockUrlField.Frame.Bottom + 20); // because there's no placeholder, we can't SizeToFit the URL Field, so we'll measure the font and then size it. RockAuthKeyField.Bounds = new CGRect(0, 0, View.Bounds.Width * .75f, 0); size = RockAuthKeyField.SizeThatFits(new CGSize(RockAuthKeyField.Bounds.Width, RockAuthKeyField.Bounds.Height)); RockAuthKeyField.Bounds = new CGRect(RockAuthKeyField.Bounds.X, RockAuthKeyField.Bounds.Y, RockAuthKeyField.Bounds.Width, (float)System.Math.Ceiling(size.Height)); RockAuthKeyField.Layer.Position = new CGPoint((View.Bounds.Width - RockAuthKeyField.Bounds.Width) / 2, RockAuthKeyTitle.Frame.Bottom + 5); // Description RockUrlDesc.Layer.Position = new CGPoint(RockUrlField.Frame.Left, RockAuthKeyField.Frame.Bottom + 5); // set the blocker BlockerView.SetBounds(View.Bounds.ToRectF( )); // set the submit bounds and position Submit.SizeToFit( ); Submit.Bounds = new CGRect(0, 0, RockUrlField.Bounds.Width * .35f, Submit.Bounds.Height * 1.25f); Submit.Layer.Position = new CGPoint(RockUrlField.Frame.Left + ((RockUrlField.Bounds.Width - Submit.Bounds.Width) / 2), RockUrlDesc.Frame.Bottom + 60); // let the label stretch the entire width ResultLabel.Bounds = new CGRect(0, 0, View.Bounds.Width, 0); ResultLabel.SizeToFit( ); ResultLabel.Frame = new CGRect(0, Submit.Frame.Bottom + 30, View.Bounds.Width, ResultLabel.Bounds.Height); }
public void SetBounds(RectangleF containerBounds) { View.Bounds = containerBounds; // setup the background layers /*StatusBackground.Frame = new RectangleF( View.Frame.X, * View.Frame.Top + Rock.Mobile.Graphics.Util.UnitToPx( 10 ), * View.Frame.Width, * Rock.Mobile.Graphics.Util.UnitToPx( 44 ) );*/ /*ResultBackground.Frame = new RectangleF( View.Frame.X, * View.Frame.Height / 3, * View.Frame.Width, * Rock.Mobile.Graphics.Util.UnitToPx( 150 ) );*/ // and the labels StatusLabel.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0); StatusLabel.SizeToFit( ); StatusLabel.Frame = new RectangleF((View.Frame.Width - StatusLabel.Frame.Width) / 2, View.Frame.Top + Rock.Mobile.Graphics.Util.UnitToPx(10), StatusLabel.Frame.Width, StatusLabel.Frame.Height); ResultSymbol.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0); ResultSymbol.SizeToFit( ); float circleWidth = ResultSymbol.Frame.Width * 1.25f; ResultCircle.Frame = new RectangleF((View.Frame.Width - circleWidth) / 2, Rock.Mobile.Graphics.Util.UnitToPx(140), circleWidth, circleWidth); ResultSymbol.Frame = new RectangleF(ResultCircle.Frame.X + (ResultCircle.Frame.Width - ResultSymbol.Frame.Width) / 2, ResultCircle.Frame.Y + (ResultCircle.Frame.Height - ResultSymbol.Frame.Height) / 2, ResultSymbol.Frame.Width, ResultSymbol.Frame.Height); ResultLabel.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0); ResultLabel.SizeToFit( ); ResultLabel.Frame = new RectangleF((View.Frame.Width - ResultLabel.Frame.Width) / 2, ResultCircle.Frame.Bottom + Rock.Mobile.Graphics.Util.UnitToPx(5), ResultLabel.Frame.Width, ResultLabel.Frame.Height); // lastly the button float doneWidth = Rock.Mobile.Graphics.Util.UnitToPx(122); DoneButton.Frame = new RectangleF((View.Frame.Width - doneWidth) / 2, ResultLabel.Frame.Bottom + Rock.Mobile.Graphics.Util.UnitToPx(10), doneWidth, DoneButton.Frame.Height); }
private void CheckButton_Click(object sender, EventArgs e) { CheckButton.Enabled = false; ResultLabel.ResetText(); string countryCode = ExtractCountryCodeFromInput(); string VATCode = ExtractVatCodeFromInput(); if (VatIsFine() && ValidateVatByCountryCode(countryCode, VATCode)) { CheckVatByVies(countryCode, VATCode); } else { ResultLabel.Text = MessageProvider.ErrorMessage(); } CheckButton.Enabled = true; }
public Form1() { InitializeComponent(); bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); g = Graphics.FromImage(bmp); pictureBox1.Image = bmp; TransformationButton.Enabled = false; DefinitionButton.Enabled = false; ResultLabel.Hide(); comboBox1.Hide(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); OkButton.Hide(); }
protected override void SetupLayoutConstraints() { base.SetupLayoutConstraints(); this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints(); this.AddConstraints( HeaderLabel.WithSameCenterX(this), HeaderLabel.WithSameCenterY(this)); this.AddConstraints( ResultLabel.Below(HeaderLabel, 24), ResultLabel.WithSameCenterX(this)); this.AddConstraints( NextButton.Below(ResultLabel, 24), NextButton.WithSameCenterX(this)); }
private void ResultLabel_DoubleClick(object sender, EventArgs e) { lock_Form = true; if (Result != "") { Clipboard.SetText(Result); } ResultLabel.Text = "翻译内容已复制至剪切板"; ResultLabel.Update(); new Thread(() => { Thread.Sleep(700); BeginInvoke(new Action(() => { lock_Form = false; DisposeForm(); }), null); }).Start(); }
void ReleaseDesignerOutlets() { if (CallBroButton != null) { CallBroButton.Dispose(); CallBroButton = null; } if (FindOutButton != null) { FindOutButton.Dispose(); FindOutButton = null; } if (InstructionsLabel != null) { InstructionsLabel.Dispose(); InstructionsLabel = null; } if (QueryDatePicker != null) { QueryDatePicker.Dispose(); QueryDatePicker = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (StatusLabel != null) { StatusLabel.Dispose(); StatusLabel = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } }
void ReleaseDesignerOutlets() { if (DownloadedImageView != null) { DownloadedImageView.Dispose(); DownloadedImageView = null; } if (getAsync != null) { getAsync.Dispose(); getAsync = null; } if (GetButton != null) { GetButton.Dispose(); GetButton = null; } if (getXMLX != null) { getXMLX.Dispose(); getXMLX = null; } if (kayitOldumu != null) { kayitOldumu.Dispose(); kayitOldumu = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (ResultTextView != null) { ResultTextView.Dispose(); ResultTextView = null; } }
void ReleaseDesignerOutlets() { if (OponentLabel != null) { OponentLabel.Dispose(); OponentLabel = null; } if (PaperButton != null) { PaperButton.Dispose(); PaperButton = null; } if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (RockButton != null) { RockButton.Dispose(); RockButton = null; } if (ScissorsButton != null) { ScissorsButton.Dispose(); ScissorsButton = null; } if (Timer != null) { Timer.Dispose(); Timer = null; } if (WinnerLabel != null) { WinnerLabel.Dispose(); WinnerLabel = null; } }
private void DefinitionButton_Click(object sender, EventArgs e) { if (current_primitive == "Point") { MessageBox.Show("Выберите другой примитив", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ResultLabel.Show(); ResultLabel.Text = "Точка не выбрана"; comboBox1.Hide(); textBox1.Hide(); textBox2.Hide(); label1.Hide(); label2.Hide(); OkButton.Hide(); mode = "define"; }
private void Check(Moves selection) { var random = new Random(); var position = random.Next(0, Options.Length); var machineChoose = Options[position]; if (selection == machineChoose) { ResultLabel.SetText(Results.TIE.ToString()); } else if (selection == Moves.Rock && machineChoose == Moves.Scissors) { ResultLabel.SetText(Results.WIN.ToString()); Counter += 1; } else if (selection == Moves.Rock && machineChoose == Moves.Paper) { ResultLabel.SetText(Results.LOSE.ToString()); } else if (selection == Moves.Paper && machineChoose == Moves.Rock) { ResultLabel.SetText(Results.WIN.ToString()); Counter += 1; } else if (selection == Moves.Paper && machineChoose == Moves.Scissors) { ResultLabel.SetText(Results.LOSE.ToString()); } else if (selection == Moves.Scissors && machineChoose == Moves.Paper) { ResultLabel.SetText(Results.WIN.ToString()); Counter += 1; } else if (selection == Moves.Scissors && machineChoose == Moves.Rock) { ResultLabel.SetText(Results.LOSE.ToString()); } WinnerLabel.SetText($"Wins: {Counter}"); OponentLabel.SetText($"Oponent: { machineChoose }"); }
void ReleaseDesignerOutlets() { if (ResultLabel != null) { ResultLabel.Dispose(); ResultLabel = null; } if (AlertOptions != null) { AlertOptions.Dispose(); AlertOptions = null; } if (ModalCounter != null) { ModalCounter.Dispose(); ModalCounter = null; } }