Esempio n. 1
0
        public DialogEditor(DialogTemplate template)
        {
            InitializeComponent();
            SetContentTemplate(template);

            // Set reference if it's available
            if (string.IsNullOrEmpty(template.JsonPayload))
                _rootDialogNode = new DialogNode("Default");
            else
                _rootDialogNode = GetFromJson(template.JsonPayload);

            GenerateTree();

            textName.DataBindings.Add("Text", ContentTemplate, "Name");

            // Make sure nodes can be updated
            txtText.LostFocus += TxtTextOnTextChanged;
            txtComment.LostFocus += TxtTextOnTextChanged;
            txtText.GotFocus += TxtTextOnTextChanged;
            txtComment.GotFocus += TxtTextOnTextChanged;
        }
Esempio n. 2
0
 public DialogProvider(DialogTemplate dialogTemplate)
 {
     // Deflate our root dialog node
     _rootDialogNode = JsonConvert.DeserializeObject<DialogNode>(dialogTemplate.JsonPayload, jsonSerializerSettings);
 }