コード例 #1
0
ファイル: DsPicker.cs プロジェクト: vmware/likewise-open
        public DirectoryEntry GetRootDSE(string serverOrDomain)
        {
            DirectoryEntry de;

            de = new DirectoryEntry(SDSUtils.MakePath(null, serverOrDomain, "RootDSE", null));

            return(de);
        }
コード例 #2
0
ファイル: DsPicker.cs プロジェクト: vmware/likewise-open
        // public DsPicker(DialogType dt,string sProtocal,string targetServer,string sDCs,bool allowMultiSelect):this()
        public void SetData(DialogType dt, string sProtocal, string targetServer, string sDCs, bool allowMultiSelect)
        {
            if (timer.Enabled)
            {
                timer.Start();
            }
            else
            {
                timer.Enabled = true;
                timer.Start();
            }
            lvUserToGroup.MultiSelect = allowMultiSelect;
            // if no server specified, try to synthesize it from the dc's
            if (targetServer == null && sDCs != null)
            {
                targetServer = SDSUtils.DNToDomainName(sDCs);
            }

            sDomainName = SDSUtils.DNToDomainName(sDCs);

            string sPath = SDSUtils.MakePath(sProtocal, targetServer, null, sDCs);

            de = new DirectoryEntry(sPath);

            deList  = new Dictionary <string, DirectoryEntry>();
            this.dt = dt;

            try
            {
                waitForm = new WaitForm(backgroundWorker, timer, de);
                backgroundWorker.RunWorkerAsync(null);

                //System.Threading.Thread.Sleep(1000);
                if (waitForm != null)
                {
                    waitForm.ShowDialog(this);
                }
                //this.lvUserToGroup.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Likewise Administrator Console",
                                MessageBoxButtons.OK);
            }

            this.CancelBtn.Enabled = true;
            lvUserToGroup.Enabled  = true;
            lvUserToGroup.Sort();
        }