private void btnCorrupt_Click(object sender, EventArgs e) { BlastLayer bl = new BlastLayer(); foreach (var item in lbBlastLayer.Items) { BlastUnit bu = (item as BlastUnit); if (bu.IsEnabled) { bl.Layer.Add(bu); } } GC.Collect(); GC.WaitForPendingFinalizers(); (bl.Clone() as BlastLayer).Apply(); }
private void btnLoadCorrupt_Click(object sender, EventArgs e) { BlastLayer bl = new BlastLayer(); foreach (var item in lbBlastLayer.Items) { BlastUnit bu = (item as BlastUnit); if (bu.IsEnabled) { bl.Layer.Add(bu); } } StashKey newSk = (StashKey)sk.Clone(); newSk.BlastLayer = (BlastLayer)bl.Clone(); GC.Collect(); GC.WaitForPendingFinalizers(); newSk.Run(); }