Esempio n. 1
0
        private void lnkAddContentTypeFromRoot_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            SPDocumentLibrary doclib = (SPDocumentLibrary)cboDocLibs.SelectedItem;

            FrmAddContnetTypeToDocLib.ShowForm(doclib);

            m_cboDocLibHasChangedSinceColumnListWasUpdated = true;
            populatemetadataColumnNames(false);
        }
Esempio n. 2
0
        public static void ShowForm(SPDocumentLibrary docLib)
        {
            FrmAddContnetTypeToDocLib f = new FrmAddContnetTypeToDocLib();

            f.m_docLib = docLib;

            //--
            SPWeb rootWeb = docLib.ParentWeb.Site.RootWeb;

            foreach (SPContentType ct in rootWeb.ContentTypes)
            {
                if (ct.Parent.Name == "Document" && ct.Group != "_Hidden")
                {
                    f.cboRootContentTypes.Items.Add(new ContentTypeHolder(ct));
                }
            }

            f.Text = "Add Content Type to " + docLib.Title;
            f.lblAvailableCT.Text = "Content Types available to add from " + rootWeb.Url;
            f.Location            = new Point(MainForm.DefInstance.Left + 10, MainForm.DefInstance.Top + 10);
            f.ShowDialog();
        }