Example #1
0
        private void _UpdateBuildTabsList()
        {
            buildTabsList.Clear();

            int currentTab = buildTabs.CurrentTab;

            bool noCurrentTab = currentTab < 0 || currentTab >= buildTabs.GetTabCount();

            for (int i = 0; i < buildTabs.GetChildCount(); i++)
            {
                var tab = (BuildTab)buildTabs.GetChild(i);

                if (tab == null)
                {
                    continue;
                }

                string itemName = Path.GetFileNameWithoutExtension(tab.BuildInfo.Solution);
                itemName += " [" + tab.BuildInfo.Configuration + "]";

                buildTabsList.AddItem(itemName, tab.IconTexture);

                string itemTooltip = "Solution: " + tab.BuildInfo.Solution;
                itemTooltip += "\nConfiguration: " + tab.BuildInfo.Configuration;
                itemTooltip += "\nStatus: ";

                if (tab.BuildExited)
                {
                    itemTooltip += tab.BuildResult == BuildTab.BuildResults.Success ? "Succeeded" : "Errored";
                }
                else
                {
                    itemTooltip += "Running";
                }

                if (!tab.BuildExited || tab.BuildResult == BuildTab.BuildResults.Error)
                {
                    itemTooltip += $"\nErrors: {tab.ErrorCount}";
                }

                itemTooltip += $"\nWarnings: {tab.WarningCount}";

                buildTabsList.SetItemTooltip(i, itemTooltip);

                if (noCurrentTab || currentTab == i)
                {
                    buildTabsList.Select(i);
                    _BuildTabsItemSelected(i);
                }
            }
        }
Example #2
0
        private void _UpdateBuildTab(int index, int?currentTab)
        {
            var tab = (BuildTab)buildTabs.GetChild(index);

            string itemName = Path.GetFileNameWithoutExtension(tab.BuildInfo.Solution);

            itemName += " [" + tab.BuildInfo.Configuration + "]";

            buildTabsList.AddItem(itemName, tab.IconTexture);

            string itemTooltip = "Solution: " + tab.BuildInfo.Solution;

            itemTooltip += "\nConfiguration: " + tab.BuildInfo.Configuration;
            itemTooltip += "\nStatus: ";

            if (tab.BuildExited)
            {
                itemTooltip += tab.BuildResult == BuildTab.BuildResults.Success ? "Succeeded" : "Errored";
            }
            else
            {
                itemTooltip += "Running";
            }

            if (!tab.BuildExited || tab.BuildResult == BuildTab.BuildResults.Error)
            {
                itemTooltip += $"\nErrors: {tab.ErrorCount}";
            }

            itemTooltip += $"\nWarnings: {tab.WarningCount}";

            buildTabsList.SetItemTooltip(index, itemTooltip);

            // If this tab was already selected before the changes or if no tab was selected
            if (currentTab == null || currentTab == index)
            {
                buildTabsList.Select(index);
                _BuildTabsItemSelected(index);
            }
        }