private Dictionary <string, string> GetListEventReceiverProperties(ISharePointCommandContext context, EventReceiverInfo eventReceiverInfo)
        {
            SPEventReceiverDefinition   eventReceiver           = null;
            Dictionary <string, string> eventReceiverProperties = new Dictionary <string, string>();

            SPList list = context.Web.Lists[eventReceiverInfo.ListId];

            if (eventReceiverInfo.Id != Guid.Empty)
            {
                eventReceiver = list.EventReceivers[eventReceiverInfo.Id];
            }
            else if (!String.IsNullOrEmpty(eventReceiverInfo.Name))
            {
                eventReceiver = (from SPEventReceiverDefinition er in list.EventReceivers
                                 where er.Name.Equals(eventReceiverInfo.Name)
                                 select er).FirstOrDefault();
            }
            else
            {
                eventReceiver = (from SPEventReceiverDefinition er in list.EventReceivers
                                 where er.Assembly == eventReceiverInfo.Assembly &&
                                 er.Class == eventReceiverInfo.Class &&
                                 (int)er.Type == eventReceiverInfo.EventType
                                 select er).FirstOrDefault();
            }

            if (eventReceiver != null)
            {
                eventReceiverProperties = SharePointCommandServices.GetProperties(eventReceiver);
            }

            return(eventReceiverProperties);
        }
        private static Dictionary <string, string> GetWebTemplateProperties(ISharePointCommandContext context,
                                                                            WebTemplateInfo nodeInfo)
        {
            SPWebTemplate template = context.Web.GetAvailableWebTemplates((uint)context.Web.Locale.LCID, true)[nodeInfo.Name];

            return(SharePointCommandServices.GetProperties(template));
        }
예제 #3
0
        private static Dictionary <string, string> GetThemeProperties(ISharePointCommandContext context,
                                                                      FileNodeInfo nodeInfo)
        {
            SPList     themes = context.Site.GetCatalog(SPListTemplateType.ThemeCatalog);
            SPListItem theme  = themes.Items[nodeInfo.UniqueId];

            return(SharePointCommandServices.GetProperties(theme));
        }
        private static Dictionary <string, string> GetSolutionProperties(ISharePointCommandContext context,
                                                                         FileNodeInfo nodeInfo)
        {
            SPList     solutions = context.Site.GetCatalog(SPListTemplateType.SolutionCatalog);
            SPListItem solution  = solutions.Items[nodeInfo.UniqueId];

            return(SharePointCommandServices.GetProperties(solution));
        }
        private static Dictionary <string, string> GetWebPartProperties(ISharePointCommandContext context,
                                                                        FileNodeInfo nodeInfo)
        {
            SPList     webParts = context.Site.GetCatalog(SPListTemplateType.WebPartCatalog);
            SPListItem webPart  = webParts.Items[nodeInfo.UniqueId];

            return(SharePointCommandServices.GetProperties(webPart));
        }
        public static Dictionary <string, string> GetProperties(ISharePointCommandContext context, FieldNodeInfo field)
        {
            Dictionary <string, string> properties = null;

            if (field.Id != Guid.Empty)
            {
                properties = SharePointCommandServices.GetProperties(context.Site.RootWeb.Fields[field.Id]);
            }

            return(properties);
        }
        private static Dictionary <string, string> GetProperties(ISharePointCommandContext context, PublishingPageInfo pageInfo)
        {
            Dictionary <string, string> pageProperties = new Dictionary <string, string>();

            PublishingWeb  publishingWeb = PublishingWeb.GetPublishingWeb(context.Web);
            PublishingPage page          = publishingWeb.GetPublishingPage(pageInfo.ServerRelativeUrl);

            if (page != null)
            {
                pageProperties = SharePointCommandServices.GetProperties(page);
            }

            return(pageProperties);
        }
        public static Dictionary <string, string> GetProperties(ISharePointCommandContext context, FieldNodeInfo field)
        {
            Dictionary <string, string> properties = null;

            if (field.ListId == Guid.Empty)
            {
                properties = SharePointCommandServices.GetProperties(context.Web.AvailableContentTypes[field.ContentTypeName].Fields[field.Id]);
            }
            else
            {
                properties = SharePointCommandServices.GetProperties(context.Web.Lists[field.ListId].Fields[field.Id]);
            }

            return(properties);
        }
예제 #9
0
        private static Dictionary <string, string> GetMasterPageOrPageLayoutProperties(ISharePointCommandContext context, FileNodeInfo fileNodeInfo)
        {
            Dictionary <string, string> properties = new Dictionary <string, string>();

            try
            {
                SPList     masterPageGallery      = context.Web.GetCatalog(SPListTemplateType.MasterPageCatalog);
                SPListItem masterPageOrPageLayout = masterPageGallery.Items[fileNodeInfo.UniqueId];

                properties = SharePointCommandServices.GetProperties(masterPageOrPageLayout);
            }
            catch { }

            return(properties);
        }
예제 #10
0
        private static Dictionary <string, string> GetFileProperties(ISharePointCommandContext context, FileNodeInfo fileNodeInfo)
        {
            Dictionary <string, string> properties = new Dictionary <string, string>();

            try
            {
                SPFile file = context.Web.GetFile(fileNodeInfo.ServerRelativeUrl);
                if (file != null)
                {
                    properties = SharePointCommandServices.GetProperties(file.Item);
                }
            }
            catch { }

            return(properties);
        }
 private static Dictionary <string, string> GetThemeGalleryProperties(ISharePointCommandContext context,
                                                                      ThemeGalleryNodeInfo nodeInfo)
 {
     return(SharePointCommandServices.GetProperties(context.Site.GetCatalog(SPListTemplateType.ThemeCatalog)));
 }
예제 #12
0
 private static Dictionary <string, string> GetDesignCatalogProperties(ISharePointCommandContext context,
                                                                       DesignCatalogNodeInfo nodeInfo)
 {
     return(SharePointCommandServices.GetProperties(context.Site.GetCatalog(SPListTemplateType.DesignCatalog)));
 }