public RegistrationDialog(Rd.Dialog dialog, Dialog owner) : base(dialog, owner) { // set operation anyway Operation = BotManager.Core.Repository.CreteRegistrationOp(); Path = RootPath; }
/// <summary> /// Good old recursion again initialize dialogs tree /// </summary> private List <Dialog> InitializeSubDialogs(Rd.Dialog dialog, Dialog owner) { List <Dialog> result = new List <Dialog>(); foreach (var dia in dialog.Dialogs) { Dialog d = new Dialog(dia, owner); result.Add(d); } return(result); }
public Dialog(Rd.Dialog dialog, Dialog owner) : this(dialog.Id) { if (dialog.Data.IsBloated(26)) { throw new Exception($"Data lenght cant exceed size of 26 chars!\r\nDialog/Button Id = '{dialog.Id}'"); } DisplayedName = dialog.Name; Content = dialog.Message?.FirstOrDefault(); Data = dialog.Data; DisplayPriority = dialog.DisplayPriority; Dialogs = InitializeSubDialogs(dialog, this); Owner = owner; Operation = BotManager.Core.Operations.GetOperation(dialog.Operation, BotManager.Core.IsEditor); }
public RootDialog(Rd.Dialog dialog) : base(dialog, null) { Path = RootPath; }
public SerialDialog(Rd.Dialog dialog, Dialog owner) : base(dialog, owner) { }