예제 #1
0
        //public static IEnumerable<List> Get_DocumentLibraries(ClientContext ctx, Web web)
        //{
        //    var alllists = web.Lists;

        //    IEnumerable<List> doclibs = ctx.LoadQuery(alllists.Where
        //        (list => list.BaseType == BaseType.DocumentLibrary)
        //        );

        //    ctx.ExecuteQuery();

        //    return doclibs;
        //}

        private XlHlp.XlLocation AddSection_Libraries(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Libraries", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Libraries", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            IEnumerable <List> doclibs = VNC.SP.Helper.GetDocumentLibraries(ctx, web);

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_Libraries(insertAt, doclibs, false, "OneLevel");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblLibraries_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
예제 #2
0
        //private static IEnumerable<List> Get_Lists(ClientContext ctx, Web web)
        //{
        //    var alllists = web.Lists;

        //    IEnumerable<List> lists = ctx.LoadQuery(alllists.Where
        //        (list => list.BaseType == BaseType.GenericList)
        //        );

        //    ctx.ExecuteQuery();
        //    return lists;
        //}

        private XlHlp.XlLocation AddSection_Lists(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddTitledInfo(insertAt.AddRow(), "Lists", web.Title);
            }
            else
            {
                XlHlp.AddTitledInfo(insertAt.AddRow(), "Lists", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            IEnumerable <List> lists = VNCSP.Helper.GetLists(ctx, web);

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_Lists(insertAt, lists, false, "OneLevel");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblLists_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End");

            return(insertAt);
        }
예제 #3
0
        internal static void Add_TP_Developers(
            XlHlp.XlLocation insertAt,
            Options_AZDO_TFS options,
            string teamProjectName,
            SortedDictionary <string, int> developers,
            SortedDictionary <string, DateTime> developersLatestDate,
            SortedDictionary <string, DateTime> developersEarliestDate)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            foreach (string developer in developers.Keys)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), teamProjectName);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developer);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developers[developer].ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developersEarliestDate[developer].ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), developersLatestDate[developer].ToString());

                insertAt.IncrementRows();
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);
        }
예제 #4
0
        private VNC.AddinHelper.Excel.XlLocation DisplayListOf_Lists(VNC.AddinHelper.Excel.XlLocation insertAt, IEnumerable <List> lists, bool displayDataOnly, string tableSuffix)
        {
            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt);

            Worksheet ws = insertAt.workSheet;

            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "Title");
                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 15, "Id");
                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var list in lists)
            {
                insertAt.ClearOffsets();

                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.Title);
                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.Id.ToString());
                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), list.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End");

            return(insertAt);
        }
예제 #5
0
        private XlHlp.XlLocation DisplayListOf_ContentTypes(XlHlp.XlLocation insertAt, ContentTypeCollection contentTypes, bool displayDataOnly, string tableSuffix)
        {
            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt);

            Worksheet ws = insertAt.workSheet;

            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "Name");
                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Group");
                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 15, "Id");
                XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var cType in contentTypes)
            {
                insertAt.ClearOffsets();

                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Name);
                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Group);
                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.Id.ToString());
                XlHlp.AddContentToCell(insertAt.AddOffsetColumn(), cType.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End");

            return(insertAt);
        }
예제 #6
0
        internal static void Add_TP_Workspaces(
            XlHlp.XlLocation insertAt,
            Options_AZDO_TFS options,
            Workspace[] workSpaces)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            foreach (Workspace workspace in workSpaces)
            {
                insertAt.ClearOffsets();

                // Keep in same order with headers, supra.

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Computer);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Name);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.OwnerDisplayName);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.OwnerName);
                //ExcelHlp.AddContentToCell(rngOutput.Offset[currentRow, col++], workspace.DisambiguatedDisplayName);
                //ExcelHlp.AddContentToCell(rngOutput.Offset[currentRow, col++], workspace.DisplayName);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.LastAccessDate.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), workspace.Comment);
                //ExcelHlp.AddContentToCell(rngOutput.Offset[XlLocation.Rows, col++], workspace.QualifiedName);

                insertAt.IncrementRows();
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);
        }
예제 #7
0
        internal static XlHlp.XlLocation Add_Info(
            XlHlp.XlLocation insertAt,
            TeamProject teamProject)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            insertAt.MarkStart();

            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "TP Name", teamProject.Name);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "AbsoluteUri", teamProject.ArtifactUri.AbsoluteUri);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ServerItem", teamProject.ServerItem);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "VCS ServerGuid", teamProject.VersionControlServer.ServerGuid.ToString());

            // TODO(crhodes)
            // What else can we get here?
            // Capabilities
            // Template?
            // Creation Date?

            insertAt.MarkEnd();

            if (!insertAt.OrientVertical)
            {
                // Skip past the info just added.
                insertAt.SetLocation(insertAt.RowStart, insertAt.MarkEndColumn + 1);
            }

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
예제 #8
0
        XlHlp.XlLocation AddSection_ChildNodes(
            XlHlp.XlLocation insertAt,
            string NodeType,
            ReadOnlyCollection <CatalogNode> childNodes)
        {
            //XlHlp.DisplayInWatchWindow(insertAt);

            //// List the team project collections

            XlHlp.AddContentToCell(insertAt.InsertRow(1), string.Format("{0}({1})", NodeType, childNodes.Count));

            //currentRow = startingRow;
            //int innerRowsAdded = 0;
            //int col = 1;

            //foreach (CatalogNode child in childNodes)
            //{
            //    // Need to fix this so expands down the page
            //    innerRowsAdded = AddSection_CatalogNode(ws, rngOutput, child);
            //    insertAt = innerRowsAdded;
            //    currentRow += innerRowsAdded;
            //}

            //XlLocation.Rows++;

            return(insertAt);
        }
예제 #9
0
        internal static void Add_TP_WorkItemFields(XlHlp.XlLocation insertAt)
        {
            long startTicks = Log.APPLICATION("Enter", Common.PROJECT_NAME);

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Team Project");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "WIT Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "FieldType");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "SystemType");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 6, "Id");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsComputed");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsCoreField");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsEditable");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsIdentity");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsIndexed");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "IsQueryable");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 12, "ReferenceName");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "ReportingAttributes.Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "ReportingAttributes.ReferenceName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Usage");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 40, "FieldNameType");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 60, "AllowedValues");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 60, "ProhibitedValues");

            insertAt.IncrementRows();

            Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
        }
예제 #10
0
        internal static XlHlp.XlLocation AddSection_ConfigurationServer_Info(
            XlHlp.XlLocation insertAt,
            TfsConfigurationServer configurationServer)
        {
            insertAt.MarkStart(XlHlp.MarkType.None);

            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Name:", configurationServer.Name);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Culture:", configurationServer.Culture.DisplayName);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "InstanceId:", configurationServer.InstanceId.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ServerCapabilities:", configurationServer.ServerCapabilities.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "SessionId:", configurationServer.SessionId.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "TimeZone:", configurationServer.TimeZone.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "UICulture", configurationServer.UICulture.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "Uri", configurationServer.Uri.ToString());

            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "AuthorizedIdentity:", configurationServer.AuthorizedIdentity.DisplayName);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "CatalogNode:", configurationServer.CatalogNode.FullPath);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "HasAuthenticated:", configurationServer.HasAuthenticated.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "IsHostedServer:", configurationServer.IsHostedServer.ToString());
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ClientCacheDirectoryForInstance:", configurationServer.ClientCacheDirectoryForInstance);
            XlHlp.AddLabeledInfo(insertAt.AddRow(2), "ClientCacheDirectoryForUser:", configurationServer.ClientCacheDirectoryForUser);

            insertAt.MarkEnd(XlHlp.MarkType.None);

            if (!insertAt.OrientVertical)
            {
                // Skip past the info just added.
                insertAt.SetLocation(insertAt.RowStart, insertAt.MarkEndColumn + 1);
            }

            return(insertAt);
        }
예제 #11
0
        internal static void Add_TP_WorkItemTypes(XlHlp.XlLocation insertAt)
        {
            long startTicks = Log.APPLICATION("Enter", Common.PROJECT_NAME);

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Team Project");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Count");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "FieldCount");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "LastCreateDate");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "LastChangedDate");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "LastRevisedDate");

            // TODO(crhodes)
            // Since we now can pass in a CellFormatSpecification, might be able to go back to just using insertAt.AddOffsetColumn
            insertAt.AddOffsetColumnX();

            CellFormatSpecification lucidia7 = insertAt.CreateCellFormat("lucidia7", fontSize: 7);

            lucidia7.Font.Name = "Lucida Sans Typewriter";

            XlHlp.AddColumnHeaderToSheetX(insertAt.workSheet, insertAt.RowCurrent, insertAt.ColumnOffset,
                                          180, "Transitions", lucidia7);

            insertAt.IncrementRows();

            Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
        }
예제 #12
0
        internal static void Add_TP_Shelvesets(
            XlHlp.XlLocation insertAt,
            Options_AZDO_TFS options,
            Shelveset[] shelvesets)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            try
            {
                foreach (Shelveset item in shelvesets)
                {
                    insertAt.ClearOffsets();

                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.OwnerDisplayName);
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.OwnerName);
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.Name);
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.CreationDate.ToString());
                    //ExcelHlp.AddContentToCell(insertAt.AddOffsetColumn(), item.DisplayName);
                    //ExcelHlp.AddContentToCell(insertAt.AddOffsetColumn(), item.QualifiedName);
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.CheckinNote.ToString());
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), item.Comment);

                    insertAt.IncrementRows();
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("{0} - {1}", "TP", ex.ToString());

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), msg);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);
        }
예제 #13
0
        private XlHlp.XlLocation DisplayListOf_Libraries(XlHlp.XlLocation insertAt, IEnumerable <List> libraries, bool displayDataOnly, string tableSuffix)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            Worksheet ws = insertAt.workSheet;

            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Title");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 15, "Id");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var library in libraries)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), library.Title);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), library.Id.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), library.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
예제 #14
0
        internal static void Add_BuildServiceHosts(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Status");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "StatusChangedOn");

            insertAt.IncrementRows();
        }
예제 #15
0
        internal static void Add_BuildAgents(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            //XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Description");
            //XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "QueueStatus");

            insertAt.IncrementRows();
        }
예제 #16
0
        internal static void Add_BuildProcessTemplates(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Id");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Description");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "TemplateType");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Version");

            insertAt.IncrementRows();
        }
예제 #17
0
        private XlHlp.XlLocation AddSection_SiteGroups(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt);

            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "Groups", "SiteName");

            //Range rng = ws.Cells[startingRow, 1];
            //int rowsAdded = 0;

            //var siteGroups = web.SiteGroups;

            ////IEnumerable<List> groups = ctx.LoadQuery(siteGroups.Where(true));

            //ctx.Load(siteGroups);

            //ctx.ExecuteQuery();

            //foreach (var group in siteGroups)
            //{
            //    int col = 0;
            //    //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.LoginName); // Seems same as Title
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Title);
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Id.ToString());
            //    //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Owner.LoginName);
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.PrincipalType.ToString());

            //    rowsAdded++;

            //    UserCollection users = ctx.Web.SiteGroups.GetById(group.Id).Users;

            //    ctx.Load(users);
            //    ctx.ExecuteQuery();

            //    foreach (var user in users)
            //    {
            //        col = 4;
            //        //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.LoginName);
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Title);
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Id.ToString());
            //        //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.UserId.ToString());
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.PrincipalType.ToString());
            //        rowsAdded++;
            //    }
            //    rowsAdded++;

            //}

            //insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblSiteGroups_{0}", web.Title));

            //insertAt.Group(insertAt.OrientVertical, hide: true);

            //insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            //XlHlp.DisplayInWatchWindow(System.Reflection.MethodInfo.GetCurrentMethod().Name, insertAt, "End");

            return(insertAt);
        }
예제 #18
0
        private void CreateWS_Web_Info(ClientContext ctx, string sectionsToDisplay, bool orientVertical)
        {
            XlHlp.DisplayInWatchWindow(string.Format("{0}",
                                                     System.Reflection.MethodInfo.GetCurrentMethod().Name));

            var web = ctx.Web;

            ctx.Load(web);
            ctx.ExecuteQuery();

            string    sheetName = XlHlp.SafeSheetName(string.Format("{0}{1}", "SPWeb>", web.Title));
            Worksheet ws        = XlHlp.NewWorksheet(sheetName, beforeSheetName: "FIRST");

            XlHlp.XlLocation insertAt = new XlHlp.XlLocation(ws, row: 2, column: 1, orientVertical: GetDisplayOrientation());

            if (insertAt.OrientVertical)
            {
                XlHlp.AddContentToCell(insertAt.AddRowX(), "Web Info");
                insertAt.IncrementRows();
            }
            else
            {
                XlHlp.AddContentToCell(insertAt.AddRowX(), "Web Info");
                insertAt.DecrementRows();   // AddRow bumped it.
                insertAt.IncrementColumns();
            }

            if (sectionsToDisplay.Contains("WebInfo"))
            {
                insertAt = AddSection_WebInfo(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("Libraries"))
            {
                insertAt = AddSection_Libraries(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("Lists"))
            {
                insertAt = AddSection_Lists(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("SiteGroups"))
            {
                insertAt = AddSection_SiteGroups(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("SiteColumns"))
            {
                insertAt = AddSection_SiteColumns(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("ContentTypes"))
            {
                insertAt = AddSection_ContentTypes(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }
        }
예제 #19
0
        internal static void Add_BuildControllers(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Description");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "Enabled");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "AgentsCount");

            insertAt.IncrementRows();
        }
예제 #20
0
        internal static void CreateWS_All_TPC_LastChangeset(Options_AZDO_TFS options,
                                                            VersionControlServer versionControlServer)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            try
            {
                XlHlp.XlLocation insertAt = CreateNewWorksheet(string.Format("{0}_{1}", "All_TPC", "LastChangeset"),
                                                               options);

                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Last Changeset All TeamProjects", AzureDevOpsExplorer.Presentation.Views.Server.TfsTeamProjectCollection.Name);

                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                Header_VersionControlServer.Add_Changesets(insertAt);

                //Body_VersionControlServer.Add_Changesets(insertAt, options, versionControlServer);

                foreach (var teamProjectName in options.TeamProjects)
                {
                    insertAt.ClearOffsets();

                    long loopTicks = Log.Trace($"Processing {teamProjectName}", Common.PROJECT_NAME);

                    TeamProject teamProject = VNCTFS.Helper.Get_TeamProject(versionControlServer, teamProjectName.Trim());

                    if (teamProject != null)
                    {
                        Globals.ThisAddIn.Application.StatusBar = $"Processing {teamProject.Name}";

                        Body_VersionControlServer.Add_TP_Changesets(insertAt, options,
                                                                    Presentation.Views.Server.VersionControlServer, teamProject);

                        AZDOHelper.ProcessLoopDelay(options);
                    }
                    else
                    {
                        XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), teamProjectName);
                        XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "No VCS Project");
                        insertAt.IncrementRows();
                    }

                    Log.Trace($"EndProcessing {teamProjectName}", Common.PROJECT_NAME, loopTicks);
                }

                insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tbl_{0}", insertAt.workSheet.Name));

                insertAt.Group(insertAt.OrientVertical, hide: true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);
        }
예제 #21
0
        internal static void Add_Builds(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "BuildController");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "LabelName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "StartTime");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 10, "FinishTime");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 30, "Finished");

            insertAt.IncrementRows();
        }
예제 #22
0
        internal static void Add_TP_Developers(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "TFS Team Project");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Developer");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Changeset Count");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Earliest Date");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Latest Date");

            insertAt.IncrementRows();
        }
예제 #23
0
        internal static void Add_Changesets(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Team Project");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Changeset ID");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Creation Date");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Supported Features");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "WebService Level");

            insertAt.IncrementRows();
        }
예제 #24
0
 internal static XlHlp.XlLocation Add_BuildProcessTemplates(XlHlp.XlLocation insertAt,
                                                            Options_AZDO_TFS options,
                                                            IBuildServer buildServer,
                                                            TeamProject teamProject)
 {
     return(ProcessAddSectionCommand_BuildServer(insertAt,
                                                 buildServer, teamProject,
                                                 "Build ProcessTemplates", Header_BuildServer.Add_BuildAgents,
                                                 (insertAt, buildServer, teamProject) => Body_BuildServer.Add_BuildAgents(insertAt, options, buildServer, teamProject),
                                                 "tblBPT_"));
 }
예제 #25
0
        private XlHlp.XlLocation CreateNewWorksheet(string sheetName,
                                                    Options_AZDO_TFS options, [CallerMemberName] string callerName = "")
        {
            Int64 startTicks = Log.APPLICATION($"Begin: sheetName: {sheetName}", Common.PROJECT_NAME);

            string    safeSheetName = XlHlp.SafeSheetName(sheetName);
            Worksheet ws            = XlHlp.NewWorksheet(safeSheetName, beforeSheetName: "FIRST");

            XlHlp.XlLocation insertAt = new XlHlp.XlLocation(ws, options.StartingRow, options.StartingColumn, options.OrientOutputVertically);
            XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Date Run", DateTime.Now.ToString());

            XlHlp.DisplayInWatchWindow("End", startTicks);

            if (!options.FormatSpecs.IsInitialized)
            {
                options.FormatSpecs.Initialize(insertAt);
            }

            using (System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog())
            {
                string strOutputFile = null;
                try
                {
                    saveFileDialog.FileName = "AzureDevOpsExplorer.xlsx";
                    //saveFileDialog.InitialDirectory = startingFolder;

                    if (System.Windows.Forms.DialogResult.Cancel == saveFileDialog.ShowDialog())
                    {
                        Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
                        return(insertAt);
                    }
                    else
                    {
                        strOutputFile = saveFileDialog.FileName;
                    }

                    if (string.IsNullOrEmpty(strOutputFile))
                    {
                        Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
                        return(insertAt);
                    }

                    Globals.ThisAddIn.Application.ActiveWorkbook.SaveAs(strOutputFile);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);

            return(insertAt);
        }
예제 #26
0
        internal static void Add_TP_Workspaces(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Computer");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "OwnerDisplayName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "OwnerName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "LastAccessDate");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Comment");

            insertAt.IncrementRows();
        }
예제 #27
0
        internal static void Add_TP_WorkItemDetails(XlHlp.XlLocation insertAt, Options_AZDO_TFS options)
        {
            long startTicks = Log.APPLICATION("Enter", Common.PROJECT_NAME);

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Project");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Id");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Type");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Title");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "CreatedBy");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "CreatedDate");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "ChangedBy");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "ChangedDate");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "AuthorizedDate");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "RevisedDate");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Rev");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Revision");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "State");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Reason");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Tags");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "AreaPath");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "IterationPath");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "RelatedLinkCount");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "ExternalLinkCount");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "HyperLinkCount");

            // NOTE(crhodes)
            // The Query can specify additional fields to display
            // They are added to the query to avoid a round trip if accessed
            // after the result set is returned.

            // Add Headers for any requested

            if ((options.WorkItemQuerySpec.Fields?.Count ?? 0) > 0)
            {
                foreach (string field in options.WorkItemQuerySpec.Fields)
                {
                    XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, field);
                }
            }

            insertAt.IncrementRows();

            Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
        }
예제 #28
0
        internal static void Add_TP_Iterations(XlHlp.XlLocation insertAt)
        {
            long startTicks = Log.APPLICATION("Enter", Common.PROJECT_NAME);

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Team Project");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Iteration");

            // TODO(crhodes)
            // This can have a variable number of columns.  Not sure how to label them.

            insertAt.IncrementRows();

            Log.APPLICATION("Exit", Common.PROJECT_NAME, startTicks);
        }
예제 #29
0
        internal static XlHlp.XlLocation ProcessAddSectionCommand_BuildServer(
            XlHlp.XlLocation insertAt,
            IBuildServer buildServer,
            TeamProject teamProject,
            string sectionTitle,
            RequestHandlers.ProcessAddHeaderCommand addHeaderCommand,
            ProcessAddBodyCommand_BS addBodyCommand,
            string tablePrefix)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            try
            {
                // Save the location of the title so we can update later after have traversed all items.

                Range rngTitle = insertAt.GetCurrentRange();

                if (insertAt.OrientVertical)
                {
                    XlHlp.AddSectionInfo(insertAt.AddRow(), sectionTitle, "");
                }
                else
                {
                    XlHlp.AddSectionInfo(insertAt.AddRow(), sectionTitle, "",
                                         orientation: XlOrientation.xlUpward);
                    insertAt.IncrementColumns();
                }

                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                addHeaderCommand(insertAt);

                addBodyCommand(insertAt, buildServer, teamProject);

                insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("{0}_{1}", tablePrefix, teamProject.Name));

                insertAt.Group(insertAt.OrientVertical);

                insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            XlHlp.DisplayInWatchWindow("End: " + DateTime.Now);
            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
예제 #30
0
        internal static void Add_Shelvesets(XlHlp.XlLocation insertAt)
        {
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "OwnerDisplayName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "OwnerName");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Name");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "CreationDate");
            //ExcelHlp.AddColumnHeaderToheet(insertAt.AddOffsetCoumn(), 20, "DisplayName");
            //ExcelHlp.AddColumnHeaderToheet(insertAt.AddOffsetCoumn(), 20, "QualifiedName");

            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "CheckinNote");
            XlHlp.AddColumnHeaderToSheet(insertAt.AddOffsetColumn(), 20, "Comment");

            insertAt.IncrementRows();
        }