private void toolStripAssemblies_Click(object sender, EventArgs e) { using (AssemblyChooserDialog chooseDialog = new AssemblyChooserDialog(Module._Options.GlobalReferences, Module._Options.GlobalNamespaces)) { chooseDialog.Text = "Add Global References"; chooseDialog.SaveOptions += new EventHandler(chooseDialog_SaveOptions); chooseDialog.ExcludedReferences.AddRange(GetDefaultAssemblies()); if (chooseDialog.ShowDialog(this) == DialogResult.OK) { Module._Options.GlobalReferences = chooseDialog.References; Module._Options.GlobalNamespaces = chooseDialog.Namespaces; Save(); } } }
private void toolStripButtonScriptAssemblies_Click(object sender, EventArgs e) { List <AssemblyReference> allReferences = new List <AssemblyReference>(); allReferences.AddRange(Module._Options.GlobalReferences); allReferences.AddRange(CurrentItem.Rule.References); using (AssemblyChooserDialog chooseDialog = new AssemblyChooserDialog(allReferences, CurrentItem.Rule.Namespaces)) { chooseDialog.Text = "Add Local References"; chooseDialog.ExcludedReferences.AddRange(Module._Options.GlobalReferences); chooseDialog.ExcludedReferences.AddRange(GetDefaultAssemblies()); if (chooseDialog.ShowDialog(this) == DialogResult.OK) { CurrentItem.Rule.References = chooseDialog.References; CurrentItem.Rule.Namespaces = chooseDialog.Namespaces; Save(); } } }