void SetDefaultProjectUnitFormat( DisplayUnitFormat defaultFormat )
Sub SetDefaultProjectUnitFormat( _ ByVal defaultFormat As DisplayUnitFormat _ )
Parameters
- defaultFormat
void SetDefaultProjectUnitFormat( DisplayUnitFormat defaultFormat )
Sub SetDefaultProjectUnitFormat( _ ByVal defaultFormat As DisplayUnitFormat _ )
//Must be on the QueuedTask.Run() var unit_formats = Enum.GetValues(typeof(UnitFormatType)).OfType<UnitFormatType>().ToList(); foreach (var unit_type in unit_formats) { var current_default = DisplayUnitFormats.Instance.GetDefaultProjectUnitFormat(unit_type); //Arbitrarily pick the last unit in each unit format list var replacement = DisplayUnitFormats.Instance.GetProjectUnitFormats(unit_type).Last(); DisplayUnitFormats.Instance.SetDefaultProjectUnitFormat(replacement); var line = $"{current_default.DisplayName}, {current_default.UnitName}, {current_default.UnitCode}"; var line2 = $"{replacement.DisplayName}, {replacement.UnitName}, {replacement.UnitCode}"; System.Diagnostics.Debug.WriteLine($"Format: {unit_type.ToString()}"); System.Diagnostics.Debug.WriteLine($" Current default: {line}"); System.Diagnostics.Debug.WriteLine($" Replacement default: {line2}"); }
Target Platforms: Windows 11, Windows 10