Example #1
0
 private void ComplexAdditionWindowShow_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (sorteritno.dir_counter < sorteritno.dir_count_max)
     {
         if (CurrentlyChosenDir.Description.FullName.Length < sorteritno.path_max_length)
         {
             sorteritno.caw_dir_counter = 0;
             CAW = new ComplexAdditionWindow();
             settings.GetCAWsize();
             settings.ApplyStyleCAW();
             CAW.ShowDialog();
         }
         else
         {
             EMW = new ErrorMessageWindow();
             EMW.SetMessage(3);
             EMW.ShowDialog();
         }
     }
     else
     {
         EMW = new ErrorMessageWindow();
         EMW.SetMessage(1);
         EMW.ShowDialog();
     }
 }
Example #2
0
        /// <summary>
        /// Handles the DispatcherUnhandledException event of the App control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Threading.DispatcherUnhandledExceptionEventArgs"/> instance containing the event data.</param>
        public void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            ErrorMessageWindow errorMessageWindow = new ErrorMessageWindow(e.Exception);

            errorMessageWindow.ShowDialog();
            e.Handled = true;
        }
Example #3
0
 protected override void Start()
 {
     base.Start();
     skillDB            = GameObject.FindGameObjectWithTag("SkillDataBase").GetComponent <SkillDataBase>();
     errorMessageWindow = GameObject.Find("ErrorMessage").GetComponent <ErrorMessageWindow>();
     errorMessageWindow.InitErrorMessageWindow();
     nullColor = new Vector4(1, 1, 1, 0.4f);
     InitSelectSquare();
     InitSkillListPanel();
     InitSkillSetPanel();
 }
Example #4
0
        private void PasteChildrenDirs_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (CurrentlyChosenDir.Description.FullName.Length < sorteritno.path_max_length )
            {
                List<IEditableDirWithChildrenAndParent> CopyOfChildren =
                SaveAndReadElementInBinaryFile.GetDefaultInstance()
                .ReadFromBinaryFile<IEditableDirWithChildren>(@"C:..\..\..\TemporaryFiles\tempFile~Copy")
                .Children;
                int dirCount = 0;
                foreach (ChildDir childdir in CopyOfChildren)
                {
                    dirCount += sorteritno.GetDirCount(childdir);
                }
                if (dirCount + sorteritno.dir_counter < sorteritno.dir_count_max)
                {
                    var validate = DirValidate.GetDefaultInstance();
                    foreach (IEditableDirWithChildrenAndParent child in CopyOfChildren)
                    {

                        if (validate.IsDirExistingAsFolderAndChild(CurrentlyChosenDir, child.Description.Name))
                        {
                            child.Description.Name = DirNameGenerator.GetDefaultInstance().GeneratetName_Default(CurrentlyChosenDir, 1, child.Description.Name);
                        }

                        child.ParentDir = CurrentlyChosenDir;
                    }
                    CurrentlyChosenDir.AddChildrenToChildrenList(CopyOfChildren);
                    DirManagement.GetDefaultInstance().AutoGenerateChildrenFullName(CurrentlyChosenDir);
                    int result = PasteFullNameControl(CurrentlyChosenDir);
                    if (result > 0)
                    {
                        EMW = new ErrorMessageWindow();
                        EMW.SetMessage(4);
                        EMW.ShowDialog();
                    }
                    AddMemento();
                    sorteritno.ResetTree(ResTree, ResetHighlight, Seed, drzewo, "MW");
                }
                else             //wyswietl info o zbyt duzej ilosci dirow
                {
                    EMW = new ErrorMessageWindow();
                    EMW.SetMessage(2);
                    EMW.ShowDialog();
                }
            }
            else
            {
                EMW = new ErrorMessageWindow();
                EMW.SetMessage(3);
                EMW.ShowDialog();
            }
        }
        private void buttonCalculate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                double cost = Math.Round(double.Parse(textBoxCost.Text), 2);
                double payment = Math.Round(double.Parse(textBoxPayment.Text), 2);
                double change = payment - cost;

                // Show change in cash register window
                textBlockChange.Text = "$" + string.Format("{0:0.00}", change);

                // Calculate exact change
                double[] exact = calculateExactChange(change);

                // Show exact change to give
                textBlockExactChange.Text = "You need to give \n" +
                                            exact[0] + " $100 bill(s) \n" +
                                            exact[1] + " $50 bill(s) \n" +
                                            exact[2] + " $20 bill(s) \n" +
                                            exact[3] + " $10 bill(s) \n" +
                                            exact[4] + " $5 bill(s) \n" +
                                            exact[5] + " $1 bill(s) \n" +
                                            exact[6] + " quarter(s) \n" +
                                            exact[7] + " dime(s) \n" +
                                            exact[8] + " nickel(s) and \n" +
                                            exact[9] + " pennies.";
            }
            catch (FormatException exception)
            {
                // Window pops up to display error 

                ErrorMessageWindow window = new ErrorMessageWindow();
                if (textBoxCost.Text == "Enter cost here" || textBoxPayment.Text == "Enter payment here")
                {
                    window.textBlockError.Text = "You forgot to enter the cost and/or payment.";
                }
                else
                {
                    window.textBlockError.Text = "Please enter a valid number. \n" +
                                                 "Do not include any currency symbols (i.e. $)";
                }

                window.Show();
            }
        }
Example #6
0
    private void Start()
    {
        try
        {
            level = LevelLoader.LoadLevel("test");
        } catch (IOException)
        {
            ErrorMessageWindow.Show("Could not open level");
            return;
        } catch (Exception)
        {
            ErrorMessageWindow.Show("Could not load level. Most likely an invalid format");
            return;
        }

        playGrid.InitGrid();
        playGrid.AddAppliances(level.StaticAppliancesInfos);
    }
Example #7
0
        private void DefaultAddition_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (CurrentlyChosenDir.Description.FullName.Length < sorteritno.path_max_length)
            {
                if (sorteritno.dir_counter < sorteritno.dir_count_max)
                {
                    string name = DirNameGenerator.GetDefaultInstance().GeneratetName_Default(CurrentlyChosenDir);
                    IEditableDirWithChildrenAndParent NewDir = new ChildDir(name, CurrentlyChosenDir);
                    CurrentlyChosenDir.AddChildToChildrenList(NewDir);
                    AddMemento();
                    sorteritno.ResetTree(ResTree, ResetHighlight, Seed, drzewo, "MW");
                    if (CurrentlyChosen.Margin.Left > 0)
                    {
                        //sorteritno.SetTreeSVSize("MW");
                        //Point relativeLocation = CurrentlyChosen.TranslatePoint(new Point(0, 0), ResTree);
                        drzewo.ScrollToHorizontalOffset(drzewo.ScrollableWidth + 80);
                        //FolderSearchTB.Text = relativeLocation.X.ToString();
                    }
                    else
                    {
                        // Point relativeLocation = CurrentlyChosen.TranslatePoint(new Point(0, 0), ResTree);
                        drzewo.ScrollToHorizontalOffset(drzewo.ScrollableWidth);
                        //FolderSearchTB.Text = relativeLocation.X.ToString();

                    }

                }
                else                //wyswietlenie informacji o zbyt duzej ilosci folderow w drzewie
                {
                    EMW = new ErrorMessageWindow();
                    EMW.SetMessage(1);
                    EMW.ShowDialog();
                }
            }
            else
            {
                EMW = new ErrorMessageWindow();
                EMW.SetMessage(3);
                EMW.ShowDialog();
            }

        }
 private void Awake()
 {
     instance = this;
 }
Example #9
0
 private void Awake()
 {
     characterClass     = GetComponent <ICharacterClass>();
     errorMessageWindow = GameObject.FindGameObjectWithTag("GUI").GetComponentInChildren <ErrorMessageWindow>();
     spellBar           = GameObject.FindGameObjectWithTag("GUI").GetComponentInChildren <SpellBar>();
 }