예제 #1
0
        private void OnDescriptionEditCancelButtonClick(object sender, EventArgs e)
        {
            DescriptionWebBrowser.Navigate("about:blank");
            DescriptionWebBrowser.Document.OpenNew(false);
            DescriptionWebBrowser.Document.Write(OldDescription);
            DescriptionWebBrowser.Refresh();

            DescriptionEditWindow.Close();
        }
예제 #2
0
        public WpfEpisodeView()
        {
            InitializeComponent();
            DescriptionWebBrowser.NavigateToString("<p>This is a description in a paragraph.</p>" +
                                                   "<p>The second paragraph has <b>bold</b>, <i>italics</i> and <a href=\"http://markheath.net\">a link</a>");
            var r     = new Random();
            var peaks = Enumerable.Range(1, 3000).Select(n => r.NextDouble()).Select(d => (float)d).ToArray();

            WaveformControl.SetPeaks(peaks);
        }
예제 #3
0
        private void PopulateFields(string raceName)
        {
            string   controlName;
            TextBox  skillPointsBox;
            ComboBox bonusFeatChoiceBox;

            ModelofRace = new RaceModel();
            ModelofRace.Initialize(raceName);
            //set our Original values for error checking unique values.
            DatabaseName         = ModelofRace.Name;
            DatabaseAbbreviation = ModelofRace.Abbreviation;

            //Set the Main Control Values
            NameInputBox.Text                  = ModelofRace.Name;
            AbbreviationInputBox.Text          = ModelofRace.Abbreviation;
            PastLifeFeatCombo.SelectedItem     = FeatModel.GetNameFromId(ModelofRace.PastLifeFeatId);
            StartingClassComboBox.SelectedItem = ClassModel.GetNameFromId(ModelofRace.StartingClassId);
            IconicCheckBox.Checked             = ModelofRace.Iconic;

            DescriptionWebBrowser.Navigate("about:blank");
            DescriptionWebBrowser.Document.OpenNew(false);
            DescriptionWebBrowser.Document.Write(ModelofRace.Description);
            DescriptionWebBrowser.Refresh();
            MaleIconNameInputBox.Text   = ModelofRace.MaleImageFileName;
            FemaleIconNameInputBox.Text = ModelofRace.FemaleImageFileName;
            MaleIcon = new IconClass(ModelofRace.MaleImageFileName);
            MaleIcon.SetLocation(this.Width, this.Height, MaleIconLocation);
            FemaleIcon = new IconClass(ModelofRace.FemaleImageFileName);
            FemaleIcon.SetLocation(this.Width, this.Height, FemaleIconLocation);
            //Starting Stat Boxes
            StrengthMinimumBox.SelectedItem     = ModelofRace.StrengthMinimum.ToString();
            StrengthMaximumBox.SelectedItem     = ModelofRace.StrengthMaximum.ToString();
            DexterityMinimumBox.SelectedItem    = ModelofRace.DexterityMinimum.ToString();
            DexterityMaximumBox.SelectedItem    = ModelofRace.DexterityMaximum.ToString();
            ConstitutionMinimumBox.SelectedItem = ModelofRace.ConstitutionMinimum.ToString();
            ConstitutionMaximumBox.SelectedItem = ModelofRace.ConstitutionMaximum.ToString();
            IntelligenceMinimumBox.SelectedItem = ModelofRace.IntelligenceMinimum.ToString();
            IntelligenceMaximumBox.SelectedItem = ModelofRace.IntelligenceMaximum.ToString();
            WisdomMinimumBox.SelectedItem       = ModelofRace.WisdomMinimum.ToString();
            WisdomMaximumBox.SelectedItem       = ModelofRace.WisdomMaximum.ToString();
            CharismaMinimumBox.SelectedItem     = ModelofRace.CharismaMinimum.ToString();
            CharismaMaximumBox.SelectedItem     = ModelofRace.CharismaMaximum.ToString();
            //System Boxes
            GuidLabel.Text               = ModelofRace.Id.ToString();
            LastUpdatedDateLabel.Text    = ModelofRace.LastUpdatedDate.ToString();
            LastUpdatedVersionLabel.Text = ModelofRace.LastUpdatedVersion;

            //LevelDetails Information
            ModelofRaceDetail = RaceLevelDetailModel.GetAll(ModelofRace.Id);
            if (ModelofRaceDetail == null)
            {
                //no detail records exist for this race, so we need to create them
                ModelofRaceDetail = new List <RaceLevelDetailModel>();
                for (int i = 0; i < Constant.NumHeroicLevels; i++)
                {
                    ModelofRaceDetail.Add(new RaceLevelDetailModel());
                    ModelofRaceDetail[i].Level = i + 1;
                }
                NewRecord = true;
            }
            //now lets fill in our Level Detail Controls
            for (int i = 0; i < Constant.NumHeroicLevels; i++)
            {
                controlName         = "SkillPointsInputBox" + (i + 1);
                skillPointsBox      = (TextBox)this.LevelDetailsPanel.Controls[controlName];
                skillPointsBox.Text = ModelofRaceDetail[i].BonusSkillPoints.ToString();

                controlName        = "BonusFeatChoiceCombo" + (i + 1);
                bonusFeatChoiceBox = (ComboBox)this.LevelDetailsPanel.Controls[controlName];
                bonusFeatChoiceBox.SelectedItem = FeatTypeModel.GetNameFromId(ModelofRaceDetail[i].FeatTypeId);
            }
        }