Ejemplo n.º 1
0
        // ---------------------- //
        // -- Event Management -- //
        // ---------------------- //

        // Control-specific events //
        private void CommitButton_Click(object sender, RoutedEventArgs e)
        {
            string name        = EntityName.Text;
            string description = EntityDescription.Text;

            if (pageMode == PageFunctions.Switch)
            {
                EntityFunctions.SwitchEntity(ref selectedEntity, (bool)MakeDefaultCheckBox.IsChecked);
            }
            else if (pageMode == PageFunctions.New)
            {
                EntityFunctions.NewEntity(name, description, (bool)SwitchToCheckBox.IsChecked, (bool)MakeDefaultCheckBox.IsChecked);
            }
            else if (pageMode == PageFunctions.Amend)
            {
                EntityFunctions.AmendEntity(ref selectedEntity, name, description);
            }
            else if (pageMode == PageFunctions.Default)
            {
                EntityFunctions.ChangeDefaultEntity(ref selectedEntity, name);
            }
        }