示例#1
0
        /// <summary>
        /// Gets all class attributes from the Schema template and add them to the treeview
        /// </summary>
        /// <param name="objectAddDlg"></param>
        public ObjectAddWelcomePage(ADObjectAddDlg objectAddDlg, ADUCDirectoryNode dirnode, IPlugInContainer container, StandardPage parentPage)
            : this()
        {
            this._objectAddDlg = objectAddDlg;
            this.dirnode       = dirnode;
            this._container    = container;
            this._parentPage   = parentPage;

            if (_objectAddDlg.objectClasses != null)
            {
                if (treeView1.Nodes != null)
                {
                    treeView1.Nodes.Clear();
                }

                foreach (string node in _objectAddDlg.objectClasses)
                {
                    if (node != null)
                    {
                        SchemaType    schemaType          = _objectAddDlg.schemaCache.GetSchemaTypeByObjectClass(node);
                        LdapClassType ldapClassType       = schemaType as LdapClassType;
                        String[]      mandatoryAttributes = ldapClassType.MandatoryAttributes;
                        TreeNode      schemeNode          = new TreeNode();
                        schemeNode.Text = schemaType.AttributeDisplayName;
                        schemeNode.Tag  = mandatoryAttributes;
                        treeView1.Nodes.Add(schemeNode);
                        treeView1.Sort();
                    }
                }
            }

            treeView1.HideSelection = true;
        }
    /// <summary>
    /// Gets all class attributes from the Schema template and add them to the treeview
    /// </summary>
    /// <param name="objectAddDlg"></param>
    public ObjectAddWelcomePage(ADObjectAddDlg objectAddDlg, ADUCDirectoryNode dirnode, IPlugInContainer container, StandardPage parentPage)
        : this()
    {
        this._objectAddDlg = objectAddDlg;
        this.dirnode = dirnode;
        this._container = container;
        this._parentPage = parentPage;

        if (_objectAddDlg.objectClasses != null)
        {
            if (treeView1.Nodes != null)
            {
                treeView1.Nodes.Clear();
            }

            foreach (string node in _objectAddDlg.objectClasses)
            {
                if (node != null)
                {
                    SchemaType schemaType = _objectAddDlg.schemaCache.GetSchemaTypeByObjectClass(node);
                    LdapClassType ldapClassType = schemaType as LdapClassType;
                    String[] mandatoryAttributes = ldapClassType.MandatoryAttributes;
                    TreeNode schemeNode = new TreeNode();
                    schemeNode.Text = schemaType.AttributeDisplayName;
                    schemeNode.Tag = mandatoryAttributes;
                    treeView1.Nodes.Add(schemeNode);
                    treeView1.Sort();
                }
            }
        }

        treeView1.HideSelection = true;
    }
示例#3
0
 public ObjectAddMoreAttributesDlg(ADObjectAddDlg objectAddDlg, IPlugInContainer container, StandardPage parentPage)
     : this(container, parentPage)
 {
     this._objectAddDlg = objectAddDlg;
     InitializeComponent();
     InitializePages();
 }
 public ObjectAddMoreAttributesDlg(ADObjectAddDlg objectAddDlg, IPlugInContainer container, StandardPage parentPage)
     : this(container, parentPage)
 {
     this._objectAddDlg = objectAddDlg;
     InitializeComponent();
     InitializePages();
 }
 public ObjectAddFinalPage(ADObjectAddDlg objectAddDlg, IPlugInContainer container, StandardPage parentPage)
     : this()
 {
     this._objectAddDlg = objectAddDlg;
     this._container    = container;
     this._parentPage   = parentPage;
     //this.pageName = "finalnewObjectPage";
 }
    /// <summary>
    /// Overriden constructor will get and initializes attribute list from the selected object class from the treeview
    /// </summary>
    /// <param name="objectAddDlg"></param>
    /// <param name="attrName"></param>
    public ObjectAddSinglePage(ADObjectAddDlg objectAddDlg, string attrName)
    : this()
    {
        this.Name = attrName;
        this._objectAddDlg = objectAddDlg;
        this.attrNameLabel.Text = attrName;

        SchemaType syntax = _objectAddDlg.schemaCache.GetSchemaTypeByDisplayName(attrName);
        if (syntax != null)
        {
            this.cnSyntaxlabel.Text = ObjectAddAttributesTab.GetADSTypeString(syntax);
        }
        pageName = attrName;
        this.cntextBox.Text = "";
    }
        /// <summary>
        /// Overriden constructor will get and initializes attribute list from the selected object class from the treeview
        /// </summary>
        /// <param name="objectAddDlg"></param>
        /// <param name="attrName"></param>
        public ObjectAddSinglePage(ADObjectAddDlg objectAddDlg, string attrName)
            : this()
        {
            this.Name               = attrName;
            this._objectAddDlg      = objectAddDlg;
            this.attrNameLabel.Text = attrName;

            SchemaType syntax = _objectAddDlg.schemaCache.GetSchemaTypeByDisplayName(attrName);

            if (syntax != null)
            {
                this.cnSyntaxlabel.Text = ObjectAddAttributesTab.GetADSTypeString(syntax);
            }
            pageName            = attrName;
            this.cntextBox.Text = "";
        }
 public ObjectAddAttributesTab(ADObjectAddDlg objectAddDlg)
     : this()
 {
     this._objectAddDlg = objectAddDlg;
     _newAttributesList = _objectAddDlg.objectInfo._AttributesList;
 }
 public ObjectAddAttributesTab(ADObjectAddDlg objectAddDlg)
 : this()
 {
     this._objectAddDlg = objectAddDlg;
     _newAttributesList = _objectAddDlg.objectInfo._AttributesList;
 }
示例#10
0
    /// <summary>
    /// Helper function that is used to add new object when we click of 'New - Object' menu item
    /// </summary>
    /// <param name="dirnode"></param>
    private void AddNewObject(ADUCDirectoryNode dirnode)
    {
        if (dirnode != null)
        {
            DirectoryContext dirContext = dirnode.LdapContext;
            string sText = "Create Object";
            LDAPSchemaCache schemaCache = dirContext.SchemaCache;


            ADObjectAddDlg f = new ADObjectAddDlg(base.container, this, sText, schemaCache, dirnode);
            f.ShowDialog(this);

            if (f.objectInfo.commit)
            {
                //create an new object
                if (f.choosenClass.Equals("computer", StringComparison.InvariantCultureIgnoreCase))
                {
                    AddNewObj_Computer(dirnode, f.objectInfo.htMandatoryAttrList, true, false, false);
                }
                else if (f.choosenClass.Equals("user", StringComparison.InvariantCultureIgnoreCase))
                {
                    AddNewObj_User(dirnode, f.objectInfo.htMandatoryAttrList, true, null, true, false, false, false);
                }
                else if (f.choosenClass.Equals("group", StringComparison.InvariantCultureIgnoreCase))
                {
                    AddNewObj_Group(dirnode, f.objectInfo.htMandatoryAttrList, true);
                }
                else if (f.choosenClass.Equals("organizationalUnit", StringComparison.InvariantCultureIgnoreCase))
                {
                    AddNewObj_OU(dirnode, null, f.objectInfo.htMandatoryAttrList, true);
                }
                else
                {
                    AddNewObj(dirnode, f.choosenClass, null, f.objectInfo.htMandatoryAttrList);
                }
            }
        }
    }