From e52a8df10c036afeb756477e1c7161de2a575a74 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Thu, 30 May 2019 13:07:19 +0800 Subject: [PATCH] Remove regions and remaining Pragmas + Remove Localization attribute in DefBase. --- src/Avalonia.Controls/DefinitionBase.cs | 1 - src/Avalonia.Controls/Grid.cs | 59 +------------------------ 2 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/Avalonia.Controls/DefinitionBase.cs b/src/Avalonia.Controls/DefinitionBase.cs index 56e2cab298..81c88b2638 100644 --- a/src/Avalonia.Controls/DefinitionBase.cs +++ b/src/Avalonia.Controls/DefinitionBase.cs @@ -17,7 +17,6 @@ namespace Avalonia.Controls /// DefinitionBase provides core functionality used internally by Grid /// and ColumnDefinitionCollection / RowDefinitionCollection /// - [Localizability(LocalizationCategory.Ignore)] public abstract class DefinitionBase : FrameworkContentElement { //------------------------------------------------------ diff --git a/src/Avalonia.Controls/Grid.cs b/src/Avalonia.Controls/Grid.cs index b1e7851200..4ba5c324f1 100644 --- a/src/Avalonia.Controls/Grid.cs +++ b/src/Avalonia.Controls/Grid.cs @@ -10,6 +10,7 @@ using System.Diagnostics; using Avalonia; using Avalonia.Collections; +using Avalonia.Media; namespace Avalonia.Controls { @@ -24,8 +25,6 @@ namespace Avalonia.Controls // //------------------------------------------------------ - #region Constructors - static Grid() { } @@ -38,16 +37,12 @@ namespace Avalonia.Controls SetFlags((bool) ShowGridLinesProperty.GetDefaultValue(DependencyObjectType), Flags.ShowGridLinesPropertyValue); } - #endregion Constructors - //------------------------------------------------------ // // Public Methods // //------------------------------------------------------ - #region Public Methods - /// /// @@ -232,16 +227,12 @@ namespace Avalonia.Controls return ((bool)element.GetValue(IsSharedSizeScopeProperty)); } - #endregion Public Methods - //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ - #region Public Properties - /// /// ShowGridLines property. /// @@ -281,16 +272,12 @@ namespace Avalonia.Controls } } - #endregion Public Properties - //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ - #region Protected Methods - /// /// Derived class must implement to support Visual children. The method must return /// the child at the specified index. Index must be between 0 and GetVisualChildrenCount-1. @@ -726,16 +713,12 @@ namespace Avalonia.Controls base.OnVisualChildrenChanged(visualAdded, visualRemoved); } - #endregion Protected Methods - //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ - #region Internal Methods - /// /// Invalidates grid caches and makes the grid dirty for measure. /// @@ -789,16 +772,12 @@ namespace Avalonia.Controls return (value); } - #endregion Internal Methods - //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ - #region Internal Properties - /// /// Convenience accessor to MeasureOverrideInProgress bit flag. /// @@ -835,16 +814,12 @@ namespace Avalonia.Controls set { SetFlags(!value, Flags.ValidDefinitionsVStructure); } } - #endregion Internal Properties - //------------------------------------------------------ // // Private Methods // //------------------------------------------------------ - #region Private Methods - /// /// Lays out cells according to rows and columns, and creates lookup grids. /// @@ -3021,16 +2996,12 @@ namespace Avalonia.Controls return (result != 2); } - #endregion Private Methods - //------------------------------------------------------ // // Private Properties // //------------------------------------------------------ - #region Private Properties - /// /// Private version returning array of column definitions. /// @@ -3238,15 +3209,11 @@ namespace Avalonia.Controls } } - #endregion Private Properties - //------------------------------------------------------ // // Private Fields // //------------------------------------------------------ - - #region Private Fields private ExtendedData _data; // extended data instantiated on demand, for non-trivial case handling only private Flags _flags; // grid validity / property caches dirtiness flags private GridLinesRenderer _gridLinesRenderer; @@ -3257,15 +3224,11 @@ namespace Avalonia.Controls // Stores unrounded values and rounding errors during layout rounding. double[] _roundingErrors; - #endregion Private Fields - //------------------------------------------------------ // // Static Fields // //------------------------------------------------------ - - #region Static Fields private const double c_epsilon = 1e-5; // used in fp calculations private const double c_starClip = 1e298; // used as maximum for clipping star values during normalization private const int c_layoutLoopMaxCount = 5; // 5 is an arbitrary constant chosen to end the measure loop @@ -3278,16 +3241,12 @@ namespace Avalonia.Controls private static readonly IComparer s_maxRatioComparer = new MaxRatioComparer(); private static readonly IComparer s_starWeightComparer = new StarWeightComparer(); - #endregion Static Fields - //------------------------------------------------------ // // Private Structures / Classes // //------------------------------------------------------ - #region Private Structures Classes - /// /// Extended data instantiated on demand, when grid handles non-trivial case. /// @@ -3340,16 +3299,12 @@ namespace Avalonia.Controls ArrangeOverrideInProgress = 0x00080000, // "1" while in the context of Grid.ArrangeOverride } - #endregion Private Structures Classes - //------------------------------------------------------ // // Properties // //------------------------------------------------------ - #region Properties - /// /// ShowGridLines property. This property is used mostly /// for simplification of visual debuggig. When it is set @@ -3464,16 +3419,12 @@ namespace Avalonia.Controls false, new PropertyChangedCallback(DefinitionBase.OnIsSharedSizeScopePropertyChanged))); - #endregion Properties - //------------------------------------------------------ // // Internal Structures / Classes // //------------------------------------------------------ - #region Internal Structures Classes - /// /// LayoutTimeSizeType is used internally and reflects layout-time size type. /// @@ -3486,16 +3437,12 @@ namespace Avalonia.Controls Star = 0x04, } - #endregion Internal Structures Classes - //------------------------------------------------------ // // Private Structures / Classes // //------------------------------------------------------ - #region Private Structures Classes - /// /// CellCache stored calculated values of /// 1. attached cell positioning properties; @@ -4071,12 +4018,10 @@ namespace Avalonia.Controls { if (_currentEnumerator == -1) { - #pragma warning suppress 6503 // IEnumerator.Current is documented to throw this exception throw new InvalidOperationException(SR.Get(SRID.EnumeratorNotStarted)); } if (_currentEnumerator >= 3) { - #pragma warning suppress 6503 // IEnumerator.Current is documented to throw this exception throw new InvalidOperationException(SR.Get(SRID.EnumeratorReachedEnd)); } @@ -4186,7 +4131,5 @@ namespace Avalonia.Controls private static readonly Pen s_evenDashPen; // second pen to draw dash private static readonly Point c_zeroPoint = new Point(0, 0); } - - #endregion Private Structures Classes } } \ No newline at end of file