Example #1
0
        private void MakeSkillDisplays()
        {
            Stopwatch sw = Stopwatch.StartNew();

            _groups = new BindingListDisplay <SkillGroup>(_character.SkillsSection.SkillGroups, group => new SkillGroupControl(group))
            {
                Location = new Point(0, 15),
            };
            _groups.Filter(x => x.SkillList.Any(y => _character.SkillsSection.SkillsDictionary.ContainsKey(y.Name)), true);

            sw.TaskEnd("_groups");

            splitSkills.Panel1.Controls.Add(_groups);

            sw.TaskEnd("_group add");

            _skills = new BindingListDisplay <Skill>(_character.SkillsSection.Skills, MakeActiveSkill)
            {
                Location = new Point(265, 42),
            };

            sw.TaskEnd("_skills");

            splitSkills.Panel1.Controls.Add(_skills);

            sw.TaskEnd("_skills add");

            _knoSkills = new BindingListDisplay <KnowledgeSkill>(_character.SkillsSection.KnowledgeSkills,
                                                                 knoSkill => new KnowledgeSkillControl(knoSkill))
            {
                Location = new Point(3, 50),
            };

            splitSkills.Panel2.Controls.Add(_knoSkills);
        }
        private void cboDisplayFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox csender = (ComboBox)sender;
            Tuple <string, Predicate <Power> > selectedItem = (Tuple <string, Predicate <Power> >)csender.SelectedItem;

            if (selectedItem.Item2 == null)
            {
                csender.DropDownStyle = ComboBoxStyle.DropDown;
                _searchMode           = true;
            }
            else
            {
                csender.DropDownStyle = ComboBoxStyle.DropDownList;
                _searchMode           = false;
                _powers.Filter(selectedItem.Item2);
            }
        }
 private void cboDisplayFilterKnowledge_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboDisplayFilterKnowledge.SelectedItem is Tuple <string, Predicate <KnowledgeSkill> > selectedItem)
     {
         if (selectedItem.Item2 == null)
         {
             cboDisplayFilterKnowledge.DropDownStyle = ComboBoxStyle.DropDown;
             _blnKnowledgeSkillSearchMode            = true;
             cboDisplayFilterKnowledge.Text          = string.Empty;
         }
         else
         {
             cboDisplayFilterKnowledge.DropDownStyle = ComboBoxStyle.DropDownList;
             _blnKnowledgeSkillSearchMode            = false;
             _lstKnowledgeSkills.Filter(selectedItem.Item2);
         }
     }
 }
Example #4
0
 private void cboDisplayFilter_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboDisplayFilter.SelectedItem is Tuple <string, Predicate <Power> > selectedItem)
     {
         if (selectedItem.Item2 == null)
         {
             cboDisplayFilter.DropDownStyle = ComboBoxStyle.DropDown;
             _blnSearchMode        = true;
             cboDisplayFilter.Text = string.Empty;
         }
         else
         {
             cboDisplayFilter.DropDownStyle = ComboBoxStyle.DropDownList;
             _blnSearchMode = false;
             _powers.Filter(selectedItem.Item2);
         }
     }
 }
Example #5
0
 private void cboDisplayFilter_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboDisplayFilter.SelectedItem is Tuple <string, Predicate <Skill> > selectedItem)
     {
         if (selectedItem.Item2 == null)
         {
             cboDisplayFilter.DropDownStyle = ComboBoxStyle.DropDown;
             _blnActiveSkillSearchMode      = true;
             cboDisplayFilter.Text          = string.Empty;
         }
         else
         {
             cboDisplayFilter.DropDownStyle = ComboBoxStyle.DropDownList;
             _blnActiveSkillSearchMode      = false;
             _lstActiveSkills.SuspendLayout();
             _lstActiveSkills.Filter(selectedItem.Item2);
             _lstActiveSkills.ResumeLayout();
         }
     }
 }
Example #6
0
        public async ValueTask RealLoad()
        {
            if (ParentForm is CharacterShared frmParent)
            {
                _objCharacter = frmParent.CharacterObject;
            }
            else
            {
                _blnDisposeCharacterOnDispose = true;
                _objCharacter = new Character();
                Utils.BreakIfDebug();
            }

            if (Utils.IsDesignerMode || Utils.IsRunningInVisualStudio)
            {
                return;
            }

            _lstDropDownActiveSkills    = GenerateDropdownFilter(_objCharacter);
            _lstDropDownKnowledgeSkills = GenerateKnowledgeDropdownFilter(_objCharacter);

            Stopwatch sw = Stopwatch.StartNew();  //Benchmark, should probably remove in release
            //Keep everything visible until ready to display everything. This
            //seems to prevent redrawing everything each time anything is added
            //Not benched, but should be faster

            //Might also be useless horseshit, 2 lines

            //Visible = false;

            bool blnExoticVisible = (await _objCharacter.LoadDataXPathAsync("skills.xml"))
                                    .SelectSingleNode(
                "/chummer/skills/skill[exotic = "
                + bool.TrueString.CleanXPath()
                + ']') != null;

            await this.DoThreadSafeAsync(() =>
            {
                Stopwatch swDisplays = Stopwatch.StartNew();
                Stopwatch parts      = Stopwatch.StartNew();
                SuspendLayout();
                try
                {
                    _lstActiveSkills
                        = new BindingListDisplay <Skill>(_objCharacter.SkillsSection.Skills, MakeActiveSkill)
                        {
                            Dock = DockStyle.Fill
                        };

                    Control MakeActiveSkill(Skill arg)
                    {
                        SkillControl objSkillControl            = new SkillControl(arg);
                        objSkillControl.CustomAttributeChanged += Control_CustomAttributeChanged;
                        return(objSkillControl);
                    }

                    RefreshSkillLabels();

                    swDisplays.TaskEnd("_lstActiveSkills");

                    tlpActiveSkills.Controls.Add(_lstActiveSkills, 0, 2);
                    tlpActiveSkills.SetColumnSpan(_lstActiveSkills, 5);

                    swDisplays.TaskEnd("_lstActiveSkills add");

                    _lstKnowledgeSkills = new BindingListDisplay <KnowledgeSkill>(
                        _objCharacter.SkillsSection.KnowledgeSkills,
                        knoSkill => new KnowledgeSkillControl(knoSkill))
                    {
                        Dock = DockStyle.Fill
                    };
                    RefreshKnowledgeSkillLabels();

                    swDisplays.TaskEnd("_lstKnowledgeSkills");

                    tlpBottomPanel.Controls.Add(_lstKnowledgeSkills, 0, 2);
                    tlpBottomPanel.SetColumnSpan(_lstKnowledgeSkills, 4);

                    swDisplays.TaskEnd("_lstKnowledgeSkills add");

                    if (_objCharacter.SkillsSection.SkillGroups.Count > 0)
                    {
                        _lstSkillGroups = new BindingListDisplay <SkillGroup>(_objCharacter.SkillsSection.SkillGroups,
                                                                              group => new SkillGroupControl(group))
                        {
                            Dock = DockStyle.Fill
                        };
                        _lstSkillGroups.Filter(
                            x => x.SkillList.Any(y => _objCharacter.SkillsSection.HasActiveSkill(y.DictionaryKey)),
                            true);
                        _lstSkillGroups.Sort(new SkillGroupSorter(SkillsSection.CompareSkillGroups));
                        RefreshSkillGroupLabels();

                        swDisplays.TaskEnd("_lstSkillGroups");

                        tlpSkillGroups.Controls.Add(_lstSkillGroups, 0, 1);
                        tlpSkillGroups.SetColumnSpan(_lstSkillGroups, 3);

                        swDisplays.TaskEnd("_lstSkillGroups add");
                    }
                    else
                    {
                        tlpSkillGroups.Visible      = false;
                        tlpActiveSkills.Margin      = new Padding(0);
                        tlpTopPanel.ColumnStyles[0] = new ColumnStyle(SizeType.AutoSize);
                        tlpTopPanel.ColumnStyles[1] = new ColumnStyle(SizeType.Percent, 100F);
                    }

                    parts.TaskEnd("MakeSkillDisplay()");

                    cboDisplayFilter.BeginUpdate();
                    try
                    {
                        cboDisplayFilter.DataSource       = null;
                        cboDisplayFilter.ValueMember      = "Item2";
                        cboDisplayFilter.DisplayMember    = "Item1";
                        cboDisplayFilter.DataSource       = _lstDropDownActiveSkills;
                        cboDisplayFilter.SelectedIndex    = 1;
                        cboDisplayFilter.MaxDropDownItems = _lstDropDownActiveSkills.Count;
                    }
                    finally
                    {
                        cboDisplayFilter.EndUpdate();
                    }

                    cboDisplayFilterKnowledge.BeginUpdate();
                    try
                    {
                        cboDisplayFilterKnowledge.DataSource       = null;
                        cboDisplayFilterKnowledge.ValueMember      = "Item2";
                        cboDisplayFilterKnowledge.DisplayMember    = "Item1";
                        cboDisplayFilterKnowledge.DataSource       = _lstDropDownKnowledgeSkills;
                        cboDisplayFilterKnowledge.SelectedIndex    = 1;
                        cboDisplayFilterKnowledge.MaxDropDownItems = _lstDropDownKnowledgeSkills.Count;
                    }
                    finally
                    {
                        cboDisplayFilterKnowledge.EndUpdate();
                    }
                    parts.TaskEnd("_ddl databind");

                    cboSort.BeginUpdate();
                    try
                    {
                        cboSort.DataSource       = null;
                        cboSort.ValueMember      = "Item2";
                        cboSort.DisplayMember    = "Item1";
                        cboSort.DataSource       = _sortList;
                        cboSort.SelectedIndex    = 0;
                        cboSort.MaxDropDownItems = _sortList.Count;
                    }
                    finally
                    {
                        cboSort.EndUpdate();
                    }

                    cboSortKnowledge.BeginUpdate();
                    try
                    {
                        cboSortKnowledge.DataSource       = null;
                        cboSortKnowledge.ValueMember      = "Item2";
                        cboSortKnowledge.DisplayMember    = "Item1";
                        cboSortKnowledge.DataSource       = _lstSortKnowledgeList;
                        cboSortKnowledge.SelectedIndex    = 0;
                        cboSortKnowledge.MaxDropDownItems = _lstSortKnowledgeList.Count;
                    }
                    finally
                    {
                        cboSortKnowledge.EndUpdate();
                    }

                    parts.TaskEnd("_sort databind");

                    if (_lstSkillGroups != null)
                    {
                        _lstSkillGroups.ChildPropertyChanged += ChildPropertyChanged;
                    }
                    _lstActiveSkills.ChildPropertyChanged    += ChildPropertyChanged;
                    _lstKnowledgeSkills.ChildPropertyChanged += ChildPropertyChanged;

                    if (!_objCharacter.Created)
                    {
                        lblGroupsSp.DoOneWayDataBinding("Visible", _objCharacter,
                                                        nameof(Character.EffectiveBuildMethodUsesPriorityTables));
                        lblActiveSp.DoOneWayDataBinding("Visible", _objCharacter,
                                                        nameof(Character.EffectiveBuildMethodUsesPriorityTables));
                        lblBuyWithKarma.DoOneWayDataBinding("Visible", _objCharacter,
                                                            nameof(Character.EffectiveBuildMethodUsesPriorityTables));

                        lblKnoSp.DoOneWayDataBinding("Visible", _objCharacter.SkillsSection,
                                                     nameof(SkillsSection.HasKnowledgePoints));
                        lblKnoBwk.DoOneWayDataBinding("Visible", _objCharacter.SkillsSection,
                                                      nameof(SkillsSection.HasKnowledgePoints));
                        UpdateKnoSkillRemaining();
                    }
                    else
                    {
                        lblGroupsSp.Visible                  = false;
                        lblGroupKarma.Visible                = false;
                        lblActiveSp.Visible                  = false;
                        lblActiveKarma.Visible               = false;
                        lblBuyWithKarma.Visible              = false;
                        lblKnoSp.Visible                     = false;
                        lblKnoKarma.Visible                  = false;
                        lblKnoBwk.Visible                    = false;
                        lblKnowledgeSkillPoints.Visible      = false;
                        lblKnowledgeSkillPointsTitle.Visible = false;
                    }

                    btnExotic.Visible = blnExoticVisible;
                }
                finally
                {
                    ResumeLayout(true);
                }
            });

            sw.Stop();
            Debug.WriteLine("RealLoad() in {0} ms", sw.Elapsed.TotalMilliseconds);

            _objCharacter.SkillsSection.Skills.ListChanged          += SkillsOnListChanged;
            _objCharacter.SkillsSection.SkillGroups.ListChanged     += SkillGroupsOnListChanged;
            _objCharacter.SkillsSection.KnowledgeSkills.ListChanged += KnowledgeSkillsOnListChanged;
            _objCharacter.SkillsSection.PropertyChanged             += SkillsSectionOnPropertyChanged;
        }
Example #7
0
 private void SearchParameterChanged(object sender, EventArgs e)
 {
     _bldCrashReports.Filter(report => TextFilter(report, txtSearch.Text) && OtherFilter(report), true);
 }
        public void RealLoad()
        {
            if (ParentForm is CharacterShared frmParent)
            {
                _objCharacter = frmParent.CharacterObject;
            }
            else
            {
                _objCharacter = new Character();
                Utils.BreakIfDebug();
            }

            Stopwatch sw    = Stopwatch.StartNew(); //Benchmark, should probably remove in release
            Stopwatch parts = Stopwatch.StartNew();

            //Keep everything visible until ready to display everything. This
            //seems to prevent redrawing everything each time anything is added
            //Not benched, but should be faster

            //Might also be useless horseshit, 2 lines

            //Visible = false;
            SuspendLayout();

            Stopwatch swDisplays = Stopwatch.StartNew();

            _lstActiveSkills = new BindingListDisplay <Skill>(_objCharacter.SkillsSection.Skills, MakeActiveSkill)
            {
                Dock = DockStyle.Fill
            };
            Control MakeActiveSkill(Skill arg)
            {
                SkillControl2 objSkillControl = new SkillControl2(arg);

                objSkillControl.CustomAttributeChanged += Control_CustomAttributeChanged;
                return(objSkillControl);
            }

            RefreshSkillLabels();

            swDisplays.TaskEnd("_lstActiveSkills");

            tlpActiveSkills.Controls.Add(_lstActiveSkills, 0, 2);
            tlpActiveSkills.SetColumnSpan(_lstActiveSkills, 3);

            swDisplays.TaskEnd("_lstActiveSkills add");

            _lstKnowledgeSkills = new BindingListDisplay <KnowledgeSkill>(_objCharacter.SkillsSection.KnowledgeSkills,
                                                                          knoSkill => new KnowledgeSkillControl(knoSkill))
            {
                Dock = DockStyle.Fill
            };
            RefreshKnowledgeSkillLabels();

            swDisplays.TaskEnd("_lstKnowledgeSkills");

            tlpBottomPanel.Controls.Add(_lstKnowledgeSkills, 0, 2);
            tlpBottomPanel.SetColumnSpan(_lstKnowledgeSkills, 3);

            swDisplays.TaskEnd("_lstKnowledgeSkills add");

            if (_objCharacter.SkillsSection.SkillGroups.Count > 0)
            {
                _lstSkillGroups = new BindingListDisplay <SkillGroup>(_objCharacter.SkillsSection.SkillGroups,
                                                                      group => new SkillGroupControl(group))
                {
                    Dock = DockStyle.Fill
                };
                _lstSkillGroups.Filter(x => x.SkillList.Any(y => _objCharacter.SkillsSection.SkillsDictionary.ContainsKey(y.Name)), true);
                _lstSkillGroups.Sort(new SkillGroupSorter(SkillsSection.CompareSkillGroups));
                RefreshSkillGroupLabels();

                swDisplays.TaskEnd("_lstSkillGroups");

                tlpSkillGroups.Controls.Add(_lstSkillGroups, 0, 1);
                tlpSkillGroups.SetColumnSpan(_lstSkillGroups, 2);

                swDisplays.TaskEnd("_lstSkillGroups add");
            }
            else
            {
                tlpSkillGroups.Visible      = false;
                tlpActiveSkills.Margin      = new Padding(0);
                tlpTopPanel.ColumnStyles[0] = new ColumnStyle(SizeType.AutoSize);
                tlpTopPanel.ColumnStyles[1] = new ColumnStyle(SizeType.Percent, 100F);
            }

            parts.TaskEnd("MakeSkillDisplay()");

            cboDisplayFilter.BeginUpdate();
            cboDisplayFilter.DataSource       = null;
            cboDisplayFilter.ValueMember      = "Item2";
            cboDisplayFilter.DisplayMember    = "Item1";
            cboDisplayFilter.DataSource       = _lstDropDownActiveSkills;
            cboDisplayFilter.SelectedIndex    = 1;
            cboDisplayFilter.MaxDropDownItems = _lstDropDownActiveSkills.Count;
            cboDisplayFilter.EndUpdate();

            cboDisplayFilterKnowledge.BeginUpdate();
            cboDisplayFilterKnowledge.DataSource       = null;
            cboDisplayFilterKnowledge.ValueMember      = "Item2";
            cboDisplayFilterKnowledge.DisplayMember    = "Item1";
            cboDisplayFilterKnowledge.DataSource       = _lstDropDownKnowledgeSkills;
            cboDisplayFilterKnowledge.SelectedIndex    = 1;
            cboDisplayFilterKnowledge.MaxDropDownItems = _lstDropDownKnowledgeSkills.Count;
            cboDisplayFilterKnowledge.EndUpdate();
            parts.TaskEnd("_ddl databind");

            cboSort.BeginUpdate();
            cboSort.DataSource       = null;
            cboSort.ValueMember      = "Item2";
            cboSort.DisplayMember    = "Item1";
            cboSort.DataSource       = _sortList;
            cboSort.SelectedIndex    = 0;
            cboSort.MaxDropDownItems = _sortList.Count;
            cboSort.EndUpdate();

            cboSortKnowledge.BeginUpdate();
            cboSortKnowledge.DataSource       = null;
            cboSortKnowledge.ValueMember      = "Item2";
            cboSortKnowledge.DisplayMember    = "Item1";
            cboSortKnowledge.DataSource       = _lstSortKnowledgeList;
            cboSortKnowledge.SelectedIndex    = 0;
            cboSortKnowledge.MaxDropDownItems = _lstSortKnowledgeList.Count;
            cboSortKnowledge.EndUpdate();

            parts.TaskEnd("_sort databind");

            if (_lstSkillGroups != null)
            {
                _lstSkillGroups.ChildPropertyChanged += MakeDirtyWithCharacterUpdate;
            }
            _lstActiveSkills.ChildPropertyChanged    += MakeDirtyWithCharacterUpdate;
            _lstKnowledgeSkills.ChildPropertyChanged += MakeDirtyWithCharacterUpdate;

            if (!_objCharacter.Created)
            {
                lblGroupsSp.DoOneWayDataBinding("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints));
                lblActiveSp.DoOneWayDataBinding("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints));
                lblBuyWithKarma.DoOneWayDataBinding("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints));

                lblKnoSp.DoOneWayDataBinding("Visible", _objCharacter.SkillsSection, nameof(SkillsSection.HasKnowledgePoints));
                lblKnoBwk.DoOneWayDataBinding("Visible", _objCharacter.SkillsSection, nameof(SkillsSection.HasKnowledgePoints));
                UpdateKnoSkillRemaining();
            }
            else
            {
                flpSkillGroupLabels.Visible = false;

                lblActiveSp.Visible     = false;
                lblActiveKarma.Visible  = false;
                lblBuyWithKarma.Visible = false;

                flpKnowledgeSkillsLabels.Visible = false;
                lblKnoBwk.Visible = false;
                lblKnowledgeSkillPoints.Visible      = false;
                lblKnowledgeSkillPointsTitle.Visible = false;
            }

            btnExotic.Visible = XmlManager.Load("skills.xml").SelectSingleNode("/chummer/skills/skill[exotic = \"True\"]") != null;

            _objCharacter.SkillsSection.Skills.ListChanged          += SkillsOnListChanged;
            _objCharacter.SkillsSection.SkillGroups.ListChanged     += SkillGroupsOnListChanged;
            _objCharacter.SkillsSection.KnowledgeSkills.ListChanged += KnowledgeSkillsOnListChanged;
            ResumeLayout(true);
            sw.Stop();
            Debug.WriteLine("RealLoad() in {0} ms", sw.Elapsed.TotalMilliseconds);
        }
        public void RealLoad()
        {
            if (ParentForm is CharacterShared frmParent)
            {
                _objCharacter = frmParent.CharacterObject;
            }
            else
            {
                _objCharacter = new Character();
                Utils.BreakIfDebug();
            }

            Stopwatch sw    = Stopwatch.StartNew(); //Benchmark, should probably remove in release
            Stopwatch parts = Stopwatch.StartNew();

            //Keep everything visible until ready to display everything. This
            //seems to prevent redrawing everything each time anything is added
            //Not benched, but should be faster

            //Might also be useless horseshit, 2 lines

            //Visible = false;
            SuspendLayout();

            Stopwatch swDisplays = Stopwatch.StartNew();

            _lstSkillGroups = new BindingListDisplay <SkillGroup>(_objCharacter.SkillsSection.SkillGroups, group => new SkillGroupControl(group))
            {
                Location = new Point(0, 15),
            };
            _lstSkillGroups.Filter(x => x.SkillList.Any(y => _objCharacter.SkillsSection.SkillsDictionary.ContainsKey(y.Name)), true);
            _lstSkillGroups.Sort(new SkillGroupSorter(SkillsSection.CompareSkillGroups));
            int intNameLabelWidth   = 0;
            int intRatingLabelWidth = 0;

            foreach (SkillGroupControl sg in _lstSkillGroups.Controls[0].Controls)
            {
                intNameLabelWidth   = Math.Max(sg.NameWidth, intNameLabelWidth);
                intRatingLabelWidth = Math.Max(sg.RatingWidth, intRatingLabelWidth);
            }

            foreach (SkillGroupControl s in _lstSkillGroups.Controls[0].Controls)
            {
                s.MoveControls(intNameLabelWidth, intRatingLabelWidth);
            }
            lblGroupsSp.Left   = _lstSkillGroups.Controls[0].Left + intNameLabelWidth + 6;
            lblGroupKarma.Left = lblGroupsSp.Left + intRatingLabelWidth + 6;

            swDisplays.TaskEnd("_lstSkillGroups");

            splitSkills.Panel1.Controls.Add(_lstSkillGroups);

            swDisplays.TaskEnd("_lstSkillGroups add");

            _lstActiveSkills = new BindingListDisplay <Skill>(_objCharacter.SkillsSection.Skills, MakeActiveSkill)
            {
                Location = new Point(265, 42),
            };
            intNameLabelWidth = 0;
            foreach (SkillControl2 objSkillControl in _lstSkillControls)
            {
                intNameLabelWidth = Math.Max(intNameLabelWidth, objSkillControl.NameWidth);
            }
            foreach (SkillControl2 objSkillControl in _lstSkillControls)
            {
                objSkillControl.MoveControls(intNameLabelWidth);
            }

            lblActiveSkills.Left = _lstActiveSkills.Left;
            if (!_objCharacter.Created)
            {
                intRatingLabelWidth = 0;
                foreach (SkillControl2 objSkillControl in _lstSkillControls)
                {
                    intRatingLabelWidth = Math.Max(intRatingLabelWidth, objSkillControl.NudSkillWidth);
                }
                lblActiveSp.Left     = lblActiveSkills.Left + intNameLabelWidth + 6;
                lblActiveKarma.Left  = lblActiveSp.Left + intRatingLabelWidth + 6;
                lblBuyWithKarma.Left = splitSkills.Panel1.Width - lblBuyWithKarma.Width;
            }

            swDisplays.TaskEnd("_lstActiveSkills");

            splitSkills.Panel1.Controls.Add(_lstActiveSkills);

            swDisplays.TaskEnd("_lstActiveSkills add");

            _lstKnowledgeSkills = new BindingListDisplay <KnowledgeSkill>(_objCharacter.SkillsSection.KnowledgeSkills,
                                                                          knoSkill => new KnowledgeSkillControl(knoSkill)
            {
                Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
            })
            {
                Location = new Point(3, 50),
            };
            if (_objCharacter.SkillsSection.KnowledgeSkills.Count > 0)
            {
                intNameLabelWidth = 0;
                foreach (KnowledgeSkill objLoopSkill in _objCharacter.SkillsSection.KnowledgeSkills)
                {
                    intNameLabelWidth = Math.Max(intNameLabelWidth, objLoopSkill.DisplayName.Length);
                }
                foreach (KnowledgeSkillControl objKnowledgeSkillControl in _lstKnowledgeSkills.Controls[0].Controls)
                {
                    objKnowledgeSkillControl.MoveControls(intNameLabelWidth);
                }
            }

            swDisplays.TaskEnd("_lstKnowledgeSkills");

            splitSkills.Panel2.Controls.Add(_lstKnowledgeSkills);

            swDisplays.TaskEnd("_lstKnowledgeSkills add");

            parts.TaskEnd("MakeSkillDisplay()");

            cboDisplayFilter.BeginUpdate();
            cboDisplayFilterKnowledge.BeginUpdate();
            cboSort.BeginUpdate();
            cboSortKnowledge.BeginUpdate();

            cboDisplayFilter.DataSource       = _lstDropDownActiveSkills;
            cboDisplayFilter.ValueMember      = "Item2";
            cboDisplayFilter.DisplayMember    = "Item1";
            cboDisplayFilter.SelectedIndex    = 1;
            cboDisplayFilter.MaxDropDownItems = _lstDropDownActiveSkills.Count;

            cboDisplayFilterKnowledge.DataSource       = _lstDropDownKnowledgeSkills;
            cboDisplayFilterKnowledge.ValueMember      = "Item2";
            cboDisplayFilterKnowledge.DisplayMember    = "Item1";
            cboDisplayFilterKnowledge.SelectedIndex    = 1;
            cboDisplayFilterKnowledge.MaxDropDownItems = _lstDropDownKnowledgeSkills.Count;
            parts.TaskEnd("_ddl databind");

            cboSort.DataSource       = _sortList;
            cboSort.ValueMember      = "Item2";
            cboSort.DisplayMember    = "Item1";
            cboSort.SelectedIndex    = 0;
            cboSort.MaxDropDownItems = _sortList.Count;

            cboSortKnowledge.DataSource       = _lstSortKnowledgeList;
            cboSortKnowledge.ValueMember      = "Item2";
            cboSortKnowledge.DisplayMember    = "Item1";
            cboSortKnowledge.SelectedIndex    = 0;
            cboSortKnowledge.MaxDropDownItems = _lstSortKnowledgeList.Count;

            cboDisplayFilter.EndUpdate();
            cboDisplayFilterKnowledge.EndUpdate();
            cboSort.EndUpdate();
            cboSortKnowledge.EndUpdate();

            parts.TaskEnd("_sort databind");

            _lstActiveSkills.ChildPropertyChanged    += MakeDirtyWithCharacterUpdate;
            _lstSkillGroups.ChildPropertyChanged     += MakeDirtyWithCharacterUpdate;
            _lstKnowledgeSkills.ChildPropertyChanged += MakeDirtyWithCharacterUpdate;

            //Visible = true;
            //this.ResumeLayout(false);
            //this.PerformLayout();
            parts.TaskEnd("visible");
            Panel1_Resize(null, null);
            Panel2_Resize(null, null);
            parts.TaskEnd("resize");
            //this.Update();
            //this.ResumeLayout(true);
            //this.PerformLayout();

            if (!_objCharacter.Created)
            {
                lblKnoKarma.Visible    = true;
                lblActiveKarma.Visible = true;
                lblGroupKarma.Visible  = true;

                lblGroupsSp.Visible = _objCharacter.BuildMethodHasSkillPoints;
                lblGroupsSp.DataBindings.Add("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints), false, DataSourceUpdateMode.OnPropertyChanged);
                lblActiveSp.Visible = _objCharacter.BuildMethodHasSkillPoints;
                lblActiveSp.DataBindings.Add("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints), false, DataSourceUpdateMode.OnPropertyChanged);
                lblBuyWithKarma.Visible = _objCharacter.BuildMethodHasSkillPoints;
                lblBuyWithKarma.DataBindings.Add("Visible", _objCharacter, nameof(Character.BuildMethodHasSkillPoints), false, DataSourceUpdateMode.OnPropertyChanged);

                //Because visible is broken in databindings
                _objCharacter.SkillsSection.PropertyChanged += RefreshKnowledgePointsLabels;
                lblKnoSp.Visible = true;
                lblKnoSp.DataBindings.Add("Visible", _objCharacter.SkillsSection, nameof(SkillsSection.HasKnowledgePoints), false, DataSourceUpdateMode.OnPropertyChanged);
                lblKnoBwk.Visible = true;
                lblKnoBwk.DataBindings.Add("Visible", _objCharacter.SkillsSection, nameof(SkillsSection.HasKnowledgePoints), false, DataSourceUpdateMode.OnPropertyChanged);
                UpdateKnoSkillRemaining();
            }
            else
            {
                lblKnowledgeSkillPoints.Visible      = false;
                lblKnowledgeSkillPointsTitle.Visible = false;
            }
            ResumeLayout(true);
            sw.Stop();
            Debug.WriteLine("RealLoad() in {0} ms", sw.Elapsed.TotalMilliseconds);
        }