Skip to content

Commit 91a4744

Browse files
authored
Merge pull request #2426 from Miepee/fsn
Bump Eto C# lang to 8, use file scoped namespaces
2 parents a7ba6ae + 96c3ac4 commit 91a4744

File tree

307 files changed

+57099
-57509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+57099
-57509
lines changed

src/Eto/AutoInitializeAttribute.cs

+51-52
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,59 @@
44
using System.Globalization;
55
using System.Threading;
66

7-
namespace Eto
7+
namespace Eto;
8+
9+
/// <summary>
10+
/// Attribute to specify whether the handler interface should be initialized automatically
11+
/// </summary>
12+
/// <remarks>
13+
/// Handler interfaces that defer creation of the control to various Create() methods can apply this attribute
14+
/// so that the initialization can be done afterwards.
15+
///
16+
/// If auto initialization is disabled, the widget author must call Widget.Initialize() after the control is created.
17+
///
18+
/// Initialization applies styles to the widget and the handler, sets up events based on overridden event methods, etc.
19+
///
20+
/// This is only needed by widget authors in advanced scenarios. The default is to auto initialize, so this is
21+
/// only needed if you want to disable this behaviour.
22+
/// </remarks>
23+
/// <example>
24+
/// An example handler that implements this behaviour:
25+
/// <code>
26+
/// [AutoInitialize(false)]
27+
/// public interface IMyWidget : IControl
28+
/// {
29+
/// void CreateWithParams(int param1, bool param2);
30+
/// }
31+
///
32+
/// [Handler(typeof(IMyWidget))]
33+
/// public class MyWidget : Control
34+
/// {
35+
/// public MyWidget(int param1, bool param2)
36+
/// {
37+
/// ((IMyWidget)Handler).CreateWithParams(param1, param2);
38+
/// Initialize(); // ensure you call this on any constructor of your widget
39+
/// }
40+
/// }
41+
/// </code>
42+
/// </example>
43+
/// <copyright>(c) 2014 by Curtis Wensley</copyright>
44+
/// <license type="BSD-3">See LICENSE for full terms</license>
45+
[AttributeUsage(AttributeTargets.Interface)]
46+
public sealed class AutoInitializeAttribute : Attribute
847
{
948
/// <summary>
10-
/// Attribute to specify whether the handler interface should be initialized automatically
49+
/// Gets a value indicating whether to auto initialize the handler, false to defer this to the widget author
1150
/// </summary>
12-
/// <remarks>
13-
/// Handler interfaces that defer creation of the control to various Create() methods can apply this attribute
14-
/// so that the initialization can be done afterwards.
15-
///
16-
/// If auto initialization is disabled, the widget author must call Widget.Initialize() after the control is created.
17-
///
18-
/// Initialization applies styles to the widget and the handler, sets up events based on overridden event methods, etc.
19-
///
20-
/// This is only needed by widget authors in advanced scenarios. The default is to auto initialize, so this is
21-
/// only needed if you want to disable this behaviour.
22-
/// </remarks>
23-
/// <example>
24-
/// An example handler that implements this behaviour:
25-
/// <code>
26-
/// [AutoInitialize(false)]
27-
/// public interface IMyWidget : IControl
28-
/// {
29-
/// void CreateWithParams(int param1, bool param2);
30-
/// }
31-
///
32-
/// [Handler(typeof(IMyWidget))]
33-
/// public class MyWidget : Control
34-
/// {
35-
/// public MyWidget(int param1, bool param2)
36-
/// {
37-
/// ((IMyWidget)Handler).CreateWithParams(param1, param2);
38-
/// Initialize(); // ensure you call this on any constructor of your widget
39-
/// }
40-
/// }
41-
/// </code>
42-
/// </example>
43-
/// <copyright>(c) 2014 by Curtis Wensley</copyright>
44-
/// <license type="BSD-3">See LICENSE for full terms</license>
45-
[AttributeUsage(AttributeTargets.Interface)]
46-
public sealed class AutoInitializeAttribute : Attribute
47-
{
48-
/// <summary>
49-
/// Gets a value indicating whether to auto initialize the handler, false to defer this to the widget author
50-
/// </summary>
51-
/// <value><c>true</c> if initialize; otherwise, <c>false</c>.</value>
52-
public bool Initialize { get; private set; }
51+
/// <value><c>true</c> if initialize; otherwise, <c>false</c>.</value>
52+
public bool Initialize { get; private set; }
5353

54-
/// <summary>
55-
/// Initializes a new instance of the <see cref="Eto.AutoInitializeAttribute"/> class.
56-
/// </summary>
57-
/// <param name="initialize">If set to <c>true</c> initialize the widget automatically, otherwise <c>false</c>.</param>
58-
public AutoInitializeAttribute(bool initialize)
59-
{
60-
Initialize = initialize;
61-
}
54+
/// <summary>
55+
/// Initializes a new instance of the <see cref="Eto.AutoInitializeAttribute"/> class.
56+
/// </summary>
57+
/// <param name="initialize">If set to <c>true</c> initialize the widget automatically, otherwise <c>false</c>.</param>
58+
public AutoInitializeAttribute(bool initialize)
59+
{
60+
Initialize = initialize;
6261
}
63-
}
62+
}

0 commit comments

Comments
 (0)