Пример #1
0
        protected ToggleGroupCommandDefinitionBase(string commandName, TraceListItemType groupType)
        {
            mCommandName = commandName;

            mImageSource = new Uri(string.Format("/Modules/TraceList/Images/{0}.png",
                                                 groupType.ToString()),
                                   UriKind.Relative);
        }
Пример #2
0
        public static string ToDisplayString(this TraceListItemType type, bool plural)
        {
            switch (type)
            {
            case TraceListItemType.Error:
                if (plural)
                {
                    return(nameof(TraceListItemType.Error) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Error));
                }

            case TraceListItemType.Warning:
                if (plural)
                {
                    return(nameof(TraceListItemType.Warning) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Warning));
                }

            case TraceListItemType.Start:
                if (plural)
                {
                    return(nameof(TraceListItemType.Start) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Start));
                }

            case TraceListItemType.Stop:
                if (plural)
                {
                    return(nameof(TraceListItemType.Stop) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Stop));
                }

            case TraceListItemType.Suspend:
                return(nameof(TraceListItemType.Suspend) + "ed");

            case TraceListItemType.Resume:
                if (plural)
                {
                    return(nameof(TraceListItemType.Resume) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Resume));
                }

            case TraceListItemType.Transfer:
                if (plural)
                {
                    return(nameof(TraceListItemType.Transfer) + "s");
                }
                else
                {
                    return(nameof(TraceListItemType.Transfer));
                }

            default:
                return(type.ToString());
            }
        }