// Phuong thuc them cac uy quyen vao mang (them hieu ung vao mang) public void AddToEffects(DoEffect theEffect) { if (numEffectsRegistered >= 10) { throw new Exception("Too many members in array"); } arrayOfEffects[numEffectsRegistered++] = theEffect; }
private void DoEffect_DoWork(object sender, DoWorkEventArgs e) { mProgress = 0L; // var buffer = ; var task = Task.Factory.StartNew( () => mAction(mBitmap, ref mProgress) ); while (!task.IsCompleted) { DoEffect.ReportProgress((int)mProgress); Thread.Sleep(100); } }
public BuildingEffect(string description, LightSequence sequence, DoEffect effectHandle, bool isKnown) { this.description = description; this.sequence = sequence; this.effectHandle = effectHandle; this.isKnown = isKnown; }
private void ProgressDialog_Load(object sender, EventArgs e) { DoEffect.RunWorkerAsync(); }