Ejemplo n.º 1
0
        //private void NewStyles()
        //{
        //    if (styleAddInput.Text != string.Empty)
        //    {
        //        List<string> splitList = styleAddInput.Text.ToUpper().Split(';', ',').Select(p => p.Trim()).ToList();
        //        foreach (string styl in splitList)
        //        {
        //            bool alreadyExists = false;
        //            for (int i = 0; i < localStyleList.Count; i++)
        //            {
        //                if (localStyleList[i].style == styl)
        //                {
        //                    alreadyExists = true;
        //                    selectedGame.style.Add(localStyleList[i]);
        //                    selectedGame.styleListToString += styl + " ; ";
        //                    break;
        //                }
        //            }
        //            if (!alreadyExists)
        //            {
        //                Style newStyle = new Style();
        //                newStyle.style = styl;
        //                newStyleList.Add(newStyle);
        //                selectedGame.style.Add(newStyle);
        //                selectedGame.styleListToString += styl + " ; ";
        //            }
        //        }
        //    }
        //}

        private void deleteExpansion_Click(object sender, RoutedEventArgs e)
        {
            ConfirmWindow confirm = new ConfirmWindow();

            confirm.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            var result = confirm.ShowDialog();

            if (result == DialogResult.HasValue)
            {
                if (confirm.isOK)
                {
                    Expansion selectedExpansion = (Expansion)(sender as Button).DataContext;
                    selectedGame.removeExpansion(selectedExpansion);
                }
            }
            ExpansionList.Items.Refresh();
        }
Ejemplo n.º 2
0
        private void deleteEditor_Click(object sender, RoutedEventArgs e)
        {
            Editor        selectedEditor = (Editor)(sender as System.Windows.Controls.Button).DataContext;
            ConfirmWindow confirmWindow  = new ConfirmWindow();

            confirmWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            var result = confirmWindow.ShowDialog();

            if (result == DialogResult.HasValue)
            {
                if (confirmWindow.isOK)
                {
                    selectedGame.localEditorList.Remove(selectedEditor);
                    selectedGame.refreshEditorListToString();
                    EditorsList.Items.Refresh();
                }
            }
        }
Ejemplo n.º 3
0
        //private void NewEditors()
        //{
        //    if (editorAddInput.Text != string.Empty)
        //    {
        //        List<string> splitList = editorAddInput.Text.ToUpper().Split(';', ',').Select(p => p.Trim()).ToList();
        //        foreach(string editorName in splitList)
        //        {
        //            bool alreadyExists = false;
        //            for (int i = 0; i< localEditorsList.Count; i++)
        //            {
        //                if (localEditorsList[i].Name == editorName)
        //                {
        //                    alreadyExists = true;
        //                    selectedGame.localEditorList.Add(localEditorsList[i]);
        //                    selectedGame.editorListToString += editorName + " ; ";
        //                    break;
        //                }
        //            }
        //            if(!alreadyExists)
        //            {
        //                Editor newEditor = new Editor();
        //                newEditor.Name = editorName;
        //                newEditorsList.Add(newEditor);
        //                selectedGame.localEditorList.Add(newEditor);
        //                selectedGame.editorListToString += editorName + " ; ";
        //            }
        //        }
        //    }
        //}

        private void deleteStyle_Click(object sender, RoutedEventArgs e)
        {
            Style         selectedStyle = (Style)(sender as System.Windows.Controls.Button).DataContext;
            ConfirmWindow confirmWindow = new ConfirmWindow();

            confirmWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            var result = confirmWindow.ShowDialog();

            if (result == DialogResult.HasValue)
            {
                if (confirmWindow.isOK)
                {
                    selectedGame.style.Remove(selectedStyle);
                    selectedGame.refreshStyleListToString();
                    StyleList.Items.Refresh();
                }
            }
        }