protected void Page_Load(object sender, EventArgs e) { this.employeeRole = Common.GetEncryptedQueryStringValue("Description", ""); LabelPageTitle.Text = (this.employeeRole == "") ? "New Role" : "Edit Role"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxDescription.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxDescription.Focus(); if (ViewState["employeeRole"] != null) { this.employeeRole = ViewState["employeeRole"].ToString(); } if (this.employeeRole != "") { BindRole(); ButtonDelete.Visible = Roles.IsUserInRole("Administrator") || Roles.IsUserInRole("Supplier"); } else { ButtonDelete.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { this.securityLevelId = Common.GetEncryptedQueryStringValue("SecurityLevelId", 0); LabelPageTitle.Text = (this.securityLevelId == 0) ? "New Security Level" : "Edit Security Level"; Page.Form.DefaultFocus = TextBoxDescription.ClientID; Page.Form.DefaultButton = ButtonSave.UniqueID; if (!IsPostBack) { TextBoxDescription.Focus(); ButtonSave.Visible = true; ButtonSaveNew.Visible = true; if (ViewState["SecurityLevelId"] != null) { this.securityLevelId = Convert.ToInt32(ViewState["SecurityLevelId"].ToString()); } if (this.securityLevelId != 0) { BindSecurityLevel(); } } }
private void UserControl_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { if (TextBoxNumber.IsKeyboardFocused) { Keyboard.Focus(TextBoxSymbol); TextBoxSymbol.SelectAll(); } else if (TextBoxSymbol.IsKeyboardFocused) { Keyboard.Focus(TextBoxDescription); TextBoxDescription.SelectAll(); } else if (TextBoxDescription.IsKeyboardFocused) { Keyboard.Focus(TextBoxNumber); TextBoxNumber.SelectAll(); } if (Keyboard.Modifiers == ModifierKeys.Shift) { RaiseEvent(new RoutedEventArgs(EntryCompleteEvent, this)); } } }
private void AddUpdatedLabel(string fieldName, string labelCaption) { if (String.IsNullOrEmpty(labelCaption)) { return; } Label newLabel = new Label(); newLabel.AutoSize = true; newLabel.Location = new System.Drawing.Point(labelUpdateIssueNote.Location.X, labelUpdateIssueNote.Location.Y); newLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); newLabel.Name = "labelUpdateField_" + fieldName; newLabel.Size = new System.Drawing.Size(44, 13); newLabel.TabIndex = 4; newLabel.Text = labelCaption; newLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); Controls.Add(newLabel); if (newLabel.Size.Width > Size.Width - newLabel.Location.X - 10) { this.Size = new Size(newLabel.Location.X + newLabel.Size.Width + 10, this.Size.Height); } SuspendLayout(); int newLabelHeight = newLabel.Height + 5; Size = new System.Drawing.Size(Size.Width, Size.Height + newLabelHeight); MinimumSize = new System.Drawing.Size(MinimumSize.Width, MinimumSize.Height + newLabelHeight); labelUpdateIssueNote.MoveControl(0, newLabelHeight); TextBoxDescription.MoveControl(0, newLabelHeight); BtnSaveButton.MoveControl(0, newLabelHeight); BtnCancelButton.MoveControl(0, newLabelHeight); ResumeLayout(false); }
protected void Page_Load(object sender, EventArgs e) { this.supplierId = Common.GetEncryptedQueryStringValue("supplierId", 0); LabelPageTitle.Text = (this.supplierId == 0) ? "New Supplier" : "Edit Supplier"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxDescription.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxDescription.Focus(); BindSupplierType(); ButtonSaveEdit.Visible = true; //ButtonSaveNew.Visible = true; if (ViewState["supplierId"] != null) { this.supplierId = Convert.ToInt32(ViewState["supplierId"].ToString()); } if (this.supplierId != 0) { BindSupplier(); BindSupplierContact(); BindSupplierContactList(); } } }
protected void Page_Load(object sender, EventArgs e) { this.merchandisingGroupCustomId = Common.GetEncryptedQueryStringValue("merchandisingGroupCustomId", 0); LabelPageTitle.Text = (this.merchandisingGroupCustomId == 0) ? "New Merchandising Custom Group" : "Edit Merchandising Custom Group"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxDescription.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxDescription.Focus(); GridViewResult.Visible = false; BindMerchandisingGroupCustom(); ButtonSaveEdit.Visible = true; ButtonSaveNew.Visible = true; ButtonSaveEdit.Text = "Save and Add Category"; if (ViewState["merchandisingGroupCustomId"] != null) { this.merchandisingGroupCustomId = Convert.ToInt32(ViewState["merchandisingGroupCustomId"].ToString()); } if (this.merchandisingGroupCustomId != 0) { BindMerchandisingGroupCustom(); BindGridViewResult(); GridViewResult.Visible = true; ButtonSaveEdit.Text = "Save and Edit"; } } }
private void AddLine(string bold_text, string regular_text) { CursorY += 16; TextBoxDescription.SelectionFont = BoldFont; TextBoxDescription.AppendText(bold_text); TextBoxDescription.SelectionFont = RegularFont; TextBoxDescription.AppendText(regular_text + "\r\n"); }
private void ButtonEdit_Click(object sender, EventArgs e) { TextBoxDescription.Enabled = true; ButtonNew.Enabled = false; ButtonEdit.Enabled = true; ButtonSave.Enabled = true; ButtonDelete.Enabled = false; _save = false; TextBoxDescription.Focus(); }
private void ButtonNew_Click(object sender, EventArgs e) { TextBoxDescription.Enabled = true; ButtonEdit.Enabled = false; ButtonSave.Enabled = true; ButtonDelete.Enabled = false; TextBoxDescription.Text = ""; _meterTypeId = 0; TextBoxDescription.Focus(); }
/// <summary> /// Text /// </summary> /// <param name="displayName"></param> /// <param name="text"></param> /// <returns></returns> public static IGroupContainer <T, TextBoxDescription> Text <T>(this IGroupContainer <T> root, String displayName, Expression <PropertyGetter <T> > text, String stringFormat = null, Expression <PropertyGetter <T> > command = null) { var item = new TextBoxDescription( displayName, PropertyPath.GetPropertyPath(text), stringFormat, true, PropertyPath.GetPropertyPath(command)); return(root.AddDescription(item)); }
public void ClearDescription() { RuneImage.Image = null; CursorY = 0; TextBoxDescription.Clear(); foreach (var pb in Links) { TextBoxDescription.Controls.Remove(pb); } Links.Clear(); }
public void SetSpellRune(Spell s) { SetRune(s); s.Description = database_ref.ExtractAbilitiesAndConditions(s.Description, ref s.DescriptionAbilities, ref s.DescriptionConditions); AddLine("Nora cost: ", s.NoraCost.ToString()); AddLine("", ""); AddLine("", s.Description); AddLine("", ""); TextBoxDescription.SelectionFont = ItalicFont; TextBoxDescription.AppendText(s.Flavor + "\r\n"); }
public void SetEquipmentRune(Equipment e) { SetRune(e); e.Description = database_ref.ExtractAbilitiesAndConditions(e.Description, ref e.DescriptionAbilities, ref e.DescriptionConditions); AddLine("Nora cost: ", e.NoraCost.ToString()); AddLine("", ""); AddLine("", e.Description); AddLine("", ""); TextBoxDescription.SelectionFont = ItalicFont; TextBoxDescription.AppendText(e.Flavor + "\r\n"); }
public void SetRelicRune(Relic r) { SetRune(r); r.Description = database_ref.ExtractAbilitiesAndConditions(r.Description, ref r.DescriptionAbilities, ref r.DescriptionConditions); AddLine("Nora cost: ", r.NoraCost.ToString()); AddLine("Defense: ", r.Defense.ToString()); AddLine("Hit points: ", r.HitPoints.ToString()); AddLine("Size: ", r.Size.ToString()); AddLine("", ""); AddLine("", r.Description); AddLine("", ""); TextBoxDescription.SelectionFont = ItalicFont; TextBoxDescription.AppendText(r.Flavor + "\r\n"); }
protected void Page_Load(object sender, EventArgs e) { this.productId = Common.GetEncryptedQueryStringValue("ProductId", 0); this.supplierId = Common.GetEncryptedQueryStringValue("SupplierId", 0); LabelPageTitle.Text = (this.productId == 0) ? "New Product" : "Edit Product"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxDescription.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxDescription.Focus(); BindProductSparHierarchySegment(); BindProductSparHierarchyFamily(); BindProductBrand(); BindMerchandisingGroup(); BindMerchandisingCategory(); ButtonSaveEdit.Visible = true; //ButtonSaveNew.Visible = true; if (ViewState["ProductId"] != null) { this.productId = Convert.ToInt32(ViewState["ProductId"].ToString()); } if (ViewState["SupplierId"] != null) { this.supplierId = Convert.ToInt32(ViewState["SupplierId"].ToString()); } if (this.productId != 0) { BindProduct(); } } }
private void SetRune(Rune r) { ClearDescription(); Program.image_cache.LoadRuneImage(r.Hash); TextBoxDescription.Clear(); TextBoxDescription.SelectionColor = Color.LightGray; TextBoxDescription.SelectionFont = ItalicFont; TextBoxDescription.AppendText("Illustrated by " + r.Artist + "\r\n\r\n"); TextBoxDescription.SelectionColor = GetColorByRarity(r.Rarity); TextBoxDescription.SelectionFont = BoldFont; TextBoxDescription.AppendText(r.Name + "\r\n"); CursorY += 32; TextBoxDescription.SelectionColor = Color.LightGray; AddLine("Expansion: ", r.Expansion); string faction = ""; for (int i = 0; i < r.Faction.Count - 1; i++) { faction += r.Faction[i] + ", "; } if (r.Faction.Count != 0) { faction += r.Faction[r.Faction.Count - 1]; } AddLine("Faction: ", faction); AddLine("Deck limit: ", r.DeckLimit.ToString()); AddLine("", ""); }
public void SetAbility(Ability a) { ClearDescription(); a.Description = database_ref.ExtractAbilitiesAndConditions(a.Description, ref a.DescriptionAbilities, ref a.DescriptionConditions); TextBoxDescription.Clear(); TextBoxDescription.SelectionColor = Color.White; AddLine(a.ToString(), ""); TextBoxDescription.SelectionColor = Color.LightGray; AddLine("Nora cost: ", a.NoraCost.ToString()); AddLine("AP cost: ", a.APCost.ToString()); AddLine("Cooldown: ", a.Cooldown.ToString()); TextBoxDescription.SelectionColor = Color.LightGray; TextBoxDescription.AppendText("\r\n"); TextBoxDescription.SelectionFont = RegularFont; TextBoxDescription.AppendText(a.Description + "\r\n"); }
private void Window_Loaded(object sender, RoutedEventArgs e) { TextBoxDescription.Focus(); TextBoxDescription.SelectAll(); }
public void SetChampionRune(Champion c) { SetRune(c); AddLine("Default nora cost: ", c.DefaultNoraCost.ToString()); string cl = ""; for (int i = 0; i < c.Class.Count - 1; i++) { cl += c.Class[i] + ", "; } if (c.Class.Count != 0) { cl += c.Class[c.Class.Count - 1]; } AddLine("Class: ", cl); string race = ""; for (int i = 0; i < c.Race.Count - 1; i++) { race += c.Race[i] + ", "; } if (c.Race.Count != 0) { race += c.Race[c.Race.Count - 1]; } AddLine("Race: ", race); AddLine("Damage: ", c.Damage.ToString()); AddLine("Speed: ", c.Speed.ToString()); AddLine("Range: ", c.MinRNG.ToString() + " - " + c.MaxRNG.ToString()); AddLine("Defense: ", c.Defense.ToString()); AddLine("Hit points: ", c.HitPoints.ToString()); AddLine("Size: ", c.Size.ToString()); AddLine("", ""); AddLine("Abilities:", ""); foreach (var ab in c.BaseAbilities_refs) { if (ab.Name.Contains("Attack: ")) { TextBoxDescription.SelectionColor = Color.LightGray; TextBoxDescription.SelectionFont = RegularFont; TextBoxDescription.AppendText("(" + ab.NoraCost.ToString() + ") Attack: "); TextBoxDescription.SelectionColor = GetColorByAttackType(ab.Name.Substring(8)); TextBoxDescription.SelectionFont = BoldFont; TextBoxDescription.AppendText(ab.Name.Substring(8) + "\r\n"); /*TextBoxDescription.SelectionColor = Color.LightGray; * TextBoxDescription.SelectionFont = RegularFont; * TextBoxDescription.AppendText(" (" + ab.NoraCost.ToString() + ")\r\n");*/ CursorY += 16; } else { AddLine("", "(" + ab.NoraCost.ToString() + ") " + ab.ToString()); } AddLink(new Point() { X = 220, Y = CursorY }, new TracerViewData() { ID = ab.ID, Type = Pox.DataElement.ElementType.ABILITY }); } foreach (var ab in c.UpgradeAbilities1_refs) { TextBoxDescription.SelectionColor = Color.PaleTurquoise; if (c.UpgradeAbilities1_refs.IndexOf(ab) == c.DefaultUpgrade1Index) { TextBoxDescription.SelectionColor = Color.Cyan; AddLine("(" + ab.NoraCost.ToString() + ") " + ab.ToString(), ""); } else { TextBoxDescription.SelectionColor = Color.DeepSkyBlue; AddLine("", "(" + ab.NoraCost.ToString() + ") " + ab.ToString()); } AddLink(new Point() { X = 220, Y = CursorY }, new TracerViewData() { ID = ab.ID, Type = Pox.DataElement.ElementType.ABILITY }); } foreach (var ab in c.UpgradeAbilities2_refs) { if (c.UpgradeAbilities2_refs.IndexOf(ab) == c.DefaultUpgrade2Index) { TextBoxDescription.SelectionColor = Color.Lime; AddLine("(" + ab.NoraCost.ToString() + ") " + ab.ToString(), ""); } else { TextBoxDescription.SelectionColor = Color.LimeGreen; AddLine("", "(" + ab.NoraCost.ToString() + ") " + ab.ToString()); } AddLink(new Point() { X = 220, Y = CursorY }, new TracerViewData() { ID = ab.ID, Type = Pox.DataElement.ElementType.ABILITY }); } TextBoxDescription.SelectionColor = Color.LightGray; TextBoxDescription.AppendText("\r\n"); TextBoxDescription.SelectionFont = ItalicFont; TextBoxDescription.AppendText(c.Description + "\r\n"); }