Ejemplo n.º 1
0
 private void buttonNew_Click(object sender, EventArgs e)
 {
     using (var dialog = new TemplateDialog("template1", new DatabaseTemplate()))
     {
         dialog.ShowDialog();
         if (dialog.DialogResult == DialogResult.OK)
         {
             var template = dialog.ConfiguredTemplate;
             config.AddTemplate(dialog.SelectedAlias, template);
             this.comboBoxTemplate.DataSource = config.Templates.Select(kvp => kvp.Key).ToList();
         }
     }
 }
Ejemplo n.º 2
0
        private void buttonNew_Click(object sender, EventArgs e)
        {
            using (var dialog = new TemplateDialog("template1", new DatabaseTemplate()))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    var template = dialog.ConfiguredTemplate;

                    // TODO - let the dialog config these internally
                    this.staticResponseTypeControl1.Configure(template);
                    this.eventResponseTypeControl1.Configure(template);


                    config.AddTemplate(dialog.SelectedAlias, template);
                    this.comboBoxTemplate.DataSource = config.Templates.Select(kvp => kvp.Key).ToList();
                }
            }
        }
Ejemplo n.º 3
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            var alias  = this.comboBoxTemplate.SelectedItem.ToString();
            var edited = config.GetTemplateMaybeNull(alias);

            if (edited != null)
            {
                using (var dialog = new TemplateDialog(alias, edited))
                {
                    dialog.ShowDialog();
                    if (dialog.DialogResult == DialogResult.OK)
                    {
                        var template = dialog.ConfiguredTemplate;
                        config.AddTemplate(dialog.SelectedAlias, template);
                        this.comboBoxTemplate.DataSource = config.Templates.Select(kvp => kvp.Key).ToList();
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void buttonNew_Click(object sender, EventArgs e)
        {
            using (var dialog = new TemplateDialog("template1", new DatabaseTemplate()))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    var template = dialog.ConfiguredTemplate;

                    // TODO - let the dialog config these internally
                    this.staticResponseTypeControl1.Configure(template);
                    this.eventResponseTypeControl1.Configure(template);

                    config.AddTemplate(dialog.SelectedAlias, template);
                    this.comboBoxTemplate.DataSource = config.Templates.Select(kvp => kvp.Key).ToList();
                }
            }
        }
Ejemplo n.º 5
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            var alias = this.comboBoxTemplate.SelectedItem.ToString();
            var edited = config.GetTemplateMaybeNull(alias);

            if (edited != null)
            {
                using (var dialog = new TemplateDialog(alias, edited))
                {
                    dialog.ShowDialog();
                    if (dialog.DialogResult == DialogResult.OK)
                    {
                        var template = dialog.ConfiguredTemplate;
                        config.AddTemplate(dialog.SelectedAlias, template);
                        this.comboBoxTemplate.DataSource = config.Templates.Select(kvp => kvp.Key).ToList();
                    }
                }
            }
        }