コード例 #1
0
        protected override string GetSelection <TKey, TValue>(
            IDictionary <TKey, TValue> source,
            Func <TKey, TValue, object> descriptionSelector = null,
            bool isOptional            = false,
            CollectionWriteStyle style = CollectionWriteStyle.Rows)
        {
            var collection = new InputCollection <TKey, TValue>(source, descriptionSelector, isOptional);

            return(collection.GetSelection(_console, style)?.ToString());
        }
コード例 #2
0
        protected virtual string GetSelectionWithDefault <TKey, TValue>(
            IDictionary <TKey, TValue> source,
            Func <TKey, TValue, object> descriptionSelector = null,
            string defaultValue        = null,
            CollectionWriteStyle style = CollectionWriteStyle.Rows)
        {
            var collection = new InputCollection <TKey, TValue>(source, descriptionSelector, true, defaultValue: defaultValue);

            return(collection.GetSelection(_console, style)?.ToString());
        }
コード例 #3
0
 public static TValue GetSelection <TKey, TValue>(this InputCollection <TKey, TValue> collection, IConsole console, bool writeInline = false)
 {
     return(collection.GetSelection(console,
                                    writeInline ? CollectionWriteStyle.Inline : CollectionWriteStyle.Rows));
 }