Browse Source

Remove regions and remaining Pragmas + Remove Localization attribute in DefBase.

pull/2563/head
Jumar Macato 7 years ago
parent
commit
e52a8df10c
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 1
      src/Avalonia.Controls/DefinitionBase.cs
  2. 59
      src/Avalonia.Controls/Grid.cs

1
src/Avalonia.Controls/DefinitionBase.cs

@ -17,7 +17,6 @@ namespace Avalonia.Controls
/// DefinitionBase provides core functionality used internally by Grid /// DefinitionBase provides core functionality used internally by Grid
/// and ColumnDefinitionCollection / RowDefinitionCollection /// and ColumnDefinitionCollection / RowDefinitionCollection
/// </summary> /// </summary>
[Localizability(LocalizationCategory.Ignore)]
public abstract class DefinitionBase : FrameworkContentElement public abstract class DefinitionBase : FrameworkContentElement
{ {
//------------------------------------------------------ //------------------------------------------------------

59
src/Avalonia.Controls/Grid.cs

@ -10,6 +10,7 @@ using System.Diagnostics;
using Avalonia; using Avalonia;
using Avalonia.Collections; using Avalonia.Collections;
using Avalonia.Media;
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -24,8 +25,6 @@ namespace Avalonia.Controls
// //
//------------------------------------------------------ //------------------------------------------------------
#region Constructors
static Grid() static Grid()
{ {
} }
@ -38,16 +37,12 @@ namespace Avalonia.Controls
SetFlags((bool) ShowGridLinesProperty.GetDefaultValue(DependencyObjectType), Flags.ShowGridLinesPropertyValue); SetFlags((bool) ShowGridLinesProperty.GetDefaultValue(DependencyObjectType), Flags.ShowGridLinesPropertyValue);
} }
#endregion Constructors
//------------------------------------------------------ //------------------------------------------------------
// //
// Public Methods // Public Methods
// //
//------------------------------------------------------ //------------------------------------------------------
#region Public Methods
/// <summary> /// <summary>
/// <see cref="FrameworkElement.LogicalChildren"/> /// <see cref="FrameworkElement.LogicalChildren"/>
@ -232,16 +227,12 @@ namespace Avalonia.Controls
return ((bool)element.GetValue(IsSharedSizeScopeProperty)); return ((bool)element.GetValue(IsSharedSizeScopeProperty));
} }
#endregion Public Methods
//------------------------------------------------------ //------------------------------------------------------
// //
// Public Properties // Public Properties
// //
//------------------------------------------------------ //------------------------------------------------------
#region Public Properties
/// <summary> /// <summary>
/// ShowGridLines property. /// ShowGridLines property.
/// </summary> /// </summary>
@ -281,16 +272,12 @@ namespace Avalonia.Controls
} }
} }
#endregion Public Properties
//------------------------------------------------------ //------------------------------------------------------
// //
// Protected Methods // Protected Methods
// //
//------------------------------------------------------ //------------------------------------------------------
#region Protected Methods
/// <summary> /// <summary>
/// Derived class must implement to support Visual children. The method must return /// 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. /// 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); base.OnVisualChildrenChanged(visualAdded, visualRemoved);
} }
#endregion Protected Methods
//------------------------------------------------------ //------------------------------------------------------
// //
// Internal Methods // Internal Methods
// //
//------------------------------------------------------ //------------------------------------------------------
#region Internal Methods
/// <summary> /// <summary>
/// Invalidates grid caches and makes the grid dirty for measure. /// Invalidates grid caches and makes the grid dirty for measure.
/// </summary> /// </summary>
@ -789,16 +772,12 @@ namespace Avalonia.Controls
return (value); return (value);
} }
#endregion Internal Methods
//------------------------------------------------------ //------------------------------------------------------
// //
// Internal Properties // Internal Properties
// //
//------------------------------------------------------ //------------------------------------------------------
#region Internal Properties
/// <summary> /// <summary>
/// Convenience accessor to MeasureOverrideInProgress bit flag. /// Convenience accessor to MeasureOverrideInProgress bit flag.
/// </summary> /// </summary>
@ -835,16 +814,12 @@ namespace Avalonia.Controls
set { SetFlags(!value, Flags.ValidDefinitionsVStructure); } set { SetFlags(!value, Flags.ValidDefinitionsVStructure); }
} }
#endregion Internal Properties
//------------------------------------------------------ //------------------------------------------------------
// //
// Private Methods // Private Methods
// //
//------------------------------------------------------ //------------------------------------------------------
#region Private Methods
/// <summary> /// <summary>
/// Lays out cells according to rows and columns, and creates lookup grids. /// Lays out cells according to rows and columns, and creates lookup grids.
/// </summary> /// </summary>
@ -3021,16 +2996,12 @@ namespace Avalonia.Controls
return (result != 2); return (result != 2);
} }
#endregion Private Methods
//------------------------------------------------------ //------------------------------------------------------
// //
// Private Properties // Private Properties
// //
//------------------------------------------------------ //------------------------------------------------------
#region Private Properties
/// <summary> /// <summary>
/// Private version returning array of column definitions. /// Private version returning array of column definitions.
/// </summary> /// </summary>
@ -3238,15 +3209,11 @@ namespace Avalonia.Controls
} }
} }
#endregion Private Properties
//------------------------------------------------------ //------------------------------------------------------
// //
// Private Fields // Private Fields
// //
//------------------------------------------------------ //------------------------------------------------------
#region Private Fields
private ExtendedData _data; // extended data instantiated on demand, for non-trivial case handling only private ExtendedData _data; // extended data instantiated on demand, for non-trivial case handling only
private Flags _flags; // grid validity / property caches dirtiness flags private Flags _flags; // grid validity / property caches dirtiness flags
private GridLinesRenderer _gridLinesRenderer; private GridLinesRenderer _gridLinesRenderer;
@ -3257,15 +3224,11 @@ namespace Avalonia.Controls
// Stores unrounded values and rounding errors during layout rounding. // Stores unrounded values and rounding errors during layout rounding.
double[] _roundingErrors; double[] _roundingErrors;
#endregion Private Fields
//------------------------------------------------------ //------------------------------------------------------
// //
// Static Fields // Static Fields
// //
//------------------------------------------------------ //------------------------------------------------------
#region Static Fields
private const double c_epsilon = 1e-5; // used in fp calculations 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 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 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_maxRatioComparer = new MaxRatioComparer();
private static readonly IComparer s_starWeightComparer = new StarWeightComparer(); private static readonly IComparer s_starWeightComparer = new StarWeightComparer();
#endregion Static Fields
//------------------------------------------------------ //------------------------------------------------------
// //
// Private Structures / Classes // Private Structures / Classes
// //
//------------------------------------------------------ //------------------------------------------------------
#region Private Structures Classes
/// <summary> /// <summary>
/// Extended data instantiated on demand, when grid handles non-trivial case. /// Extended data instantiated on demand, when grid handles non-trivial case.
/// </summary> /// </summary>
@ -3340,16 +3299,12 @@ namespace Avalonia.Controls
ArrangeOverrideInProgress = 0x00080000, // "1" while in the context of Grid.ArrangeOverride ArrangeOverrideInProgress = 0x00080000, // "1" while in the context of Grid.ArrangeOverride
} }
#endregion Private Structures Classes
//------------------------------------------------------ //------------------------------------------------------
// //
// Properties // Properties
// //
//------------------------------------------------------ //------------------------------------------------------
#region Properties
/// <summary> /// <summary>
/// ShowGridLines property. This property is used mostly /// ShowGridLines property. This property is used mostly
/// for simplification of visual debuggig. When it is set /// for simplification of visual debuggig. When it is set
@ -3464,16 +3419,12 @@ namespace Avalonia.Controls
false, false,
new PropertyChangedCallback(DefinitionBase.OnIsSharedSizeScopePropertyChanged))); new PropertyChangedCallback(DefinitionBase.OnIsSharedSizeScopePropertyChanged)));
#endregion Properties
//------------------------------------------------------ //------------------------------------------------------
// //
// Internal Structures / Classes // Internal Structures / Classes
// //
//------------------------------------------------------ //------------------------------------------------------
#region Internal Structures Classes
/// <summary> /// <summary>
/// LayoutTimeSizeType is used internally and reflects layout-time size type. /// LayoutTimeSizeType is used internally and reflects layout-time size type.
/// </summary> /// </summary>
@ -3486,16 +3437,12 @@ namespace Avalonia.Controls
Star = 0x04, Star = 0x04,
} }
#endregion Internal Structures Classes
//------------------------------------------------------ //------------------------------------------------------
// //
// Private Structures / Classes // Private Structures / Classes
// //
//------------------------------------------------------ //------------------------------------------------------
#region Private Structures Classes
/// <summary> /// <summary>
/// CellCache stored calculated values of /// CellCache stored calculated values of
/// 1. attached cell positioning properties; /// 1. attached cell positioning properties;
@ -4071,12 +4018,10 @@ namespace Avalonia.Controls
{ {
if (_currentEnumerator == -1) if (_currentEnumerator == -1)
{ {
#pragma warning suppress 6503 // IEnumerator.Current is documented to throw this exception
throw new InvalidOperationException(SR.Get(SRID.EnumeratorNotStarted)); throw new InvalidOperationException(SR.Get(SRID.EnumeratorNotStarted));
} }
if (_currentEnumerator >= 3) if (_currentEnumerator >= 3)
{ {
#pragma warning suppress 6503 // IEnumerator.Current is documented to throw this exception
throw new InvalidOperationException(SR.Get(SRID.EnumeratorReachedEnd)); 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 Pen s_evenDashPen; // second pen to draw dash
private static readonly Point c_zeroPoint = new Point(0, 0); private static readonly Point c_zeroPoint = new Point(0, 0);
} }
#endregion Private Structures Classes
} }
} }
Loading…
Cancel
Save