Example #1
0
        private void btPpTypeNew_Click(object sender, RoutedEventArgs e)
        {
            List <string> existingPPTypeNames = new List <string>();

            foreach (PlotPointType ppT in _currentStoryData.PlotPointTypes)
            {
                existingPPTypeNames.Add(ppT.Name);
            }

            string constraintErrorMessage = "That name is already in use by another Plot Point Type.";
            string newName = Utilities.MakeConstrainedTextDialog("Please enter a name for your new Plot Point Type:", constraintErrorMessage, existingPPTypeNames, this);

            if (newName != null)
            {
                PlotPointType newPPType = new PlotPointType(newName, _currentStoryData);
                _currentStoryData.PlotPointTypes.Add(newPPType);

                clearDataElements();
                dataBindWindow();

                Window newWin = new WindowPlotPointTypeEditor(newPPType, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();
                clearDataElements();
                dataBindWindow();
            }
        }
Example #2
0
        private void btPpTypeEdit_Click(object sender, RoutedEventArgs e)
        {
            Object itemToEdit = ppDataGrid.SelectedItem;

            if ((itemToEdit == null) || (itemToEdit.GetType() != typeof(PlotPointType)))
            {
                return;
            }


            Window newWin = new WindowPlotPointTypeEditor((PlotPointType)itemToEdit, _currentStoryData);

            newWin.Owner = this;
            newWin.ShowDialog();
            clearDataElements();
            dataBindWindow();
        }
        private void btPpTypeNew_Click(object sender, RoutedEventArgs e)
        {
            List<string> existingPPTypeNames = new List<string>();

            foreach (PlotPointType ppT in _currentStoryData.PlotPointTypes)
            {

                existingPPTypeNames.Add(ppT.Name);
            }

            string constraintErrorMessage = "That name is already in use by another Plot Point Type.";
            string newName = Utilities.MakeConstrainedTextDialog("Please enter a name for your new Plot Point Type:", constraintErrorMessage, existingPPTypeNames, this);

            if (newName != null)
            {
                PlotPointType newPPType = new PlotPointType(newName, _currentStoryData);
                _currentStoryData.PlotPointTypes.Add(newPPType);

                clearDataElements();
                dataBindWindow();

                Window newWin = new WindowPlotPointTypeEditor(newPPType, _currentStoryData);
                newWin.Owner = this;
                newWin.ShowDialog();
                clearDataElements();
                dataBindWindow();
            }
        }
        private void btPpTypeEdit_Click(object sender, RoutedEventArgs e)
        {
            Object itemToEdit = ppDataGrid.SelectedItem;
            if ((itemToEdit == null) || (itemToEdit.GetType() != typeof(PlotPointType))) { return; }

            Window newWin = new WindowPlotPointTypeEditor((PlotPointType)itemToEdit, _currentStoryData);
            newWin.Owner = this;
            newWin.ShowDialog();
            clearDataElements();
            dataBindWindow();
        }