public void AddScrap(ScrapBaseInfo pInfo, bool pIsFirstInit = false) { ScrapBase newScrap = new ScrapBase(); newScrap.addScrapStyleEvent(this._mainform); newScrap.addScrapMenuEvent(this._mainform); if (!string.IsNullOrEmpty(pInfo.name)) { newScrap.Name = pInfo.name; } newScrap.Image = pInfo.image; newScrap.cacheInfo = pInfo; newScrap.SetBounds(0, 0, pInfo.imageWidth, pInfo.imageHeight, BoundsSpecified.All); var style = this._mainform.optSetuna.FindStyle(pInfo.styleID); if (style != null) { newScrap.isFirstInitCompactScrap = pIsFirstInit; style.Apply(ref newScrap, pInfo.stylePoint); } newScrap.Left = pInfo.posX; newScrap.Top = pInfo.posY; newScrap.Refresh(); newScrap.Show(); if (!pIsFirstInit) { newScrap.ApplyCache(); } this.AddScrap(newScrap, pInfo); }
protected override void OnClick(EventArgs e) { if (this._style != null) { ScrapBase scrap = ((ContextStyleMenuStrip)base.Owner).Scrap; this._style.Apply(ref scrap); } }
public IEnumerator <ScrapBase> GetEnumerator() { IEnumerator enumerator = this._scraps.GetEnumerator(); while (enumerator.MoveNext()) { ScrapBase current = (ScrapBase)enumerator.Current; yield return(current); } }
public void AddScrap(ScrapBase newScrap) { newScrap.Manager = this; this._scraps.Add(newScrap); newScrap.OnScrapCreated(); if (this.ScrapAdded != null) { this.ScrapAdded(this, new ScrapEventArgs(newScrap)); } }
public void AddScrap(ScrapBase newScrap, ScrapBaseInfo pInfo = null) { newScrap.cacheInfo = pInfo ?? new ScrapBaseInfo(newScrap.Image, newScrap.Left, newScrap.Top, newScrap.Width, newScrap.Height, System.DateTime.Now.Ticks.ToString()); newScrap.Manager = this; this._scraps.Add(newScrap); newScrap.OnScrapCreated(); if (this.ScrapAdded != null) { this.ScrapAdded(this, new ScrapEventArgs(newScrap)); } }
public void WClickStyle(ScrapBase scrap, Point clickpoint) { int wClickStyleID = this._mainform.optSetuna.Scrap.WClickStyleID; if (wClickStyleID != 0) { CStyle style = this._mainform.optSetuna.FindStyle(wClickStyleID); if (style != null) { style.Apply(ref scrap, clickpoint); } } }
public void AddScrap(Image img, int x, int y, int width, int height, string scrapname, string pGuid = null) { ScrapBase newScrap = new ScrapBase(); newScrap.addScrapStyleEvent(this._mainform); newScrap.addScrapMenuEvent(this._mainform); if (scrapname != "") { newScrap.Name = scrapname; } newScrap.Image = img; newScrap.SaveImg(img, pGuid); newScrap.SetBounds(x, y, img.Width, img.Height, BoundsSpecified.All); newScrap.Refresh(); newScrap.Show(); this.AddScrap(newScrap); }
public void ScrapClose(object sender, ScrapEventArgs e) { ScrapBase base2 = (ScrapBase)sender; this._scraps.Remove(base2); if ((this._dustbox != null) && (this._dustcap > 0)) { if (this._dustbox.Count == this._dustcap) { this._dustbox.Dequeue().ScrapClose(); } this._dustbox.Enqueue(base2); base2.Hide(); } else { base2.ScrapClose(); } if (this.ScrapRemoved != null) { this.ScrapRemoved(this, new ScrapEventArgs()); } }
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; } }
public ScrapMenuArgs(ScrapBase targetscrap, ContextMenuStrip targetmenu) { this.scrap = targetscrap; this.menu = targetmenu; }
// Token: 0x060001AA RID: 426 RVA: 0x000099E4 File Offset: 0x00007BE4 public ScrapEventArgs(ScrapBase targetscrap) { scrap = targetscrap; }