Esempio n. 1
0
        private void BrowseMSDNLink(TreeNode node)
        {
            Uri link = SPHelp.GetMSDNHelpLink(node);

            if (link != null)
            {
                System.Diagnostics.Process.Start(link.OriginalString);
            }
        }
Esempio n. 2
0
        public void tsClassName_Click(object sender, EventArgs e)
        {
            Uri url = SPHelp.GetMSDNHelpLink(tvSite.SelectedNode);

            if (url != null)
            {
                System.Diagnostics.Process.Start(url.OriginalString);
            }
        }
        public static bool IsCustom(this SPClient.Feature feature)
        {
            SPFeature f = SPHelp.GetFeature(feature.DefinitionId);

            if (f == null)
            {
                return(false);
            }
            else
            {
                return(f.IsCustomDefinition);
            }
        }
        public static string GetFeatureName(this SPClient.Feature feature)
        {
            SPFeature f = SPHelp.GetFeature(feature.DefinitionId);

            if (f == null)
            {
                return(string.Format("{0} (unknown feature)", feature.DefinitionId));
            }
            else
            {
                return(string.Format("{0} ({1})", f.DisplayName, f.InternalName));
            }
        }
Esempio n. 5
0
        public static void LoadLists(TreeNode parentNode, SPClient.ListCollection lists, MainBrowser form)
        {
            try
            {
                SPClient.ClientContext ctx = GetClientContext(parentNode);
                ctx.Load(lists);
                ctx.ExecuteQuery();

                int total   = lists.Count;
                int current = 0;

                foreach (SPClient.List list in lists)
                {
                    TreeNode node = parentNode.Nodes.Add(string.Format("{0} ({1})", list.Title, list.ItemCount));
                    node.ImageKey         = SPHelp.GetFileName(list.ImageUrl);
                    node.SelectedImageKey = SPHelp.GetFileName(list.ImageUrl);
                    node.ContextMenuStrip = form.mnContextItem;
                    node.Tag = list;

                    if (list.Hidden)
                    {
                        node.ForeColor = Color.Gray;
                    }

                    AddLoadingNode(node, "Fields", Constants.IMAGE_SITE_COLUMN, LoadType.ListFields);
                    AddLoadingNode(node, "Content Types", Constants.IMAGE_CONTENT_TYPE, LoadType.ListContentTypes);
                    AddLoadingNode(node, "Views", Constants.IMAGE_VIEW, LoadType.ListViews);
                    AddLoadingNode(node, "Role Assignments", Constants.IMAGE_ROLE_ASSIGNMENT, LoadType.ListRoleAssignments);
                    AddLoadingNode(node, "Workflow Associations", Constants.IMAGE_WORKFLOW_ASSOCIATION, LoadType.ListWorkflowAssociations);

                    // Add root folder
                    LoadFolder(node, list.RootFolder, form, true);

                    // Update progress
                    current++;
                    ItemLoaded(null, new ItemLoadedEventArgs()
                    {
                        TotalItem = total, CurrentItem = current
                    });
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, form.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);

                AddLoadingNode(parentNode, LoadType.WebLists);
            }
        }
Esempio n. 6
0
 private void LoadingTabMsdnBrowser()
 {
     if (tabs.SelectedTab == tpMsdn)
     {
         Uri url = SPHelp.GetMSDNHelpLink(tvSite.SelectedNode);
         if (url != null)
         {
             if (wbMsdnHelp.Url != url)
             {
                 wbMsdnHelp.Url = url;
             }
         }
         else if (wbMsdnHelp.Url != SPHelp.GetMSDNHelpLink())
         {
             wbMsdnHelp.Url = SPHelp.GetMSDNHelpLink();
         }
     }
 }