2016-04-07 13 views

Antwort

0

Es sieht so aus, als ob dies noch nicht implementiert wurde. Ich nahm einen Blick ins Innere https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/FormFlow/FormBuilder.cs und fand dieses:

internal static void TypePaths(Type type, string path, List<string> paths) 
    { 
     if (type.IsClass) 
     { 
      if (type == typeof(string)) 
      { 
       paths.Add(path); 
      } 
      else if (type.IsIEnumerable()) 
      { 
       var elt = type.GetGenericElementType(); 
       if (elt.IsEnum) 
       { 
        paths.Add(path); 
       } 
       else 
       { 
        // TODO: What to do about enumerations of things other than enums? 
       } 
      } 
      else 
      { 
       FieldPaths(type, path, paths); 
      } 
     } 
     else if (type.IsEnum) 
     { 
      paths.Add(path); 
     } 
     else if (type == typeof(bool)) 
     { 
      paths.Add(path); 
     } 
     else if (type.IsIntegral()) 
     { 
      paths.Add(path); 
     } 
     else if (type.IsDouble()) 
     { 
      paths.Add(path); 
     } 
     else if (type.IsNullable() && type.IsValueType) 
     { 
      paths.Add(path); 
     } 
     else if (type == typeof(DateTime)) 
     { 
      paths.Add(path); 
     } 
    } 

Hinweis der ToDo etwa Aufzählungen andere als Aufzählungen.

Außerhalb des FormBuilder können wir PromptDialog.Choice verwenden, die eine IEnumerable<> Ihrer Optionen dauert.

Es ist möglich, Dialoge miteinander zu verketten, so dass Sie Ihre FormDialog in zwei teilen müssen mit dem PromptDialog dazwischen.

Alternativ nehmen Sie eine Gabel von BotBuilder und implementieren Sie die TODO!

Verwandte Themen