public ObjectSelectPage(WizardDialog wizardDialog, IPlugIn plugin, IPlugInContainer container)
 {
     InitializeComponent();
     this.objectSelectDlg = (ObjectSelectDlg)wizardDialog;
     this.plugin = plugin;
     this.container = container;
 }
Esempio n. 2
0
 public ObjectSelectPage(WizardDialog wizardDialog, IPlugIn plugin, IPlugInContainer container)
 {
     InitializeComponent();
     this.objectSelectDlg = (ObjectSelectDlg)wizardDialog;
     this.plugin          = plugin;
     this.container       = container;
 }
Esempio n. 3
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            Logger.Log("AddPluginsDlg.AddBtn_Click", Logger.manageLogLevel);

            if (PluginlistView.SelectedItems.Count == 0)
            {
                return;
            }
            foreach (ListViewItem selectedItem in PluginlistView.SelectedItems)
            {
                Logger.Log(
                    "The selectedItem is " + selectedItem.SubItems[0].Text,
                    Logger.manageLogLevel);

                LACTreeNode node = selectedItem.Tag as LACTreeNode;

                // Allow the plug-in to take itself out of the list if it wants
                if (node.Plugin.PluginSelected() == false)
                {
                    Logger.Log(
                        "The selectedItem is " + selectedItem.SubItems[0].Text + " opted out of selection",
                        Logger.manageLogLevel);

                    continue;
                }

                node = new LACTreeNode(node.Name, node.image, node.t, node.Plugin);
#if QUARTZ
                #if LMC_ENTERPRISE
                if (node.Plugin is GPOEPlugin)
                {
                    GPOEPlugin gPlugin = node.Plugin as GPOEPlugin;

                    uint requestedFields = (uint)Hostinfo.FieldBitmaskBits.FQDN;

                    //if (!String.IsNullOrEmpty(gPlugin._hn.domainName))
                    //{
                    //    requestedFields |= (uint)Hostinfo.FieldBitmaskBits.FORCE_USER_PROMPT;
                    //}

                    if (gPlugin._usingSimpleBind || gPlugin._hn.IsConnectionSuccess)
                    {
                        requestedFields |= (uint)Hostinfo.FieldBitmaskBits.CREDS_NT4DOMAIN;
                        requestedFields |= (uint)Hostinfo.FieldBitmaskBits.CREDS_USERNAME;
                        requestedFields |= (uint)Hostinfo.FieldBitmaskBits.CREDS_PASSWORD;
                    }

                    if (!gPlugin._container.GetTargetMachineInfo(gPlugin, gPlugin._hn, requestedFields))
                    {
                        Logger.Log(
                            "GPOE could not find information about target domain",
                            Logger.GPOELogLevel);
                        if (requestedFields == (uint)Hostinfo.FieldBitmaskBits.FQDN)
                        {
                            AddBtn_Click(sender, e);
                        }
                        return;
                    }
                    else
                    {
                        if (!gPlugin._usingSimpleBind && !gPlugin._hn.IsConnectionSuccess)
                        {
                            gPlugin._usingSimpleBind = true;
                            return;
                        }
                    }
                    if (gPlugin._hn.IsConnectionSuccess)
                    {
                        ObjectSelectDlg selectDlg = new ObjectSelectDlg(
                            _standalonePage._controlManage,
                            node.PluginPage as StandardPage,
                            gPlugin._hn,
                            node.Plugin as IPlugIn);
                        selectDlg.ShowDialog(this);

                        if (selectDlg.distinguishedName == null)
                        {
                            continue;
                        }
                        else
                        {
                            node.Text = selectDlg.displayName + " [" + selectDlg.dirContext.DomainControllerName + "] Policy";
                            GPObjectInfo gpoInfo = new GPObjectInfo(selectDlg.dirContext, selectDlg.distinguishedName, selectDlg.displayName);
                            gpoInfo.HostInfo = gPlugin._hn;
                            node.Tag         = gpoInfo;
                        }
                        node.ImageIndex = selectedItem.ImageIndex;
                        _standalonePage.dummy.Add(node);

                        ListViewItem lviArr;
                        string[]     values = { node.Text };
                        lviArr            = new ListViewItem(values);
                        lviArr.ImageIndex = node.ImageIndex;
                        lviArr.Tag        = node;
                        ListViewItem item = _standalonePage.ChosenPlugins.Items.Add(lviArr);
                    }
                }
                else  //Not a GPOEPlugin
                #endif
#endif
                {
                    node.ImageIndex = selectedItem.ImageIndex;
                    _standalonePage.dummy.Add(node);

                    ListViewItem lviArr;
                    string[]     values = { node.Text };
                    lviArr            = new ListViewItem(values);
                    lviArr.ImageIndex = node.ImageIndex;
                    lviArr.Tag        = node;
                    ListViewItem item = _standalonePage.ChosenPlugins.Items.Add(lviArr);

                    //Inserting the new item to the combo

                    /*int level = _standalonePage.PluginCombo.SelectedIndex;
                     * level += 1;
                     * char[] spacing = new char[level * 2];
                     * for (int i = 0; i < level * 2; i++)
                     *  spacing[i] = ' ';
                     * _standalonePage.PluginCombo.Items.Insert(item.Index+1, string.Concat(new string(spacing), node.Text));*/
                }
            }
        }