Exemple #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());
        }
Exemple #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());
        }
 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));
 }