Esempio n. 1
0
        private void toolStripMenuItemAdd_Click(object sender, EventArgs e)
        {
            if (null == ParentEditor)
            {
                return;
            }
            if (null == ParentEditor.References)
            {
                return;
            }

            ReferencesDialog dialog = new ReferencesDialog(ParentEditor.ReferencePanelSettings.AllowAddFileReferences);

            dialog.GACTitle          = ParentEditor.ReferencePanelSettings.GACTitle;
            dialog.FileSystemTitle   = ParentEditor.ReferencePanelSettings.FileSystemTitle;
            dialog.OkButtonTitle     = ParentEditor.ReferencePanelSettings.OkButtonTitle;
            dialog.CancelButtonTitle = ParentEditor.ReferencePanelSettings.CancelButtonTitle;
            dialog.Text = ParentEditor.ReferencePanelSettings.DialogTitle;

            if (DialogResult.OK == dialog.ShowDialog(this))
            {
                foreach (var item in dialog.SelectedAssemblies)
                {
                    if (IsValidAssembly(item.Path) && !ParentEditor.References.ContainsReferenece(item.Name))
                    {
                        ParentEditor.References.Add(new AssemblyReference(item.Name, item.Path));
                    }
                }
            }
        }
Esempio n. 2
0
        private void toolStripMenuItemAdd_Click(object sender, EventArgs e)
        {
            if (null == ParentEditor)
                return;
            if (null == ParentEditor.References)
                return;

            ReferencesDialog dialog = new ReferencesDialog(ParentEditor.ReferencePanelSettings.AllowAddFileReferences);
            dialog.GACTitle = ParentEditor.ReferencePanelSettings.GACTitle;
            dialog.FileSystemTitle = ParentEditor.ReferencePanelSettings.FileSystemTitle;
            dialog.OkButtonTitle = ParentEditor.ReferencePanelSettings.OkButtonTitle;
            dialog.CancelButtonTitle = ParentEditor.ReferencePanelSettings.CancelButtonTitle;
            dialog.Text = ParentEditor.ReferencePanelSettings.DialogTitle;
        
            if (DialogResult.OK == dialog.ShowDialog(this)) 
            {
                foreach (var item in dialog.SelectedAssemblies)
                {
                    if (IsValidAssembly(item.Path) && !ParentEditor.References.ContainsReferenece(item.Name))
                        ParentEditor.References.Add(new AssemblyReference(item.Name, item.Path));
                }
            }             
        }