Skip to content

Commit cb9ce28

Browse files
remove some redundant namespace qualifications (#4516)
Co-authored-by: Rockford Lhotka <[email protected]>
1 parent ea27034 commit cb9ce28

36 files changed

+225
-223
lines changed

Source/Csla.AspNetCore/Blazor/State/SessionIdManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public string GetSessionId()
5555
httpContext.Response.Cookies.Append(sessionIdName, result);
5656
}
5757

58-
return result ?? throw new InvalidOperationException(Csla.Properties.Resources.SessionIdManagerIdMustBeNotNull);
58+
return result ?? throw new InvalidOperationException(Properties.Resources.SessionIdManagerIdMustBeNotNull);
5959
}
6060
}
6161
}

Source/Csla.Blazor/ViewModel.cs

+15-16
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ViewModel(ApplicationContext applicationContext)
6262
/// Event raised when the Model object
6363
/// raises its ModelChildChanged event.
6464
/// </summary>
65-
public event Action<object, Core.ChildChangedEventArgs> ModelChildChanged;
65+
public event Action<object, ChildChangedEventArgs> ModelChildChanged;
6666
/// <summary>
6767
/// Event raised when the Model object
6868
/// raises its ModelCollectionChanged event.
@@ -78,7 +78,7 @@ protected virtual void OnModelChanging(T oldValue, T newValue)
7878
{
7979
if (ReferenceEquals(oldValue, newValue)) return;
8080

81-
if (ManageObjectLifetime && newValue is Core.ISupportUndo undo)
81+
if (ManageObjectLifetime && newValue is ISupportUndo undo)
8282
undo.BeginEdit();
8383

8484
_propertyInfoCache.Clear();
@@ -88,7 +88,7 @@ protected virtual void OnModelChanging(T oldValue, T newValue)
8888
{
8989
UnhookChangedEvents(oldValue);
9090

91-
if (oldValue is Core.INotifyBusy nb)
91+
if (oldValue is INotifyBusy nb)
9292
nb.BusyChanged -= OnBusyChanged;
9393
}
9494

@@ -97,7 +97,7 @@ protected virtual void OnModelChanging(T oldValue, T newValue)
9797
{
9898
HookChangedEvents(newValue);
9999

100-
if (newValue is Core.INotifyBusy nb)
100+
if (newValue is INotifyBusy nb)
101101
nb.BusyChanged += OnBusyChanged;
102102
}
103103

@@ -136,8 +136,7 @@ private void HookChangedEvents(T model)
136136
cc.CollectionChanged += OnModelCollectionChanged;
137137
}
138138

139-
140-
private void OnBusyChanged(object sender, Core.BusyChangedEventArgs e)
139+
private void OnBusyChanged(object sender, BusyChangedEventArgs e)
141140
{
142141
// only set busy state for entire object. Ignore busy state based
143142
// on async rules being active
@@ -168,7 +167,7 @@ protected virtual void OnModelPropertyChanged(object sender, PropertyChangedEven
168167
/// </summary>
169168
/// <param name="sender"></param>
170169
/// <param name="e"></param>
171-
protected virtual void OnModelChildChanged(object sender, Core.ChildChangedEventArgs e)
170+
protected virtual void OnModelChildChanged(object sender, ChildChangedEventArgs e)
172171
{
173172
ModelChildChanged?.Invoke(this, e);
174173
}
@@ -253,7 +252,7 @@ public async Task SaveAsync(CancellationToken ct)
253252
ViewModelErrorText = null;
254253
try
255254
{
256-
if (Model is Core.ITrackStatus obj && !obj.IsSavable)
255+
if (Model is ITrackStatus obj && !obj.IsSavable)
257256
{
258257
if (obj.IsBusy)
259258
{
@@ -275,16 +274,16 @@ public async Task SaveAsync(CancellationToken ct)
275274

276275
UnhookChangedEvents(Model);
277276

278-
var savable = Model as Core.ISavable;
277+
var savable = Model as ISavable;
279278
if (ManageObjectLifetime)
280279
{
281280
//apply changes - must apply edit to Model not clone
282-
if (Model is Core.ISupportUndo undoable)
281+
if (Model is ISupportUndo undoable)
283282
undoable.ApplyEdit();
284283

285284
// clone the object if possible
286285
if (Model is ICloneable clonable)
287-
savable = (Core.ISavable)clonable.Clone();
286+
savable = (ISavable)clonable.Clone();
288287
}
289288

290289
IsBusy = true;
@@ -308,7 +307,7 @@ public async Task SaveAsync(CancellationToken ct)
308307
}
309308
finally
310309
{
311-
if (ManageObjectLifetime && Model is IUndoableObject udbl && udbl.EditLevel == 0 && Model is Core.ISupportUndo undo)
310+
if (ManageObjectLifetime && Model is IUndoableObject udbl && udbl.EditLevel == 0 && Model is ISupportUndo undo)
312311
undo.BeginEdit();
313312

314313
HookChangedEvents(Model);
@@ -323,13 +322,13 @@ public async Task SaveAsync(CancellationToken ct)
323322
/// <summary>
324323
/// Override to provide custom Model save behavior.
325324
/// </summary>
326-
protected virtual async Task<T> DoSaveAsync(Core.ISavable cloned)
325+
protected virtual async Task<T> DoSaveAsync(ISavable cloned)
327326
{
328327
if (cloned != null)
329328
{
330329
var saved = (T)await cloned.SaveAsync();
331-
if (Model is Core.IEditableBusinessObject editable)
332-
await new Core.GraphMerger(ApplicationContext).MergeGraphAsync(editable, (Core.IEditableBusinessObject)saved);
330+
if (Model is IEditableBusinessObject editable)
331+
await new GraphMerger(ApplicationContext).MergeGraphAsync(editable, (IEditableBusinessObject)saved);
333332
else
334333
Model = saved;
335334
}
@@ -344,7 +343,7 @@ protected virtual void DoCancel()
344343
{
345344
if (ManageObjectLifetime)
346345
{
347-
if (Model is Core.ISupportUndo undo)
346+
if (Model is ISupportUndo undo)
348347
{
349348
UnhookChangedEvents(Model);
350349
try

Source/Csla.Channels.RabbitMq/RabbitMqChannelExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ public static class RabbitMqChannelExtensions
2323
/// <param name="config">CslaDataPortalConfiguration object</param>
2424
/// <param name="options">Data portal proxy options</param>
2525
/// <exception cref="ArgumentNullException"><paramref name="config"/> or <paramref name="options"/> is <see langword="null"/>.</exception>
26-
public static DataPortalClientOptions UseRabbitMqProxy(this DataPortalClientOptions config, Action<Channels.RabbitMq.RabbitMqProxyOptions> options)
26+
public static DataPortalClientOptions UseRabbitMqProxy(this DataPortalClientOptions config, Action<RabbitMqProxyOptions> options)
2727
{
2828
if (config is null)
2929
throw new ArgumentNullException(nameof(config));
3030
if (options is null)
3131
throw new ArgumentNullException(nameof(options));
3232

33-
var proxyOptions = new Channels.RabbitMq.RabbitMqProxyOptions();
33+
var proxyOptions = new RabbitMqProxyOptions();
3434
options.Invoke(proxyOptions);
3535
config.Services.AddTransient(typeof(IDataPortalProxy),
3636
sp =>
3737
{
3838
var applicationContext = sp.GetRequiredService<ApplicationContext>();
39-
return new Channels.RabbitMq.RabbitMqProxy(applicationContext, proxyOptions);
39+
return new RabbitMqProxy(applicationContext, proxyOptions);
4040
});
4141
return config;
4242
}
@@ -48,7 +48,7 @@ public static DataPortalClientOptions UseRabbitMqProxy(this DataPortalClientOpti
4848
/// <param name="options"></param>
4949
/// <returns></returns>
5050
/// <exception cref="ArgumentNullException"></exception>
51-
public static DataPortalServerOptions UseRabbitMqPortal(this DataPortalServerOptions config, Action<Channels.RabbitMq.RabbitMqPortalOptions>? options)
51+
public static DataPortalServerOptions UseRabbitMqPortal(this DataPortalServerOptions config, Action<RabbitMqPortalOptions>? options)
5252
{
5353
if (config is null)
5454
throw new ArgumentNullException(nameof(config));

Source/Csla.Channels.RabbitMq/WorkInProgress.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal static class Wip
1010

1111
internal class WipItem
1212
{
13-
public Threading.AsyncManualResetEvent ResetEvent { get; }
13+
public AsyncManualResetEvent ResetEvent { get; }
1414
public byte[]? Response { get; set; }
1515

1616
internal WipItem(AsyncManualResetEvent resetEvent)

Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedTypeDefinition.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ public override bool Equals(object obj)
9494
public override int GetHashCode()
9595
{
9696
// Calculate and return the hash code based on the properties, fields, or any other relevant data
97-
return System.HashCode.Combine(Namespace + Scope + TypeName, TypeKind, FullyQualifiedName, Properties, BaseClassTypeName, DefaultPropertyModifiers, DefaultPropertySetterModifiers);
97+
return HashCode.Combine(Namespace + Scope + TypeName, TypeKind, FullyQualifiedName, Properties, BaseClassTypeName, DefaultPropertyModifiers, DefaultPropertySetterModifiers);
9898
}
9999
}

Source/Csla.Web.Mvc.Shared/ConfigurationExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static CslaOptions AddAspNetMvc(this CslaOptions config, Action<AspNetMvc
4141

4242
#if NET462
4343
// use correct IContextManager
44-
config.Services.TryAddSingleton<Csla.Core.IContextManager, ApplicationContextManager>();
44+
config.Services.TryAddSingleton<Core.IContextManager, ApplicationContextManager>();
4545
#endif
4646

4747
return config;

Source/Csla.Web/ConfigurationExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static CslaOptions AddAspNet(this CslaOptions config, Action<AspNetOption
3838
options?.Invoke(webOptions);
3939

4040
// use correct IContextManager
41-
config.Services.TryAddSingleton<Csla.Core.IContextManager, ApplicationContextManager>();
41+
config.Services.TryAddSingleton<Core.IContextManager, ApplicationContextManager>();
4242

4343
return config;
4444
}

Source/Csla.Windows/ConfigurationExtensions.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// <summary>Implement extension methods for .NET Core configuration</summary>
77
//-----------------------------------------------------------------------
88

9+
using Csla.Windows;
910
using Microsoft.Extensions.DependencyInjection;
1011

1112
namespace Csla.Configuration
@@ -37,7 +38,7 @@ public static CslaOptions AddWindowsForms(this CslaOptions config, Action<Window
3738
options?.Invoke(winFormsOptions);
3839

3940
// use correct IContextManager
40-
config.Services.AddSingleton<Core.IContextManager, Csla.Windows.ApplicationContextManager>();
41+
config.Services.AddSingleton<Core.IContextManager, ApplicationContextManager>();
4142

4243
// use correct mode for raising PropertyChanged events
4344
config.BindingOptions.PropertyChangedMode = ApplicationContext.PropertyChangedModes.Windows;

Source/Csla.Xaml.Shared/ConfigurationExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static CslaOptions AddXaml(this CslaOptions config, Action<XamlOptions> o
3838
options?.Invoke(xamlOptions);
3939

4040
// use correct IContextManager
41-
config.Services.AddSingleton<Csla.Core.IContextManager, ApplicationContextManager>();
41+
config.Services.AddSingleton<Core.IContextManager, ApplicationContextManager>();
4242

4343
// use correct mode for raising PropertyChanged events
4444
config.BindingOptions.PropertyChangedMode = ApplicationContext.PropertyChangedModes.Xaml;

Source/Csla/BusinessBase.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ object ISavable.Save(bool forceUpdate)
303303
/// <summary>
304304
/// Event raised when an object has been saved.
305305
/// </summary>
306-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
307-
"CA1062:ValidateArgumentsOfPublicMethods")]
306+
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods")]
308307
public event EventHandler<SavedEventArgs> Saved
309308
{
310309
add

Source/Csla/BusinessBindingListBase.cs

+10-14
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace Csla
2121
/// </summary>
2222
/// <typeparam name="T">Type of the business object being defined.</typeparam>
2323
/// <typeparam name="C">Type of the child objects contained in the list.</typeparam>
24-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
25-
"Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
24+
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
2625
[Serializable]
2726
public abstract class BusinessBindingListBase<
2827
#if NET8_0_OR_GREATER
@@ -144,8 +143,7 @@ public T Clone()
144143
/// A collection containing all child objects marked
145144
/// for deletion.
146145
/// </summary>
147-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
148-
"Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
146+
[SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
149147
[EditorBrowsable(EditorBrowsableState.Advanced)]
150148
protected MobileList<C> DeletedList
151149
{
@@ -157,8 +155,7 @@ protected MobileList<C> DeletedList
157155
}
158156
}
159157

160-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
161-
"Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
158+
[SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
162159
[EditorBrowsable(EditorBrowsableState.Advanced)]
163160
IEnumerable<IEditableBusinessObject> IContainsDeletedList.DeletedList => (IEnumerable<IEditableBusinessObject>)DeletedList;
164161

@@ -1023,7 +1020,7 @@ public async Task SaveAndMergeAsync()
10231020
/// requested DataPortal_xyz method.
10241021
/// </summary>
10251022
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
1026-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1023+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10271024
[EditorBrowsable(EditorBrowsableState.Advanced)]
10281025
protected virtual void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e)
10291026
{ }
@@ -1033,7 +1030,7 @@ protected virtual void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e)
10331030
/// requested DataPortal_xyz method.
10341031
/// </summary>
10351032
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
1036-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1033+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10371034
[EditorBrowsable(EditorBrowsableState.Advanced)]
10381035
protected virtual void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e)
10391036
{ }
@@ -1044,7 +1041,7 @@ protected virtual void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs
10441041
/// </summary>
10451042
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
10461043
/// <param name="ex">The Exception thrown during data access.</param>
1047-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1044+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10481045
[EditorBrowsable(EditorBrowsableState.Advanced)]
10491046
protected virtual void DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex)
10501047
{ }
@@ -1054,7 +1051,7 @@ protected virtual void DataPortal_OnDataPortalException(DataPortalEventArgs e, E
10541051
/// requested DataPortal_XYZ method.
10551052
/// </summary>
10561053
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
1057-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1054+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10581055
[EditorBrowsable(EditorBrowsableState.Advanced)]
10591056
protected virtual void Child_OnDataPortalInvoke(DataPortalEventArgs e)
10601057
{ }
@@ -1064,7 +1061,7 @@ protected virtual void Child_OnDataPortalInvoke(DataPortalEventArgs e)
10641061
/// requested DataPortal_XYZ method.
10651062
/// </summary>
10661063
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
1067-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1064+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10681065
[EditorBrowsable(EditorBrowsableState.Advanced)]
10691066
protected virtual void Child_OnDataPortalInvokeComplete(DataPortalEventArgs e)
10701067
{ }
@@ -1075,7 +1072,7 @@ protected virtual void Child_OnDataPortalInvokeComplete(DataPortalEventArgs e)
10751072
/// </summary>
10761073
/// <param name="e">The DataPortalContext object passed to the DataPortal.</param>
10771074
/// <param name="ex">The Exception thrown during data access.</param>
1078-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
1075+
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]
10791076
[EditorBrowsable(EditorBrowsableState.Advanced)]
10801077
protected virtual void Child_OnDataPortalException(DataPortalEventArgs e, Exception ex)
10811078
{ }
@@ -1143,8 +1140,7 @@ void ISavable<T>.SaveComplete(T newObject)
11431140
/// <summary>
11441141
/// Event raised when an object has been saved.
11451142
/// </summary>
1146-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
1147-
"CA1062:ValidateArgumentsOfPublicMethods")]
1143+
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods")]
11481144
public event EventHandler<SavedEventArgs> Saved
11491145
{
11501146
add

Source/Csla/BusinessListBase.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.ComponentModel;
1111
using System.ComponentModel.DataAnnotations;
1212
using System.Diagnostics.CodeAnalysis;
13+
using System.Diagnostics;
1314
using Csla.Core;
1415
using Csla.Properties;
1516
using Csla.Serialization.Mobile;
@@ -24,7 +25,7 @@ namespace Csla
2425
/// <typeparam name="T">Type of the business object being defined.</typeparam>
2526
/// <typeparam name="C">Type of the child objects contained in the list.</typeparam>
2627
#if TESTING
27-
[System.Diagnostics.DebuggerStepThrough]
28+
[DebuggerStepThrough]
2829
#endif
2930
[Serializable]
3031
public abstract class BusinessListBase<
@@ -149,8 +150,7 @@ public T Clone()
149150
/// A collection containing all child objects marked
150151
/// for deletion.
151152
/// </summary>
152-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
153-
"Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
153+
[SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
154154
[EditorBrowsable(EditorBrowsableState.Advanced)]
155155
protected MobileList<C> DeletedList
156156
{
@@ -162,8 +162,7 @@ protected MobileList<C> DeletedList
162162
}
163163
}
164164

165-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
166-
"Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
165+
[SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists")]
167166
[EditorBrowsable(EditorBrowsableState.Advanced)]
168167
IEnumerable<IEditableBusinessObject> IContainsDeletedList.DeletedList => (IEnumerable<IEditableBusinessObject>)DeletedList;
169168

@@ -1156,8 +1155,7 @@ void ISavable<T>.SaveComplete(T newObject)
11561155
/// <summary>
11571156
/// Event raised when an object has been saved.
11581157
/// </summary>
1159-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design",
1160-
"CA1062:ValidateArgumentsOfPublicMethods")]
1158+
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods")]
11611159
public event EventHandler<SavedEventArgs> Saved
11621160
{
11631161
add
@@ -1202,7 +1200,7 @@ protected virtual void OnSaved(T newObject, Exception e, object userState)
12021200
/// </remarks>
12031201
[Browsable(false)]
12041202
[Display(AutoGenerateField = false)]
1205-
[System.ComponentModel.DataAnnotations.ScaffoldColumn(false)]
1203+
[ScaffoldColumn(false)]
12061204
[EditorBrowsable(EditorBrowsableState.Advanced)]
12071205
public IParent Parent
12081206
{

0 commit comments

Comments
 (0)