Exemplo n.º 1
0
        public void AddEntry(object obj)
        {
            if (SelectedStep == null)
            {
                return;
            }

            WizardSection selectedSection = null;
            int           id = -1;

            if (int.TryParse(obj.ToString(), out id))
            {
                for (int i = 0; i < SelectedStep.WizardSections.Count; i++)
                {
                    if (SelectedStep.WizardSections[i].Id == id)
                    {
                        selectedSection = SelectedStep.WizardSections[i];
                        break;
                    }
                }
            }

            if (selectedSection != null)
            {
                var newEditorMeta = new EditorMeta()
                {
                    CurrentLabel = "New Entry",
                    CurrentValue = "New Entry value"
                };
                selectedSection.CurrentValues.Add(newEditorMeta);
            }
        }
Exemplo n.º 2
0
        public void AddSection(object obj)
        {
            if (SelectedStep == null)
            {
                return;
            }

            var newSection = new WizardSection()
            {
                Name      = "Section " + (WizardSteps.Count + 1),
                IsEditing = true,
                Info      = "This is a new step, you can edit it and press ok to exit edit mode."
            };

            newSection.Parent = SelectedStep;
            SelectedStep.WizardSections.Add(newSection);
            // SelectedWizardSection = newSection;
        }