コード例 #1
0
        ///<summary>Reloads the control with any new sheet layouts available.
        ///This should only be called if a dynamic sheetDef was added/modified/deleted, the SheetLayoutMode has changed, or a new user signed in.</summary>
        public void ReloadSheetLayout(SheetFieldLayoutMode sheetFieldLayoutMode, Dictionary <string, Control> dictionaryControls)
        {
            long practiceDefaultSheetDefNum = PrefC.GetLong(PrefName.SheetsDefaultChartModule);

            ListSheetDefsLayout = SheetDefs.GetCustomForType(_sheetType);
            ListSheetDefsLayout.Add(SheetsInternal.GetSheetDef(SheetsInternal.GetInternalType(_sheetType))); //Internal at bottom of list. UI reflects this too.
            ListSheetDefsLayout = ListSheetDefsLayout
                                  .OrderBy(x => x.SheetDefNum != practiceDefaultSheetDefNum)                 //practice default sheetdef should be at the top of the list
                                  .ThenBy(x => x.SheetDefNum == 0)                                           //if the internal sheetdef is not the default it should be last
                                  .ThenBy(x => x.Description)                                                //order custom sheetdefs by description
                                  .ThenBy(x => x.SheetDefNum).ToList();                                      //then by SheetDefNum to be deterministic order
            InitLayoutForSheetDef(GetLayoutForUser(), sheetFieldLayoutMode, dictionaryControls, true);       //Force refresh in case they edit current layout.
        }