Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
def01dd
cimConverter.cs
CarloToso Dec 14, 2022
52d6335
CimJobException.cs
CarloToso Dec 14, 2022
bd1494a
cimQuery.cs
CarloToso Dec 14, 2022
605f7f6
CsvCommands.cs
CarloToso Dec 14, 2022
7511932
MatchString.cs
CarloToso Dec 14, 2022
a7cf89b
Etw
CarloToso Dec 14, 2022
1187a62
CounterSetRegistrarBase
CarloToso Dec 14, 2022
dede643
CryptoUtils
CarloToso Dec 14, 2022
eabf5d6
SessionStateExceptions
CarloToso Dec 14, 2022
8eda402
ObjectReader
CarloToso Dec 14, 2022
c8f94be
ObjectWriter
CarloToso Dec 14, 2022
198f389
RunspacrConnectionInfo
CarloToso Dec 14, 2022
fb43b2f
ExecutionExceptions
CarloToso Dec 14, 2022
855f789
ObjectModelWrapper
CarloToso Dec 14, 2022
e4bf0bf
SessionStateUtils
CarloToso Dec 14, 2022
85e3cac
ColumnPicker.xaml
CarloToso Dec 14, 2022
236f6d1
changed 10 files
CarloToso Dec 14, 2022
b0ff8f9
fix
CarloToso Dec 14, 2022
d62ba27
change 20 files
CarloToso Dec 14, 2022
b1655d9
fix
CarloToso Dec 14, 2022
54f9838
change 10 files
CarloToso Dec 14, 2022
010dbf1
changed 5 files
CarloToso Dec 14, 2022
6606c84
changed 5 files
CarloToso Dec 14, 2022
50eaae0
changed 5 files
CarloToso Dec 14, 2022
4cf7fc4
changed 15 files
CarloToso Dec 14, 2022
e8e3274
changed 15 files
CarloToso Dec 14, 2022
22ce000
changed 10 files
CarloToso Dec 14, 2022
136de8c
changed 5 files
CarloToso Dec 14, 2022
7698363
changed 3 files
CarloToso Dec 14, 2022
92ed70f
changed 2 files
CarloToso Dec 14, 2022
770ede3
changed 2 files
CarloToso Dec 14, 2022
a325954
fix conflict
CarloToso Dec 14, 2022
2a4bfce
Merge branch 'master' into throw-new-ArgumentNullException(nameof())
CarloToso Dec 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ internal class ParagraphBuilder : INotifyPropertyChanged
/// <param name="paragraph">Paragraph we will be adding lines to in BuildParagraph.</param>
internal ParagraphBuilder(Paragraph paragraph)
{
if (paragraph == null)
{
throw new ArgumentNullException("paragraph");
}
ArgumentNullException.ThrowIfNull(paragraph);

this.paragraph = paragraph;
this.boldSpans = new List<TextSpan>();
Expand Down Expand Up @@ -185,10 +182,7 @@ internal void HighlightAllInstancesOf(string search, bool caseSensitive, bool wh
/// <param name="bold">True if the text should be bold.</param>
internal void AddText(string str, bool bold)
{
if (str == null)
{
throw new ArgumentNullException("str");
}
ArgumentNullException.ThrowIfNull(str);

if (str.Length == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ public class IntegralConverter : IMultiValueConverter
/// </returns>
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
ArgumentNullException.ThrowIfNull(values);

if (values.Length != 2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ public class InverseBooleanConverter : IValueConverter
/// <returns>The inverted boolean value.</returns>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
ArgumentNullException.ThrowIfNull(value);

var boolValue = (bool)value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ public class IsEqualConverter : IMultiValueConverter
/// </returns>
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
ArgumentNullException.ThrowIfNull(values);

if (values.Length != 2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ public class StringFormatConverter : IValueConverter
/// <returns>The formatted string.</returns>
public object Convert(object value, Type targetType, Object parameter, CultureInfo culture)
{
if (parameter == null)
{
throw new ArgumentNullException("parameter");
}
ArgumentNullException.ThrowIfNull(parameter);

string str = (string)value;
string formatString = (string)parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ public static class Utilities
/// <exception cref="ArgumentNullException">The specified value is a null reference.</exception>
public static bool AreAllItemsOfType<T>(IEnumerable items)
{
if (items == null)
{
throw new ArgumentNullException("items");
}
ArgumentNullException.ThrowIfNull(items);

foreach (object item in items)
{
Expand All @@ -108,10 +105,7 @@ public static bool AreAllItemsOfType<T>(IEnumerable items)
/// <exception cref="ArgumentNullException">The specified value is a null reference.</exception>
public static T Find<T>(this IEnumerable items)
{
if (items == null)
{
throw new ArgumentNullException("items");
}
ArgumentNullException.ThrowIfNull(items);

foreach (object item in items)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ public class VisualToAncestorDataConverter : IValueConverter
/// <exception cref="ArgumentNullException">The specified value is a null reference.</exception>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
ArgumentNullException.ThrowIfNull(value);

if (parameter == null)
{
throw new ArgumentNullException("parameter");
}
ArgumentNullException.ThrowIfNull(parameter);

Type dataType = (Type)parameter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ internal class WeakEventListener<TEventArgs> : IWeakEventListener where TEventAr
/// <param name="handler">The handler for the event.</param>
public WeakEventListener(EventHandler<TEventArgs> handler)
{
if (handler == null)
{
throw new ArgumentNullException("handler");
}
ArgumentNullException.ThrowIfNull(handler);

this.realHander = handler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ public bool IsEmpty
/// <exception cref="NotSupportedException">The specified value does not have a parent that supports removal.</exception>
public static void RemoveFromParent(FrameworkElement element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
ArgumentNullException.ThrowIfNull(element);

// If the element has already been detached, do nothing \\
if (element.Parent == null)
Expand Down Expand Up @@ -215,10 +212,7 @@ public static void RemoveFromParent(FrameworkElement element)
/// <exception cref="NotSupportedException">The specified value does not have a parent that supports removal.</exception>
public static void AddChild(FrameworkElement parent, FrameworkElement element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
ArgumentNullException.ThrowIfNull(element);

if (parent == null)
{
Expand Down Expand Up @@ -310,10 +304,8 @@ public static List<T> FindVisualChildren<T>(DependencyObject obj)
where T : DependencyObject
{
Debug.Assert(obj != null, "obj is null");
if (obj == null)
{
throw new ArgumentNullException("obj");
}

ArgumentNullException.ThrowIfNull(obj);

List<T> childrenOfType = new List<T>();

Expand Down Expand Up @@ -348,10 +340,7 @@ public static List<T> FindVisualChildren<T>(DependencyObject obj)
public static T FindVisualAncestorData<T>(this DependencyObject obj)
where T : class
{
if (obj == null)
{
throw new ArgumentNullException("obj");
}
ArgumentNullException.ThrowIfNull(obj);

FrameworkElement parent = obj.FindVisualAncestor<FrameworkElement>();

Expand Down Expand Up @@ -413,10 +402,7 @@ public static T FindVisualAncestor<T>(this DependencyObject @object) where T : c
/// <exception cref="ArgumentNullException">The specified value is a null reference.</exception>
public static bool TryExecute(this RoutedCommand command, object parameter, IInputElement target)
{
if (command == null)
{
throw new ArgumentNullException("command");
}
ArgumentNullException.ThrowIfNull(command);

if (command.CanExecute(parameter, target))
{
Expand All @@ -437,10 +423,7 @@ public static bool TryExecute(this RoutedCommand command, object parameter, IInp
/// <returns>The reference to the child, or null if the template part wasn't found.</returns>
public static T GetOptionalTemplateChild<T>(Control templateParent, string childName) where T : FrameworkElement
{
if (templateParent == null)
{
throw new ArgumentNullException("templateParent");
}
ArgumentNullException.ThrowIfNull(templateParent);

if (string.IsNullOrEmpty(childName))
{
Expand Down Expand Up @@ -566,10 +549,7 @@ public static RoutedPropertyChangedEventArgs<T> CreateRoutedPropertyChangedEvent
/// <exception cref="ArgumentOutOfRangeException">The specified index is not valid for the specified collection.</exception>
public static void ChangeIndex(ItemCollection items, object item, int newIndex)
{
if (items == null)
{
throw new ArgumentNullException("items");
}
ArgumentNullException.ThrowIfNull(items);

if (!items.Contains(item))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ public ResizerGripThicknessConverter()
/// <returns>A converted value. If the method returns nullNothingnullptra null reference (Nothing in Visual Basic), the valid null value is used.</returns>
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
ArgumentNullException.ThrowIfNull(values);

if (object.ReferenceEquals(values[0], DependencyProperty.UnsetValue) ||
object.ReferenceEquals(values[1], DependencyProperty.UnsetValue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ public override IPropertyValueGetter PropertyValueGetter

set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
ArgumentNullException.ThrowIfNull(value);

this.propertyValueGetter = value;
}
Expand Down Expand Up @@ -106,15 +103,9 @@ public override ICollection<FilterRule> CreateDefaultFilterRulesForPropertyValue
/// </param>
public override void TransferValues(FilterRule oldRule, FilterRule newRule)
{
if (oldRule == null)
{
throw new ArgumentNullException("oldRule");
}
ArgumentNullException.ThrowIfNull(oldRule);

if (newRule == null)
{
throw new ArgumentNullException("newRule");
}
ArgumentNullException.ThrowIfNull(newRule);

if (this.TryTransferValuesAsSingleValueComparableValueFilterRule(oldRule, newRule))
{
Expand All @@ -130,10 +121,7 @@ public override void TransferValues(FilterRule oldRule, FilterRule newRule)
/// </param>
public override void ClearValues(FilterRule rule)
{
if (rule == null)
{
throw new ArgumentNullException("rule");
}
ArgumentNullException.ThrowIfNull(rule);

if (this.TryClearValueFromSingleValueComparableValueFilterRule(rule))
{
Expand Down Expand Up @@ -163,10 +151,7 @@ public override void ClearValues(FilterRule rule)
/// </returns>
public override string GetErrorMessageForInvalidValue(string value, Type typeToParseTo)
{
if (typeToParseTo == null)
{
throw new ArgumentNullException("typeToParseTo");
}
ArgumentNullException.ThrowIfNull(typeToParseTo);

bool isNumericType = typeToParseTo == typeof(byte)
|| typeToParseTo == typeof(sbyte)
Expand Down Expand Up @@ -222,10 +207,7 @@ private object GetValueFromValidatingValue(FilterRule rule, string propertyName)
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");

// NOTE: This isn't needed but OACR is complaining
if (rule == null)
{
throw new ArgumentNullException("rule");
}
ArgumentNullException.ThrowIfNull(rule);

Type ruleType = rule.GetType();

Expand All @@ -241,10 +223,7 @@ private void SetValueOnValidatingValue(FilterRule rule, string propertyName, obj
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");

// NOTE: This isn't needed but OACR is complaining
if (rule == null)
{
throw new ArgumentNullException("rule");
}
ArgumentNullException.ThrowIfNull(rule);

Type ruleType = rule.GetType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ public FilterExpressionNode FilterExpression
/// </param>
public void AddFilterExpressionProvider(IFilterExpressionProvider provider)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
ArgumentNullException.ThrowIfNull(provider);

this.filterExpressionProviders.Add(provider);
provider.FilterExpressionChanged += this.FilterProvider_FilterExpressionChanged;
Expand All @@ -162,10 +159,7 @@ public void AddFilterExpressionProvider(IFilterExpressionProvider provider)
/// </param>
public void RemoveFilterExpressionProvider(IFilterExpressionProvider provider)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
ArgumentNullException.ThrowIfNull(provider);

this.filterExpressionProviders.Remove(provider);
provider.FilterExpressionChanged -= this.FilterProvider_FilterExpressionChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public Exception Exception
/// </param>
public FilterExceptionEventArgs(Exception exception)
{
if (exception == null)
{
throw new ArgumentNullException("exception");
}
ArgumentNullException.ThrowIfNull(exception);

this.Exception = exception;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ public FilterExpressionAndOperatorNode()
/// </param>
public FilterExpressionAndOperatorNode(IEnumerable<FilterExpressionNode> children)
{
if (children == null)
{
throw new ArgumentNullException("children");
}
ArgumentNullException.ThrowIfNull(children);

this.children.AddRange(children);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ public FilterRule Rule
/// </param>
public FilterExpressionOperandNode(FilterRule rule)
{
if (rule == null)
{
throw new ArgumentNullException("rule");
}
ArgumentNullException.ThrowIfNull(rule);

this.Rule = rule;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ public FilterExpressionOrOperatorNode()
/// </param>
public FilterExpressionOrOperatorNode(IEnumerable<FilterExpressionNode> children)
{
if (children == null)
{
throw new ArgumentNullException("children");
}
ArgumentNullException.ThrowIfNull(children);

this.children.AddRange(children);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public static FilterRuleCustomizationFactory FactoryInstance

set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
ArgumentNullException.ThrowIfNull(value);

factoryInstance = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public static class FilterRuleExtensions
/// </returns>
public static FilterRule DeepCopy(this FilterRule rule)
{
if (rule == null)
{
throw new ArgumentNullException("rule");
}
ArgumentNullException.ThrowIfNull(rule);

Debug.Assert(rule.GetType().IsSerializable, "rule is serializable");

Expand Down
Loading