public override void ClearSearch()
 {
     if (TableControl != null)
     {
         TableControl.SetFilter(SearchFilterKey, null);
     }
     else
     {
         System.Diagnostics.Debug.Fail("Attempting to clear before initializing ErrorListWindow");
     }
 }
Beispiel #2
0
        protected override int InnerExec(ref Guid commandGroupGuid, uint commandId, uint commandExecOption, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (commandGroupGuid != ProjectSystemToolsPackage.CommandSetGuid)
            {
                return((int)Constants.OLECMDERR_E_NOTSUPPORTED);
            }

            var handled = true;

            switch (commandId)
            {
            case ProjectSystemToolsPackage.StartLoggingCommandId:
                _dataSource.Start();
                break;

            case ProjectSystemToolsPackage.StopLoggingCommandId:
                _dataSource.Stop();
                break;

            case ProjectSystemToolsPackage.ClearCommandId:
                _dataSource.Clear();
                break;

            case ProjectSystemToolsPackage.SaveLogsCommandId:
                SaveLogs();
                break;

            case ProjectSystemToolsPackage.OpenLogsCommandId:
                OpenLogs();
                break;

            case ProjectSystemToolsPackage.OpenLogsExternalCommandId:
                OpenLogsExternal();
                break;

            case ProjectSystemToolsPackage.BuildTypeComboCommandId:
                var selectedType = string.Empty;
                if (pvaOut != IntPtr.Zero)
                {
                    switch (_filterType)
                    {
                    case BuildType.All:
                        selectedType = BuildLoggingResources.FilterBuildAll;
                        break;

                    case BuildType.Evaluation:
                        selectedType = BuildLoggingResources.FilterBuildEvaluations;
                        break;

                    case BuildType.DesignTimeBuild:
                        selectedType = BuildLoggingResources.FilterBuildDesignTimeBuilds;
                        break;

                    case BuildType.Build:
                        selectedType = BuildLoggingResources.FilterBuildBuilds;
                        break;

                    case BuildType.Roslyn:
                        selectedType = BuildLoggingResources.FilterBuildRoslyn;
                        break;
                    }

                    Marshal.GetNativeVariantForObject(selectedType, pvaOut);
                }
                else
                {
                    var selectedItem = Marshal.GetObjectForNativeVariant(pvaIn);

                    selectedType = selectedItem.ToString();
                    var column = TableControl.ColumnDefinitionManager.GetColumnDefinition(TableColumnNames.BuildType);
                    if (selectedType.Equals(BuildLoggingResources.FilterBuildAll))
                    {
                        TableControl.SetFilter(TableColumnNames.BuildType, new ColumnHashSetFilter(column));
                    }
                    else if (selectedType.Equals(BuildLoggingResources.FilterBuildEvaluations))
                    {
                        TableControl.SetFilter(TableColumnNames.BuildType, new ColumnHashSetFilter(column, GetExcluded(nameof(BuildType.Evaluation))));
                    }
                    else if (selectedType.Equals(BuildLoggingResources.FilterBuildDesignTimeBuilds))
                    {
                        TableControl.SetFilter(TableColumnNames.BuildType, new ColumnHashSetFilter(column, GetExcluded(nameof(BuildType.DesignTimeBuild))));
                    }
                    else if (selectedType.Equals(BuildLoggingResources.FilterBuildBuilds))
                    {
                        TableControl.SetFilter(TableColumnNames.BuildType, new ColumnHashSetFilter(column, GetExcluded(nameof(BuildType.Build))));
                    }
                    else if (selectedType.Equals(BuildLoggingResources.FilterBuildRoslyn))
                    {
                        TableControl.SetFilter(TableColumnNames.BuildType, new ColumnHashSetFilter(column, GetExcluded(nameof(BuildType.Roslyn))));
                    }
                }

                break;

            case ProjectSystemToolsPackage.BuildTypeComboGetListCommandId:
                var outParam = pvaOut;
                Marshal.GetNativeVariantForObject(GetBuildFilterComboItems(), outParam);
                break;

            default:
                handled = false;
                break;
            }

            return(handled ? VSConstants.S_OK : (int)Constants.OLECMDERR_E_NOTSUPPORTED);
        }