Skip to content

Commit 14a7064

Browse files
committed
dotnet format
1 parent e75ca55 commit 14a7064

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

Datamodel.NET/Arrays.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ internal set
181181
if (elem.Owner == null)
182182
{
183183
var importedElement = OwnerDatamodel.ImportElement(elem, Datamodel.ImportRecursionMode.Stubs, Datamodel.ImportOverwriteMode.Stubs);
184-
185-
if(importedElement is not null)
184+
185+
if (importedElement is not null)
186186
{
187187
Inner[i] = importedElement;
188188
}
@@ -201,8 +201,8 @@ protected override void Insert_Internal(int index, Element item)
201201
if (item.Owner == null)
202202
{
203203
var importedElement = OwnerDatamodel.ImportElement(item, Datamodel.ImportRecursionMode.Recursive, Datamodel.ImportOverwriteMode.Stubs);
204-
205-
if(importedElement is not null)
204+
205+
if (importedElement is not null)
206206
{
207207
item = importedElement;
208208
}

Datamodel.NET/AttributeList.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private ICollection<Attribute> GetPropertyBasedAttributes(bool useSerializationN
2929
var result = new List<Attribute>();
3030
foreach (DictionaryEntry entry in PropertyInfos)
3131
{
32-
if(entry.Value is null)
32+
if (entry.Value is null)
3333
{
3434
throw new InvalidDataException("Property value can not be null");
3535
}
@@ -135,7 +135,7 @@ public void Add(string key, object? value)
135135
{
136136
var attrib = Inner[key];
137137

138-
if(attrib is null)
138+
if (attrib is null)
139139
{
140140
return null;
141141
}
@@ -269,7 +269,7 @@ public virtual object? this[string name]
269269
{
270270
// were actually fine with this being null, it will just set the value to null
271271
// but need to check so the type check doesn't fail if it is null
272-
if(value != null)
272+
if (value != null)
273273
{
274274
var valueType = value.GetType();
275275

@@ -307,7 +307,7 @@ public virtual object? this[string name]
307307

308308
return;
309309
}
310-
310+
311311
Attribute? old_attr;
312312
Attribute? new_attr;
313313
int old_index = -1;
@@ -343,7 +343,7 @@ public AttrKVP this[int index]
343343
{
344344
var attr = (Attribute?)Inner[index];
345345

346-
if(attr is null)
346+
if (attr is null)
347347
{
348348
throw new InvalidOperationException($"attribute at index {index} doesn't exist");
349349
}
@@ -367,7 +367,7 @@ public void RemoveAt(int index)
367367
{
368368
attr = (Attribute?)Inner[index];
369369

370-
if(attr is not null)
370+
if (attr is not null)
371371
{
372372
attr.Owner = null;
373373
Inner.RemoveAt(index);
@@ -571,7 +571,7 @@ public static ValueComparer Default
571571

572572
public new bool Equals(object? x, object? y)
573573
{
574-
if(x is null || y is null)
574+
if (x is null || y is null)
575575
{
576576
return false;
577577
}

Datamodel.NET/Datamodel.ElementList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public void Trim()
219219
{
220220
foreach (var elem in this.Except(used).ToArray())
221221
{
222-
if(elem != null)
222+
if (elem != null)
223223
{
224224
store.Remove(elem.ID);
225225
elem.Owner = null;
@@ -241,7 +241,7 @@ public void Trim()
241241

242242
protected void WalkElemTree(Element? elem, HashSet<Element?> found)
243243
{
244-
if(elem is null)
244+
if (elem is null)
245245
{
246246
return;
247247
}

Datamodel.NET/Datamodel.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private static ICodec GetCodec(string encoding, int encoding_version)
167167

168168
var codecConstructor = codec_type.GetConstructor(Type.EmptyTypes);
169169

170-
if(codecConstructor is null)
170+
if (codecConstructor is null)
171171
{
172172
throw new InvalidOperationException("Failed to get codec constructor.");
173173
}
@@ -252,7 +252,7 @@ public static Datamodel Load(Stream stream, DeferredMode defer_mode = DeferredMo
252252
public static Datamodel Load<T>(Stream stream, DeferredMode defer_mode = DeferredMode.Automatic, ReflectionParams? reflectionParams = null)
253253
where T : Element
254254
{
255-
return Load_Internal<T>(stream,defer_mode, reflectionParams);
255+
return Load_Internal<T>(stream, defer_mode, reflectionParams);
256256
}
257257

258258
/// <summary>
@@ -262,7 +262,7 @@ public static Datamodel Load<T>(Stream stream, DeferredMode defer_mode = Deferre
262262
/// <param name="defer_mode">How to handle deferred loading.</param>
263263
public static Datamodel Load(byte[] data, DeferredMode defer_mode = DeferredMode.Automatic)
264264
{
265-
return Load_Internal<Element>(new MemoryStream(data, true),defer_mode);
265+
return Load_Internal<Element>(new MemoryStream(data, true), defer_mode);
266266
}
267267
/// <summary>
268268
/// Loads a Datamodel from a byte array.
@@ -287,7 +287,7 @@ public static Datamodel Load(string path, DeferredMode defer_mode = DeferredMode
287287
Datamodel? dm = null;
288288
try
289289
{
290-
dm = Load_Internal<Element>(stream,defer_mode);
290+
dm = Load_Internal<Element>(stream, defer_mode);
291291
return dm;
292292
}
293293
finally
@@ -310,22 +310,22 @@ public static Datamodel Load<T>(string path, ReflectionParams? reflectionParams
310310
private static Datamodel Load_Internal<T>(Stream stream, DeferredMode defer_mode = DeferredMode.Automatic, ReflectionParams? reflectionParams = null)
311311
where T : Element
312312
{
313-
reflectionParams ??= new ();
313+
reflectionParams ??= new();
314314

315315
var templateType = typeof(T);
316316

317-
if(templateType is null)
317+
if (templateType is null)
318318
{
319319
throw new InvalidDataException("Template type can't be null");
320320
}
321321

322-
if(templateType == typeof(Element))
322+
if (templateType == typeof(Element))
323323
{
324324
reflectionParams.AttemptReflection = false;
325325
}
326326

327327
// if user doesnt specify these assume assembly and namespace of root node
328-
if(reflectionParams.Assembly == string.Empty)
328+
if (reflectionParams.Assembly == string.Empty)
329329
{
330330
reflectionParams.Assembly = templateType.Assembly.GetName().Name!;
331331
}
@@ -389,7 +389,7 @@ private static Datamodel Load_Internal<T>(Stream stream, DeferredMode defer_mode
389389
{
390390
result = StubRequest(id);
391391

392-
if(result is null)
392+
if (result is null)
393393
{
394394
throw new InvalidDataException("Stub request failed, result was null");
395395
}
@@ -484,7 +484,7 @@ public string Format
484484
get => _Format;
485485
set
486486
{
487-
if(value is null)
487+
if (value is null)
488488
{
489489
throw new InvalidDataException("Format can not be null");
490490
}
@@ -519,7 +519,7 @@ public string Encoding
519519
get => _Encoding;
520520
set
521521
{
522-
if(value is null)
522+
if (value is null)
523523
{
524524
throw new InvalidDataException("Encoding can not be null");
525525
}
@@ -779,7 +779,7 @@ public ImportJob(ImportRecursionMode import_mode, ImportOverwriteMode overwrite_
779779
local_element = null;
780780
}
781781

782-
if(local_element is null)
782+
if (local_element is null)
783783
{
784784
return null;
785785
}
@@ -799,7 +799,7 @@ public ImportJob(ImportRecursionMode import_mode, ImportOverwriteMode overwrite_
799799
var list = (System.Collections.ICollection)attr.Value;
800800
var inner_type = GetArrayInnerType(list.GetType());
801801

802-
if(inner_type is null)
802+
if (inner_type is null)
803803
{
804804
throw new InvalidOperationException("Failed to get inner_type while importing element");
805805
}
@@ -935,7 +935,7 @@ internal DestubException(ElementArray array, int index, Exception innerException
935935
: base("An exception occured while destubbing an array item.", innerException)
936936
{
937937
var arrayOwner = array.Owner;
938-
if(arrayOwner is not null)
938+
if (arrayOwner is not null)
939939
{
940940
Data.Add("Element", ((Element)arrayOwner).ID);
941941
}

ElementFactoryGenerator/ElementFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private static bool ValidateType(INamedTypeSymbol type, Compilation compilation)
179179
// only internal classes in execution assembly are fine
180180
if (type.DeclaredAccessibility == Accessibility.Internal)
181181
{
182-
if(compilation.Assembly != type.ContainingAssembly)
182+
if (!SymbolEqualityComparer.Default.Equals(compilation.Assembly, type.ContainingAssembly))
183183
{
184184
return false;
185185
}

0 commit comments

Comments
 (0)