public void ReplaceStyle(CStyleItem target, CStyleItem newitem) { int index = this._styles.IndexOf(target); if (index >= 0) { this._styles[index] = newitem; } }
private void btnItemUp_Click(object sender, EventArgs e) { if ((this.listStyleItem.SelectedItem != null) && (this.listStyleItem.SelectedIndex > 0)) { int selectedIndex = this.listStyleItem.SelectedIndex; CStyleItem selectedItem = (CStyleItem)this.listStyleItem.SelectedItem; this.listStyleItem.Items[selectedIndex] = this.listStyleItem.Items[selectedIndex - 1]; this.listStyleItem.Items[selectedIndex - 1] = selectedItem; this.listStyleItem.SelectedIndex = selectedIndex - 1; } }
private void btnItemDown_Click(object sender, EventArgs e) { if ((this.listStyleItem.SelectedItem != null) && ((this.listStyleItem.SelectedIndex + 1) < this.listStyleItem.Items.Count)) { int selectedIndex = this.listStyleItem.SelectedIndex; CStyleItem selectedItem = (CStyleItem)this.listStyleItem.SelectedItem; this.listStyleItem.Items[selectedIndex] = this.listStyleItem.Items[selectedIndex + 1]; this.listStyleItem.Items[selectedIndex + 1] = selectedItem; this.listStyleItem.SelectedIndex = selectedIndex + 1; } }
protected int GetTerminate() { for (int i = 0; i < base.Items.Count; i++) { CStyleItem item = (CStyleItem)base.Items[i]; if (item.IsTerminate) { return(i); } } return(-1); }
private void InsertStyleItem() { if (this.listAllStyleItem.SelectedItem != null) { CStyleItem item = (CStyleItem)((CStyleItem)this.listAllStyleItem.SelectedItem).Clone(); if (item.IsSetting) { item.StyleItemSetting(); } if (this.listStyleItem.SelectedIndex == -1) { this.listStyleItem.Items.Add(item); this.listStyleItem.SelectedIndex = this.listStyleItem.Items.Count - 1; } else { this.listStyleItem.Items.Insert(this.listStyleItem.SelectedIndex + 1, item); this.listStyleItem.SelectedIndex++; } } }
protected override void DrawItemString(Graphics g, object item, Font font, Brush brush, Rectangle bounds, StringFormat sf, int index) { if (index >= 0) { string displayName; string description; Rectangle rectangle = bounds; if (!base.DesignMode) { CStyleItem item2 = (CStyleItem)item; displayName = item2.GetDisplayName(); description = item2.GetDescription(); Bitmap icon = item2.GetIcon(); if (icon != null) { g.DrawImage(icon, 2, rectangle.Top + 2); } } else { displayName = item.ToString(); description = item.ToString(); } if (this.TerminateEnd && !base.DesignMode) { int terminate = this.GetTerminate(); if ((index > terminate) && (terminate >= 0)) { brush = Brushes.Gray; } } base.DrawItemString(g, displayName, this.Font, brush, bounds, sf, index); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; sf.FormatFlags -= 0x1000; bounds.Y += ((int)this.Font.GetHeight()) + 2; bounds.Height = this.ItemHeight - ((((int)this.Font.GetHeight()) + 2) + 2); base.DrawItemString(g, description, this.HelpFont, new SolidBrush(this.HelpForeColor), bounds, sf, index); } }
public void ApplyStyleItem(object sender, EventArgs e) { this.StyleApplyTimer.Enabled = false; if (this.StyleItems != null && this.StyleAppliIndex < this.StyleItems.Length) { int waitinterval = 1; ScrapBase scrap = this; try { CStyleItem item = this.StyleItems[this.StyleAppliIndex]; if (this.Initialized || (!this.Initialized && item.IsInitApply)) { item.Apply(ref scrap, out waitinterval, this.StyleClickPoint); } this.StyleAppliIndex++; if (waitinterval <= 0) { waitinterval = 1; } this.StyleApplyTimer.Interval = waitinterval; this.StyleApplyTimer.Enabled = true; } catch (Exception exception) { Console.WriteLine("ScrapBase ApplyStyleItem Exception:" + exception.ToString()); this.IsStyleApply = false; } } else { this.IsStyleApply = false; } if (!this.IsStyleApply && !this.Initialized) { this.Initialized = true; } }
protected override void DrawItemString(Graphics g, object item, Font font, Brush brush, Rectangle bounds, StringFormat sf, int index) { if (index >= 0) { string nameAndState; if (!base.DesignMode) { CStyleItem item2 = (CStyleItem)item; nameAndState = item2.NameAndState; item2.GetDescription(); } else { nameAndState = item.ToString(); item.ToString(); } int terminate = this.GetTerminate(); if ((index > terminate) && (terminate >= 0)) { brush = Brushes.Gray; } base.DrawItemString(g, nameAndState, font, brush, bounds, sf, index); } }
// Token: 0x060000AD RID: 173 RVA: 0x00004C94 File Offset: 0x00002E94 public NothingStyleItemPanel(CStyleItem item) : base(item) { }
public void AddStyle(CStyleItem newCi) { this._styles.Add(newCi); }
public void RemoveStyle(CStyleItem removeCi) { this._styles.Remove(removeCi); }
// Token: 0x060004F5 RID: 1269 RVA: 0x00023490 File Offset: 0x00021690 public TimerStyleItemPanel(CStyleItem item) : base(item) { }