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(); }
public void LoadStashkey(StashKey _sk) { if (_sk == null || _sk.BlastLayer == null || _sk.BlastLayer.Layer == null) { return; } //lbBlastLayer.Items.Clear(); sk = (StashKey)_sk.Clone(); //lbBlastLayer.DataSource = sk.BlastLayer.Layer; //foreach (var item in sk.blastlayer.Layer) // lbBlastLayer.Items.Add(item); RefreshBlastLayer(); this.Show(); }