コード例 #1
0
        internal static ParameterDisplayHints CreateParameterDisplayHints(string channelOrKey, Mode mode, bool isInput)
        {
            ParameterDisplayHints descriptor = new ParameterDisplayHints();

            if (mode == Mode.PubSub)
            {
                descriptor.Description = isInput
                    ? string.Format(CultureInfo.CurrentCulture, "publish to channel '{0}'", channelOrKey)
                    : string.Format(CultureInfo.CurrentCulture, "subscribe to channel '{0}'", channelOrKey);
            }
            else
            {
                descriptor.Description = isInput
                    ? string.Format(CultureInfo.CurrentCulture, "key to get from cache '{0}'", channelOrKey)
                    : string.Format(CultureInfo.CurrentCulture, "key to add to cache'{0}'", channelOrKey);
            }
            descriptor.Prompt = isInput ?
                "Enter the channel name" :
                "Enter the key name";

            descriptor.DefaultValue = isInput ? null : channelOrKey;

            return descriptor;
        }
コード例 #2
0
        internal static ParameterDisplayHints CreateParameterDisplayHints(string entityPath, bool isInput)
        {
            ParameterDisplayHints descriptor = new ParameterDisplayHints();

            descriptor.Description = isInput ?
                string.Format(CultureInfo.CurrentCulture, "dequeue from '{0}'", entityPath) :
                string.Format(CultureInfo.CurrentCulture, "enqueue to '{0}'", entityPath);

            descriptor.Prompt = isInput ?
                "Enter the queue message body" :
                "Enter the output entity name";

            descriptor.DefaultValue = isInput ? null : entityPath;

            return descriptor;
        }