Beispiel #1
0
        // Uncomment the method below to handle the event raised after a feature has been installed.

        //public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        //{
        //}


        // Uncomment the method below to handle the event raised before a feature is uninstalled.

        public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {
            Microsoft.SharePoint.Administration.SPFarm Farm = Microsoft.SharePoint.Administration.SPFarm.Local;
            foreach (SPService Service in Farm.Services)
            {
                if (Service is SPWebService)
                {
                    Microsoft.SharePoint.Administration.SPWebService SPWebService = (Microsoft.SharePoint.Administration.SPWebService)Service;
                    foreach (SPWebApplication webApp in SPWebService.WebApplications)
                    {
                        RemoveAllCustomisations(webApp);
                    }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SPAdmin.SPWebService service = farm.Services.GetValue <SPAdmin.SPWebService>("");
         foreach (SPAdmin.SPWebApplication webapp in service.WebApplications)
         {
             foreach (SPOM.SPSite site in webapp.Sites)
             {
                 string url = site.Url;
                 uxSites.Items.Add(url);
             }
             uxSites.Items[0].Selected = true;
             GetAllListData(uxSites.SelectedItem.ToString());
         }
     }
 }