From d20292f211943dda2a3b00461a92a9ce559fa63e Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 14:49:00 +0300 Subject: [PATCH 01/64] Fix CS8625 in base/common files. --- src/IgniteUI.Blazor.Lite.csproj | 4 +- src/componentsBase/BaseCollection.cs | 16 +-- src/componentsBase/BaseRendererControl.cs | 116 +++++++++--------- src/componentsBase/BaseRendererElement.cs | 44 +++---- src/componentsBase/CollectionAdapter.cs | 6 +- src/componentsBase/DynamicContentHolder.cs | 4 +- .../IgbComponentRendererContainer.cs | 4 +- src/componentsBase/JsonDataSource.cs | 30 ++--- src/componentsBase/JsonDataSourceItem.cs | 26 ++-- src/componentsBase/JsonDataSourceSchema.cs | 25 ++-- src/componentsBase/JsonSerializable.cs | 6 +- src/componentsBase/RefSink.cs | 12 +- src/componentsBase/RendererMessage.cs | 6 +- src/componentsBase/RendererSerializer.cs | 8 +- src/componentsBase/RuntimeHelper.cs | 8 +- src/componentsBase/UnmarshalledDataSource.cs | 80 ++++++------ src/componentsBase/Utils.cs | 2 +- 17 files changed, 198 insertions(+), 199 deletions(-) diff --git a/src/IgniteUI.Blazor.Lite.csproj b/src/IgniteUI.Blazor.Lite.csproj index aa0d7a56..f774ad13 100644 --- a/src/IgniteUI.Blazor.Lite.csproj +++ b/src/IgniteUI.Blazor.Lite.csproj @@ -2,9 +2,7 @@ .Lite - - disable + enable diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 3dffcf47..2c9cd534 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -61,7 +61,7 @@ protected override void RemoveItem(int index) if (item is BaseRendererElement) { BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = null; + c.Parent = null!; } NotifyParent(); } @@ -78,7 +78,7 @@ protected override void SetItem(int index, T item) NotifyParent(); } - internal object Parent + internal object? Parent { get { @@ -90,9 +90,9 @@ internal object Parent } } - private object _parent = null; - private string _propertyName = null; - internal string PropertyName + private object? _parent = null; + private string? _propertyName = null; + internal string? PropertyName { get { @@ -104,7 +104,7 @@ internal string PropertyName } } - public BaseCollection(object parent, string propertyName) + public BaseCollection(object? parent, string? propertyName) { _parent = parent; _propertyName = propertyName; @@ -139,14 +139,14 @@ protected override void ClearItems() if (item is BaseRendererElement) { BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = null; + c.Parent = null!; } } base.ClearItems(); NotifyParent(); } - public void Serialize(SerializationContext context, string propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { //var vals = new List(); if (propertyName != null) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 906ccd84..3b0cf570 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -31,13 +31,15 @@ public enum ControlEventBehavior public partial class BaseRendererControl : ComponentBase, RefSink, JsonSerializable, IDisposable { - private IIgniteUIBlazor _igBlazor; + private static readonly SerializationFilter DefaultSerializationFilter = static (_, _) => true; + + private IIgniteUIBlazor? _igBlazor; [Inject] protected IIgniteUIBlazor IgBlazor { get { - return _igBlazor; + return _igBlazor!; } set { @@ -58,17 +60,17 @@ protected virtual void EnsureModulesLoaded() } - private IJSRuntime JsRuntime + private IJSRuntime? JsRuntime { get { - return IgBlazor != null ? IgBlazor.JsRuntime : null; + return _igBlazor != null ? _igBlazor.JsRuntime : null; } } - private IJSInProcessRuntime _inproc = null; + private IJSInProcessRuntime? _inproc = null; private bool _checkedInproc = false; - private IJSInProcessRuntime JsInProcessRuntime + private IJSInProcessRuntime? JsInProcessRuntime { get { @@ -83,25 +85,25 @@ private IJSInProcessRuntime JsInProcessRuntime } [Parameter] - public string Height + public string? Height { get; set; } [Parameter] - public string Width + public string? Width { get; set; } [Parameter] - public string Class + public string? Class { get; set; } [Parameter(CaptureUnmatchedValues = true)] - public Dictionary AdditionalAttributes { get; set; } + public Dictionary? AdditionalAttributes { get; set; } protected virtual string ParentTypeName { @@ -137,15 +139,15 @@ protected ControlEventBehavior ResolveEventBehavior() return EventBehavior; } - [Parameter] public RenderFragment ChildContent { get; set; } + [Parameter] public RenderFragment? ChildContent { get; set; } private ElementReference contEle; private Dictionary _isDirty = new Dictionary(); private Dictionary _isDirtyRef = new Dictionary(); private bool _hasDirty = false; private bool _serializeDirty = true; - private DataSourceManager _dataSourceManager; - internal DataSourceManager DataSourceManager + private DataSourceManager? _dataSourceManager; + internal DataSourceManager? DataSourceManager { get { return _dataSourceManager; } } @@ -171,7 +173,7 @@ internal string ContainerId [Parameter] public RoundTripDateConversion RoundTripDateConversion { get; set; } = RoundTripDateConversion.Auto; - private DotNetObjectReference _objRef; + private DotNetObjectReference? _objRef; private DotNetObjectReference GetObjectRef() { @@ -197,7 +199,7 @@ protected virtual string ResolveDisplay() return "block"; } - protected string ToSpinal(string value) + protected string? ToSpinal(string? value) { if (value == null) { @@ -390,7 +392,7 @@ protected virtual object TransformPotentialEnumValue(string key, object value) return value; } - private SequenceInfo _sequenceInfo = null; + private SequenceInfo? _sequenceInfo = null; protected virtual SequenceInfo BuildSequenceInfo(int startSequence) { @@ -401,7 +403,7 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) foreach (var prop in props) { bool isParam = false; - string wcName = null; + string? wcName = null; foreach (var attr in prop.GetCustomAttributes(true)) { if (attr.GetType().Name == "ParameterAttribute") @@ -421,7 +423,7 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) } var pType = prop.PropertyType; - Dictionary wcEnumTransform = null; + Dictionary? wcEnumTransform = null; if (pType != null) { if (pType.IsEnum) @@ -648,7 +650,7 @@ internal void UpdateTemplate(string templateId, object template, Type type) _contentTemplateTypes[templateId] = type; } - internal object FindTemplate(string templateId) + internal object? FindTemplate(string templateId) { if (_contentTemplates.ContainsKey(templateId)) { @@ -657,7 +659,7 @@ internal object FindTemplate(string templateId) return null; } - internal void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string args) + internal void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string? args) { switch (actionType) { @@ -701,20 +703,20 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin { DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; - object context = null; + object? context = null; if (args != null) { var argsDic = JsonSerializer.Deserialize>(args, SerializerOptions); - context = ConvertReturnValue(argsDic); + context = ConvertReturnValue(argsDic!); } - dynamicContent.UpdateContext(context); + dynamicContent.UpdateContext(context!); } break; } } } - protected Type TemplateContentType(string templateId) + protected Type? TemplateContentType(string templateId) { if (!_contentTemplateTypes.ContainsKey(templateId)) { @@ -725,7 +727,7 @@ protected Type TemplateContentType(string templateId) } private Dictionary> _dynamicContentBuilders = new Dictionary>(); - private DynamicContentInfo BuildDynamicContentInfo(string contentType, string templateId) + private DynamicContentInfo? BuildDynamicContentInfo(string contentType, string templateId) { var templateContentType = TemplateContentType(templateId); if (templateContentType != null) @@ -745,17 +747,17 @@ private DynamicContentInfo BuildDynamicContentInfo(string contentType, string te else { //TODO: other types - _dynamicContentBuilders[templateContentType] = () => null; + _dynamicContentBuilders[templateContentType] = () => null!; } } } else { //TODO: other types - _dynamicContentBuilders[templateContentType] = () => null; + _dynamicContentBuilders[templateContentType!] = () => null!; } - return _dynamicContentBuilders[templateContentType](); + return _dynamicContentBuilders[templateContentType!](); } protected virtual bool NeedsDynamicContent @@ -912,7 +914,7 @@ public virtual string Type } } - public void Serialize(SerializationContext context, string propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; @@ -929,7 +931,7 @@ public string Serialize() { using (Utf8JsonWriter uw = new Utf8JsonWriter(stream)) { - SerializationContext c = new SerializationContext(uw, null); + SerializationContext c = new SerializationContext(uw, DefaultSerializationFilter); //RendererSerializer ser = new RendererSerializer(uw); Serialize(c); @@ -947,17 +949,17 @@ public string Serialize() private Object _semLock = new Object(); static long _invokeId = 0; - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return await InvokeMethodHelper(null, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return InvokeMethodHelperSync(null, methodName, arguments, types, nativeElements); } - private JsonSerializerOptions _serializerOptions = null; + private JsonSerializerOptions? _serializerOptions = null; private JsonSerializerOptions SerializerOptions { get @@ -973,7 +975,7 @@ private JsonSerializerOptions SerializerOptions } } - internal object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + internal object InvokeMethodHelperSync(string? target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -1027,7 +1029,7 @@ internal object InvokeMethodHelperSync(string target, string methodName, object[ Dictionary> _methodTasks = new Dictionary>(); - internal async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + internal async Task InvokeMethodHelper(string? target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -1086,7 +1088,7 @@ internal async Task InvokeMethodHelper(string target, string methodName, return result; } - private string GetStringArg(object argument, string type) + private string? GetStringArg(object? argument, string type) { if (argument == null) { @@ -1184,7 +1186,7 @@ private string GetStringArg(object argument, string type) return argument.ToString(); } - internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) + internal void OnRefChanged(string propertyName, object? oldValue, object? newValue, bool isScript, bool isElement, Action refChanged) { _isDirtyRef[propertyName] = true; _isDirty[propertyName] = true; @@ -1213,8 +1215,8 @@ internal void OnRefChanged(string propertyName, object oldValue, object newValue using (var stream = new System.IO.MemoryStream()) using (var writer = new System.Text.Json.Utf8JsonWriter(stream)) { - var context = new SerializationContext(writer, null); - ((JsonSerializable)newValue).Serialize(context, null); + var context = new SerializationContext(writer, DefaultSerializationFilter); + ((JsonSerializable)newValue).Serialize(context); writer.Flush(); var json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); @@ -1405,7 +1407,7 @@ public void NotifyUpdateItem(object dataSource, int index, object refItem, bool _dataSourceManager.NotifyUpdateItem(refName, index, refItem, syncDataOnly); } - public void OnRefChanged(string refName, object refValue) + public void OnRefChanged(string refName, object? refValue) { RendererMessage m = new RendererMessage(); m.Type = ("refChanged"); @@ -1876,7 +1878,7 @@ internal T[] DowncastArray(object val) return (T[])val; } - internal object ConvertReturnValue(object returnValue, bool transformArrays = false, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object ConvertReturnValue(object returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { try { @@ -2368,7 +2370,7 @@ internal string ObjectToParam(object val) { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, null); + SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); ObjectToParam(c, val); w.Flush(); return System.Text.Encoding.UTF8.GetString(ms.ToArray()); @@ -2382,7 +2384,7 @@ internal string ObjectToParam(object val, Type type) { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, null); + SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); ObjectToParam(c, type, val); w.Flush(); return System.Text.Encoding.UTF8.GetString(ms.ToArray()); @@ -2671,7 +2673,7 @@ internal string ObjectArrayToParam(object[] arr) { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, null); + SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); w.WriteStartArray(); for (int i = 0; i < arr.Length; i++) { @@ -2794,12 +2796,12 @@ internal object[] ReturnToObjectArray(object val) } } - internal T[] ReturnToObjectArray(object val) + internal T[]? ReturnToObjectArray(object val) { return ReturnToObjectArray(val, null); } - internal T[] ReturnToObjectArray(object val, string typeGuess) + internal T[]? ReturnToObjectArray(object val, string? typeGuess) { if (val == null) { @@ -2808,7 +2810,7 @@ internal T[] ReturnToObjectArray(object val, string typeGuess) val = ConvertReturnValue(val); try { - var arr = JsonSerializer.Deserialize[]>((string)val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize[]>(val.ToString(), SerializerOptions); T[] ret = new T[arr.Length]; for (int i = 0; i < arr.Length; i++) { @@ -2936,7 +2938,7 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string } } - internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T : BaseRendererElement, new() + internal void SetHandler(string name, string propertyName, EventCallback? handler, Action? onArgs = null) where T : BaseRendererElement, new() { if (!handler.HasValue) { @@ -2956,7 +2958,7 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string onArgs(a); } var task = handler?.InvokeAsync(a); - if (task.Exception != null) + if (task?.Exception != null) { throw task.Exception; } @@ -2968,7 +2970,7 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string _handlers[name + "/" + propertyName] = inner; } - internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) + internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action? onArgs = null) { if (!handler.HasValue) { @@ -2985,7 +2987,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac onArgs(a); } var task = handler?.InvokeAsync(a); - if (task.Exception != null) + if (task?.Exception != null) { throw task.Exception; } @@ -2995,7 +2997,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac _handlers[name + "/" + propertyName] = inner; } - internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T : BaseRendererElement, new() + internal void SetActionHandler(string name, string propertyName, Action handler, Action? onArgs = null) where T : BaseRendererElement, new() { if (handler == null) { @@ -3023,7 +3025,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac _handlers[name + "/" + propertyName] = inner; } - internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) + internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action? onArgs = null) { if (handler == null) { @@ -3354,7 +3356,7 @@ public interface IIgniteUIBlazorSettings { bool ForceJsonDataMarshalling { get; } IgniteUIJsonSerializerOptions JsonSerializerOptions { get; } - ReadOnlyCollection ModulesToLoad { get; } + ReadOnlyCollection? ModulesToLoad { get; } } public class IgniteUIBlazorSettings @@ -3362,7 +3364,7 @@ public class IgniteUIBlazorSettings { public bool ForceJsonDataMarshalling { get; private set; } public IgniteUIJsonSerializerOptions JsonSerializerOptions { get; private set; } - public ReadOnlyCollection ModulesToLoad { get; private set; } + public ReadOnlyCollection? ModulesToLoad { get; private set; } public IgniteUIBlazorSettings() { @@ -3536,7 +3538,7 @@ public bool IsRuntimeValid(bool reevaluate = false) public class SequenceInfo { - private ReadOnlyCollection _attributeKeys = null; + private ReadOnlyCollection? _attributeKeys = null; public ReadOnlyCollection AttributeKeys { get @@ -3593,7 +3595,7 @@ internal string TransformEnumValue(string attributeKey, string fieldName) return fieldName; } - internal void AddSequence(string attributeKey, string wcName = null, Dictionary wcEnumTransform = null) + internal void AddSequence(string attributeKey, string? wcName = null, Dictionary? wcEnumTransform = null) { if (!_keysSet.Contains(attributeKey)) { diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index f6c2af87..ca39ecbc 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -207,8 +207,8 @@ protected void OnElementNameChanged(BaseRendererElement element, string oldName, } } - private object _tempParent = null; - internal object TempParent + private object? _tempParent = null; + internal object? TempParent { get { @@ -220,14 +220,14 @@ internal object TempParent } } - private Object _parent = null; + private Object? _parent = null; private class RefChange { - public String propertyName; - public Object oldValue; - public Object newValue; - public Action refChanged; + public String propertyName = null!; + public Object? oldValue; + public Object? newValue; + public Action refChanged = null!; public bool isScript; public bool isElement; } @@ -235,7 +235,7 @@ private class RefChange private List _queuedTemplateUpdates = new List(); private List _deferredNameChanges = new List(); - private void QueueRefChange(String propertyName, Object oldValue, Object newValue, bool isScript, bool isElement, Action refChanged) + private void QueueRefChange(String propertyName, Object? oldValue, Object? newValue, bool isScript, bool isElement, Action refChanged) { RefChange c = new RefChange(); c.propertyName = propertyName; @@ -257,7 +257,7 @@ private void FlushRefs() } } - public object Parent + public object? Parent { get { @@ -265,7 +265,7 @@ public object Parent } internal set { - Object oldParent = _parent; + Object? oldParent = _parent; _parent = value; _serializeDirty = true; if (_parent != null) @@ -327,17 +327,17 @@ protected virtual string MethodTarget } } - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return await InvokeMethodHelper(MethodTarget, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return InvokeMethodHelperSync(MethodTarget, methodName, arguments, types, nativeElements); } - protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (CurrParent == null) { @@ -353,7 +353,7 @@ protected async Task InvokeMethodHelper(string target, string methodName } } - protected object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + protected object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (CurrParent == null) { @@ -410,7 +410,7 @@ internal void UpdateTemplate(string contentType, object template, Type type) } } - internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) + internal void OnRefChanged(string propertyName, object? oldValue, object? newValue, bool isScript, bool isElement, Action refChanged) { _isDirtyRef[propertyName] = true; _isDirty[propertyName] = true; @@ -523,7 +523,7 @@ public virtual string Type } } - public void Serialize(SerializationContext context, string propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; @@ -736,7 +736,7 @@ internal T[] ReturnToObjectArray(Object val) { return ReturnToObjectArray(val, null); } - internal T[] ReturnToObjectArray(Object val, string typeGuess) + internal T[] ReturnToObjectArray(Object val, string? typeGuess) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -866,7 +866,7 @@ internal bool ReturnToBoolean(object val) } } - internal object ConvertReturnValue(object val, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object ConvertReturnValue(object val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -907,7 +907,7 @@ internal T[] DowncastArray(object val) private List _deferredHandlers = new List(); - internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T : BaseRendererElement, new() + internal void SetHandler(string name, string propertyName, EventCallback? handler, Action? onArgs = null) where T : BaseRendererElement, new() { Action add = () => { @@ -929,7 +929,7 @@ internal T[] DowncastArray(object val) add(); } - internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) + internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action? onArgs = null) { Action add = () => { @@ -951,7 +951,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac add(); } - internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T : BaseRendererElement, new() + internal void SetActionHandler(string name, string propertyName, Action handler, Action? onArgs = null) where T : BaseRendererElement, new() { Action add = () => { @@ -974,7 +974,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac } - internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) + internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action? onArgs = null) { Action add = () => { diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index e6720be8..6746c3a6 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -18,7 +18,7 @@ internal class CollectionAdapter private bool _hasShiftedOnceAlready; - public CollectionAdapter(IList query, IList target, IList allList, Func toTarget, Action onItemAdded, Action onItemRemoved, Func collisionChecker = null) + public CollectionAdapter(IList query, IList target, IList allList, Func toTarget, Action onItemAdded, Action onItemRemoved, Func? collisionChecker = null) { if (collisionChecker != null) { @@ -40,9 +40,9 @@ public CollectionAdapter(IList query, IList target, IList allList, Func } } - private Func _collisionChecker = null; + private Func? _collisionChecker = null; - public Func CollisionChecker + public Func? CollisionChecker { get { diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 4e271a06..4b03ed62 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -119,8 +119,8 @@ public string RefDivName } } - private object _component = null; - public object Component + private object? _component = null; + public object? Component { get { diff --git a/src/componentsBase/IgbComponentRendererContainer.cs b/src/componentsBase/IgbComponentRendererContainer.cs index 977f9777..6cee0a20 100644 --- a/src/componentsBase/IgbComponentRendererContainer.cs +++ b/src/componentsBase/IgbComponentRendererContainer.cs @@ -25,8 +25,8 @@ public Type ComponentType } } - private object _rootComponent = null; - public object RootComponent + private object? _rootComponent = null; + public object? RootComponent { get { diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 36641103..d3d03913 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -48,9 +48,9 @@ public JSDataSourceType DataSourceType } public bool IsSent { get; set; } - private object _originalData; + private object? _originalData; - public string GetDataIntentsAsJson() + public string? GetDataIntentsAsJson() { if (_schema != null) { @@ -63,16 +63,16 @@ public string GetDataIntentsAsJson() private Dictionary _uuidToItem = new Dictionary(); private Dictionary _itemToOriginal = new Dictionary(); private Dictionary _originalToItem = new Dictionary(); - private JSDataSourceSchema _parentSchema = null; - private DataSourceManager _manager = null; - private string _parentId = null; + private JSDataSourceSchema? _parentSchema = null; + private DataSourceManager? _manager = null; + private string? _parentId = null; private bool _dateCacheReady = false; private Dictionary> _subDataSources = new Dictionary>(); public bool DateCacheReady { get { return _dateCacheReady; } } - public static IJSDataSource CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { if (data == null) { @@ -279,7 +279,7 @@ public IJSDataSourceItem FromOriginal(object item) return null; } - public Object ToOriginal(IJSDataSourceItem item) + public Object? ToOriginal(IJSDataSourceItem item) { if (item == null) { @@ -294,7 +294,7 @@ public Object ToOriginal(IJSDataSourceItem item) return null; } - public static IJSDataSource Create(Object data, DataSourceManager manager) + public static IJSDataSource? Create(Object data, DataSourceManager manager) { if (data == null) { @@ -316,7 +316,7 @@ public static IJSDataSource Create(Object data, DataSourceManager manager) return null; } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema? schema, DataSourceManager manager, string? parentId) { JsonDataSource newData = new JsonDataSource(); newData._manager = manager; @@ -330,7 +330,7 @@ private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourc return newData; } - private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema? schema, DataSourceManager manager, string? parentId) { //Console.WriteLine("test json"); //DateTime testTime = DateTime.Now; @@ -353,7 +353,7 @@ private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema sche return newData; } - private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema? schema, DataSourceManager manager, string? parentId) { JsonDataSource newData = new JsonDataSource(); newData._parentSchema = schema; @@ -367,9 +367,9 @@ private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema s return newData; } - private JSDataSourceSchema _schema = null; + private JSDataSourceSchema? _schema = null; - private void Add(object item) + private void Add(object? item) { if (_schema == null) { @@ -422,7 +422,7 @@ private void OnAddItem(IJSDataSourceItem itemJson, Object item) } } - private void EnsureSchema(object item) + private void EnsureSchema(object? item) { if (item != null && _schema == null) { @@ -463,7 +463,7 @@ public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem return itemJson; } - private void OnRemove(IJSDataSourceItem itemJson, object item) + private void OnRemove(IJSDataSourceItem itemJson, object? item) { if (_uuidToItem.ContainsKey(itemJson.Id)) { diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 2895feef..9612f11c 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -9,8 +9,8 @@ internal class JsonDataSourceItem private Guid _id; private bool _isNull = false; private bool _isDataSource = true; - private IJSDataSource _source = null; - private string _parentId = null; + private IJSDataSource? _source = null; + private string? _parentId = null; private Dictionary _values = new Dictionary(); private Dictionary _valueTypes = new Dictionary(); @@ -39,12 +39,12 @@ public Guid Id } } - public IJSDataSource Source + public IJSDataSource? Source { get { return _source; } } - public string ParentId + public string? ParentId { get { @@ -52,7 +52,7 @@ public string ParentId } } - public object GetValue(string key) + public object? GetValue(string key) { if (_values.ContainsKey(key)) return _values[key]; @@ -60,7 +60,7 @@ public object GetValue(string key) return null; } - public static JSDataSourceSchema ExtractSchema(object item) + public static JSDataSourceSchema? ExtractSchema(object? item) { if (item == null) { @@ -112,14 +112,14 @@ public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, JsonDataSourceItem parentItem) + public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema, DataSourceManager manager, JsonDataSourceItem parentItem) { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem._parentId = parentItem.ParentId != null ? parentItem.ParentId + "/" + parentItem.Id.ToString() : parentItem.Id.ToString(); newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema, DataSourceManager? manager, string? parentId) { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem._parentId = parentId; @@ -139,8 +139,8 @@ public void Refresh(object item, JSDataSourceSchema schema, DataSourceManager ma Read(item, schema, manager); } - private JSDataSourceSchema _schema = null; - private void Read(Object item, JSDataSourceSchema schema, DataSourceManager manager) + private JSDataSourceSchema? _schema = null; + private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? manager) { if (schema == null || item == null) { @@ -198,14 +198,14 @@ public string ToJson() } - public void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer, string parentKey = null) + public void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer, string? parentKey = null) { if (_isNull) { return; } - if (_schema.IsDataSource) + if (_schema?.IsDataSource == true) { var itemSchema = _schema.GetSubSchema("Items"); GetDateCacheAsJson(itemSchema, writer, parentKey + "[]"); @@ -215,7 +215,7 @@ public void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer, string pa GetDateCacheAsJson(_schema, writer, parentKey); } } - public void GetDateCacheAsJson(JSDataSourceSchema schema, System.Text.Json.Utf8JsonWriter writer, string parentKey = null) + public void GetDateCacheAsJson(JSDataSourceSchema? schema, System.Text.Json.Utf8JsonWriter writer, string? parentKey = null) { if (schema == null) { diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index da24de5f..05021854 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -79,7 +79,7 @@ private bool HasDataIntents() return false; } - private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8JsonWriter uw) + private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8JsonWriter uw) { if (propertyName != null) { @@ -192,7 +192,7 @@ private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8Js uw.WriteEndObject(); } - public string GetDataIntentsAsJson() + public string? GetDataIntentsAsJson() { if (!HasDataIntents()) { @@ -257,16 +257,15 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) { if (key is string) { - if (item[key] == null) + var keyValue = item[key]; + if (keyValue == null) { continue; } - - List dataIntents = null; names.Add((string)key); s._buildingPropertiesDataIntents.Add(null); - Type ret = item[key].GetType(); + var ret = keyValue.GetType(); types.Add(ret); JSDataSourceSchemaType type = s.ResolveSchemaType(ret); @@ -486,9 +485,9 @@ public String RenderDate(object value) return "null"; } - private JSDataSourceSchema _itemSchema = null; + private JSDataSourceSchema? _itemSchema = null; - public JSDataSourceSchema ItemSchema + public JSDataSourceSchema? ItemSchema { get { @@ -505,12 +504,12 @@ public JSDataSourceSchema ItemSchema private List _buildingProperties = new List(); private List _buildingPropertiesTypes = new List(); - private List _buildingPropertiesDataIntents = new List(); + private List _buildingPropertiesDataIntents = new List(); private List _buildingFields = new List(); private List _buildingFieldsTypes = new List(); - private List _buildingFieldsDataIntents = new List(); + private List _buildingFieldsDataIntents = new List(); - private Dictionary _subSchemas = new Dictionary(); + private Dictionary _subSchemas = new Dictionary(); public bool IsNullable(string propertyName) { @@ -732,14 +731,14 @@ public void AddField(FieldInfo curr) public Delegate[] TypedPropertyGetters; public Delegate[] TypedFieldGetters; public JSDataSourceSchemaType[] PropertyTypes; - public IDataIntentAttribute[][] PropertyDataIntents; + public IDataIntentAttribute[]?[] PropertyDataIntents; public System.Text.Json.JsonEncodedText[] JsonPropertyNames; public System.Text.Json.JsonEncodedText[] JsonFieldNames; public String[] PropertyNames; public String[] FieldNames; public FieldInfo[] Fields; public JSDataSourceSchemaType[] FieldTypes; - public IDataIntentAttribute[][] FieldDataIntents; + public IDataIntentAttribute[]?[] FieldDataIntents; private System.Linq.Expressions.UnaryExpression GetConversion(Type type, System.Linq.Expressions.Expression expression) { diff --git a/src/componentsBase/JsonSerializable.cs b/src/componentsBase/JsonSerializable.cs index 4e041a7f..e13a6bed 100644 --- a/src/componentsBase/JsonSerializable.cs +++ b/src/componentsBase/JsonSerializable.cs @@ -5,9 +5,9 @@ namespace IgniteUI.Blazor.Controls public class SerializationContext { public System.Text.Json.Utf8JsonWriter Writer { get; set; } - public SerializationFilter Filter { get; set; } + public SerializationFilter? Filter { get; set; } - public SerializationContext(System.Text.Json.Utf8JsonWriter writer, SerializationFilter filter) + public SerializationContext(System.Text.Json.Utf8JsonWriter writer, SerializationFilter? filter) { Writer = writer; Filter = filter; @@ -16,7 +16,7 @@ public SerializationContext(System.Text.Json.Utf8JsonWriter writer, Serializatio public interface JsonSerializable { - void Serialize(SerializationContext writer, string propertyName = null); + void Serialize(SerializationContext writer, string? propertyName = null); } } diff --git a/src/componentsBase/RefSink.cs b/src/componentsBase/RefSink.cs index 9fd674d2..eceaa460 100644 --- a/src/componentsBase/RefSink.cs +++ b/src/componentsBase/RefSink.cs @@ -3,11 +3,11 @@ namespace IgniteUI.Blazor.Controls internal interface RefSink { - void OnRefChanged(String refName, Object refValue); - void OnRefNotifyInsertItem(IJSDataSource dataSource, String refName, int index, Object refItem); - void OnRefNotifyRemoveItem(IJSDataSource dataSource, String refName, int index, Object oldItem); - void OnRefNotifyClearItems(IJSDataSource dataSource, String refName, Object refValue); - void OnRefNotifySetItem(IJSDataSource dataSource, String refName, int index, Object oldItem, Object newItem); - void OnRefNotifyUpdateItem(IJSDataSource dataSource, String refName, int index, Object refItem, bool syncDataOnly); + void OnRefChanged(String refName, Object? refValue); + void OnRefNotifyInsertItem(IJSDataSource dataSource, String refName, int index, Object? refItem); + void OnRefNotifyRemoveItem(IJSDataSource dataSource, String refName, int index, Object? oldItem); + void OnRefNotifyClearItems(IJSDataSource dataSource, String refName, Object? refValue); + void OnRefNotifySetItem(IJSDataSource dataSource, String refName, int index, Object? oldItem, Object? newItem); + void OnRefNotifyUpdateItem(IJSDataSource dataSource, String refName, int index, Object? refItem, bool syncDataOnly); } } diff --git a/src/componentsBase/RendererMessage.cs b/src/componentsBase/RendererMessage.cs index 06297815..0412f476 100644 --- a/src/componentsBase/RendererMessage.cs +++ b/src/componentsBase/RendererMessage.cs @@ -5,8 +5,8 @@ namespace IgniteUI.Blazor.Controls internal class RendererMessage { private Dictionary _data = new Dictionary(); - private String _type = null; - public string Type + private String? _type = null; + public string? Type { get { @@ -35,7 +35,7 @@ public string ToJson() return "{" + string.Join(",\n", props) + "}"; } - public ElementReference[] NativeElements { get; set; } + public ElementReference[]? NativeElements { get; set; } } } diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index cfa25a68..0af1f19b 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -21,9 +21,9 @@ public RendererSerializer(SerializationContext context, ComponentBase component, private SerializationContext _context; //private List _properties = new List(); - private string _type = null; + private string? _type = null; - public string Type + public string? Type { get { @@ -64,7 +64,7 @@ public void AddStringProp(string propertyName, string value) //_properties.Add("\"" + propertyName + "\"" + ": \"" + (value == null ? "null" : value) + "\""); } - public void AddPrimitiveProp(object val) + public void AddPrimitiveProp(object? val) { if (val is Array) { @@ -356,7 +356,7 @@ public void AddDateTimeProp(String propertyName, DateTime? value) //_properties.Add("\"" + propertyName + "\"" + ": \"" + value.ToString("o") + "\""); } - public void Start(string propertyName = null) + public void Start(string? propertyName = null) { if (propertyName != null) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index b685dc57..d7233089 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -10,7 +10,7 @@ internal class RuntimeHelper #if NET5_0 private IJSUnmarshalledRuntime _unmarshalledRuntime; #else - private Func _callSendUnmarshalledColumnMessage; + private Func _callSendUnmarshalledColumnMessage; private Func _callSendUnmarshalledColumnDataIntentMessage; #endif private IJSInProcessRuntime _inprocRuntime; @@ -72,7 +72,7 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) indexParam, columnsParam); _callSendUnmarshalledColumnMessage = - (Func)Expression.Lambda( + (Func)Expression.Lambda( call, jsRuntimeParam, methodNameParam, refNameParam, indexParam, columnsParam).Compile(); } @@ -105,12 +105,12 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) } } - public unsafe string SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn[] columns) + public unsafe string SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn?[]? columns) { #if NET5_0 if (_unmarshalledRuntime != null) { - return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, index, columns); + return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, index, columns); } #else if (_callSendUnmarshalledColumnMessage != null) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 9c6d4bd4..65f33657 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -20,21 +20,21 @@ public UnmarshalledColumnData() public string PropertyPath { get; set; } public JSDataSourceSchemaType Type { get; set; } - public int[] IntValues { get; set; } - public long[] LongValues { get; set; } - public double[] DoubleValues { get; set; } - public string[] StringValues { get; set; } - public bool[] NullValues { get; set; } - public Guid[] IDValues { get; set; } - public UnmarshalledColumn[][] SubDataSourceValues; + public int[]? IntValues { get; set; } + public long[]? LongValues { get; set; } + public double[]? DoubleValues { get; set; } + public string?[]? StringValues { get; set; } + public bool[]? NullValues { get; set; } + public Guid[]? IDValues { get; set; } + public UnmarshalledColumn?[]?[]? SubDataSourceValues; public UnmarshalledColumn Column { get; set; } public bool IsObjectColumn { get; set; } - public UnmarshalledColumnData[] SubColumns { get; set; } - public JSDataSourceSchema SubSchema { get; set; } - public Action Insert { get; internal set; } + public UnmarshalledColumnData[]? SubColumns { get; set; } + public JSDataSourceSchema? SubSchema { get; set; } + public Action Insert { get; internal set; } public Action Update { get; internal set; } public Action Remove { get; internal set; } public bool IsIDColumn { get; internal set; } @@ -66,7 +66,7 @@ internal struct UnmarshalledColumn [FieldOffset(40)] public string[] StringValues; [FieldOffset(40)] - public UnmarshalledColumn[][] SubDataSourceValues; + public UnmarshalledColumn?[][]? SubDataSourceValues; [FieldOffset(48)] public bool[] NullValues; } @@ -89,11 +89,11 @@ public JSDataSourceType DataSourceType private Dictionary _originalToUuid = new Dictionary(); //private Dictionary _stringToUuid = new Dictionary(); private RuntimeHelper _helper; - private JSDataSourceSchema _parentSchema = null; - private string _parentId; - private DataSourceManager _manager = null; + private JSDataSourceSchema? _parentSchema = null; + private string? _parentId; + private DataSourceManager? _manager = null; - private UnmarshalledColumnData[] _columns = null; + private UnmarshalledColumnData[]? _columns = null; private Dictionary> _subDataSources = new Dictionary>(); @@ -141,7 +141,7 @@ public UnmarshalledDataSource() }; } - private UnmarshalledColumnData[] AdjustCapacity(string parentPath, UnmarshalledColumnData[] columns, JSDataSourceSchema schema, int oldValue, int newValue) + private UnmarshalledColumnData[]? AdjustCapacity(string parentPath, UnmarshalledColumnData?[] columns, JSDataSourceSchema schema, int oldValue, int newValue) { //Console.WriteLine("adjusting capacity, oldValue: " + oldValue + ", newValue: " + newValue); DateTime start = DateTime.Now; @@ -713,14 +713,14 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa if (column.IsSubDataSource) { - UnmarshalledColumn[] cols = null; + UnmarshalledColumn?[]? cols = null; if (objVal != null) { var id = _idGetter(item); var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); - cols = sub.GetColumns(""); + cols = sub?.GetColumns(""); if (!_subDataSources.ContainsKey(id)) { @@ -796,15 +796,15 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa if (column.IsSubDataSource) { - UnmarshalledColumn[] cols = null; + UnmarshalledColumn?[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); var subcols = sub.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].ActualCount; - primcol.DataSourceID = subcols[0].DataSourceID; + primcol.ActualCount = subcols[0].GetValueOrDefault().ActualCount; + primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); int i = 0; @@ -858,7 +858,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - cols = new UnmarshalledColumn[subcols.Length + 1]; + cols = new UnmarshalledColumn?[subcols.Length + 1]; for (i = 0; i < subcols.Length; i++) { cols[i] = subcols[i]; @@ -1055,7 +1055,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa if (column.IsSubDataSource) { - UnmarshalledColumn[] cols = null; + UnmarshalledColumn?[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); @@ -1103,15 +1103,15 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa if (column.IsSubDataSource) { - UnmarshalledColumn[] cols = null; + UnmarshalledColumn?[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); var subcols = sub.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].ActualCount; - primcol.DataSourceID = subcols[0].DataSourceID; + primcol.ActualCount = subcols[0].GetValueOrDefault().ActualCount; + primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); int i = 0; @@ -1165,7 +1165,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - cols = new UnmarshalledColumn[subcols.Length + 1]; + cols = new UnmarshalledColumn?[subcols.Length + 1]; for (i = 0; i < subcols.Length; i++) { cols[i] = subcols[i]; @@ -1536,7 +1536,7 @@ private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) return JSDataSourceSchemaType.ObjectValue; } - private void GetColumns(string refName, UnmarshalledColumnData[] columns, List l) + private void GetColumns(string refName, UnmarshalledColumnData[] columns, List? l) { List toDrill = new List(); @@ -1573,9 +1573,9 @@ private void GetColumns(string refName, UnmarshalledColumnData[] columns, List(); + var l = new List(); GetColumns(refName, _columns, l); return l.ToArray(); } @@ -1628,7 +1628,7 @@ private void OnRemoveId(Guid oldId) } } - private UnmarshalledColumnData AdjustColumnCapacity(string parentPath, UnmarshalledColumnData column, JSDataSourceSchema schema, string propertyName, Delegate getter, Func untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) + private UnmarshalledColumnData AdjustColumnCapacity(string parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) { if (column == null) { @@ -1644,7 +1644,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string parentPath, Unmarshal var existingColumn = column.SubDataSourceValues; if (existingColumn == null || existingColumn.Length != newValue) { - var subColumn = new UnmarshalledColumn[newValue][]; + var subColumn = new UnmarshalledColumn?[newValue][]; if (existingColumn != null) { Array.Copy(existingColumn, subColumn, _size); @@ -2094,11 +2094,11 @@ public static IJSDataSource Create(Object data, DataSourceManager manager, Runti } return null; } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { return CreateFromIEnumerable(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { UnmarshalledDataSource newData = new UnmarshalledDataSource(); newData._helper = helper; @@ -2119,11 +2119,11 @@ private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string pare return newData; } - private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { return CreateFromIList(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromIList(IList data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIList(IList data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { //Console.WriteLine("test json"); //DateTime testTime = DateTime.Now; @@ -2168,11 +2168,11 @@ private static void EnsureParentSchema(UnmarshalledDataSource data) } } - private static IJSDataSource CreateFromArray(Array data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromArray(Array data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { return CreateFromArray(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromArray(Array data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromArray(Array data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) { UnmarshalledDataSource newData = new UnmarshalledDataSource(); newData._helper = helper; @@ -2192,7 +2192,7 @@ private static IJSDataSource CreateFromArray(Array data, string parentId, JSData return newData; } - private JSDataSourceSchema _schema = null; + private JSDataSourceSchema? _schema = null; private int _leadingNullItems = 0; @@ -2230,7 +2230,7 @@ private void EnsureLeadingNullsInserted(JSDataSourceSchema schema, UnmarshalledC } } - private void InsertItemAt(object item, int index, JSDataSourceSchema schema, UnmarshalledColumnData[] columns) + private void InsertItemAt(object? item, int index, JSDataSourceSchema schema, UnmarshalledColumnData[] columns) { EnsureLeadingNullsInserted(schema, columns); EnsureCapacity(_size + 1); diff --git a/src/componentsBase/Utils.cs b/src/componentsBase/Utils.cs index f89241bb..50c1a2cb 100644 --- a/src/componentsBase/Utils.cs +++ b/src/componentsBase/Utils.cs @@ -2,7 +2,7 @@ namespace IgniteUI.Blazor.Controls { internal static class Utils { - internal static bool TryGetWCEnumName(Type enumType, string enumMemberName, out string name) + internal static bool TryGetWCEnumName(Type enumType, string enumMemberName, out string? name) { name = null; From 92a5801abd566e9b6d90273ff4cd6f3f8dfb11a4 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 15:07:35 +0300 Subject: [PATCH 02/64] Fix CS8625 in component files. --- src/components/Blazor/Accordion.cs | 16 +++++------ src/components/Blazor/Banner.cs | 8 +++--- src/components/Blazor/ButtonBase.cs | 8 +++--- src/components/Blazor/ButtonGroup.cs | 8 +++--- src/components/Blazor/Calendar.cs | 4 +-- src/components/Blazor/Carousel.cs | 12 ++++---- src/components/Blazor/Chat.cs | 28 +++++++++--------- src/components/Blazor/CheckboxBase.cs | 12 ++++---- src/components/Blazor/Chip.cs | 8 +++--- src/components/Blazor/Combo.cs | 28 +++++++++--------- src/components/Blazor/DatePicker.cs | 24 ++++++++-------- src/components/Blazor/DateRangePicker.cs | 24 ++++++++-------- src/components/Blazor/DateTimeInput.cs | 16 +++++------ src/components/Blazor/DateTimeInputBase.cs | 8 +++--- src/components/Blazor/Dialog.cs | 8 +++--- src/components/Blazor/Dropdown.cs | 20 ++++++------- src/components/Blazor/ExpansionPanel.cs | 16 +++++------ src/components/Blazor/Icon.cs | 8 +++--- src/components/Blazor/IconButton.cs | 8 +++--- src/components/Blazor/Input.cs | 4 +-- src/components/Blazor/InputBase.cs | 12 ++++---- src/components/Blazor/MaskInput.cs | 12 ++++---- src/components/Blazor/NavDrawer.cs | 8 +++--- src/components/Blazor/Radio.cs | 12 ++++---- src/components/Blazor/RadioGroup.cs | 4 +-- src/components/Blazor/RangeSlider.cs | 8 +++--- src/components/Blazor/Rating.cs | 8 +++--- src/components/Blazor/Select.cs | 28 +++++++++--------- src/components/Blazor/Slider.cs | 8 +++--- src/components/Blazor/Snackbar.cs | 4 +-- src/components/Blazor/Splitter.cs | 12 ++++---- src/components/Blazor/Stepper.cs | 8 +++--- src/components/Blazor/Tabs.cs | 10 +++---- src/components/Blazor/Textarea.cs | 16 +++++------ src/components/Blazor/Tile.cs | 32 ++++++++++----------- src/components/Blazor/TileManager.cs | 32 ++++++++++----------- src/components/Blazor/Tooltip.cs | 20 ++++++------- src/components/Blazor/Tree.cs | 24 ++++++++-------- src/componentsBase/BaseRendererControl.cs | 2 +- src/componentsBase/WebInputs/Accordion.cs | 4 +-- src/componentsBase/WebInputs/Dropdown.cs | 2 +- src/componentsBase/WebInputs/Input.cs | 2 +- src/componentsBase/WebInputs/Rating.cs | 2 +- src/componentsBase/WebInputs/Select.cs | 2 +- src/componentsBase/WebInputs/TileManager.cs | 2 +- src/componentsBase/WebInputs/Tree.cs | 2 +- 46 files changed, 272 insertions(+), 272 deletions(-) diff --git a/src/components/Blazor/Accordion.cs b/src/components/Blazor/Accordion.cs index 8a8321e7..4d18c225 100644 --- a/src/components/Blazor/Accordion.cs +++ b/src/components/Blazor/Accordion.cs @@ -137,8 +137,8 @@ public void ShowAll() InvokeMethodSync("showAll", new object[] { }, new string[] { }); } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -209,8 +209,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -281,8 +281,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -353,8 +353,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Banner.cs b/src/components/Blazor/Banner.cs index 4cbf91d6..b4e6bbbd 100644 --- a/src/components/Blazor/Banner.cs +++ b/src/components/Blazor/Banner.cs @@ -157,8 +157,8 @@ public bool Toggle() return ReturnToBoolean(iv); } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -229,8 +229,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index a3dd622c..b256d44a 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -294,8 +294,8 @@ public void Click() InvokeMethodSync("click", new object[] { }, new string[] { }); } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -366,8 +366,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index 00d244d1..bd3ac09b 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -145,8 +145,8 @@ public void SetNativeElement(Object element) InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } - private string _selectRef = null; - private string _selectScript = null; + private string? _selectRef = null; + private string? _selectScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -217,8 +217,8 @@ public EventCallback Select } } - private string _deselectRef = null; - private string _deselectScript = null; + private string? _deselectRef = null; + private string? _deselectScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 1f37de61..2fc0bab7 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -341,8 +341,8 @@ public EventCallback ValuesChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 8c66218a..86460448 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -454,8 +454,8 @@ public bool Select(double index, CarouselAnimationDirection? animationDirection return ReturnToBoolean(iv); } - private string _slideChangedRef = null; - private string _slideChangedScript = null; + private string? _slideChangedRef = null; + private string? _slideChangedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -526,8 +526,8 @@ public EventCallback SlideChanged } } - private string _playingRef = null; - private string _playingScript = null; + private string? _playingRef = null; + private string? _playingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -598,8 +598,8 @@ public EventCallback Playing } } - private string _pausedRef = null; - private string _pausedScript = null; + private string? _pausedRef = null; + private string? _pausedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index 74368152..0d648827 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -147,8 +147,8 @@ public void ScrollToMessage(String messageId) InvokeMethodSync("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); } - private string _messageCreatedRef = null; - private string _messageCreatedScript = null; + private string? _messageCreatedRef = null; + private string? _messageCreatedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -219,8 +219,8 @@ public EventCallback MessageCreated } } - private string _messageReactRef = null; - private string _messageReactScript = null; + private string? _messageReactRef = null; + private string? _messageReactScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -291,8 +291,8 @@ public EventCallback MessageReact } } - private string _attachmentClickRef = null; - private string _attachmentClickScript = null; + private string? _attachmentClickRef = null; + private string? _attachmentClickScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -363,8 +363,8 @@ public EventCallback AttachmentClick } } - private string _typingChangeRef = null; - private string _typingChangeScript = null; + private string? _typingChangeRef = null; + private string? _typingChangeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -435,8 +435,8 @@ public EventCallback TypingChange } } - private string _inputFocusRef = null; - private string _inputFocusScript = null; + private string? _inputFocusRef = null; + private string? _inputFocusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -507,8 +507,8 @@ public EventCallback InputFocus } } - private string _inputBlurRef = null; - private string _inputBlurScript = null; + private string? _inputBlurRef = null; + private string? _inputBlurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -579,8 +579,8 @@ public EventCallback InputBlur } } - private string _inputChangeRef = null; - private string _inputChangeScript = null; + private string? _inputChangeRef = null; + private string? _inputChangeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 115581c3..0bab31cd 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -333,8 +333,8 @@ public EventCallback CheckedChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -440,8 +440,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -512,8 +512,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Chip.cs b/src/components/Blazor/Chip.cs index 03067857..c01aada8 100644 --- a/src/components/Blazor/Chip.cs +++ b/src/components/Blazor/Chip.cs @@ -212,8 +212,8 @@ public EventCallback SelectedChanged } } - private string _removeRef = null; - private string _removeScript = null; + private string? _removeRef = null; + private string? _removeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -284,8 +284,8 @@ public EventCallback Remove } } - private string _selectRef = null; - private string _selectScript = null; + private string? _selectRef = null; + private string? _selectScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index b2334725..4fa2b4a9 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -803,8 +803,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -910,8 +910,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -982,8 +982,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1054,8 +1054,8 @@ public EventCallback Blur } } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1126,8 +1126,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1198,8 +1198,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1270,8 +1270,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 449bb996..4804bc80 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -721,8 +721,8 @@ public EventCallback ValueChanged } } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -793,8 +793,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -865,8 +865,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -937,8 +937,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1009,8 +1009,8 @@ public EventCallback Closed } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1116,8 +1116,8 @@ internal void EnsureChangeHandled() } } - private string _inputRef = null; - private string _inputScript = null; + private string? _inputRef = null; + private string? _inputScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index df7e5490..2c8da819 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -850,8 +850,8 @@ public EventCallback ValueChanged } } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -922,8 +922,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -994,8 +994,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1066,8 +1066,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1138,8 +1138,8 @@ public EventCallback Closed } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1250,8 +1250,8 @@ internal void EnsureChangeHandled() } } - private string _inputRef = null; - private string _inputScript = null; + private string? _inputRef = null; + private string? _inputScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index effafd95..0d4d7043 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -151,8 +151,8 @@ public EventCallback ValueChanged } } - private string _inputOcurredRef = null; - private string _inputOcurredScript = null; + private string? _inputOcurredRef = null; + private string? _inputOcurredScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -223,8 +223,8 @@ public EventCallback InputOcurred } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -330,8 +330,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -402,8 +402,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index aff647f6..b0e479e9 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -442,7 +442,7 @@ public bool HasTimeParts() /// /// Sets the text selection range of the control. /// - public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) + public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String? direction = null) { await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } @@ -450,7 +450,7 @@ public async Task SetSelectionRangeAsync(double start = -1, double end = -1, Str /// /// Sets the text selection range of the control. /// - public void SetSelectionRange(double start = -1, double end = -1, String direction = null) + public void SetSelectionRange(double start = -1, double end = -1, String? direction = null) { InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } @@ -458,7 +458,7 @@ public void SetSelectionRange(double start = -1, double end = -1, String directi /// /// Replaces the selected text in the control and re-applies the mask. /// - public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) + public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String? selectMode = null) { await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } @@ -466,7 +466,7 @@ public async Task SetRangeTextAsync(String replacement, double start = -1, doubl /// /// Replaces the selected text in the control and re-applies the mask. /// - public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) + public void SetRangeText(String replacement, double start = -1, double end = -1, String? selectMode = null) { InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index b9cedb18..803429d3 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -269,8 +269,8 @@ public bool Toggle() return ReturnToBoolean(iv); } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -341,8 +341,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 176a7542..e5534f12 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -394,8 +394,8 @@ public void ClearSelection() InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -466,8 +466,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -538,8 +538,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -610,8 +610,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -682,8 +682,8 @@ public EventCallback Closed } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/ExpansionPanel.cs b/src/components/Blazor/ExpansionPanel.cs index 73690c57..5acc91d3 100644 --- a/src/components/Blazor/ExpansionPanel.cs +++ b/src/components/Blazor/ExpansionPanel.cs @@ -189,8 +189,8 @@ public bool Show() return ReturnToBoolean(iv); } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -261,8 +261,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -333,8 +333,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -405,8 +405,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Icon.cs b/src/components/Blazor/Icon.cs index e7f2e442..c54180b0 100644 --- a/src/components/Blazor/Icon.cs +++ b/src/components/Blazor/Icon.cs @@ -132,7 +132,7 @@ public void SetNativeElement(Object element) /// The unique name for the icon. /// The URL to fetch the SVG icon from. /// The collection to register the icon in. Defaults to default. - public async Task RegisterIconAsync(String name, String url, String collection = null) + public async Task RegisterIconAsync(String name, String url, String? collection = null) { await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -143,7 +143,7 @@ public async Task RegisterIconAsync(String name, String url, String collection = /// The unique name for the icon. /// The URL to fetch the SVG icon from. /// The collection to register the icon in. Defaults to default. - public void RegisterIcon(String name, String url, String collection = null) + public void RegisterIcon(String name, String url, String? collection = null) { InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -154,7 +154,7 @@ public void RegisterIcon(String name, String url, String collection = null) /// The unique name for the icon. /// The SVG markup as a string. /// The collection to register the icon in. Defaults to default. - public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) + public async Task RegisterIconFromTextAsync(String name, String iconText, String? collection = null) { await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -165,7 +165,7 @@ public async Task RegisterIconFromTextAsync(String name, String iconText, String /// The unique name for the icon. /// The SVG markup as a string. /// The collection to register the icon in. Defaults to default. - public void RegisterIconFromText(String name, String iconText, String collection = null) + public void RegisterIconFromText(String name, String iconText, String? collection = null) { InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } diff --git a/src/components/Blazor/IconButton.cs b/src/components/Blazor/IconButton.cs index 682635bc..4cdce599 100644 --- a/src/components/Blazor/IconButton.cs +++ b/src/components/Blazor/IconButton.cs @@ -149,7 +149,7 @@ public IconButtonVariant Variant /// The unique name for the icon. /// The URL to fetch the SVG icon from. /// The collection to register the icon in. Defaults to default. - public async Task RegisterIconAsync(String name, String url, String collection = null) + public async Task RegisterIconAsync(String name, String url, String? collection = null) { await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -160,7 +160,7 @@ public async Task RegisterIconAsync(String name, String url, String collection = /// The unique name for the icon. /// The URL to fetch the SVG icon from. /// The collection to register the icon in. Defaults to default. - public void RegisterIcon(String name, String url, String collection = null) + public void RegisterIcon(String name, String url, String? collection = null) { InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -171,7 +171,7 @@ public void RegisterIcon(String name, String url, String collection = null) /// The unique name for the icon. /// The SVG markup as a string. /// The collection to register the icon in. Defaults to default. - public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) + public async Task RegisterIconFromTextAsync(String name, String iconText, String? collection = null) { await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } @@ -182,7 +182,7 @@ public async Task RegisterIconFromTextAsync(String name, String iconText, String /// The unique name for the icon. /// The SVG markup as a string. /// The collection to register the icon in. Defaults to default. - public void RegisterIconFromText(String name, String iconText, String collection = null) + public void RegisterIconFromText(String name, String iconText, String? collection = null) { InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index da529be0..5b16749e 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -390,8 +390,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index 78db5728..5423cc27 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -254,8 +254,8 @@ public void SetCustomValidity(String message) InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); } - private string _inputOcurredRef = null; - private string _inputOcurredScript = null; + private string? _inputOcurredRef = null; + private string? _inputOcurredScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -329,8 +329,8 @@ public EventCallback InputOcurred } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -401,8 +401,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 4f6d2f93..71f9c892 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -165,7 +165,7 @@ public bool ReadOnly /// /// Sets the text selection range of the control. /// - public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) + public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String? direction = null) { await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } @@ -173,7 +173,7 @@ public async Task SetSelectionRangeAsync(double start = -1, double end = -1, Str /// /// Sets the text selection range of the control. /// - public void SetSelectionRange(double start = -1, double end = -1, String direction = null) + public void SetSelectionRange(double start = -1, double end = -1, String? direction = null) { InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } @@ -181,7 +181,7 @@ public void SetSelectionRange(double start = -1, double end = -1, String directi /// /// Replaces the selected text in the control and re-applies the mask. /// - public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) + public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String? selectMode = null) { await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } @@ -189,7 +189,7 @@ public async Task SetRangeTextAsync(String replacement, double start = -1, doubl /// /// Replaces the selected text in the control and re-applies the mask. /// - public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) + public void SetRangeText(String replacement, double start = -1, double end = -1, String? selectMode = null) { InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } @@ -225,8 +225,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index 1bcef029..ab09ea55 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -251,8 +251,8 @@ public bool Toggle() return ReturnToBoolean(iv); } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -323,8 +323,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index 1577d405..ebbf48d1 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -333,8 +333,8 @@ public EventCallback CheckedChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -440,8 +440,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -512,8 +512,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 849ef6ad..2d2c217a 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -158,8 +158,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/RangeSlider.cs b/src/components/Blazor/RangeSlider.cs index 25c18eaf..b00c22fa 100644 --- a/src/components/Blazor/RangeSlider.cs +++ b/src/components/Blazor/RangeSlider.cs @@ -129,8 +129,8 @@ public string ThumbLabelUpper } } - private string _inputRef = null; - private string _inputScript = null; + private string? _inputRef = null; + private string? _inputScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -201,8 +201,8 @@ public EventCallback Input } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index 84e3d586..3c4cd4b5 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -419,8 +419,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -526,8 +526,8 @@ internal void EnsureChangeHandled() } } - private string _hoverRef = null; - private string _hoverScript = null; + private string? _hoverRef = null; + private string? _hoverScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 23fd0918..a1868bdf 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -553,8 +553,8 @@ public EventCallback ValueChanged } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -660,8 +660,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -732,8 +732,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -804,8 +804,8 @@ public EventCallback Blur } } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -876,8 +876,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -948,8 +948,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -1020,8 +1020,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Slider.cs b/src/components/Blazor/Slider.cs index faf3f834..47b8ae7e 100644 --- a/src/components/Blazor/Slider.cs +++ b/src/components/Blazor/Slider.cs @@ -230,8 +230,8 @@ public EventCallback ValueChanged } } - private string _inputRef = null; - private string _inputScript = null; + private string? _inputRef = null; + private string? _inputScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -302,8 +302,8 @@ public EventCallback Input } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Snackbar.cs b/src/components/Blazor/Snackbar.cs index 1fda6695..2d014a17 100644 --- a/src/components/Blazor/Snackbar.cs +++ b/src/components/Blazor/Snackbar.cs @@ -78,8 +78,8 @@ public string ActionText } } - private string _actionRef = null; - private string _actionScript = null; + private string? _actionRef = null; + private string? _actionScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Splitter.cs b/src/components/Blazor/Splitter.cs index edacee57..3d6c01f9 100644 --- a/src/components/Blazor/Splitter.cs +++ b/src/components/Blazor/Splitter.cs @@ -303,8 +303,8 @@ public void Toggle(PanePosition position) InvokeMethodSync("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); } - private string _resizeStartRef = null; - private string _resizeStartScript = null; + private string? _resizeStartRef = null; + private string? _resizeStartScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -375,8 +375,8 @@ public EventCallback ResizeStart } } - private string _resizingRef = null; - private string _resizingScript = null; + private string? _resizingRef = null; + private string? _resizingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -447,8 +447,8 @@ public EventCallback Resizing } } - private string _resizeEndRef = null; - private string _resizeEndScript = null; + private string? _resizeEndRef = null; + private string? _resizeEndScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index 2dfd7f7b..d590a1e1 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -319,8 +319,8 @@ public void Reset() InvokeMethodSync("reset", new object[] { }, new string[] { }); } - private string _activeStepChangingRef = null; - private string _activeStepChangingScript = null; + private string? _activeStepChangingRef = null; + private string? _activeStepChangingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -391,8 +391,8 @@ public EventCallback ActiveStepChanging } } - private string _activeStepChangedRef = null; - private string _activeStepChangedScript = null; + private string? _activeStepChangedRef = null; + private string? _activeStepChangedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index ae860f76..6c311989 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -73,7 +73,7 @@ protected override string ParentTypeName private CollectionAdapter _tabsCollectionAdapter; private IgbTabs_TabCollection _allTabsCollection; - private IgbTabs_TabCollection _contentTabsCollection = null; + private IgbTabs_TabCollection? _contentTabsCollection = null; public IgbTabs_TabCollection ContentTabsCollection { @@ -87,7 +87,7 @@ public IgbTabs_TabCollection ContentTabsCollection return this._contentTabsCollection; } } - private IgbTabs_TabCollection _actualTabsCollection = null; + private IgbTabs_TabCollection? _actualTabsCollection = null; public IgbTabs_TabCollection ActualTabsCollection { @@ -125,7 +125,7 @@ public IgbTabs() : base() } - private IgbTabs_TabCollection _tabsCollection = null; + private IgbTabs_TabCollection? _tabsCollection = null; public IgbTabs_TabCollection TabsCollection { @@ -249,8 +249,8 @@ public void Select(String id) InvokeMethodSync("select", new object[] { StringToString(id) }, new string[] { "String" }); } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 710b67f9..34214f8c 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -548,8 +548,8 @@ public EventCallback ValueChanged } } - private string _inputRef = null; - private string _inputScript = null; + private string? _inputRef = null; + private string? _inputScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -620,8 +620,8 @@ public EventCallback Input } } - private string _changeRef = null; - private string _changeScript = null; + private string? _changeRef = null; + private string? _changeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -727,8 +727,8 @@ internal void EnsureChangeHandled() } } - private string _focusRef = null; - private string _focusScript = null; + private string? _focusRef = null; + private string? _focusScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -799,8 +799,8 @@ public EventCallback Focus } } - private string _blurRef = null; - private string _blurScript = null; + private string? _blurRef = null; + private string? _blurScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index 2e7c527f..7a484754 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -262,8 +262,8 @@ public void SetNativeElement(Object element) InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } - private string _tileFullscreenRef = null; - private string _tileFullscreenScript = null; + private string? _tileFullscreenRef = null; + private string? _tileFullscreenScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -334,8 +334,8 @@ public EventCallback TileFullscreen } } - private string _tileMaximizeRef = null; - private string _tileMaximizeScript = null; + private string? _tileMaximizeRef = null; + private string? _tileMaximizeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -406,8 +406,8 @@ public EventCallback TileMaximize } } - private string _tileDragStartRef = null; - private string _tileDragStartScript = null; + private string? _tileDragStartRef = null; + private string? _tileDragStartScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -478,8 +478,8 @@ public EventCallback TileDragStart } } - private string _tileDragEndRef = null; - private string _tileDragEndScript = null; + private string? _tileDragEndRef = null; + private string? _tileDragEndScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -550,8 +550,8 @@ public EventCallback TileDragEnd } } - private string _tileDragCancelRef = null; - private string _tileDragCancelScript = null; + private string? _tileDragCancelRef = null; + private string? _tileDragCancelScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -622,8 +622,8 @@ public EventCallback TileDragCancel } } - private string _tileResizeStartRef = null; - private string _tileResizeStartScript = null; + private string? _tileResizeStartRef = null; + private string? _tileResizeStartScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -694,8 +694,8 @@ public EventCallback TileResizeStart } } - private string _tileResizeEndRef = null; - private string _tileResizeEndScript = null; + private string? _tileResizeEndRef = null; + private string? _tileResizeEndScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -766,8 +766,8 @@ public EventCallback TileResizeEnd } } - private string _tileResizeCancelRef = null; - private string _tileResizeCancelScript = null; + private string? _tileResizeCancelRef = null; + private string? _tileResizeCancelScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index 44972fb6..41c4f1ee 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -274,8 +274,8 @@ public void LoadLayout(String data) InvokeMethodSync("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); } - private string _tileFullscreenRef = null; - private string _tileFullscreenScript = null; + private string? _tileFullscreenRef = null; + private string? _tileFullscreenScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -346,8 +346,8 @@ public EventCallback TileFullscreen } } - private string _tileMaximizeRef = null; - private string _tileMaximizeScript = null; + private string? _tileMaximizeRef = null; + private string? _tileMaximizeScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -418,8 +418,8 @@ public EventCallback TileMaximize } } - private string _tileDragStartRef = null; - private string _tileDragStartScript = null; + private string? _tileDragStartRef = null; + private string? _tileDragStartScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -490,8 +490,8 @@ public EventCallback TileDragStart } } - private string _tileDragEndRef = null; - private string _tileDragEndScript = null; + private string? _tileDragEndRef = null; + private string? _tileDragEndScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -562,8 +562,8 @@ public EventCallback TileDragEnd } } - private string _tileDragCancelRef = null; - private string _tileDragCancelScript = null; + private string? _tileDragCancelRef = null; + private string? _tileDragCancelScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -634,8 +634,8 @@ public EventCallback TileDragCancel } } - private string _tileResizeStartRef = null; - private string _tileResizeStartScript = null; + private string? _tileResizeStartRef = null; + private string? _tileResizeStartScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -706,8 +706,8 @@ public EventCallback TileResizeStart } } - private string _tileResizeEndRef = null; - private string _tileResizeEndScript = null; + private string? _tileResizeEndRef = null; + private string? _tileResizeEndScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -778,8 +778,8 @@ public EventCallback TileResizeEnd } } - private string _tileResizeCancelRef = null; - private string _tileResizeCancelScript = null; + private string? _tileResizeCancelRef = null; + private string? _tileResizeCancelScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index da430486..f662bf15 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -284,7 +284,7 @@ public void SetNativeElement(Object element) /// Shows the tooltip if not already showing. /// If is provided, it is set as a transient anchor. /// - public async Task ShowAsync(String target = null) + public async Task ShowAsync(String? target = null) { var iv = await InvokeMethod("show", new object[] { StringToString(target) }, new string[] { "String" }); return ReturnToBoolean(iv); @@ -294,7 +294,7 @@ public async Task ShowAsync(String target = null) /// Shows the tooltip if not already showing. /// If is provided, it is set as a transient anchor. /// - public bool Show(String target = null) + public bool Show(String? target = null) { var iv = InvokeMethodSync("show", new object[] { StringToString(target) }, new string[] { "String" }); return ReturnToBoolean(iv); @@ -334,8 +334,8 @@ public bool Toggle() return ReturnToBoolean(iv); } - private string _openingRef = null; - private string _openingScript = null; + private string? _openingRef = null; + private string? _openingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -406,8 +406,8 @@ public EventCallback Opening } } - private string _openedRef = null; - private string _openedScript = null; + private string? _openedRef = null; + private string? _openedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -478,8 +478,8 @@ public EventCallback Opened } } - private string _closingRef = null; - private string _closingScript = null; + private string? _closingRef = null; + private string? _closingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -550,8 +550,8 @@ public EventCallback Closing } } - private string _closedRef = null; - private string _closedScript = null; + private string? _closedRef = null; + private string? _closedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/components/Blazor/Tree.cs b/src/components/Blazor/Tree.cs index eae8fee9..f62b2df5 100644 --- a/src/components/Blazor/Tree.cs +++ b/src/components/Blazor/Tree.cs @@ -154,8 +154,8 @@ public void ConnectedCallback() InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); } - private string _selectionChangedRef = null; - private string _selectionChangedScript = null; + private string? _selectionChangedRef = null; + private string? _selectionChangedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -226,8 +226,8 @@ public EventCallback SelectionChanged } } - private string _itemExpandingRef = null; - private string _itemExpandingScript = null; + private string? _itemExpandingRef = null; + private string? _itemExpandingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -298,8 +298,8 @@ public EventCallback ItemExpanding } } - private string _itemExpandedRef = null; - private string _itemExpandedScript = null; + private string? _itemExpandedRef = null; + private string? _itemExpandedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -370,8 +370,8 @@ public EventCallback ItemExpanded } } - private string _itemCollapsingRef = null; - private string _itemCollapsingScript = null; + private string? _itemCollapsingRef = null; + private string? _itemCollapsingScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -442,8 +442,8 @@ public EventCallback ItemCollapsing } } - private string _itemCollapsedRef = null; - private string _itemCollapsedScript = null; + private string? _itemCollapsedRef = null; + private string? _itemCollapsedScript = null; /// /// Name of a client-side function that handles the event in the browser instead. @@ -514,8 +514,8 @@ public EventCallback ItemCollapsed } } - private string _activeItemRef = null; - private string _activeItemScript = null; + private string? _activeItemRef = null; + private string? _activeItemScript = null; /// /// Name of a client-side function that handles the event in the browser instead. diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 3b0cf570..34c7e1fb 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -2601,7 +2601,7 @@ internal string ReturnToString(object val) return val.ToString(); } - internal string StringToString(object val) + internal string? StringToString(object? val) { return val == null ? null : JsonSerializer.Serialize(val.ToString(), SerializerOptions); //return val == null ? null : val.ToString(); diff --git a/src/componentsBase/WebInputs/Accordion.cs b/src/componentsBase/WebInputs/Accordion.cs index 7977cd0f..2486c93a 100644 --- a/src/componentsBase/WebInputs/Accordion.cs +++ b/src/componentsBase/WebInputs/Accordion.cs @@ -13,7 +13,7 @@ protected override string ParentTypeName } } - private BaseCollection _contentItems = null; + private BaseCollection? _contentItems = null; internal BaseCollection ContentItems { @@ -33,7 +33,7 @@ internal BaseCollection ContentItems public partial class IgbExpansionPanel : IDisposable { [CascadingParameter(Name = "AccordionParent")] - protected BaseRendererControl AccordionParent + protected BaseRendererControl? AccordionParent { get; set; } diff --git a/src/componentsBase/WebInputs/Dropdown.cs b/src/componentsBase/WebInputs/Dropdown.cs index 983b8a35..241e4fab 100644 --- a/src/componentsBase/WebInputs/Dropdown.cs +++ b/src/componentsBase/WebInputs/Dropdown.cs @@ -86,7 +86,7 @@ protected override string ParentTypeName } } - private IgbDropdownItemCollection _contentItems = null; + private IgbDropdownItemCollection? _contentItems = null; public IgbDropdownItemCollection ContentItems { diff --git a/src/componentsBase/WebInputs/Input.cs b/src/componentsBase/WebInputs/Input.cs index 2a221294..2f2cac41 100644 --- a/src/componentsBase/WebInputs/Input.cs +++ b/src/componentsBase/WebInputs/Input.cs @@ -9,7 +9,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbInputBase : BaseRendererControl { [Inject] - internal ILogger Logger { get; set; } = default; + internal ILogger Logger { get; set; } = default!; private void EnsureInputOcurredHandled() { diff --git a/src/componentsBase/WebInputs/Rating.cs b/src/componentsBase/WebInputs/Rating.cs index 6f4da14e..cdda1021 100644 --- a/src/componentsBase/WebInputs/Rating.cs +++ b/src/componentsBase/WebInputs/Rating.cs @@ -7,7 +7,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbRating { [Inject] - private ILogger Logger { get; set; } = default; + private ILogger Logger { get; set; } = default!; /// public override Task SetParametersAsync(ParameterView parameters) diff --git a/src/componentsBase/WebInputs/Select.cs b/src/componentsBase/WebInputs/Select.cs index 7b4ed032..a3320e24 100644 --- a/src/componentsBase/WebInputs/Select.cs +++ b/src/componentsBase/WebInputs/Select.cs @@ -11,7 +11,7 @@ protected override string ParentTypeName } } - private BaseCollection _contentItems = null; + private BaseCollection? _contentItems = null; internal BaseCollection ContentItems { diff --git a/src/componentsBase/WebInputs/TileManager.cs b/src/componentsBase/WebInputs/TileManager.cs index f6e0afd3..016fc753 100644 --- a/src/componentsBase/WebInputs/TileManager.cs +++ b/src/componentsBase/WebInputs/TileManager.cs @@ -11,7 +11,7 @@ protected override string ParentTypeName } } - private BaseCollection _contentItems = null; + private BaseCollection? _contentItems = null; internal BaseCollection ContentItems { diff --git a/src/componentsBase/WebInputs/Tree.cs b/src/componentsBase/WebInputs/Tree.cs index bb8768fc..ef40159a 100644 --- a/src/componentsBase/WebInputs/Tree.cs +++ b/src/componentsBase/WebInputs/Tree.cs @@ -11,7 +11,7 @@ protected override string ParentTypeName } } - private IgbTreeItemCollection _contentItems = null; + private IgbTreeItemCollection? _contentItems = null; public IgbTreeItemCollection ContentItems { From 45e4784db0632c2c7454a13866fb85a780160030 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 16:57:54 +0300 Subject: [PATCH 03/64] Fix CS8618 by making uninitialized props nullable. --- .../Blazor/ActiveStepChangedEventArgs.cs | 6 +- .../Blazor/ActiveStepChangingEventArgs.cs | 6 +- src/components/Blazor/Avatar.cs | 14 +- src/components/Blazor/BaseOptionLike.cs | 6 +- src/components/Blazor/ButtonBase.cs | 18 +-- src/components/Blazor/ButtonGroup.cs | 6 +- src/components/Blazor/Calendar.cs | 10 +- src/components/Blazor/CalendarBase.cs | 10 +- .../Blazor/CalendarFormatOptions.cs | 10 +- .../Blazor/CalendarResourceStrings.cs | 58 +++---- src/components/Blazor/Carousel.cs | 10 +- src/components/Blazor/Chat.cs | 10 +- .../Blazor/ChatAttachmentRenderContext.cs | 6 +- src/components/Blazor/ChatDraftMessage.cs | 10 +- .../Blazor/ChatInputRenderContext.cs | 6 +- src/components/Blazor/ChatMessage.cs | 26 ++-- .../Blazor/ChatMessageAttachment.cs | 18 +-- .../Blazor/ChatMessageAttachmentEventArgs.cs | 6 +- src/components/Blazor/ChatMessageEventArgs.cs | 6 +- src/components/Blazor/ChatMessageReaction.cs | 10 +- .../Blazor/ChatMessageReactionEventArgs.cs | 6 +- .../Blazor/ChatMessageRenderContext.cs | 6 +- src/components/Blazor/ChatOptions.cs | 22 +-- src/components/Blazor/ChatRenderContext.cs | 6 +- src/components/Blazor/ChatRenderers.cs | 142 +++++++++--------- src/components/Blazor/CheckboxBase.cs | 6 +- .../Blazor/CheckboxChangeEventArgs.cs | 6 +- .../Blazor/CheckboxChangeEventArgsDetail.cs | 6 +- src/components/Blazor/CircularGradient.cs | 10 +- src/components/Blazor/Combo.cs | 60 ++++---- src/components/Blazor/ComboChangeEventArgs.cs | 6 +- .../Blazor/ComboChangeEventArgsDetail.cs | 18 +-- .../ComponentDataValueChangedEventArgs.cs | 6 +- .../Blazor/ComponentValueChangedEventArgs.cs | 6 +- src/components/Blazor/CustomDateRange.cs | 10 +- src/components/Blazor/DatePicker.cs | 38 ++--- src/components/Blazor/DateRangeDescriptor.cs | 4 +- src/components/Blazor/DateRangePicker.cs | 58 +++---- .../Blazor/DateRangeValueEventArgs.cs | 6 +- src/components/Blazor/DateTimeInputBase.cs | 34 ++--- src/components/Blazor/Dialog.cs | 10 +- .../Blazor/DropdownItemComponentEventArgs.cs | 6 +- .../ExpansionPanelComponentEventArgs.cs | 6 +- src/components/Blazor/FilteringOptions.cs | 6 +- src/components/Blazor/Highlight.cs | 6 +- src/components/Blazor/Icon.cs | 10 +- src/components/Blazor/IconButton.cs | 10 +- src/components/Blazor/IconMeta.cs | 6 +- src/components/Blazor/Input.cs | 14 +- src/components/Blazor/InputBase.cs | 10 +- src/components/Blazor/MaskInput.cs | 14 +- src/components/Blazor/NavDrawer.cs | 6 +- .../Blazor/NumberFormatSpecifier.cs | 54 +++---- src/components/Blazor/ProgressBase.cs | 6 +- src/components/Blazor/Radio.cs | 6 +- src/components/Blazor/RadioChangeEventArgs.cs | 6 +- .../Blazor/RadioChangeEventArgsDetail.cs | 6 +- src/components/Blazor/RadioGroup.cs | 6 +- src/components/Blazor/RangeSlider.cs | 10 +- .../Blazor/RangeSliderValueEventArgs.cs | 6 +- src/components/Blazor/Rating.cs | 10 +- src/components/Blazor/Select.cs | 10 +- src/components/Blazor/SelectGroup.cs | 6 +- .../Blazor/SelectItemComponentEventArgs.cs | 6 +- src/components/Blazor/SliderBase.cs | 14 +- src/components/Blazor/Snackbar.cs | 6 +- .../Blazor/SplitterResizeEventArgs.cs | 6 +- src/components/Blazor/Tab.cs | 8 +- .../Blazor/TabComponentEventArgs.cs | 6 +- src/components/Blazor/Tabs.cs | 6 +- src/components/Blazor/Textarea.cs | 26 ++-- .../Blazor/TileChangeStateEventArgs.cs | 6 +- .../Blazor/TileChangeStateEventArgsDetail.cs | 6 +- .../Blazor/TileComponentEventArgs.cs | 6 +- src/components/Blazor/ToggleButton.cs | 6 +- src/components/Blazor/Tooltip.cs | 18 +-- src/components/Blazor/TreeItem.cs | 14 +- .../Blazor/TreeItemComponentEventArgs.cs | 6 +- .../Blazor/TreeSelectionEventArgs.cs | 6 +- .../Blazor/TreeSelectionEventArgsDetail.cs | 6 +- src/componentsBase/BaseRendererControl.cs | 6 +- src/componentsBase/BaseRendererElement.cs | 6 +- src/componentsBase/CollectionAdapter.cs | 16 +- src/componentsBase/DataAdapters.cs | 8 +- src/componentsBase/DataSourceManager.cs | 6 +- src/componentsBase/DynamicContentHolder.cs | 18 +-- .../IgbComponentRendererContainer.cs | 10 +- src/componentsBase/IgbTemplateContent.razor | 8 +- src/componentsBase/JsonDataSourceSchema.cs | 30 ++-- src/componentsBase/RendererSerializer.cs | 8 +- src/componentsBase/RuntimeHelper.cs | 12 +- src/componentsBase/UnmarshalledDataSource.cs | 22 +-- src/componentsBase/WebInputs/DropdownItem.cs | 2 +- src/componentsBase/WebInputs/SelectItem.cs | 2 +- src/componentsBase/WebInputs/Tile.cs | 2 +- src/componentsBase/WebInputs/TreeItem.cs | 2 +- 96 files changed, 624 insertions(+), 624 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index d3b973c0..88778a80 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbActiveStepChangedEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbActiveStepChangedEventArgsDetail _detail; + private IgbActiveStepChangedEventArgsDetail? _detail; /// /// The payload of the event, carrying the index of the step that became active. /// [Parameter] - public IgbActiveStepChangedEventArgsDetail Detail + public IgbActiveStepChangedEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index ad2ff8c2..440dc1e0 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,14 +13,14 @@ public partial class IgbActiveStepChangingEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbActiveStepChangingEventArgsDetail _detail; + private IgbActiveStepChangingEventArgsDetail? _detail; /// /// The payload of the event, carrying the index of the currently active step and the index of /// the step that is about to become active. /// [Parameter] - public IgbActiveStepChangingEventArgsDetail Detail + public IgbActiveStepChangingEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/Avatar.cs b/src/components/Blazor/Avatar.cs index 72420855..89a55c4d 100644 --- a/src/components/Blazor/Avatar.cs +++ b/src/components/Blazor/Avatar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -59,13 +59,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _src; + private string? _src; /// /// The image source to use. /// [Parameter] - public string Src + public string? Src { get { return this._src; } set @@ -78,13 +78,13 @@ public string Src } } - private string _alt; + private string? _alt; /// /// Alternative text for the image. /// [Parameter] - public string Alt + public string? Alt { get { return this._alt; } set @@ -97,13 +97,13 @@ public string Alt } } - private string _initials; + private string? _initials; /// /// Initials to use as a fallback when no image is available. /// [Parameter] - public string Initials + public string? Initials { get { return this._initials; } set diff --git a/src/components/Blazor/BaseOptionLike.cs b/src/components/Blazor/BaseOptionLike.cs index 499ccbdf..3337d842 100644 --- a/src/components/Blazor/BaseOptionLike.cs +++ b/src/components/Blazor/BaseOptionLike.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -106,14 +106,14 @@ public bool Selected } } - private string _value; + private string? _value; /// /// The current value of the item. /// If not specified, the text content of the item is used. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index b256d44a..71558f96 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -77,7 +77,7 @@ public ButtonBaseType DisplayType } } - private string _href; + private string? _href; /// /// The URL the button points to. When set, the component renders as an @@ -86,7 +86,7 @@ public ButtonBaseType DisplayType /// for full anchor semantics. /// [Parameter] - public string Href + public string? Href { get { return this._href; } set @@ -99,7 +99,7 @@ public string Href } } - private string _download; + private string? _download; /// /// Prompts the browser to download the linked resource rather than navigating @@ -107,7 +107,7 @@ public string Href /// Only effective when is set. /// [Parameter] - public string Download + public string? Download { get { return this._download; } set @@ -148,7 +148,7 @@ public ButtonBaseTarget Target } } - private string _rel; + private string? _rel; /// /// The relationship between the current document and the linked URL. @@ -158,7 +158,7 @@ public ButtonBaseTarget Target /// strongly recommended for security. /// [Parameter] - public string Rel + public string? Rel { get { return this._rel; } set @@ -190,7 +190,7 @@ public bool Disabled } } - private string _command; + private string? _command; /// /// The command to invoke on the target element specified by . @@ -199,7 +199,7 @@ public bool Disabled /// Custom commands must start with two dashes (e.g. --my-command). /// [Parameter] - public string Command + public string? Command { get { return this._command; } set diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index bd3ac09b..349e8b4e 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -116,13 +116,13 @@ public ButtonGroupSelection Selection } } - private string[] _selectedItems; + private string[]? _selectedItems; /// /// Gets or sets the values of the currently selected buttons. /// [Parameter] - public string[] SelectedItems + public string[]? SelectedItems { get { return this._selectedItems; } set diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 2fc0bab7..145ec074 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -75,7 +75,7 @@ public DateTime GetCurrentValue() var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); return ReturnToDate(iv); } - private DateTime[] _values; + private DateTime[]? _values; /// /// The current values of the calendar. @@ -83,7 +83,7 @@ public DateTime GetCurrentValue() /// or . /// [Parameter] - public DateTime[] Values + public DateTime[]? Values { get { return this._values; } set @@ -254,13 +254,13 @@ public CalendarActiveView ActiveView } } - private IgbCalendarFormatOptions _formatOptions; + private IgbCalendarFormatOptions? _formatOptions; /// /// The options used to format the months and the weekdays in the calendar views. /// [Parameter] - public IgbCalendarFormatOptions FormatOptions + public IgbCalendarFormatOptions? FormatOptions { get { return this._formatOptions; } set diff --git a/src/components/Blazor/CalendarBase.cs b/src/components/Blazor/CalendarBase.cs index 90bf6b84..90d4daa0 100644 --- a/src/components/Blazor/CalendarBase.cs +++ b/src/components/Blazor/CalendarBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -88,13 +88,13 @@ public WeekDays WeekStart } } - private string _locale; + private string? _locale; /// /// Gets/Sets the locale used for formatting and displaying the dates in the component. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -107,13 +107,13 @@ public string Locale } } - private IgbCalendarResourceStrings _resourceStrings; + private IgbCalendarResourceStrings? _resourceStrings; /// /// The resource strings for localization. /// [Parameter] - public IgbCalendarResourceStrings ResourceStrings + public IgbCalendarResourceStrings? ResourceStrings { get { return this._resourceStrings; } set diff --git a/src/components/Blazor/CalendarFormatOptions.cs b/src/components/Blazor/CalendarFormatOptions.cs index 8dfbfa9b..244ba39c 100644 --- a/src/components/Blazor/CalendarFormatOptions.cs +++ b/src/components/Blazor/CalendarFormatOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,14 +13,14 @@ public partial class IgbCalendarFormatOptions : BaseRendererElement private static bool _marshalByValue = true; - private string _weekday; + private string? _weekday; /// /// The representation of the weekday names, one of long, short or narrow. /// Defaults to narrow. /// [Parameter] - public string Weekday + public string? Weekday { get { return this._weekday; } set @@ -33,14 +33,14 @@ public string Weekday } } - private string _month; + private string? _month; /// /// The representation of the month names, one of numeric, 2-digit, long, /// short or narrow. Defaults to long. /// [Parameter] - public string Month + public string? Month { get { return this._month; } set diff --git a/src/components/Blazor/CalendarResourceStrings.cs b/src/components/Blazor/CalendarResourceStrings.cs index 209dd066..5e0c4e22 100644 --- a/src/components/Blazor/CalendarResourceStrings.cs +++ b/src/components/Blazor/CalendarResourceStrings.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -7,10 +7,10 @@ public partial class IgbCalendarResourceStrings : BaseRendererElement /// public override string Type { get { return "WebCalendarResourceStrings"; } } - private string _selectMonth; + private string? _selectMonth; [Parameter] - public string SelectMonth + public string? SelectMonth { get { return this._selectMonth; } set @@ -23,10 +23,10 @@ public string SelectMonth } } - private string _selectYear; + private string? _selectYear; [Parameter] - public string SelectYear + public string? SelectYear { get { return this._selectYear; } set @@ -39,10 +39,10 @@ public string SelectYear } } - private string _selectDate; + private string? _selectDate; [Parameter] - public string SelectDate + public string? SelectDate { get { return this._selectDate; } set @@ -55,10 +55,10 @@ public string SelectDate } } - private string _selectRange; + private string? _selectRange; [Parameter] - public string SelectRange + public string? SelectRange { get { return this._selectRange; } set @@ -71,10 +71,10 @@ public string SelectRange } } - private string _selectedDate; + private string? _selectedDate; [Parameter] - public string SelectedDate + public string? SelectedDate { get { return this._selectedDate; } set @@ -87,10 +87,10 @@ public string SelectedDate } } - private string _startDate; + private string? _startDate; [Parameter] - public string StartDate + public string? StartDate { get { return this._startDate; } set @@ -103,10 +103,10 @@ public string StartDate } } - private string _endDate; + private string? _endDate; [Parameter] - public string EndDate + public string? EndDate { get { return this._endDate; } set @@ -119,10 +119,10 @@ public string EndDate } } - private string _previousMonth; + private string? _previousMonth; [Parameter] - public string PreviousMonth + public string? PreviousMonth { get { return this._previousMonth; } set @@ -135,10 +135,10 @@ public string PreviousMonth } } - private string _nextMonth; + private string? _nextMonth; [Parameter] - public string NextMonth + public string? NextMonth { get { return this._nextMonth; } set @@ -151,10 +151,10 @@ public string NextMonth } } - private string _previousYear; + private string? _previousYear; [Parameter] - public string PreviousYear + public string? PreviousYear { get { return this._previousYear; } set @@ -167,10 +167,10 @@ public string PreviousYear } } - private string _nextYear; + private string? _nextYear; [Parameter] - public string NextYear + public string? NextYear { get { return this._nextYear; } set @@ -183,10 +183,10 @@ public string NextYear } } - private string _previousYears; + private string? _previousYears; [Parameter] - public string PreviousYears + public string? PreviousYears { get { return this._previousYears; } set @@ -199,10 +199,10 @@ public string PreviousYears } } - private string _nextYears; + private string? _nextYears; [Parameter] - public string NextYears + public string? NextYears { get { return this._nextYears; } set @@ -215,10 +215,10 @@ public string NextYears } } - private string _weekLabel; + private string? _weekLabel; [Parameter] - public string WeekLabel + public string? WeekLabel { get { return this._weekLabel; } set diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 86460448..5c054b35 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -173,14 +173,14 @@ public CarouselIndicatorsOrientation IndicatorsOrientation } } - private string _indicatorsLabelFormat; + private string? _indicatorsLabelFormat; /// /// The format used to set the aria-label on the carousel indicators. /// Instances of {0} will be replaced with the index of the corresponding slide. /// [Parameter] - public string IndicatorsLabelFormat + public string? IndicatorsLabelFormat { get { return this._indicatorsLabelFormat; } set @@ -193,7 +193,7 @@ public string IndicatorsLabelFormat } } - private string _slidesLabelFormat; + private string? _slidesLabelFormat; /// /// The format used to set the aria-label on the carousel slides and the text displayed @@ -202,7 +202,7 @@ public string IndicatorsLabelFormat /// Instances of {1} will be replaced with the total amount of slides. /// [Parameter] - public string SlidesLabelFormat + public string? SlidesLabelFormat { get { return this._slidesLabelFormat; } set diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index 0d648827..7017b512 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -49,14 +49,14 @@ public IgbChat() : base() this.Options = new IgbChatOptions(); } - private IgbChatMessage[] _messages; + private IgbChatMessage[]? _messages; /// /// The list of chat messages currently displayed. /// Use this property to set or update the message history. /// [Parameter] - public IgbChatMessage[] Messages + public IgbChatMessage[]? Messages { get { return this._messages; } set @@ -69,14 +69,14 @@ public IgbChatMessage[] Messages } } - private IgbChatDraftMessage _draftMessage; + private IgbChatDraftMessage? _draftMessage; /// /// The chat message currently being composed but not yet sent. /// Includes the draft text and any attachments. /// [Parameter] - public IgbChatDraftMessage DraftMessage + public IgbChatDraftMessage? DraftMessage { get { return this._draftMessage; } set diff --git a/src/components/Blazor/ChatAttachmentRenderContext.cs b/src/components/Blazor/ChatAttachmentRenderContext.cs index ff706ab4..363aeb53 100644 --- a/src/components/Blazor/ChatAttachmentRenderContext.cs +++ b/src/components/Blazor/ChatAttachmentRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbChatAttachmentRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatAttachmentRenderContext"; } } - private IgbChatMessageAttachment _attachment; + private IgbChatMessageAttachment? _attachment; /// /// The specific attachment being rendered. /// [Parameter] - public IgbChatMessageAttachment Attachment + public IgbChatMessageAttachment? Attachment { get { return this._attachment; } set diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 4805b1ad..563e4bf4 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -9,13 +9,13 @@ public partial class IgbChatDraftMessage : BaseRendererElement private static bool _marshalByValue = true; - private string _text; + private string? _text; /// /// The textual content of the draft message. /// [Parameter] - public string Text + public string? Text { get { return this._text; } set @@ -28,13 +28,13 @@ public string Text } } - private IgbChatMessageAttachment[] _attachments; + private IgbChatMessageAttachment[]? _attachments; /// /// An array of attachments associated with the draft message. /// [Parameter] - public IgbChatMessageAttachment[] Attachments + public IgbChatMessageAttachment[]? Attachments { get { return this._attachments; } set diff --git a/src/components/Blazor/ChatInputRenderContext.cs b/src/components/Blazor/ChatInputRenderContext.cs index 8548e070..d6c3034c 100644 --- a/src/components/Blazor/ChatInputRenderContext.cs +++ b/src/components/Blazor/ChatInputRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbChatInputRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatInputRenderContext"; } } - private string _value; + private string? _value; /// /// The current value of the input field. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 630e2422..39f49832 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbChatMessage : BaseRendererElement private static bool _marshalByValue = true; - private string _id; + private string? _id; /// /// A unique identifier for the message. /// [Parameter] - public string Id + public string? Id { get { return this._id; } set @@ -31,13 +31,13 @@ public string Id } } - private string _text; + private string? _text; /// /// The textual content of the message. /// [Parameter] - public string Text + public string? Text { get { return this._text; } set @@ -50,13 +50,13 @@ public string Text } } - private string _sender; + private string? _sender; /// /// The identifier or name of the sender of the message. /// [Parameter] - public string Sender + public string? Sender { get { return this._sender; } set @@ -69,13 +69,13 @@ public string Sender } } - private string _timestamp; + private string? _timestamp; /// /// The timestamp indicating when the message was sent. /// [Parameter] - public string Timestamp + public string? Timestamp { get { return this._timestamp; } set @@ -88,14 +88,14 @@ public string Timestamp } } - private IgbChatMessageAttachment[] _attachments; + private IgbChatMessageAttachment[]? _attachments; /// /// Optional list of attachments associated with the message, /// such as images, files, or links. /// [Parameter] - public IgbChatMessageAttachment[] Attachments + public IgbChatMessageAttachment[]? Attachments { get { return this._attachments; } set @@ -108,13 +108,13 @@ public IgbChatMessageAttachment[] Attachments } } - private string[] _reactions; + private string[]? _reactions; /// /// Optional list of reactions associated with the message. /// [Parameter] - public string[] Reactions + public string[]? Reactions { get { return this._reactions; } set diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index 2cea5832..d976e3e2 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbChatMessageAttachment : BaseRendererElement private static bool _marshalByValue = true; - private string _id; + private string? _id; /// /// A unique identifier for the attachment. /// [Parameter] - public string Id + public string? Id { get { return this._id; } set @@ -31,14 +31,14 @@ public string Id } } - private string _url; + private string? _url; /// /// The URL from which the attachment can be downloaded or viewed. /// Typically used for attachments stored on a server or CDN. /// [Parameter] - public string Url + public string? Url { get { return this._url; } set @@ -51,14 +51,14 @@ public string Url } } - private string _attachmentType; + private string? _attachmentType; /// /// The MIME type or a custom type identifier for the attachment (e.g. "image/png", "pdf", "audio"). /// [Parameter] [WCWidgetMemberName("Type")] - public string AttachmentType + public string? AttachmentType { get { return this._attachmentType; } set @@ -71,13 +71,13 @@ public string AttachmentType } } - private string _thumbnail; + private string? _thumbnail; /// /// Optional URL to a thumbnail preview of the attachment (e.g. for images or videos). /// [Parameter] - public string Thumbnail + public string? Thumbnail { get { return this._thumbnail; } set diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 6133eca6..0c27f73f 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbChatMessageAttachmentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessageAttachment _detail; + private IgbChatMessageAttachment? _detail; /// /// The chat message attachment the event was raised for. /// [Parameter] - public IgbChatMessageAttachment Detail + public IgbChatMessageAttachment? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index 2be669f0..ad6d9d5a 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbChatMessageEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessage _detail; + private IgbChatMessage? _detail; /// /// The chat message the event was raised for. /// [Parameter] - public IgbChatMessage Detail + public IgbChatMessage? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index 643a2a83..fb76147b 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbChatMessageReaction : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessage _message; + private IgbChatMessage? _message; /// /// The chat message that the reaction is associated with. /// [Parameter] - public IgbChatMessage Message + public IgbChatMessage? Message { get { return this._message; } set @@ -36,13 +36,13 @@ public IgbChatMessage Message } } - private string _reaction; + private string? _reaction; /// /// The string representation of the reaction, such as an emoji or a string; /// [Parameter] - public string Reaction + public string? Reaction { get { return this._reaction; } set diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index cb9345a3..3d34f708 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbChatMessageReactionEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessageReaction _detail; + private IgbChatMessageReaction? _detail; /// /// The reaction the event was raised for, together with the chat message it is associated with. /// [Parameter] - public IgbChatMessageReaction Detail + public IgbChatMessageReaction? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ChatMessageRenderContext.cs b/src/components/Blazor/ChatMessageRenderContext.cs index 42936ead..0f15966d 100644 --- a/src/components/Blazor/ChatMessageRenderContext.cs +++ b/src/components/Blazor/ChatMessageRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbChatMessageRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatMessageRenderContext"; } } - private IgbChatMessage _message; + private IgbChatMessage? _message; /// /// The specific chat message being rendered. /// [Parameter] - public IgbChatMessage Message + public IgbChatMessage? Message { get { return this._message; } set diff --git a/src/components/Blazor/ChatOptions.cs b/src/components/Blazor/ChatOptions.cs index d20db102..9dc50801 100644 --- a/src/components/Blazor/ChatOptions.cs +++ b/src/components/Blazor/ChatOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbChatOptions : BaseRendererElement /// public override string Type { get { return "WebChatOptions"; } } - private string _currentUserId; + private string? _currentUserId; /// /// The ID of the current user. Used to differentiate between incoming and outgoing messages. /// [Parameter] - public string CurrentUserId + public string? CurrentUserId { get { return this._currentUserId; } set @@ -87,13 +87,13 @@ public bool IsTyping } } - private string _headerText; + private string? _headerText; /// /// Optional header text to display at the top of the chat component. /// [Parameter] - public string HeaderText + public string? HeaderText { get { return this._headerText; } set @@ -106,14 +106,14 @@ public string HeaderText } } - private string _inputPlaceholder; + private string? _inputPlaceholder; /// /// Optional placeholder text for the chat input area. /// Provides a hint to the user about what they can type (e.g. "Type a message..."). /// [Parameter] - public string InputPlaceholder + public string? InputPlaceholder { get { return this._inputPlaceholder; } set @@ -126,13 +126,13 @@ public string InputPlaceholder } } - private string[] _suggestions; + private string[]? _suggestions; /// /// Suggested text snippets or quick replies that can be shown as user-selectable options. /// [Parameter] - public string[] Suggestions + public string[]? Suggestions { get { return this._suggestions; } set @@ -216,13 +216,13 @@ public bool AdoptRootStyles } } - private IgbChatRenderers _renderers; + private IgbChatRenderers? _renderers; /// /// An object containing a collection of custom renderers for different parts of the chat UI. /// [Parameter] - public IgbChatRenderers Renderers + public IgbChatRenderers? Renderers { get { return this._renderers; } set diff --git a/src/components/Blazor/ChatRenderContext.cs b/src/components/Blazor/ChatRenderContext.cs index ca7af13d..a594f561 100644 --- a/src/components/Blazor/ChatRenderContext.cs +++ b/src/components/Blazor/ChatRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -11,13 +11,13 @@ public partial class IgbChatRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatRenderContext"; } } - private IgbChat _instance; + private IgbChat? _instance; /// /// The instance of the component. /// [Parameter] - public IgbChat Instance + public IgbChat? Instance { get { return this._instance; } set diff --git a/src/components/Blazor/ChatRenderers.cs b/src/components/Blazor/ChatRenderers.cs index 49f3c7c0..a7d0e187 100644 --- a/src/components/Blazor/ChatRenderers.cs +++ b/src/components/Blazor/ChatRenderers.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -7,14 +7,14 @@ public partial class IgbChatRenderers : BaseRendererElement /// public override string Type { get { return "WebChatRenderers"; } } - private string _attachmentRef; - private RenderFragment _attachment; + private string? _attachmentRef; + private RenderFragment? _attachment; /// /// Custom renderer for a single chat message attachment. /// [Parameter] - public RenderFragment Attachment + public RenderFragment? Attachment { get { return this._attachment; } @@ -36,8 +36,8 @@ public RenderFragment Attachment } } - private string _attachmentTemplateId; - private string _attachmentScript; + private string? _attachmentTemplateId; + private string? _attachmentScript; /// /// Name of a client-side function that renders a single chat message attachment. @@ -66,14 +66,14 @@ public string AttachmentScript } } } - private string _attachmentContentRef; - private RenderFragment _attachmentContent; + private string? _attachmentContentRef; + private RenderFragment? _attachmentContent; /// /// Custom renderer for the content of an attachment. /// [Parameter] - public RenderFragment AttachmentContent + public RenderFragment? AttachmentContent { get { return this._attachmentContent; } @@ -95,8 +95,8 @@ public RenderFragment AttachmentContent } } - private string _attachmentContentTemplateId; - private string _attachmentContentScript; + private string? _attachmentContentTemplateId; + private string? _attachmentContentScript; /// /// Name of a client-side function that renders the content of an attachment. @@ -125,14 +125,14 @@ public string AttachmentContentScript } } } - private string _attachmentHeaderRef; - private RenderFragment _attachmentHeader; + private string? _attachmentHeaderRef; + private RenderFragment? _attachmentHeader; /// /// Custom renderer for the header of an attachment. /// [Parameter] - public RenderFragment AttachmentHeader + public RenderFragment? AttachmentHeader { get { return this._attachmentHeader; } @@ -154,8 +154,8 @@ public RenderFragment AttachmentHeader } } - private string _attachmentHeaderTemplateId; - private string _attachmentHeaderScript; + private string? _attachmentHeaderTemplateId; + private string? _attachmentHeaderScript; /// /// Name of a client-side function that renders the header of an attachment. @@ -184,14 +184,14 @@ public string AttachmentHeaderScript } } } - private string _inputRef; - private RenderFragment _input; + private string? _inputRef; + private RenderFragment? _input; /// /// Custom renderer for the main chat input field. /// [Parameter] - public RenderFragment Input + public RenderFragment? Input { get { return this._input; } @@ -213,8 +213,8 @@ public RenderFragment Input } } - private string _inputTemplateId; - private string _inputScript; + private string? _inputTemplateId; + private string? _inputScript; /// /// Name of a client-side function that renders the main chat input field. @@ -243,14 +243,14 @@ public string InputScript } } } - private string _inputActionsRef; - private RenderFragment _inputActions; + private string? _inputActionsRef; + private RenderFragment? _inputActions; /// /// Custom renderer for the actions container within the input area. /// [Parameter] - public RenderFragment InputActions + public RenderFragment? InputActions { get { return this._inputActions; } @@ -272,8 +272,8 @@ public RenderFragment InputActions } } - private string _inputActionsTemplateId; - private string _inputActionsScript; + private string? _inputActionsTemplateId; + private string? _inputActionsScript; /// /// Name of a client-side function that renders the actions container within the input area. @@ -302,14 +302,14 @@ public string InputActionsScript } } } - private string _inputActionsEndRef; - private RenderFragment _inputActionsEnd; + private string? _inputActionsEndRef; + private RenderFragment? _inputActionsEnd; /// /// Custom renderer for the actions at the end of the input area. /// [Parameter] - public RenderFragment InputActionsEnd + public RenderFragment? InputActionsEnd { get { return this._inputActionsEnd; } @@ -331,8 +331,8 @@ public RenderFragment InputActionsEnd } } - private string _inputActionsEndTemplateId; - private string _inputActionsEndScript; + private string? _inputActionsEndTemplateId; + private string? _inputActionsEndScript; /// /// Name of a client-side function that renders the actions at the end of the input area. @@ -361,14 +361,14 @@ public string InputActionsEndScript } } } - private string _inputActionsStartRef; - private RenderFragment _inputActionsStart; + private string? _inputActionsStartRef; + private RenderFragment? _inputActionsStart; /// /// Custom renderer for the actions at the start of the input area. /// [Parameter] - public RenderFragment InputActionsStart + public RenderFragment? InputActionsStart { get { return this._inputActionsStart; } @@ -390,8 +390,8 @@ public RenderFragment InputActionsStart } } - private string _inputActionsStartTemplateId; - private string _inputActionsStartScript; + private string? _inputActionsStartTemplateId; + private string? _inputActionsStartScript; /// /// Name of a client-side function that renders the actions at the start of the input area. @@ -420,14 +420,14 @@ public string InputActionsStartScript } } } - private string _messageRef; - private RenderFragment _message; + private string? _messageRef; + private RenderFragment? _message; /// /// Custom renderer for an entire chat message bubble. /// [Parameter] - public RenderFragment Message + public RenderFragment? Message { get { return this._message; } @@ -449,8 +449,8 @@ public RenderFragment Message } } - private string _messageTemplateId; - private string _messageScript; + private string? _messageTemplateId; + private string? _messageScript; /// /// Name of a client-side function that renders an entire chat message bubble. @@ -479,14 +479,14 @@ public string MessageScript } } } - private string _messageActionsRef; - private RenderFragment _messageActions; + private string? _messageActionsRef; + private RenderFragment? _messageActions; /// /// Custom renderer for message-specific actions (e.g. reply or delete buttons). /// [Parameter] - public RenderFragment MessageActions + public RenderFragment? MessageActions { get { return this._messageActions; } @@ -508,8 +508,8 @@ public RenderFragment MessageActions } } - private string _messageActionsTemplateId; - private string _messageActionsScript; + private string? _messageActionsTemplateId; + private string? _messageActionsScript; /// /// Name of a client-side function that renders message-specific actions (e.g. reply or delete buttons). @@ -538,14 +538,14 @@ public string MessageActionsScript } } } - private string _messageAttachmentsRef; - private RenderFragment _messageAttachments; + private string? _messageAttachmentsRef; + private RenderFragment? _messageAttachments; /// /// Custom renderer for the attachments associated with a message. /// [Parameter] - public RenderFragment MessageAttachments + public RenderFragment? MessageAttachments { get { return this._messageAttachments; } @@ -567,8 +567,8 @@ public RenderFragment MessageAttachments } } - private string _messageAttachmentsTemplateId; - private string _messageAttachmentsScript; + private string? _messageAttachmentsTemplateId; + private string? _messageAttachmentsScript; /// /// Name of a client-side function that renders the attachments associated with a message. @@ -597,14 +597,14 @@ public string MessageAttachmentsScript } } } - private string _messageContentRef; - private RenderFragment _messageContent; + private string? _messageContentRef; + private RenderFragment? _messageContent; /// /// Custom renderer for the main text and content of a message. /// [Parameter] - public RenderFragment MessageContent + public RenderFragment? MessageContent { get { return this._messageContent; } @@ -626,8 +626,8 @@ public RenderFragment MessageContent } } - private string _messageContentTemplateId; - private string _messageContentScript; + private string? _messageContentTemplateId; + private string? _messageContentScript; /// /// Name of a client-side function that renders the main text and content of a message. @@ -656,14 +656,14 @@ public string MessageContentScript } } } - private string _messageHeaderRef; - private RenderFragment _messageHeader; + private string? _messageHeaderRef; + private RenderFragment? _messageHeader; /// /// Custom renderer for the header of a message, including sender and timestamp. /// [Parameter] - public RenderFragment MessageHeader + public RenderFragment? MessageHeader { get { return this._messageHeader; } @@ -685,8 +685,8 @@ public RenderFragment MessageHeader } } - private string _messageHeaderTemplateId; - private string _messageHeaderScript; + private string? _messageHeaderTemplateId; + private string? _messageHeaderScript; /// /// Name of a client-side function that renders the header of a message, including sender and timestamp. @@ -715,14 +715,14 @@ public string MessageHeaderScript } } } - private string _sendButtonRef; - private RenderFragment _sendButton; + private string? _sendButtonRef; + private RenderFragment? _sendButton; /// /// Custom renderer for the message send button. /// [Parameter] - public RenderFragment SendButton + public RenderFragment? SendButton { get { return this._sendButton; } @@ -744,8 +744,8 @@ public RenderFragment SendButton } } - private string _sendButtonTemplateId; - private string _sendButtonScript; + private string? _sendButtonTemplateId; + private string? _sendButtonScript; /// /// Name of a client-side function that renders the message send button. @@ -774,14 +774,14 @@ public string SendButtonScript } } } - private string _suggestionPrefixRef; - private RenderFragment _suggestionPrefix; + private string? _suggestionPrefixRef; + private RenderFragment? _suggestionPrefix; /// /// Custom renderer for the prefix text shown before suggestions. /// [Parameter] - public RenderFragment SuggestionPrefix + public RenderFragment? SuggestionPrefix { get { return this._suggestionPrefix; } @@ -803,8 +803,8 @@ public RenderFragment SuggestionPrefix } } - private string _suggestionPrefixTemplateId; - private string _suggestionPrefixScript; + private string? _suggestionPrefixTemplateId; + private string? _suggestionPrefixScript; /// /// Name of a client-side function that renders the prefix text shown before suggestions. diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 0bab31cd..12a08e6b 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,13 +58,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _value; + private string? _value; /// /// The value of the control. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index f540ea7d..aa2ef57e 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbCheckboxChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbCheckboxChangeEventArgsDetail _detail; + private IgbCheckboxChangeEventArgsDetail? _detail; /// /// The payload of the event, carrying the new checked state and the value of the control. /// [Parameter] - public IgbCheckboxChangeEventArgsDetail Detail + public IgbCheckboxChangeEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index d33bc248..4d044351 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -31,13 +31,13 @@ public bool Checked } } - private string _value; + private string? _value; /// /// The value of the control. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/CircularGradient.cs b/src/components/Blazor/CircularGradient.cs index 18e7d511..acc26ad2 100644 --- a/src/components/Blazor/CircularGradient.cs +++ b/src/components/Blazor/CircularGradient.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -62,13 +62,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _offset; + private string? _offset; /// /// Defines where the gradient stop is placed along the gradient vector. /// [Parameter] - public string Offset + public string? Offset { get { return this._offset; } set @@ -81,13 +81,13 @@ public string Offset } } - private string _color; + private string? _color; /// /// Defines the color of the gradient stop. /// [Parameter] - public string Color + public string? Color { get { return this._color; } set diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index 4fa2b4a9..f23fab93 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -41,14 +41,14 @@ protected override bool SupportsVisualChildren } } - private string _dataRef; - private Object _data; + private string? _dataRef; + private Object? _data; /// /// The data source used to generate the list of options. /// [Parameter] - public Object Data + public Object? Data { get { return this._data; } @@ -69,7 +69,7 @@ public Object Data } } - private string _dataScript; + private string? _dataScript; ///Provides a means of setting Data in the JavaScript environment. [Parameter] @@ -168,13 +168,13 @@ public bool AutofocusList } } - private string _locale; + private string? _locale; /// /// Gets/Sets the locale used for getting language, affecting resource strings. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -187,13 +187,13 @@ public string Locale } } - private string _label; + private string? _label; /// /// The label of the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -206,13 +206,13 @@ public string Label } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -225,13 +225,13 @@ public string Placeholder } } - private string _placeholderSearch; + private string? _placeholderSearch; /// /// The placeholder text of the search input. /// [Parameter] - public string PlaceholderSearch + public string? PlaceholderSearch { get { return this._placeholderSearch; } set @@ -282,13 +282,13 @@ public string? DisplayKey } } - private string _groupKey; + private string? _groupKey; /// /// The key in the data source used to group items in the list. /// [Parameter] - public string GroupKey + public string? GroupKey { get { return this._groupKey; } set @@ -320,13 +320,13 @@ public GroupingDirection GroupSorting } } - private IgbFilteringOptions _filteringOptions; + private IgbFilteringOptions? _filteringOptions; /// /// An object that configures the filtering of the combo. /// [Parameter] - public IgbFilteringOptions FilteringOptions + public IgbFilteringOptions? FilteringOptions { get { return this._filteringOptions; } set @@ -401,7 +401,7 @@ public bool DisableClear } } - private T[] _value; + private T[]? _value; /// /// The value of the control, that is the currently selected items. @@ -410,7 +410,7 @@ public bool DisableClear /// of . /// [Parameter] - public T[] Value + public T[]? Value { get { return this._value; } set @@ -443,7 +443,7 @@ public T[] GetCurrentValue() var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); return ReturnToObjectArray(iv).Cast().ToArray(); } - private string _selectionRef; + private string? _selectionRef; /// /// Returns the current selection of the combo. @@ -521,14 +521,14 @@ public bool Invalid } } - private string _itemTemplateRef; - private RenderFragment _itemTemplate; + private string? _itemTemplateRef; + private RenderFragment? _itemTemplate; /// /// The template used for the content of each combo item. /// [Parameter] - public RenderFragment ItemTemplate + public RenderFragment? ItemTemplate { get { return this._itemTemplate; } @@ -550,8 +550,8 @@ public RenderFragment ItemTemplate } } - private string _itemTemplateTemplateId; - private string _itemTemplateScript; + private string? _itemTemplateTemplateId; + private string? _itemTemplateScript; /// /// Name of a client-side function that renders the template used for the content of each combo item. @@ -580,14 +580,14 @@ public string ItemTemplateScript } } } - private string _groupHeaderTemplateRef; - private RenderFragment _groupHeaderTemplate; + private string? _groupHeaderTemplateRef; + private RenderFragment? _groupHeaderTemplate; /// /// The template used for the content of each combo group header. /// [Parameter] - public RenderFragment GroupHeaderTemplate + public RenderFragment? GroupHeaderTemplate { get { return this._groupHeaderTemplate; } @@ -609,8 +609,8 @@ public RenderFragment GroupHeaderTemplate } } - private string _groupHeaderTemplateTemplateId; - private string _groupHeaderTemplateScript; + private string? _groupHeaderTemplateTemplateId; + private string? _groupHeaderTemplateScript; /// /// Name of a client-side function that renders the template used for the content of each combo group header. diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 9d149642..c072178f 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbComboChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbComboChangeEventArgsDetail _detail; + private IgbComboChangeEventArgsDetail? _detail; /// /// Describes the selection change: the new value, the items it affected and the kind of change. /// [Parameter] - public IgbComboChangeEventArgsDetail Detail + public IgbComboChangeEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index db3335ea..4d8f58ee 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -9,11 +9,11 @@ public partial class IgbComboChangeEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; - private string _newValueRef; - private object[] _newValue; + private string? _newValueRef; + private object[]? _newValue; [Parameter] - public object[] NewValue + public object[]? NewValue { get { return this._newValue; } @@ -34,7 +34,7 @@ public object[] NewValue } } - private string _newValueScript; + private string? _newValueScript; ///Provides a means of setting NewValue in the JavaScript environment. [Parameter] @@ -57,11 +57,11 @@ public string NewValueScript } } } - private string _itemsRef; - private object[] _items; + private string? _itemsRef; + private object[]? _items; [Parameter] - public object[] Items + public object[]? Items { get { return this._items; } @@ -82,7 +82,7 @@ public object[] Items } } - private string _itemsScript; + private string? _itemsScript; ///Provides a means of setting Items in the JavaScript environment. [Parameter] diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index c323a6a9..e071fc72 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -11,13 +11,13 @@ public partial class IgbComponentDataValueChangedEventArgs : BaseRendererElement /// public override string Type { get { return "WebComponentDataValueChangedEventArgs"; } } - private object _detail; + private object? _detail; /// /// The value carried by the event. /// [Parameter] - public object Detail + public object? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 40e19ac1..91505a08 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbComponentValueChangedEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private string _detail; + private string? _detail; /// /// The string value carried by the event. /// [Parameter] - public string Detail + public string? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index d2d99ff5..ab4a1df7 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbCustomDateRange : BaseRendererElement /// public override string Type { get { return "WebCustomDateRange"; } } - private string _label; + private string? _label; /// /// The text rendered in the chip for this range. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -29,13 +29,13 @@ public string Label } } - private IgbDateRangeValue _dateRange; + private IgbDateRangeValue? _dateRange; /// /// The date range applied when the chip is selected. /// [Parameter] - public IgbDateRangeValue DateRange + public IgbDateRangeValue? DateRange { get { return this._dateRange; } set diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 4804bc80..7597fd5c 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -35,13 +35,13 @@ protected override bool SupportsVisualChildren } } - private string _label; + private string? _label; /// /// The label of the datepicker. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -283,13 +283,13 @@ public bool HideOutsideDays } } - private IgbDateRangeDescriptor[] _disabledDates; + private IgbDateRangeDescriptor[]? _disabledDates; /// /// Gets/sets disabled dates. /// [Parameter] - public IgbDateRangeDescriptor[] DisabledDates + public IgbDateRangeDescriptor[]? DisabledDates { get { return this._disabledDates; } set @@ -302,13 +302,13 @@ public IgbDateRangeDescriptor[] DisabledDates } } - private IgbDateRangeDescriptor[] _specialDates; + private IgbDateRangeDescriptor[]? _specialDates; /// /// Gets/sets special dates. /// [Parameter] - public IgbDateRangeDescriptor[] SpecialDates + public IgbDateRangeDescriptor[]? SpecialDates { get { return this._specialDates; } set @@ -340,13 +340,13 @@ public bool Outlined } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -397,14 +397,14 @@ public bool ShowWeekNumbers } } - private string _displayFormat; + private string? _displayFormat; /// /// Format to display the value in when not editing. /// Defaults to the locale format if not set. /// [Parameter] - public string DisplayFormat + public string? DisplayFormat { get { return this._displayFormat; } set @@ -417,14 +417,14 @@ public string DisplayFormat } } - private string _inputFormat; + private string? _inputFormat; /// /// The date format to apply on the input. /// Defaults to the current locale of the client Intl.DateTimeFormat /// [Parameter] - public string InputFormat + public string? InputFormat { get { return this._inputFormat; } set @@ -437,13 +437,13 @@ public string InputFormat } } - private string _prompt; + private string? _prompt; /// /// The prompt symbol to use for unfilled parts of the mask. /// [Parameter] - public string Prompt + public string? Prompt { get { return this._prompt; } set @@ -456,13 +456,13 @@ public string Prompt } } - private string _locale; + private string? _locale; /// /// Gets/Sets the locale used for formatting the display value. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -475,13 +475,13 @@ public string Locale } } - private IgbCalendarResourceStrings _resourceStrings; + private IgbCalendarResourceStrings? _resourceStrings; /// /// The resource strings for localization. /// [Parameter] - public IgbCalendarResourceStrings ResourceStrings + public IgbCalendarResourceStrings? ResourceStrings { get { return this._resourceStrings; } set diff --git a/src/components/Blazor/DateRangeDescriptor.cs b/src/components/Blazor/DateRangeDescriptor.cs index 82564a46..1547b9fc 100644 --- a/src/components/Blazor/DateRangeDescriptor.cs +++ b/src/components/Blazor/DateRangeDescriptor.cs @@ -30,7 +30,7 @@ public DateRangeType RangeType } } - private object _dateRange; + private object? _dateRange; /// /// The date or dates the descriptor applies to, interpreted according to . @@ -40,7 +40,7 @@ public DateRangeType RangeType /// and . /// [Parameter] - public object DateRange + public object? DateRange { get { return this._dateRange; } set diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 2c8da819..a7821860 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Components; @@ -100,13 +100,13 @@ public IgbDateRangeValue? Value return retVal; } - private IgbCustomDateRange[] _customRanges; + private IgbCustomDateRange[]? _customRanges; /// /// Renders chips with custom ranges based on the elements of the array. /// [Parameter] - public IgbCustomDateRange[] CustomRanges + public IgbCustomDateRange[]? CustomRanges { get { return this._customRanges; } set @@ -176,13 +176,13 @@ public bool UsePredefinedRanges } } - private string _locale; + private string? _locale; /// /// The locale settings used to display the value. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -195,13 +195,13 @@ public string Locale } } - private IgbDateRangePickerResourceStrings _resourceStrings; + private IgbDateRangePickerResourceStrings? _resourceStrings; /// /// The resource strings of the date range picker. /// [Parameter] - public IgbDateRangePickerResourceStrings ResourceStrings + public IgbDateRangePickerResourceStrings? ResourceStrings { get { return this._resourceStrings; } set @@ -277,13 +277,13 @@ public bool Outlined } } - private string _label; + private string? _label; /// /// The label of the control (single input). /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -296,13 +296,13 @@ public string Label } } - private string _labelStart; + private string? _labelStart; /// /// The label of the start input. /// [Parameter] - public string LabelStart + public string? LabelStart { get { return this._labelStart; } set @@ -315,13 +315,13 @@ public string LabelStart } } - private string _labelEnd; + private string? _labelEnd; /// /// The label of the end input. /// [Parameter] - public string LabelEnd + public string? LabelEnd { get { return this._labelEnd; } set @@ -334,13 +334,13 @@ public string LabelEnd } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control (single input). /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -353,13 +353,13 @@ public string Placeholder } } - private string _placeholderStart; + private string? _placeholderStart; /// /// The placeholder text of the start input. /// [Parameter] - public string PlaceholderStart + public string? PlaceholderStart { get { return this._placeholderStart; } set @@ -372,13 +372,13 @@ public string PlaceholderStart } } - private string _placeholderEnd; + private string? _placeholderEnd; /// /// The placeholder text of the end input. /// [Parameter] - public string PlaceholderEnd + public string? PlaceholderEnd { get { return this._placeholderEnd; } set @@ -391,13 +391,13 @@ public string PlaceholderEnd } } - private string _prompt; + private string? _prompt; /// /// The prompt symbol to use for unfilled parts of the mask. /// [Parameter] - public string Prompt + public string? Prompt { get { return this._prompt; } set @@ -410,14 +410,14 @@ public string Prompt } } - private string _displayFormat; + private string? _displayFormat; /// /// Format to display the value in when not editing. /// Defaults to the locale format if not set. /// [Parameter] - public string DisplayFormat + public string? DisplayFormat { get { return this._displayFormat; } set @@ -430,14 +430,14 @@ public string DisplayFormat } } - private string _inputFormat; + private string? _inputFormat; /// /// The date format to apply on the inputs. /// Defaults to the current locale of the client Intl.DateTimeFormat /// [Parameter] - public string InputFormat + public string? InputFormat { get { return this._inputFormat; } set @@ -488,13 +488,13 @@ public DateTime? Max } } - private IgbDateRangeDescriptor[] _disabledDates; + private IgbDateRangeDescriptor[]? _disabledDates; /// /// Gets/sets disabled dates. /// [Parameter] - public IgbDateRangeDescriptor[] DisabledDates + public IgbDateRangeDescriptor[]? DisabledDates { get { return this._disabledDates; } set @@ -641,13 +641,13 @@ public bool HideOutsideDays } } - private IgbDateRangeDescriptor[] _specialDates; + private IgbDateRangeDescriptor[]? _specialDates; /// /// Gets/sets special dates. /// [Parameter] - public IgbDateRangeDescriptor[] SpecialDates + public IgbDateRangeDescriptor[]? SpecialDates { get { return this._specialDates; } set diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 0cd051b2..1894d80b 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbDateRangeValueEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbDateRangeValueDetail _detail; + private IgbDateRangeValueDetail? _detail; /// /// The date range carried by the event. /// [Parameter] - public IgbDateRangeValueDetail Detail + public IgbDateRangeValueDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index b0e479e9..6d9a67ba 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -50,13 +50,13 @@ public bool Outlined } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -69,13 +69,13 @@ public string Placeholder } } - private string _label; + private string? _label; /// /// The label for the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -88,13 +88,13 @@ public string Label } } - private string _inputFormat; + private string? _inputFormat; /// /// The date format to apply on the input. /// [Parameter] - public string InputFormat + public string? InputFormat { get { return this._inputFormat; } set @@ -145,14 +145,14 @@ public DateTime? Max } } - private string _displayFormat; + private string? _displayFormat; /// /// Format to display the value in when not editing. /// Defaults to the locale format if not set. /// [Parameter] - public string DisplayFormat + public string? DisplayFormat { get { return this._displayFormat; } set @@ -165,14 +165,14 @@ public string DisplayFormat } } - private IgbDatePartDeltas _spinDelta; + private IgbDatePartDeltas? _spinDelta; /// /// Delta values used to increment or decrement each date part on step actions. /// All values default to 1. /// [Parameter] - public IgbDatePartDeltas SpinDelta + public IgbDatePartDeltas? SpinDelta { get { return this._spinDelta; } set @@ -209,13 +209,13 @@ public bool SpinLoop } } - private string _locale; + private string? _locale; /// /// Gets/Sets the locale used for formatting the display value. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -247,13 +247,13 @@ public bool ReadOnly } } - private string _mask; + private string? _mask; /// /// The mask pattern of the component. /// [Parameter] - public string Mask + public string? Mask { get { return this._mask; } set @@ -266,14 +266,14 @@ public string Mask } } - private string _prompt; + private string? _prompt; /// /// The prompt symbol to use for unfilled parts of the mask pattern. /// Defaults to _. /// [Parameter] - public string Prompt + public string? Prompt { get { return this._prompt; } set diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index 803429d3..7a66eef0 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -154,14 +154,14 @@ public bool Open } } - private string _title; + private string? _title; /// /// The title displayed in the dialog header. /// Overridden by any content projected into the title slot. /// [Parameter] - public string Title + public string? Title { get { return this._title; } set @@ -174,7 +174,7 @@ public string Title } } - private string _returnValue; + private string? _returnValue; /// /// The return value of the dialog. @@ -183,7 +183,7 @@ public string Title /// be set programmatically before calling . /// [Parameter] - public string ReturnValue + public string? ReturnValue { get { return this._returnValue; } set diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index bfe6d754..a6233178 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbDropdownItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbDropdownItem _detail; + private IgbDropdownItem? _detail; /// /// The dropdown item that became selected. /// [Parameter] - public IgbDropdownItem Detail + public IgbDropdownItem? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 388d8395..0da3091e 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -15,13 +15,13 @@ public partial class IgbExpansionPanelComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbExpansionPanel _detail; + private IgbExpansionPanel? _detail; /// /// The expansion panel the event was raised for. /// [Parameter] - public IgbExpansionPanel Detail + public IgbExpansionPanel? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/FilteringOptions.cs b/src/components/Blazor/FilteringOptions.cs index 1a8c2691..6ba07196 100644 --- a/src/components/Blazor/FilteringOptions.cs +++ b/src/components/Blazor/FilteringOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -10,13 +10,13 @@ public partial class IgbFilteringOptions : BaseRendererElement /// public override string Type { get { return "WebFilteringOptions"; } } - private string _filterKey; + private string? _filterKey; /// /// The key in the data source used when filtering the list of options. /// [Parameter] - public string FilterKey + public string? FilterKey { get { return this._filterKey; } set diff --git a/src/components/Blazor/Highlight.cs b/src/components/Blazor/Highlight.cs index ad84e0ca..db379bd4 100644 --- a/src/components/Blazor/Highlight.cs +++ b/src/components/Blazor/Highlight.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -82,7 +82,7 @@ public bool CaseSensitive } } - private string _searchText; + private string? _searchText; /// /// The string to search and highlight in the DOM content of the component. @@ -90,7 +90,7 @@ public bool CaseSensitive /// An empty string clears all highlights. /// [Parameter] - public string SearchText + public string? SearchText { get { return this._searchText; } set diff --git a/src/components/Blazor/Icon.cs b/src/components/Blazor/Icon.cs index c54180b0..f727607b 100644 --- a/src/components/Blazor/Icon.cs +++ b/src/components/Blazor/Icon.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,14 +58,14 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _iconName; + private string? _iconName; /// /// The name of the icon glyph to draw. /// [Parameter] [WCWidgetMemberName("Name")] - public string IconName + public string? IconName { get { return this._iconName; } set @@ -78,13 +78,13 @@ public string IconName } } - private string _collection; + private string? _collection; /// /// The name of the registered collection for look up of icons. /// [Parameter] - public string Collection + public string? Collection { get { return this._collection; } set diff --git a/src/components/Blazor/IconButton.cs b/src/components/Blazor/IconButton.cs index 4cdce599..e8f1aba7 100644 --- a/src/components/Blazor/IconButton.cs +++ b/src/components/Blazor/IconButton.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -57,14 +57,14 @@ protected override string DirectRenderElementName } } - private string _iconName; + private string? _iconName; /// /// The name of the icon to display. /// [Parameter] [WCWidgetMemberName("Name")] - public string IconName + public string? IconName { get { return this._iconName; } set @@ -77,13 +77,13 @@ public string IconName } } - private string _collection; + private string? _collection; /// /// The collection the icon belongs to. /// [Parameter] - public string Collection + public string? Collection { get { return this._collection; } set diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 2b839ecb..99f8b166 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbIconMeta : BaseRendererElement private static bool _marshalByValue = true; - private string _collection; + private string? _collection; /// /// The name of the collection the icon is registered in. /// [Parameter] - public string Collection + public string? Collection { get { return this._collection; } set diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index 5b16749e..bc752326 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -53,13 +53,13 @@ protected override string DirectRenderElementName } } - private string _value; + private string? _value; /// /// The value of the control. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set @@ -130,7 +130,7 @@ public bool ReadOnly } } - private string _inputMode; + private string? _inputMode; /// /// The input mode attribute of the control. @@ -139,7 +139,7 @@ public bool ReadOnly /// [Parameter] [WCAttributeName("inputmode")] - public string InputMode + public string? InputMode { get { return this._inputMode; } set @@ -287,13 +287,13 @@ public bool Autofocus } } - private string _autocomplete; + private string? _autocomplete; /// /// The autocomplete attribute of the control. /// [Parameter] - public string Autocomplete + public string? Autocomplete { get { return this._autocomplete; } set diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index 5423cc27..57d07a81 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,13 +47,13 @@ public bool Outlined } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -66,13 +66,13 @@ public string Placeholder } } - private string _label; + private string? _label; /// /// The label for the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 71f9c892..52504dc3 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -64,14 +64,14 @@ public MaskInputValueMode ValueMode } } - private string _value; + private string? _value; /// /// The value of the input. /// Regardless of the current , an empty value returns an empty string. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set @@ -104,13 +104,13 @@ public string GetCurrentValue() var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); return ReturnToString(iv); } - private string _mask; + private string? _mask; /// /// The masked pattern of the component. /// [Parameter] - public string Mask + public string? Mask { get { return this._mask; } set @@ -123,13 +123,13 @@ public string Mask } } - private string _prompt; + private string? _prompt; /// /// The prompt symbol to use for unfilled parts of the mask pattern. /// [Parameter] - public string Prompt + public string? Prompt { get { return this._prompt; } set diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index ab09ea55..a56fbdae 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -149,7 +149,7 @@ public bool KeepOpenOnEscape } } - private string _label; + private string? _label; /// /// Sets an accessible label for the drawer. @@ -159,7 +159,7 @@ public bool KeepOpenOnEscape /// distinct label so screen-reader users can differentiate between them. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set diff --git a/src/components/Blazor/NumberFormatSpecifier.cs b/src/components/Blazor/NumberFormatSpecifier.cs index 67cb6b1d..6d56354b 100644 --- a/src/components/Blazor/NumberFormatSpecifier.cs +++ b/src/components/Blazor/NumberFormatSpecifier.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -22,14 +22,14 @@ protected override void EnsureModulesLoaded() private static bool _marshalByValue = true; - private string _locale; + private string? _locale; /// /// The culture used to format the number. When not set, the browser culture returned by /// is used. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -42,14 +42,14 @@ public string Locale } } - private string _compactDisplay; + private string? _compactDisplay; /// /// The form of the compact notation, either short or long. Applies only when /// is compact. /// [Parameter] - public string CompactDisplay + public string? CompactDisplay { get { return this._compactDisplay; } set @@ -62,13 +62,13 @@ public string CompactDisplay } } - private string _currency; + private string? _currency; /// /// The currency used in currency formatting, given as an ISO 4217 currency code. /// [Parameter] - public string Currency + public string? Currency { get { return this._currency; } set @@ -81,14 +81,14 @@ public string Currency } } - private string _currencyDisplay; + private string? _currencyDisplay; /// /// How the currency is shown, one of symbol, narrowSymbol, code or /// name. /// [Parameter] - public string CurrencyDisplay + public string? CurrencyDisplay { get { return this._currencyDisplay; } set @@ -101,13 +101,13 @@ public string CurrencyDisplay } } - private string _currencySign; + private string? _currencySign; /// /// How negative currency amounts are rendered, either standard or accounting. /// [Parameter] - public string CurrencySign + public string? CurrencySign { get { return this._currencySign; } set @@ -120,14 +120,14 @@ public string CurrencySign } } - private string _currencyCode; + private string? _currencyCode; /// /// The currency code applied when is currency. It takes precedence /// over ; when not set, the code is resolved from the culture. /// [Parameter] - public string CurrencyCode + public string? CurrencyCode { get { return this._currencyCode; } set @@ -140,13 +140,13 @@ public string CurrencyCode } } - private string _localeMatcher; + private string? _localeMatcher; /// /// The locale matching algorithm, either lookup or best fit. /// [Parameter] - public string LocaleMatcher + public string? LocaleMatcher { get { return this._localeMatcher; } set @@ -159,14 +159,14 @@ public string LocaleMatcher } } - private string _notation; + private string? _notation; /// /// The formatting notation, one of standard, scientific, engineering or /// compact. /// [Parameter] - public string Notation + public string? Notation { get { return this._notation; } set @@ -179,13 +179,13 @@ public string Notation } } - private string _numberingSystem; + private string? _numberingSystem; /// /// The numbering system used to render the digits. /// [Parameter] - public string NumberingSystem + public string? NumberingSystem { get { return this._numberingSystem; } set @@ -198,14 +198,14 @@ public string NumberingSystem } } - private string _signDisplay; + private string? _signDisplay; /// /// When the sign is shown, one of auto, never, always or /// exceptZero. /// [Parameter] - public string SignDisplay + public string? SignDisplay { get { return this._signDisplay; } set @@ -218,14 +218,14 @@ public string SignDisplay } } - private string _style; + private string? _style; /// /// The formatting style, one of decimal, currency, percent or /// unit. /// [Parameter] - public string Style + public string? Style { get { return this._style; } set @@ -238,13 +238,13 @@ public string Style } } - private string _unit; + private string? _unit; /// /// The unit used when is unit. /// [Parameter] - public string Unit + public string? Unit { get { return this._unit; } set @@ -257,13 +257,13 @@ public string Unit } } - private string _unitDisplay; + private string? _unitDisplay; /// /// How the unit is shown, one of short, narrow or long. /// [Parameter] - public string UnitDisplay + public string? UnitDisplay { get { return this._unitDisplay; } set diff --git a/src/components/Blazor/ProgressBase.cs b/src/components/Blazor/ProgressBase.cs index 1fd44d70..039fb3c0 100644 --- a/src/components/Blazor/ProgressBase.cs +++ b/src/components/Blazor/ProgressBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -163,7 +163,7 @@ public bool HideLabel } } - private string _labelFormat; + private string? _labelFormat; /// /// Format string for the default label of the control. Placeholders: @@ -173,7 +173,7 @@ public bool HideLabel /// /// [Parameter] - public string LabelFormat + public string? LabelFormat { get { return this._labelFormat; } set diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index ebbf48d1..879954ab 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -77,13 +77,13 @@ public bool Required } } - private string _value; + private string? _value; /// /// The value of the control. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 05542c80..fdf70ba4 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbRadioChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbRadioChangeEventArgsDetail _detail; + private IgbRadioChangeEventArgsDetail? _detail; /// /// The payload of the event, carrying the new checked state and the value of the radio button. /// [Parameter] - public IgbRadioChangeEventArgsDetail Detail + public IgbRadioChangeEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index 01277ee8..83012345 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -31,13 +31,13 @@ public bool Checked } } - private string _value; + private string? _value; /// /// The value of the radio button. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 2d2c217a..918ff3f5 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -77,14 +77,14 @@ public ContentOrientation Alignment } } - private string _value; + private string? _value; /// /// The value of the group, reflecting the value of the currently checked button. /// Setting it checks the button in the group with a matching value. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/RangeSlider.cs b/src/components/Blazor/RangeSlider.cs index b00c22fa..560cfdd8 100644 --- a/src/components/Blazor/RangeSlider.cs +++ b/src/components/Blazor/RangeSlider.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -90,13 +90,13 @@ public double Upper } } - private string _thumbLabelLower; + private string? _thumbLabelLower; /// /// The aria label for the lower thumb. /// [Parameter] - public string ThumbLabelLower + public string? ThumbLabelLower { get { return this._thumbLabelLower; } set @@ -109,13 +109,13 @@ public string ThumbLabelLower } } - private string _thumbLabelUpper; + private string? _thumbLabelUpper; /// /// The aria label for the upper thumb. /// [Parameter] - public string ThumbLabelUpper + public string? ThumbLabelUpper { get { return this._thumbLabelUpper; } set diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index f868831a..a3cdcaa6 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -11,13 +11,13 @@ public partial class IgbRangeSliderValueEventArgs : BaseRendererElement /// public override string Type { get { return "WebRangeSliderValueEventArgs"; } } - private IgbRangeSliderValue _detail; + private IgbRangeSliderValue? _detail; /// /// The lower and upper thumb values of the range slider. /// [Parameter] - public IgbRangeSliderValue Detail + public IgbRangeSliderValue? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index 3c4cd4b5..70c2ab6c 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -101,13 +101,13 @@ public double Step } } - private string _label; + private string? _label; /// /// The label of the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -120,7 +120,7 @@ public string Label } } - private string _valueFormat; + private string? _valueFormat; /// /// A format string which sets aria-valuetext. Instances of {0} will be replaced @@ -128,7 +128,7 @@ public string Label /// Important for screen-readers and useful for localization. /// [Parameter] - public string ValueFormat + public string? ValueFormat { get { return this._valueFormat; } set diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index a1868bdf..35d3bb34 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -146,13 +146,13 @@ public double Distance } } - private string _label; + private string? _label; /// /// The label of the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -165,13 +165,13 @@ public string Label } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set diff --git a/src/components/Blazor/SelectGroup.cs b/src/components/Blazor/SelectGroup.cs index 3b18acd5..e9e17b9c 100644 --- a/src/components/Blazor/SelectGroup.cs +++ b/src/components/Blazor/SelectGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,13 +58,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private IgbSelectItem[] _items; + private IgbSelectItem[]? _items; /// /// All child components. /// [Parameter] - public IgbSelectItem[] Items + public IgbSelectItem[]? Items { get { return this._items; } set diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 21834995..74ff009b 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbSelectItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbSelectItem _detail; + private IgbSelectItem? _detail; /// /// The select item that became selected. /// [Parameter] - public IgbSelectItem Detail + public IgbSelectItem? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/SliderBase.cs b/src/components/Blazor/SliderBase.cs index 3b88da19..6230af59 100644 --- a/src/components/Blazor/SliderBase.cs +++ b/src/components/Blazor/SliderBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -319,13 +319,13 @@ public bool HideSecondaryLabels } } - private string _locale; + private string? _locale; /// /// The locale used to format the thumb and tick label values in the slider. /// [Parameter] - public string Locale + public string? Locale { get { return this._locale; } set @@ -338,13 +338,13 @@ public string Locale } } - private string _valueFormat; + private string? _valueFormat; /// /// String format used for the thumb and tick label values in the slider. /// [Parameter] - public string ValueFormat + public string? ValueFormat { get { return this._valueFormat; } set @@ -376,13 +376,13 @@ public SliderTickLabelRotation TickLabelRotation } } - private IgbNumberFormatSpecifier _valueFormatOptions; + private IgbNumberFormatSpecifier? _valueFormatOptions; /// /// Number format options used for the thumb and tick label values in the slider. /// [Parameter] - public IgbNumberFormatSpecifier ValueFormatOptions + public IgbNumberFormatSpecifier? ValueFormatOptions { get { return this._valueFormatOptions; } set diff --git a/src/components/Blazor/Snackbar.cs b/src/components/Blazor/Snackbar.cs index 2d014a17..136eb402 100644 --- a/src/components/Blazor/Snackbar.cs +++ b/src/components/Blazor/Snackbar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,13 +58,13 @@ protected override string DirectRenderElementName } } - private string _actionText; + private string? _actionText; /// /// The text of the action button. /// [Parameter] - public string ActionText + public string? ActionText { get { return this._actionText; } set diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index bf0e107e..938390f1 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbSplitterResizeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbSplitterResizeEventArgsDetail _detail; + private IgbSplitterResizeEventArgsDetail? _detail; /// /// The current sizes of the panes adjacent to the resized splitter bar. /// [Parameter] - public IgbSplitterResizeEventArgsDetail Detail + public IgbSplitterResizeEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/Tab.cs b/src/components/Blazor/Tab.cs index 2f278d4e..d5478a44 100644 --- a/src/components/Blazor/Tab.cs +++ b/src/components/Blazor/Tab.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -59,7 +59,7 @@ protected override ControlEventBehavior DefaultEventBehavior } [CascadingParameter(Name = "TabsParent")] - protected BaseRendererControl TabsParent + protected BaseRendererControl? TabsParent { get; set; } @@ -85,13 +85,13 @@ protected override async Task OnInitializedAsync() } - private string _label; + private string? _label; /// /// The tab item label. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index 72d7f2d9..edbd35eb 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbTabComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTab _detail; + private IgbTab? _detail; /// /// The tab that became selected. /// [Parameter] - public IgbTab Detail + public IgbTab? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index 6c311989..dc4b093f 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -71,8 +71,8 @@ protected override string ParentTypeName } } - private CollectionAdapter _tabsCollectionAdapter; - private IgbTabs_TabCollection _allTabsCollection; + private CollectionAdapter? _tabsCollectionAdapter; + private IgbTabs_TabCollection? _allTabsCollection; private IgbTabs_TabCollection? _contentTabsCollection = null; public IgbTabs_TabCollection ContentTabsCollection diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 34214f8c..dfdcd889 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -60,7 +60,7 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _autocomplete; + private string? _autocomplete; /// /// Specifies what permission, if any, the browser has to provide automated assistance in filling @@ -70,7 +70,7 @@ protected override ControlEventBehavior DefaultEventBehavior /// for additional information. /// [Parameter] - public string Autocomplete + public string? Autocomplete { get { return this._autocomplete; } set @@ -83,7 +83,7 @@ public string Autocomplete } } - private string _autocapitalize; + private string? _autocapitalize; /// /// Controls whether and how text input is automatically capitalized as it is entered/edited by the user. @@ -91,7 +91,7 @@ public string Autocomplete /// MDN documentation. /// [Parameter] - public string Autocapitalize + public string? Autocapitalize { get { return this._autocapitalize; } set @@ -104,7 +104,7 @@ public string Autocapitalize } } - private string _inputMode; + private string? _inputMode; /// /// Hints at the type of data that might be entered by the user while editing the control or its contents. @@ -114,7 +114,7 @@ public string Autocapitalize /// [Parameter] [WCAttributeName("inputmode")] - public string InputMode + public string? InputMode { get { return this._inputMode; } set @@ -127,13 +127,13 @@ public string InputMode } } - private string _label; + private string? _label; /// /// The label for the control. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -206,13 +206,13 @@ public bool Outlined } } - private string _placeholder; + private string? _placeholder; /// /// The placeholder text of the control. /// [Parameter] - public string Placeholder + public string? Placeholder { get { return this._placeholder; } set @@ -285,13 +285,13 @@ public double Rows } } - private string _value; + private string? _value; /// /// The value of the component. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 75fa0871..48f07616 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -14,13 +14,13 @@ public partial class IgbTileChangeStateEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTileChangeStateEventArgsDetail _detail; + private IgbTileChangeStateEventArgsDetail? _detail; /// /// The affected tile and the state it is changing to. /// [Parameter] - public IgbTileChangeStateEventArgsDetail Detail + public IgbTileChangeStateEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index f95984fd..38690435 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbTileChangeStateEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; - private IgbTile _tile; + private IgbTile? _tile; /// /// The tile whose state is changing. /// [Parameter] - public IgbTile Tile + public IgbTile? Tile { get { return this._tile; } set diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 4e4c9018..d4dc330c 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -14,13 +14,13 @@ public partial class IgbTileComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTile _detail; + private IgbTile? _detail; /// /// The tile the operation applies to. /// [Parameter] - public IgbTile Detail + public IgbTile? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ToggleButton.cs b/src/components/Blazor/ToggleButton.cs index 083c8a22..0c4bd4be 100644 --- a/src/components/Blazor/ToggleButton.cs +++ b/src/components/Blazor/ToggleButton.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -61,13 +61,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private string _value; + private string? _value; /// /// The value of the control. /// [Parameter] - public string Value + public string? Value { get { return this._value; } set diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index f662bf15..ad39eda2 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -136,13 +136,13 @@ public PopoverPlacement Placement } } - private string _anchor; + private string? _anchor; /// /// The ID of the element to use as the anchor for the tooltip. /// [Parameter] - public string Anchor + public string? Anchor { get { return this._anchor; } set @@ -155,14 +155,14 @@ public string Anchor } } - private string _showTriggers; + private string? _showTriggers; /// /// Which event triggers will show the tooltip. /// Expects a comma separated string of different event triggers. /// [Parameter] - public string ShowTriggers + public string? ShowTriggers { get { return this._showTriggers; } set @@ -175,14 +175,14 @@ public string ShowTriggers } } - private string _hideTriggers; + private string? _hideTriggers; /// /// Which event triggers will hide the tooltip. /// Expects a comma separated string of different event triggers. /// [Parameter] - public string HideTriggers + public string? HideTriggers { get { return this._hideTriggers; } set @@ -233,13 +233,13 @@ public double HideDelay } } - private string _message; + private string? _message; /// /// Specifies plain text as the tooltip content. /// [Parameter] - public string Message + public string? Message { get { return this._message; } set diff --git a/src/components/Blazor/TreeItem.cs b/src/components/Blazor/TreeItem.cs index 8eb286e7..03cbc1fa 100644 --- a/src/components/Blazor/TreeItem.cs +++ b/src/components/Blazor/TreeItem.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,13 +58,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private IgbTreeItem _parent; + private IgbTreeItem? _parent; /// /// The parent item of the current tree item (if any) /// [Parameter] - public IgbTreeItem Parent + public IgbTreeItem? Parent { get { return this._parent; } set @@ -96,13 +96,13 @@ public double Level } } - private string _label; + private string? _label; /// /// The tree item label. /// [Parameter] - public string Label + public string? Label { get { return this._label; } set @@ -210,13 +210,13 @@ public bool Loading } } - private object _value; + private object? _value; /// /// The value entry that the tree item is visualizing. Required for searching through items. /// [Parameter] - public object Value + public object? Value { get { return this._value; } set diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 5c191a04..91549107 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -14,13 +14,13 @@ public partial class IgbTreeItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeItem _detail; + private IgbTreeItem? _detail; /// /// The tree item the event applies to. /// [Parameter] - public IgbTreeItem Detail + public IgbTreeItem? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index 370b0c66..cbad08d3 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -12,13 +12,13 @@ public partial class IgbTreeSelectionEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeSelectionEventArgsDetail _detail; + private IgbTreeSelectionEventArgsDetail? _detail; /// /// The selection the tree is about to apply. /// [Parameter] - public IgbTreeSelectionEventArgsDetail Detail + public IgbTreeSelectionEventArgsDetail? Detail { get { return this._detail; } set diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index 5f90d8bd..1ff3493a 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -13,13 +13,13 @@ public partial class IgbTreeSelectionEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeItem[] _newSelection; + private IgbTreeItem[]? _newSelection; /// /// The tree items that will make up the new selection. /// [Parameter] - public IgbTreeItem[] NewSelection + public IgbTreeItem[]? NewSelection { get { return this._newSelection; } set diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 34c7e1fb..ffc13645 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -768,7 +768,7 @@ protected virtual bool NeedsDynamicContent } } - private DynamicContentHolder Holder { get; set; } + private DynamicContentHolder? Holder { get; set; } /// protected override async Task OnAfterRenderAsync(bool firstRender) @@ -3430,7 +3430,7 @@ public class IgniteUIBlazor : IIgniteUIBlazor private bool _isRuntimeValid = false; private bool _isRuntimeChecked = false; private bool _isRemoteRuntime = false; - private System.Reflection.PropertyInfo _remoteRuntimeProp; + private System.Reflection.PropertyInfo? _remoteRuntimeProp; public IgniteUIBlazor(IJSRuntime runtime, IIgniteUIBlazorSettings settings) { @@ -3469,7 +3469,7 @@ public IgniteUIBlazor(IJSRuntime runtime) } public IJSRuntime JsRuntime { get; private set; } - public IIgniteUIBlazorSettings Settings { get; private set; } + public IIgniteUIBlazorSettings? Settings { get; private set; } public WebCallback WebCallback { get; private set; } private ConcurrentDictionary _loadedCache = new ConcurrentDictionary(); diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index ca39ecbc..7150fb9f 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -11,7 +11,7 @@ public partial class BaseRendererElement : ComponentBase, JsonSerializable // Console.WriteLine("constructing: " + this.GetType().Name); // } - private IIgniteUIBlazor _igBlazor; + private IIgniteUIBlazor? _igBlazor; [Inject] protected IIgniteUIBlazor IgBlazor { @@ -97,7 +97,7 @@ protected virtual bool UseDirectRender } } - [Parameter] public RenderFragment ChildContent { get; set; } + [Parameter] public RenderFragment? ChildContent { get; set; } protected virtual bool SupportsVisualChildren { diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 6746c3a6..0ff3a7c4 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -1,4 +1,4 @@ -using System.Collections.Specialized; +using System.Collections.Specialized; namespace IgniteUI.Blazor.Controls { @@ -6,15 +6,15 @@ internal class CollectionAdapter where T : class where J : class { - private IList _queryItems; + private IList? _queryItems; private IList _manualItems = new List(); - private IList _allList; - private IList _target; - private IList _query; - private Func _toTarget; - private Action _onItemAdded; - private Action _onItemRemoved; + private IList? _allList; + private IList? _target; + private IList? _query; + private Func? _toTarget; + private Action? _onItemAdded; + private Action? _onItemRemoved; private bool _hasShiftedOnceAlready; diff --git a/src/componentsBase/DataAdapters.cs b/src/componentsBase/DataAdapters.cs index 4b9196f8..2bdcaff9 100644 --- a/src/componentsBase/DataAdapters.cs +++ b/src/componentsBase/DataAdapters.cs @@ -1,4 +1,4 @@ -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { public class LocalJson { @@ -12,7 +12,7 @@ public static LocalJson From(string json) return new LocalJson(json); } - private string _json; + private string? _json; public string Json { get { return _json; } } internal string ToRef() @@ -38,8 +38,8 @@ public static RemoteJson From(string uri) return new RemoteJson(uri); } - private string _uri; - public string Uri { get { return _uri; } } + private string? _uri; + public string? Uri { get { return _uri; } } internal string ToRef() { diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 6e4e42dc..0ebca1ff 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -1,4 +1,4 @@ -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { internal class DataSourceManager { @@ -10,12 +10,12 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) _refSink = sink; } - private RuntimeHelper _helper; + private RuntimeHelper? _helper; // public int ChunkAmount { get; set; } // public int ChunkSlicingWait { get; set; } - private RefSink _refSink; + private RefSink? _refSink; private Dictionary _refs = new Dictionary(); private Dictionary _refsById = new Dictionary(); private Dictionary _dataSources = new Dictionary(); diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 4b03ed62..0dcc186e 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -6,7 +6,7 @@ namespace IgniteUI.Blazor.Controls public class DynamicContentHolder : ComponentBase { - protected LinkedList DynamicContentInfo + protected LinkedList? DynamicContentInfo { get; set; @@ -104,7 +104,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) public abstract class DynamicContentInfo { - public Type ControlType { get; set; } + public Type? ControlType { get; set; } public DynamicContentInfo() { RefName = Guid.NewGuid().ToString(); @@ -134,7 +134,7 @@ public object? Component } } - public BaseRendererControl Owner { get; internal set; } + public BaseRendererControl? Owner { get; internal set; } protected virtual void OnComponentChanged(object oldValue, object component) { @@ -215,15 +215,15 @@ public Task GetInstanceAsync() return tcs.Task; } - public event DynamicComponentChangingEventHandler OnComponentChanging; + public event DynamicComponentChangingEventHandler? OnComponentChanging; } public delegate void DynamicComponentChangingEventHandler(object sender, DynamicComponentChangingEventArgs e); public class DynamicComponentChangingEventArgs { - public object OldComponent { get; internal set; } - public object NewComponent { get; internal set; } + public object? OldComponent { get; internal set; } + public object? NewComponent { get; internal set; } } public class DynamicContentInfo @@ -234,8 +234,8 @@ public DynamicContentInfo() ControlType = typeof(IgbTemplateContent); } - private RenderFragment _template; - private T _context; + private RenderFragment? _template; + private T? _context; private bool _hasPopulatedContext = false; diff --git a/src/componentsBase/IgbComponentRendererContainer.cs b/src/componentsBase/IgbComponentRendererContainer.cs index 6cee0a20..e046f4d3 100644 --- a/src/componentsBase/IgbComponentRendererContainer.cs +++ b/src/componentsBase/IgbComponentRendererContainer.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -6,7 +6,7 @@ namespace IgniteUI.Blazor.Controls public class IgbComponentRendererContainer : ComponentBase { - private Type _componentType; + private Type? _componentType; [Parameter] public Type ComponentType { @@ -70,15 +70,15 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) } } - public event ComponentRendererComponentChangedEventHandler ComponentChanged; + public event ComponentRendererComponentChangedEventHandler? ComponentChanged; } public delegate void ComponentRendererComponentChangedEventHandler(object sender, ComponentRendererComponentChangedEventArgs args); public class ComponentRendererComponentChangedEventArgs { - public object OldComponent { get; internal set; } - public object NewComponent { get; internal set; } + public object? OldComponent { get; internal set; } + public object? NewComponent { get; internal set; } } } diff --git a/src/componentsBase/IgbTemplateContent.razor b/src/componentsBase/IgbTemplateContent.razor index ae2d5b92..a666c729 100644 --- a/src/componentsBase/IgbTemplateContent.razor +++ b/src/componentsBase/IgbTemplateContent.razor @@ -11,12 +11,12 @@ @code { [Parameter] - public RenderFragment Template { get; set; } + public RenderFragment? Template { get; set; } private bool _hasPopulatedContext = false; - private T _context; + private T? _context; [Parameter] - public T Context + public T? Context { get { @@ -32,4 +32,4 @@ { StateHasChanged(); } -} \ No newline at end of file +} diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 05021854..a867185e 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -11,7 +11,7 @@ internal class JSDataSourceSchema private Dictionary _checkedArray = new Dictionary(); - public Action NotifyModified { get; set; } + public Action? NotifyModified { get; set; } private bool HasDataIntents() { @@ -725,20 +725,20 @@ public void AddField(FieldInfo curr) _buildingFieldsTypes.Add(type); } - public PropertyInfo[] Properties; - public Func[] PropertyGetters; - public Func[] FieldGetters; - public Delegate[] TypedPropertyGetters; - public Delegate[] TypedFieldGetters; - public JSDataSourceSchemaType[] PropertyTypes; - public IDataIntentAttribute[]?[] PropertyDataIntents; - public System.Text.Json.JsonEncodedText[] JsonPropertyNames; - public System.Text.Json.JsonEncodedText[] JsonFieldNames; - public String[] PropertyNames; - public String[] FieldNames; - public FieldInfo[] Fields; - public JSDataSourceSchemaType[] FieldTypes; - public IDataIntentAttribute[]?[] FieldDataIntents; + public PropertyInfo[]? Properties; + public Func[]? PropertyGetters; + public Func[]? FieldGetters; + public Delegate[]? TypedPropertyGetters; + public Delegate[]? TypedFieldGetters; + public JSDataSourceSchemaType[]? PropertyTypes; + public IDataIntentAttribute[]?[]? PropertyDataIntents; + public System.Text.Json.JsonEncodedText[]? JsonPropertyNames; + public System.Text.Json.JsonEncodedText[]? JsonFieldNames; + public String[]? PropertyNames; + public String[]? FieldNames; + public FieldInfo[]? Fields; + public JSDataSourceSchemaType[]? FieldTypes; + public IDataIntentAttribute[]?[]? FieldDataIntents; private System.Linq.Expressions.UnaryExpression GetConversion(Type type, System.Linq.Expressions.Expression expression) { diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 0af1f19b..cc252d38 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Globalization; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Components; @@ -15,10 +15,10 @@ public RendererSerializer(SerializationContext context, ComponentBase component, _component = component; } - private string _name; - private ComponentBase _component; + private string? _name; + private ComponentBase? _component; - private SerializationContext _context; + private SerializationContext? _context; //private List _properties = new List(); private string? _type = null; diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index d7233089..ea6844bf 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Runtime.CompilerServices; using Microsoft.JSInterop; @@ -8,13 +8,13 @@ namespace IgniteUI.Blazor.Controls internal class RuntimeHelper { #if NET5_0 - private IJSUnmarshalledRuntime _unmarshalledRuntime; + private IJSUnmarshalledRuntime? _unmarshalledRuntime; #else - private Func _callSendUnmarshalledColumnMessage; - private Func _callSendUnmarshalledColumnDataIntentMessage; + private Func? _callSendUnmarshalledColumnMessage; + private Func? _callSendUnmarshalledColumnDataIntentMessage; #endif - private IJSInProcessRuntime _inprocRuntime; - private IIgniteUIBlazor _igBlazor; + private IJSInProcessRuntime? _inprocRuntime; + private IIgniteUIBlazor? _igBlazor; #if !NETSTANDARD [DynamicDependency( diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 65f33657..41e06914 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Specialized; using System.Runtime.InteropServices; @@ -18,7 +18,7 @@ public UnmarshalledColumnData() SubSchema = null; } - public string PropertyPath { get; set; } + public string? PropertyPath { get; set; } public JSDataSourceSchemaType Type { get; set; } public int[]? IntValues { get; set; } public long[]? LongValues { get; set; } @@ -34,14 +34,14 @@ public UnmarshalledColumnData() public UnmarshalledColumnData[]? SubColumns { get; set; } public JSDataSourceSchema? SubSchema { get; set; } - public Action Insert { get; internal set; } - public Action Update { get; internal set; } - public Action Remove { get; internal set; } + public Action? Insert { get; internal set; } + public Action? Update { get; internal set; } + public Action? Remove { get; internal set; } public bool IsIDColumn { get; internal set; } - public Action Clear { get; internal set; } - public string PropertyName { get; internal set; } + public Action? Clear { get; internal set; } + public string? PropertyName { get; internal set; } public bool IsSubDataSource { get; internal set; } - public Delegate Getter { get; internal set; } + public Delegate? Getter { get; internal set; } } [StructLayout(LayoutKind.Explicit, Size = 56)] @@ -83,12 +83,12 @@ public JSDataSourceType DataSourceType } } public bool IsSent { get; set; } - private object _originalData; + private object? _originalData; private Dictionary _uuidToOriginal = new Dictionary(); private Dictionary _originalToUuid = new Dictionary(); //private Dictionary _stringToUuid = new Dictionary(); - private RuntimeHelper _helper; + private RuntimeHelper? _helper; private JSDataSourceSchema? _parentSchema = null; private string? _parentId; private DataSourceManager? _manager = null; @@ -97,7 +97,7 @@ public JSDataSourceType DataSourceType private Dictionary> _subDataSources = new Dictionary>(); - private Func _idGetter; + private Func? _idGetter; private int _size = 0; private int _capacity = 0; diff --git a/src/componentsBase/WebInputs/DropdownItem.cs b/src/componentsBase/WebInputs/DropdownItem.cs index 96cefd44..162a10ca 100644 --- a/src/componentsBase/WebInputs/DropdownItem.cs +++ b/src/componentsBase/WebInputs/DropdownItem.cs @@ -5,7 +5,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbDropdownItem : IDisposable { [CascadingParameter(Name = "DropdownParent")] - protected BaseRendererControl DropdownParent + protected BaseRendererControl? DropdownParent { get; set; } diff --git a/src/componentsBase/WebInputs/SelectItem.cs b/src/componentsBase/WebInputs/SelectItem.cs index 6e00d7bf..4e4da625 100644 --- a/src/componentsBase/WebInputs/SelectItem.cs +++ b/src/componentsBase/WebInputs/SelectItem.cs @@ -5,7 +5,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbSelectItem : IDisposable { [CascadingParameter(Name = "SelectParent")] - protected BaseRendererControl SelectParent + protected BaseRendererControl? SelectParent { get; set; } diff --git a/src/componentsBase/WebInputs/Tile.cs b/src/componentsBase/WebInputs/Tile.cs index 854549ba..47b9fb79 100644 --- a/src/componentsBase/WebInputs/Tile.cs +++ b/src/componentsBase/WebInputs/Tile.cs @@ -5,7 +5,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbTile : IDisposable { [CascadingParameter(Name = "TileManagerParent")] - protected BaseRendererControl TileManagerParent + protected BaseRendererControl? TileManagerParent { get; set; } diff --git a/src/componentsBase/WebInputs/TreeItem.cs b/src/componentsBase/WebInputs/TreeItem.cs index 57b0519d..ab66b1aa 100644 --- a/src/componentsBase/WebInputs/TreeItem.cs +++ b/src/componentsBase/WebInputs/TreeItem.cs @@ -5,7 +5,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbTreeItem : IDisposable { [CascadingParameter(Name = "TreeParent")] - protected BaseRendererControl TreeParent + protected BaseRendererControl? TreeParent { get; set; } From c42a84970c4f7dd5282979871c68e28c48d5fef3 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 17:53:35 +0300 Subject: [PATCH 04/64] Fix CS8600 - null conversion issues. --- src/components/Blazor/DateRangePicker.cs | 4 +- src/components/Blazor/Dropdown.cs | 12 +- src/components/Blazor/Input.cs | 2 +- src/components/Blazor/MaskInput.cs | 2 +- src/components/Blazor/RadioGroup.cs | 2 +- src/components/Blazor/Select.cs | 4 +- src/components/Blazor/SliderBase.cs | 2 +- src/components/Blazor/Textarea.cs | 2 +- src/componentsBase/BaseCollection.cs | 129 ++++++++---------- src/componentsBase/BaseRendererControl.cs | 102 +++++++------- src/componentsBase/BaseRendererElement.cs | 6 +- src/componentsBase/CollectionAdapter.cs | 10 +- src/componentsBase/DataSourceManager.cs | 4 +- src/componentsBase/DynamicContentHolder.cs | 4 +- src/componentsBase/EventCallbackExtensions.cs | 4 +- src/componentsBase/JsonDataSource.cs | 6 +- src/componentsBase/JsonDataSourceItem.cs | 2 +- src/componentsBase/JsonDataSourceSchema.cs | 10 +- src/componentsBase/RendererSerializer.cs | 4 +- src/componentsBase/UnmarshalledDataSource.cs | 78 +++++------ src/componentsBase/WebInputs/Input.cs | 4 +- src/componentsBase/WebInputs/Rating.cs | 2 +- src/componentsBase/WebViewCallback.cs | 18 +-- .../Components/Common/TestUtil.cs | 4 +- 24 files changed, 203 insertions(+), 214 deletions(-) diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index a7821860..c1b5f6de 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -72,7 +72,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDateRangeValue); @@ -92,7 +92,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDateRangeValue); diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index e5534f12..341fb777 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -240,7 +240,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); @@ -260,7 +260,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); @@ -300,7 +300,7 @@ public async Task NavigateToAsync(Object index) { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); @@ -321,7 +321,7 @@ public IgbDropdownItem NavigateTo(Object index) { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); @@ -341,7 +341,7 @@ public async Task SelectAsync(Object value) { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); @@ -362,7 +362,7 @@ public IgbDropdownItem Select(Object value) { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbDropdownItem); diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index bc752326..2c78cc48 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -446,7 +446,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)(args.Detail); + newValueValue = (string)args.Detail!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 52504dc3..5ebf9bc8 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -281,7 +281,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)(args.Detail); + newValueValue = (string)args.Detail!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 918ff3f5..e15c6ce4 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -214,7 +214,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)(args.Detail.Value); + newValueValue = (string)args.Detail.Value!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 35d3bb34..9abf148d 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -314,7 +314,7 @@ public IgbSelectGroup[] GetGroups() { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); + var retVal = (IgbSelectItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbSelectItem); @@ -334,7 +334,7 @@ public IgbSelectGroup[] GetGroups() { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); + var retVal = (IgbSelectItem)ConvertReturnValue(iv)!; if (retVal == null) { return default(IgbSelectItem); diff --git a/src/components/Blazor/SliderBase.cs b/src/components/Blazor/SliderBase.cs index 6230af59..2558f3a0 100644 --- a/src/components/Blazor/SliderBase.cs +++ b/src/components/Blazor/SliderBase.cs @@ -442,7 +442,7 @@ internal override void SerializeCore(RendererSerializer ser) if (IsPropDirty("TickLabelRotation")) { ser.AddEnumProp("tickLabelRotation", this._tickLabelRotation); } if (IsPropDirty("ValueFormatOptions")) - { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable)this._valueFormatOptions); } + { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable)this._valueFormatOptions!); } } diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index dfdcd889..274e3632 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -676,7 +676,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)(args.Detail); + newValueValue = (string)args.Detail!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 2c9cd534..3017bf33 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -45,10 +45,9 @@ public T[] ToArray() protected override void InsertItem(int index, T item) { base.InsertItem(index, item); - if (item is BaseRendererElement) + if (item is BaseRendererElement element) { - BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = _parent; + element.Parent = _parent; } NotifyParent(); } @@ -58,10 +57,9 @@ protected override void RemoveItem(int index) { var item = this[index]; base.RemoveItem(index); - if (item is BaseRendererElement) + if (item is BaseRendererElement element) { - BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = null!; + element.Parent = null!; } NotifyParent(); } @@ -70,10 +68,9 @@ protected override void RemoveItem(int index) protected override void SetItem(int index, T item) { base.SetItem(index, item); - if (item is BaseRendererElement) + if (item is BaseRendererElement element) { - BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = _parent; + element.Parent = _parent; } NotifyParent(); } @@ -136,10 +133,9 @@ protected override void ClearItems() for (var i = 0; i < Count; i++) { var item = this[i]; - if (item is BaseRendererElement) + if (item is BaseRendererElement element) { - BaseRendererElement c = (BaseRendererElement)(object)item; - c.Parent = null!; + element.Parent = null!; } } base.ClearItems(); @@ -160,54 +156,55 @@ public void Serialize(SerializationContext context, string? propertyName = null) for (var i = 0; i < Count; i++) { var val = this[i]; - if (val is JsonSerializable) + if (val is null) { - ((JsonSerializable)val).Serialize(context); + context.Writer.WriteNullValue(); + } + else if (val is JsonSerializable serializable) + { + serializable.Serialize(context); + } + else if (val is int intValue) + { + context.Writer.WriteNumberValue(intValue); + } + else if (val is long longValue) + { + context.Writer.WriteNumberValue(longValue); + } + else if (val is short shortValue) + { + context.Writer.WriteNumberValue(shortValue); + } + else if (val is decimal decimalValue) + { + context.Writer.WriteNumberValue(decimalValue); + } + else if (val is float floatValue) + { + context.Writer.WriteNumberValue(floatValue); + } + else if (val is double doubleValue) + { + context.Writer.WriteNumberValue(doubleValue); + } + else if (val is byte byteValue) + { + context.Writer.WriteNumberValue(byteValue); + } + else if (val is string stringValue) + { + context.Writer.WriteStringValue(stringValue); } else { - if (typeof(T) == typeof(int)) - { - context.Writer.WriteNumberValue((int)(object)val); - } - else if (typeof(T) == typeof(long)) - { - context.Writer.WriteNumberValue((long)(object)val); - } - else if (typeof(T) == typeof(short)) - { - context.Writer.WriteNumberValue((short)(object)val); - } - else if (typeof(T) == typeof(decimal)) - { - context.Writer.WriteNumberValue((decimal)(object)val); - } - else if (typeof(T) == typeof(float)) - { - context.Writer.WriteNumberValue((float)(object)val); - } - else if (typeof(T) == typeof(double)) - { - context.Writer.WriteNumberValue((double)(object)val); - } - else if (typeof(T) == typeof(byte)) - { - context.Writer.WriteNumberValue((byte)(object)val); - } - else if (typeof(T) == typeof(string)) + if (_parent is BaseRendererElement parentElement) { - context.Writer.WriteStringValue((string)(object)val); + parentElement.ObjectToParam(context, val); } - else + if (_parent is BaseRendererControl parentControl) { - if (_parent is BaseRendererElement) - { - ((BaseRendererElement)_parent).ObjectToParam(context, val); - } - if (_parent is BaseRendererControl) - { - ((BaseRendererControl)_parent).ObjectToParam(context, val); - } + parentControl.ObjectToParam(context, val); } } } @@ -221,25 +218,20 @@ public object FindByName(string name) for (var i = 0; i < this.Count; i++) { var item = this[i]; - if (item is BaseRendererElement) + if (item is BaseRendererElement ele) { - var ele = (BaseRendererElement)(object)item; if (name == ele.Name) { return item; } var subEle = ele.FindByName(name); - if (subEle is BaseRendererElement) + if (subEle is BaseRendererElement childElement && name == childElement.Name) { - if (name == ((BaseRendererElement)subEle).Name) - { - return subEle; - } + return childElement; } } - else if (item is BaseRendererControl) + else if (item is BaseRendererControl element) { - BaseRendererControl element = (BaseRendererControl)(object)item; if (name == element.ContainerId) { return element; @@ -255,25 +247,20 @@ public bool HasName(string name) for (var i = 0; i < this.Count; i++) { var item = this[i]; - if (item is BaseRendererElement) + if (item is BaseRendererElement ele) { - var ele = (BaseRendererElement)(object)item; if (name == ele.Name) { return true; } var subEle = ele.FindByName(name); - if (subEle is BaseRendererElement) + if (subEle is BaseRendererElement childElement && name == childElement.Name) { - if (name == ((BaseRendererElement)subEle).Name) - { - return true; - } + return true; } } - else if (item is BaseRendererControl) + else if (item is BaseRendererControl element) { - BaseRendererControl element = (BaseRendererControl)(object)item; if (name == element.ContainerId) { return true; diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index ffc13645..123530f5 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -463,7 +463,7 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) /// protected override void BuildRenderTree(RenderTreeBuilder builder) { - string spinalName = ToSpinal(this.Type); + string? spinalName = ToSpinal(this.Type); string className = "igb-" + spinalName; if (Class != null) { @@ -665,7 +665,7 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin { case "Add": { - DynamicContentInfo dynamicContent = BuildDynamicContentInfo(contentType, templateId); + DynamicContentInfo? dynamicContent = BuildDynamicContentInfo(contentType, templateId); if (dynamicContent == null) { return; @@ -901,7 +901,7 @@ internal virtual void SerializeCore(RendererSerializer ser) protected String _cachedSerializedContent = ""; - public virtual string Type + public virtual string? Type { get { @@ -1192,7 +1192,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal _isDirty[propertyName] = true; _hasDirty = true; _serializeDirty = true; - string refId = _containerId + "/" + propertyName; + string? refId = _containerId + "/" + propertyName; if (newValue is LocalJson) { @@ -1733,7 +1733,7 @@ private object SendJsonImmediateSync(RendererMessage m) } string json = m.ToJson(); - ElementReference[] nativeElements = m.NativeElements; + ElementReference[]? nativeElements = m.NativeElements; if (nativeElements != null) { @@ -1878,14 +1878,14 @@ internal T[] DowncastArray(object val) return (T[])val; } - internal object ConvertReturnValue(object returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object? ConvertReturnValue(object? returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { try { //Console.WriteLine(returnValue.GetType().ToString()); if (returnValue is String || returnValue is Dictionary || returnValue is JsonElement) { - Dictionary obj; + Dictionary? obj; if (returnValue is String) { obj = JsonSerializer.Deserialize>((string)returnValue, SerializerOptions); @@ -1943,7 +1943,7 @@ internal object ConvertReturnValue(object returnValue, bool transformArrays = fa { obj = (Dictionary)returnValue; } - if (obj.ContainsKey("refType")) + if (obj != null && obj.ContainsKey("refType")) { String refType = ((JsonElement)obj["refType"]).ToString(); if ("uuid".Equals(refType)) @@ -1965,7 +1965,7 @@ internal object ConvertReturnValue(object returnValue, bool transformArrays = fa returnValue = FindByName(name); } } - else if (obj.ContainsKey("retType")) + else if (obj != null && obj.ContainsKey("retType")) { String retType = ((JsonElement)obj["retType"]).ToString(); if ("number".Equals(retType)) @@ -2037,7 +2037,7 @@ internal object ConvertReturnValue(object returnValue, bool transformArrays = fa return null; } - object o = null; + object? o = null; if (type != null) { o = MarshalByValueFactory.CreateInstance(type); @@ -2104,7 +2104,7 @@ public void OnInvokeReturn(long invokeId, Object returnValue) // } //} - object result = returnValue; + object? result = returnValue; if (returnValue is JsonElement && ((JsonElement)returnValue).ValueKind == JsonValueKind.String) { var str = ((JsonElement)returnValue).GetString(); @@ -2129,18 +2129,18 @@ internal T ReturnToObject(object val) return ReturnToObject(val, null); } - internal T ReturnToObject(object val, string? typeGuess) + internal T ReturnToObject(object? val, string? typeGuess) { if (val == null) { - return default(T); + return default(T)!; } val = ConvertReturnValue(val, false, typeGuess); - return (T)val; + return (T)val!; } - public virtual object FindByName(string name) + public virtual object? FindByName(string name) { if ("mainControl".Equals(name)) { @@ -2150,13 +2150,13 @@ public virtual object FindByName(string name) return null; } - private object GetObjectById(long objId) + private object? GetObjectById(long objId) { //TODO: this return null; } - internal int ReturnToInt(object val) + internal int ReturnToInt(object? val) { if (val == null) { @@ -2171,13 +2171,14 @@ internal int ReturnToInt(object val) { return ((IConvertible)val).ToInt32(CultureInfo.InvariantCulture); } - else + else if (val != null) { return int.Parse(val.ToString()); } + return 0; } - internal double ReturnToDouble(object val) + internal double ReturnToDouble(object? val) { if (val == null) { @@ -2199,11 +2200,12 @@ internal double ReturnToDouble(object val) //Console.WriteLine(val); return ((IConvertible)val).ToDouble(CultureInfo.InvariantCulture); } - else + else if (val != null) { //Console.WriteLine(val); return Double.Parse(val.ToString()); } + return double.NaN; } internal long ReturnToLong(object val) @@ -2213,7 +2215,7 @@ internal long ReturnToLong(object val) return 0; } //Console.WriteLine("converting return"); - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val == null) { return Int64.MinValue; @@ -2235,7 +2237,7 @@ internal long ReturnToLong(object val) } } - internal DateTime[] ReturnToDateArray(object val) + internal DateTime[]? ReturnToDateArray(object? val) { if (val == null) { @@ -2248,11 +2250,11 @@ internal DateTime[] ReturnToDateArray(object val) } try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize(val?.ToString(), SerializerOptions); DateTime[] ret = new DateTime[arr.Length]; for (int i = 0; i < arr.Length; i++) { - Object ele = arr[i]; + Object ele = arr[i]!; ele = ReturnToDate(ele); ret[i] = (DateTime)ele; } @@ -2264,7 +2266,7 @@ internal DateTime[] ReturnToDateArray(object val) } } - internal DateTime ReturnToDate(object val, bool tryConvertValue = true) + internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) { if (val == null) { @@ -2285,11 +2287,11 @@ internal DateTime ReturnToDate(object val, bool tryConvertValue = true) switch (RoundTripDateConversion) { case RoundTripDateConversion.UTC: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); case RoundTripDateConversion.Auto: case RoundTripDateConversion.Local: default: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); } } else if (val is IConvertible) @@ -2303,11 +2305,11 @@ internal DateTime ReturnToDate(object val, bool tryConvertValue = true) switch (RoundTripDateConversion) { case RoundTripDateConversion.UTC: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); case RoundTripDateConversion.Auto: case RoundTripDateConversion.Local: default: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); } } } @@ -2318,7 +2320,7 @@ internal bool ReturnToBoolean(object val) { return false; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val is bool) { return (bool)val; @@ -2491,7 +2493,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object if (val is BaseRendererControl) { - typeName = ((BaseRendererControl)val).Type; + typeName = ((BaseRendererControl)val).Type!; } else if (val is BaseRendererElement) { @@ -2592,7 +2594,7 @@ internal string ReturnToString(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val == null) { @@ -2649,7 +2651,7 @@ internal T StringToEnum(Object val) where T : struct { return default(T); } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val == null) { return default(T); @@ -2773,19 +2775,19 @@ internal object[] ReturnToObjectArray(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val == null) { return null; } try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); Object[] ret = new Object[arr.Length]; for (int i = 0; i < arr.Length; i++) { Object ele = arr[i]; - ele = ConvertReturnValue(ele); + ele = ConvertReturnValue(ele)!; ret[i] = ele; } return ret; @@ -2807,7 +2809,7 @@ internal object[] ReturnToObjectArray(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; try { var arr = JsonSerializer.Deserialize[]>(val.ToString(), SerializerOptions); @@ -2817,7 +2819,7 @@ internal object[] ReturnToObjectArray(object val) Object ele = arr[i]; //Console.WriteLine("converting obj"); //Console.WriteLine(ele); - ele = ConvertReturnValue(ele, false, typeGuess); + ele = ConvertReturnValue(ele, false, typeGuess)!; ret[i] = (T)ele; } return ret; @@ -2834,7 +2836,7 @@ internal string[] ReturnToStringArray(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; if (val == null) { return null; @@ -2842,11 +2844,11 @@ internal string[] ReturnToStringArray(object val) try { var valStr = val.ToString(); - var arr = JsonSerializer.Deserialize((string)valStr, SerializerOptions); + var arr = JsonSerializer.Deserialize(valStr!, SerializerOptions); string[] ret = new string[arr.Length]; for (int i = 0; i < arr.Length; i++) { - string ele = arr[i] != null ? arr[i].ToString() : null; + string? ele = arr[i] != null ? arr[i].ToString() : null; ret[i] = ele; } return ret; @@ -2863,10 +2865,10 @@ internal double[] ReturnToDoubleArray(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); double[] ret = new double[arr.Length]; for (int i = 0; i < arr.Length; i++) { @@ -2887,10 +2889,10 @@ internal int[] ReturnToIntArray(object val) { return null; } - val = ConvertReturnValue(val); + val = ConvertReturnValue(val)!; try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); int[] ret = new int[arr.Length]; for (int i = 0; i < arr.Length; i++) { @@ -3058,7 +3060,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) { //Console.WriteLine("got handler"); bool usedTempParent = false; - Object senderObj = null; + Object? senderObj = null; try { var obj = JsonSerializer.Deserialize>((string)args.ToString(), SerializerOptions); @@ -3067,7 +3069,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) object sender = obj["sender"]; if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) { - sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString(), SerializerOptions); + sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString()!, SerializerOptions)!; } senderObj = ConvertReturnValue(sender); @@ -3081,7 +3083,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) } var argsString = obj["args"] != null ? obj["args"].ToString() : null; - object val = null; + object? val = null; if (argsString != null) { @@ -3192,7 +3194,7 @@ public async Task SetResourceStringAsync(string grouping, string json) protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, JsonElement jsonElement) { - System.Type type = Nullable.GetUnderlyingType(property.PropertyType); + System.Type? type = Nullable.GetUnderlyingType(property.PropertyType); if (type == null) { type = property.PropertyType; @@ -3245,7 +3247,7 @@ protected void SetPropertyValue(object item, System.Reflection.PropertyInfo prop } protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, object value) { - System.Type type = Nullable.GetUnderlyingType(property.PropertyType); + System.Type? type = Nullable.GetUnderlyingType(property.PropertyType); if (type == null) { type = property.PropertyType; diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 7150fb9f..bdcc4706 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -201,7 +201,7 @@ protected void OnElementNameChanged(BaseRendererElement element, string oldName, } else { - ((BaseRendererControl)CurrParent).OnElementNameChanged(element, oldName, newName); + ((BaseRendererControl)CurrParent!).OnElementNameChanged(element, oldName, newName); } }); } @@ -396,8 +396,8 @@ internal void UpdateTemplate(string contentType, object template, Type type) } else { - ((BaseRendererElement)_parent).ChildDirty(this); - ((BaseRendererElement)_parent).UpdateTemplate(contentType, template, type); + ((BaseRendererElement)_parent!).ChildDirty(this); + ((BaseRendererElement)_parent!).UpdateTemplate(contentType, template, type); } }; if (_parent != null) diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 0ff3a7c4..90921c7c 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -85,14 +85,14 @@ private void OnManualChanged(object sender, NotifyCollectionChangedEventArgs arg switch (args.Action) { case NotifyCollectionChangedAction.Add: - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); break; case NotifyCollectionChangedAction.Remove: this.RemoveManualItemAt(args.OldStartingIndex); break; case NotifyCollectionChangedAction.Replace: this.RemoveManualItemAt(args.OldStartingIndex); - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); break; case NotifyCollectionChangedAction.Reset: this.ClearManualItems(); @@ -102,7 +102,7 @@ private void OnManualChanged(object sender, NotifyCollectionChangedEventArgs arg public void ShiftContentToManual(IList manualCollection, Action onMoving) { - T item = default(T); + T item = default(T)!; var manualSet = new HashSet(); if (this.CollisionChecker != null) @@ -168,7 +168,7 @@ private void SyncItems() Dictionary queryMap = new Dictionary(); Dictionary manualMap = new Dictionary(); - T item = default(T); + T item = default(T)!; for (var i = 0; i < this._allList.Count; i++) { item = this._allList[i]; @@ -239,7 +239,7 @@ private void SyncItems() int ind = 0; int ins = 0; - T insItem = default(T); + T insItem = default(T)!; int maxLen = queryArray.Count + this._manualItems.Count; while (ind < maxLen) { diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 0ebca1ff..06883b3a 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -72,7 +72,7 @@ public Guid FindItemId(object item) public string OnRefChanged(string path, object data) { - string id = null; + string? id = null; if (_refs.ContainsKey(path)) { object obj = _refs[path]; @@ -226,7 +226,7 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI { object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; - IJSDataSourceItem oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; + IJSDataSourceItem? oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; IJSDataSourceItem newItemJson = dataSource.NotifySetItem(data, index, oldItem, newItem); _refSink.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); } diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 0dcc186e..9164d42e 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -189,8 +189,8 @@ protected override void OnComponentChanged(object oldValue, object component) public Task GetInstanceAsync() { TaskCompletionSource tcs = new TaskCompletionSource(); - object component = null; - List> toSignal = null; + object? component = null; + List>? toSignal = null; lock (_lock) { diff --git a/src/componentsBase/EventCallbackExtensions.cs b/src/componentsBase/EventCallbackExtensions.cs index c173687c..d10a7d0c 100644 --- a/src/componentsBase/EventCallbackExtensions.cs +++ b/src/componentsBase/EventCallbackExtensions.cs @@ -36,8 +36,8 @@ internal static bool EqualsCompat(this EventCallback left, Event } // Mirrors .NET 10's EventCallback.Equals, need the internal fields for the checks: - MulticastDelegate leftDelegate = (MulticastDelegate)CallbackFields.Delegate.GetValue(left); - MulticastDelegate rightDelegate = (MulticastDelegate)CallbackFields.Delegate.GetValue(other); + MulticastDelegate? leftDelegate = (MulticastDelegate?)CallbackFields.Delegate.GetValue(left); + MulticastDelegate? rightDelegate = (MulticastDelegate?)CallbackFields.Delegate.GetValue(other); return ReferenceEquals(CallbackFields.Receiver.GetValue(left), CallbackFields.Receiver.GetValue(other)) && (leftDelegate?.Equals(rightDelegate) ?? (rightDelegate == null)); diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index d3d03913..1d4a9ca6 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -397,7 +397,7 @@ private void Add(object? item) var subSchema = schema.GetSubSchema(propertyName); if (subSchema != null) { - var propValue = (JsonDataSourceItem)itemJson.GetValue(propertyName); + var propValue = (JsonDataSourceItem)itemJson.GetValue(propertyName)!; if (propValue.Source != null) { if (!_subDataSources.ContainsKey(itemJson.Id)) @@ -539,7 +539,7 @@ public IJSDataSourceItem this[int i] public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) { EnsureSchema(item); - JsonDataSourceItem itemJson = null; + JsonDataSourceItem? itemJson = null; if (HasOriginal(item)) { itemJson = (JsonDataSourceItem)_originalToItem[item]; @@ -586,7 +586,7 @@ private void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer) for (int i = 0; i < _data.Count; i++) { item = (JsonDataSourceItem)_data[0]; - JsonDataSource ds = (JsonDataSource)item.Source; + JsonDataSource ds = (JsonDataSource)item.Source!; ds.GetDateCacheAsJson(writer); } } diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 9612f11c..6e591dfd 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -151,7 +151,7 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m if (_schema.IsDataSource) { //Console.WriteLine("in read"); - IJSDataSource source = JsonDataSource.CreateWithSchema(item, _schema, manager, _parentId); + IJSDataSource? source = JsonDataSource.CreateWithSchema(item, _schema, manager, _parentId); _source = source; return; } diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index a867185e..0d468727 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -408,7 +408,7 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt NotifyModified(); } } - JSDataSourceSchema subSchema = _subSchemas[name]; + JSDataSourceSchema? subSchema = _subSchemas[name]; return JsonDataSourceItem.Create(value, subSchema, manager, rootItem); } @@ -421,7 +421,7 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) } var schema = JsonDataSourceItem.ExtractSchema(subObject); - JSDataSourceSchema itemSchema = null; + JSDataSourceSchema? itemSchema = null; if (subObject is IEnumerable) { var collection = subObject as IEnumerable; @@ -622,7 +622,7 @@ public JSDataSourceSchemaType ResolveSchemaType(Type type) } if (typeof(IEnumerable).IsAssignableFrom(type)) { - Type enumerableType = null; + Type? enumerableType = null; if (type.IsArray) { enumerableType = type.GetElementType(); @@ -669,7 +669,7 @@ public void AddProperty(PropertyInfo prop) { _buildingProperties.Add(prop); - List dataIntents = null; + List? dataIntents = null; var attrs = prop.GetCustomAttributes(); if (attrs != null) { @@ -702,7 +702,7 @@ public void AddField(FieldInfo curr) Type ret = curr.FieldType; JSDataSourceSchemaType type = ResolveSchemaType(ret); - List dataIntents = null; + List? dataIntents = null; var attrs = curr.GetCustomAttributes(); if (attrs != null) { diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index cc252d38..914f2f9b 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -217,7 +217,7 @@ public void AddArrayProp(string propertyName, IEnumerable values) } //string[] strValues = new string[values.Length]; context.Writer.WriteStartArray(propertyName); - foreach (object val in items) + foreach (object? val in items) { if (val is String) { @@ -562,7 +562,7 @@ public void AddEnumArrayProp(String propertyName, object values) _context.Writer.WriteStartArray(propertyName); for (int i = 0; i < vals.Count; i++) { - Enum val = (Enum)vals[i]; + Enum val = (Enum)vals[i]!; _context.Writer.WriteStringValue(Camelize(val.ToString())); //strValues[i] = "\"" + val.ToString() + "\""; } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 41e06914..d33f4823 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -261,31 +261,31 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa col.IsSubDataSource = newColumn.IsSubDataSource ? 1 : 0; newColumn.Column = col; - Func idGetter = null; - Func doubleGetter = null; - Func singleGetter = null; - Func boolGetter = null; - Func byteGetter = null; - Func decimalGetter = null; - Func shortGetter = null; - Func longGetter = null; - Func stringGetter = null; - Func dateTimeGetter = null; - Func objectGetter = null; - - Func floatingPointGetter = null; - Func integerGetter = null; - - Func nullableShortGetter = null; - Func nullableIntegerGetter = null; - Func nullableLongGetter = null; - Func nullableSingleGetter = null; - Func nullableDoubleGetter = null; - Func nullableDecimalGetter = null; - Func nullableBoolGetter = null; - Func nullableByteGetter = null; - Func nullableDateTimeGetter = null; - Func nullableFloatingPointGetter = null; + Func? idGetter = null; + Func? doubleGetter = null; + Func? singleGetter = null; + Func? boolGetter = null; + Func? byteGetter = null; + Func? decimalGetter = null; + Func? shortGetter = null; + Func? longGetter = null; + Func? stringGetter = null; + Func? dateTimeGetter = null; + Func? objectGetter = null; + + Func? floatingPointGetter = null; + Func? integerGetter = null; + + Func? nullableShortGetter = null; + Func? nullableIntegerGetter = null; + Func? nullableLongGetter = null; + Func? nullableSingleGetter = null; + Func? nullableDoubleGetter = null; + Func? nullableDecimalGetter = null; + Func? nullableBoolGetter = null; + Func? nullableByteGetter = null; + Func? nullableDateTimeGetter = null; + Func? nullableFloatingPointGetter = null; switch (newColumn.Type) { @@ -420,7 +420,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - Action insert = null; + Action? insert = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: @@ -588,7 +588,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.DateTimeValue: insert = (size, column, index, item) => { - string stringVal = null; + string? stringVal = null; Guid idVal = Guid.Empty; if (item != null) { @@ -651,7 +651,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.NullableDateTimeValue: insert = (size, column, index, item) => { - string stringVal = null; + string? stringVal = null; if (item != null) { try @@ -683,7 +683,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa insert = (size, column, index, item) => { //Console.WriteLine("shouldn't be here"); - object objVal = null; + object? objVal = null; if (item != null) { objVal = objectGetter(item); @@ -765,7 +765,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.SingleArrayValue: insert = (size, column, index, item) => { - object objVal = null; + object? objVal = null; if (item != null) { objVal = objectGetter(item); @@ -891,7 +891,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - Action update = null; + Action? update = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: @@ -978,7 +978,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.DateTimeValue: update = (size, column, index, oldItem, newItem) => { - string stringVal = null; + string? stringVal = null; Guid idVal = Guid.Empty; if (column.IsIDColumn && oldItem != newItem) { @@ -1009,7 +1009,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.NullableDateTimeValue: update = (size, column, index, oldItem, newItem) => { - string stringVal = null; + string? stringVal = null; if (newItem != null) { stringVal = stringGetter(newItem); @@ -1020,13 +1020,13 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.ObjectValue: update = (size, column, index, oldItem, newItem) => { - object objVal = null; + object? objVal = null; if (newItem != null) { objVal = objectGetter(newItem); } - object oldObjVal = null; + object? oldObjVal = null; if (oldItem != null) { oldObjVal = objectGetter(oldItem); @@ -1089,13 +1089,13 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.SingleArrayValue: update = (size, column, index, oldItem, newItem) => { - object objVal = null; + object? objVal = null; if (newItem != null) { objVal = objectGetter(newItem); } - object oldObjVal = null; + object? oldObjVal = null; if (oldItem != null) { oldObjVal = objectGetter(oldItem); @@ -1190,7 +1190,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - Action remove = null; + Action? remove = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: @@ -1386,7 +1386,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; } - Action clear = null; + Action? clear = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: diff --git a/src/componentsBase/WebInputs/Input.cs b/src/componentsBase/WebInputs/Input.cs index 2f2cac41..ba4037e6 100644 --- a/src/componentsBase/WebInputs/Input.cs +++ b/src/componentsBase/WebInputs/Input.cs @@ -64,7 +64,7 @@ public override Task SetParametersAsync(ParameterView parameters) { // Params are case-insensitive & can't keep old name as deprecated, // so coerce value to avoid old code setting incorrect type errors: - parameters.TryGetValue("Readonly", out object result); + parameters.TryGetValue("Readonly", out object? result); if (result != null && result is string value) { Logger.LogWarning("Readonly has been renamed, use ReadOnly instead"); @@ -92,7 +92,7 @@ public override Task SetParametersAsync(ParameterView parameters) private ParameterView TryCoerceRenamedNumericProp(ParameterView parameters, string oldName, string newName) { - parameters.TryGetValue(oldName, out object result); + parameters.TryGetValue(oldName, out object? result); if (result != null && result is string value) { Logger.LogWarning($"{oldName} has been renamed, use {newName} instead"); diff --git a/src/componentsBase/WebInputs/Rating.cs b/src/componentsBase/WebInputs/Rating.cs index cdda1021..a999ce2d 100644 --- a/src/componentsBase/WebInputs/Rating.cs +++ b/src/componentsBase/WebInputs/Rating.cs @@ -14,7 +14,7 @@ public override Task SetParametersAsync(ParameterView parameters) { // Params are case-insensitive & can't keep old name as deprecated, // so coerce value to avoid old code setting incorrect type errors: - parameters.TryGetValue("Readonly", out object result); + parameters.TryGetValue("Readonly", out object? result); if (result != null && result is string value) { Logger.LogWarning("Readonly has been renamed, use ReadOnly instead"); diff --git a/src/componentsBase/WebViewCallback.cs b/src/componentsBase/WebViewCallback.cs index 4daad923..c1b5a47f 100644 --- a/src/componentsBase/WebViewCallback.cs +++ b/src/componentsBase/WebViewCallback.cs @@ -41,11 +41,11 @@ public void OnReady() private void ForControls(Action act) { - List toRemove = null; + List? toRemove = null; foreach (var controlKey in _controlsMap.Keys) { var control = _controlsMap[controlKey]; - BaseRendererControl target; + BaseRendererControl? target; if (control.TryGetTarget(out target)) { target.OnReady(); @@ -74,7 +74,7 @@ private BaseRendererControl GetControl(string key) if (_controlsMap.ContainsKey(key)) { var control = _controlsMap[key]; - BaseRendererControl target; + BaseRendererControl? target; if (control.TryGetTarget(out target)) { return target; @@ -138,12 +138,12 @@ public void AdjustDynamicContentBatch(string containerId, string batch) for (var i = 0; i < arr.Length; i++) { var item = arr[i]; - string currContainer = item.ContainsKey("containerId") ? (string)item["containerId"].ToString() : null; - string contentType = item.ContainsKey("contentType") ? (string)item["contentType"].ToString() : null; - string templateId = item.ContainsKey("templateId") ? (string)item["templateId"].ToString() : null; - string contentId = item.ContainsKey("contentId") ? (string)item["contentId"].ToString() : null; - string actionType = item.ContainsKey("actionType") ? (string)item["actionType"].ToString() : null; - string args = item.ContainsKey("args") ? (item["args"] != null ? item["args"].ToString() : null) : null; + string? currContainer = item.ContainsKey("containerId") ? item["containerId"].ToString() : null; + string? contentType = item.ContainsKey("contentType") ? item["contentType"].ToString() : null; + string? templateId = item.ContainsKey("templateId") ? item["templateId"].ToString() : null; + string? contentId = item.ContainsKey("contentId") ? item["contentId"].ToString() : null; + string? actionType = item.ContainsKey("actionType") ? item["actionType"].ToString() : null; + string? args = item.ContainsKey("args") ? (item["args"] != null ? item["args"].ToString() : null) : null; //Console.WriteLine("raising event"); if (currContainer != null) { diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs index a56c4c0a..8e3bb6cd 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs @@ -84,9 +84,9 @@ public static bool PropertyValuesAreEqual(object? serverValue, string? clientVal return false; } - DateTime[] serverDateArray = (DateTime[])serverDateRangeArray[i].DateRange; + DateTime[] serverDateArray = (DateTime[])serverDateRangeArray[i].DateRange!; string[] serverStringArray = serverDateArray.Select(x => x.ToShortDateString()).ToArray(); - var clientRangeArray = ((JArray)clientDateArray[i].DateRange).ToObject(); + var clientRangeArray = ((JArray)clientDateArray[i].DateRange!).ToObject(); if (clientRangeArray == null) { return false; From 6672f37d20997ee47696aebef8455bf6a8ffdafd Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 18:17:37 +0300 Subject: [PATCH 05/64] Fix for CS8601 - null ref assignments. --- src/components/Blazor/Accordion.cs | 12 ++--- .../Blazor/ActiveStepChangedEventArgs.cs | 6 +-- .../ActiveStepChangedEventArgsDetail.cs | 4 +- .../Blazor/ActiveStepChangingEventArgs.cs | 6 +-- .../ActiveStepChangingEventArgsDetail.cs | 4 +- src/components/Blazor/Avatar.cs | 6 +-- src/components/Blazor/Badge.cs | 4 +- src/components/Blazor/Banner.cs | 16 +++--- src/components/Blazor/BaseAlertLike.cs | 20 ++++---- src/components/Blazor/BaseComboBox.cs | 16 +++--- src/components/Blazor/BaseOptionLike.cs | 6 +-- src/components/Blazor/ButtonBase.cs | 32 ++++++------ src/components/Blazor/ButtonGroup.cs | 6 +-- src/components/Blazor/Calendar.cs | 10 ++-- src/components/Blazor/CalendarBase.cs | 6 +-- .../Blazor/CalendarFormatOptions.cs | 6 +-- src/components/Blazor/Card.cs | 4 +- src/components/Blazor/CardActions.cs | 4 +- src/components/Blazor/CardContent.cs | 4 +- src/components/Blazor/CardHeader.cs | 4 +- src/components/Blazor/CardMedia.cs | 4 +- src/components/Blazor/Carousel.cs | 42 ++++++++-------- src/components/Blazor/CarouselIndicator.cs | 4 +- src/components/Blazor/CarouselSlide.cs | 4 +- src/components/Blazor/Chat.cs | 10 ++-- .../Blazor/ChatAttachmentRenderContext.cs | 6 +-- src/components/Blazor/ChatDraftMessage.cs | 10 ++-- .../Blazor/ChatInputRenderContext.cs | 6 +-- src/components/Blazor/ChatMessage.cs | 10 ++-- .../Blazor/ChatMessageAttachment.cs | 10 ++-- .../Blazor/ChatMessageAttachmentEventArgs.cs | 6 +-- src/components/Blazor/ChatMessageEventArgs.cs | 6 +-- src/components/Blazor/ChatMessageReaction.cs | 10 ++-- .../Blazor/ChatMessageReactionEventArgs.cs | 6 +-- .../Blazor/ChatMessageRenderContext.cs | 6 +-- src/components/Blazor/ChatOptions.cs | 6 +-- src/components/Blazor/ChatRenderContext.cs | 6 +-- src/components/Blazor/CheckboxBase.cs | 34 ++++++------- .../Blazor/CheckboxChangeEventArgs.cs | 6 +-- .../Blazor/CheckboxChangeEventArgsDetail.cs | 10 ++-- src/components/Blazor/Chip.cs | 8 +-- src/components/Blazor/CircularGradient.cs | 6 +-- src/components/Blazor/Combo.cs | 38 +++++++------- src/components/Blazor/ComboChangeEventArgs.cs | 6 +-- .../Blazor/ComboChangeEventArgsDetail.cs | 10 ++-- .../ComponentBoolValueChangedEventArgs.cs | 4 +- .../ComponentDataValueChangedEventArgs.cs | 6 +-- .../ComponentDateValueChangedEventArgs.cs | 4 +- .../Blazor/ComponentValueChangedEventArgs.cs | 6 +-- src/components/Blazor/CustomDateRange.cs | 6 +-- src/components/Blazor/DatePicker.cs | 34 ++++++------- src/components/Blazor/DateRangePicker.cs | 26 +++++----- src/components/Blazor/DateRangeValue.cs | 4 +- src/components/Blazor/DateRangeValueDetail.cs | 8 +-- .../Blazor/DateRangeValueEventArgs.cs | 6 +-- src/components/Blazor/DateTimeInput.cs | 16 +++--- src/components/Blazor/DateTimeInputBase.cs | 50 +++++++++---------- src/components/Blazor/Dialog.cs | 18 +++---- src/components/Blazor/Divider.cs | 4 +- src/components/Blazor/Dropdown.cs | 28 +++++------ src/components/Blazor/DropdownGroup.cs | 4 +- src/components/Blazor/DropdownHeader.cs | 4 +- .../Blazor/DropdownItemComponentEventArgs.cs | 6 +-- src/components/Blazor/ExpansionPanel.cs | 16 +++--- .../ExpansionPanelComponentEventArgs.cs | 6 +-- src/components/Blazor/FilteringOptions.cs | 6 +-- src/components/Blazor/FormatSpecifier.cs | 8 +-- src/components/Blazor/Highlight.cs | 30 +++++------ src/components/Blazor/HighlightNavigation.cs | 8 +-- src/components/Blazor/Icon.cs | 18 +++---- src/components/Blazor/IconButton.cs | 16 +++--- src/components/Blazor/IconMeta.cs | 6 +-- src/components/Blazor/Input.cs | 14 +++--- src/components/Blazor/InputBase.cs | 30 +++++------ src/components/Blazor/List.cs | 4 +- src/components/Blazor/ListHeader.cs | 4 +- src/components/Blazor/ListItem.cs | 4 +- src/components/Blazor/MaskInput.cs | 14 +++--- src/components/Blazor/NavDrawer.cs | 28 +++++------ src/components/Blazor/NavDrawerHeaderItem.cs | 4 +- src/components/Blazor/NavDrawerItem.cs | 4 +- src/components/Blazor/Navbar.cs | 4 +- src/components/Blazor/NumberEventArgs.cs | 4 +- .../Blazor/NumberFormatSpecifier.cs | 6 +-- src/components/Blazor/ProgressBase.cs | 6 +-- src/components/Blazor/Radio.cs | 34 ++++++------- src/components/Blazor/RadioChangeEventArgs.cs | 6 +-- .../Blazor/RadioChangeEventArgsDetail.cs | 10 ++-- src/components/Blazor/RadioGroup.cs | 10 ++-- src/components/Blazor/RangeSliderValue.cs | 4 +- .../Blazor/RangeSliderValueEventArgs.cs | 6 +-- src/components/Blazor/Rating.cs | 30 +++++------ src/components/Blazor/RatingSymbol.cs | 8 +-- src/components/Blazor/Ripple.cs | 4 +- src/components/Blazor/Select.cs | 42 ++++++++-------- src/components/Blazor/SelectGroup.cs | 6 +-- src/components/Blazor/SelectHeader.cs | 4 +- .../Blazor/SelectItemComponentEventArgs.cs | 6 +-- src/components/Blazor/Slider.cs | 24 ++++----- src/components/Blazor/SliderBase.cs | 6 +-- src/components/Blazor/SliderLabel.cs | 4 +- src/components/Blazor/Splitter.cs | 8 +-- .../Blazor/SplitterResizeEventArgs.cs | 6 +-- .../Blazor/SplitterResizeEventArgsDetail.cs | 8 +-- src/components/Blazor/Step.cs | 4 +- src/components/Blazor/Stepper.cs | 24 ++++----- src/components/Blazor/Tab.cs | 6 +-- .../Blazor/TabComponentEventArgs.cs | 6 +-- src/components/Blazor/Tabs.cs | 14 +++--- src/components/Blazor/Textarea.cs | 26 +++++----- src/components/Blazor/ThemeProvider.cs | 4 +- src/components/Blazor/Tile.cs | 8 +-- .../Blazor/TileChangeStateEventArgs.cs | 6 +-- .../Blazor/TileChangeStateEventArgsDetail.cs | 10 ++-- .../Blazor/TileComponentEventArgs.cs | 6 +-- src/components/Blazor/TileManager.cs | 16 +++--- src/components/Blazor/ToggleButton.cs | 18 +++---- src/components/Blazor/Tooltip.cs | 18 +++---- src/components/Blazor/Tree.cs | 8 +-- src/components/Blazor/TreeItem.cs | 30 +++++------ .../Blazor/TreeItemComponentEventArgs.cs | 6 +-- .../Blazor/TreeSelectionEventArgs.cs | 6 +-- .../Blazor/TreeSelectionEventArgsDetail.cs | 6 +-- src/components/Blazor/VoidEventArgs.cs | 4 +- src/componentsBase/BaseRendererControl.cs | 16 +++--- src/componentsBase/BaseRendererElement.cs | 6 +-- src/componentsBase/DataSourceManager.cs | 2 +- src/componentsBase/WebInputs/Chat.cs | 4 +- src/componentsBase/WebInputs/DateTimeInput.cs | 18 +++---- src/componentsBase/WebInputs/Dropdown.cs | 8 +-- 130 files changed, 713 insertions(+), 713 deletions(-) diff --git a/src/components/Blazor/Accordion.cs b/src/components/Blazor/Accordion.cs index 4d18c225..53257a20 100644 --- a/src/components/Blazor/Accordion.cs +++ b/src/components/Blazor/Accordion.cs @@ -100,18 +100,18 @@ public override object FindByName(string name) } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Hides all of the child expansion panels' contents. /// public async Task HideAllAsync() { - await InvokeMethod("hideAll", new object[] { }, new string[] { }); + await InvokeMethod("hideAll", new object?[] { }, new string[] { }); } /// @@ -119,14 +119,14 @@ public async Task HideAllAsync() /// public void HideAll() { - InvokeMethodSync("hideAll", new object[] { }, new string[] { }); + InvokeMethodSync("hideAll", new object?[] { }, new string[] { }); } /// /// Shows all of the child expansion panels' contents. /// public async Task ShowAllAsync() { - await InvokeMethod("showAll", new object[] { }, new string[] { }); + await InvokeMethod("showAll", new object?[] { }, new string[] { }); } /// @@ -134,7 +134,7 @@ public async Task ShowAllAsync() /// public void ShowAll() { - InvokeMethodSync("showAll", new object[] { }, new string[] { }); + InvokeMethodSync("showAll", new object?[] { }, new string[] { }); } private string? _openingRef = null; diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 88778a80..8d01378c 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs index 430f79a5..a1534519 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs @@ -42,7 +42,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -52,7 +52,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 440dc1e0..96aea911 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -49,7 +49,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -59,7 +59,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs index 688cac2a..9d89b5c2 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs @@ -63,7 +63,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -75,7 +75,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Avatar.cs b/src/components/Blazor/Avatar.cs index 89a55c4d..16203932 100644 --- a/src/components/Blazor/Avatar.cs +++ b/src/components/Blazor/Avatar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -138,11 +138,11 @@ public AvatarShape Shape public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Badge.cs b/src/components/Blazor/Badge.cs index e4274cfc..0aac3391 100644 --- a/src/components/Blazor/Badge.cs +++ b/src/components/Blazor/Badge.cs @@ -139,11 +139,11 @@ public bool Dot public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Banner.cs b/src/components/Blazor/Banner.cs index b4e6bbbd..b6a8e768 100644 --- a/src/components/Blazor/Banner.cs +++ b/src/components/Blazor/Banner.cs @@ -87,11 +87,11 @@ public bool Open public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Opens the banner with an animated grow-in transition. @@ -100,7 +100,7 @@ public void SetNativeElement(Object element) /// or if it was already open. public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -111,7 +111,7 @@ public async Task ShowAsync() /// or if it was already open. public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -121,7 +121,7 @@ public bool Show() /// or if it was already closed. public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -132,7 +132,7 @@ public async Task HideAsync() /// or if it was already closed. public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -142,7 +142,7 @@ public bool Hide() /// when the transition completed successfully. public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -153,7 +153,7 @@ public async Task ToggleAsync() /// when the transition completed successfully. public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/BaseAlertLike.cs b/src/components/Blazor/BaseAlertLike.cs index 358bf016..46b17931 100644 --- a/src/components/Blazor/BaseAlertLike.cs +++ b/src/components/Blazor/BaseAlertLike.cs @@ -170,19 +170,19 @@ public NotificationPositioning Positioning public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public async Task ConnectedCallbackAsync() { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("connectedCallback", new object?[] { }, new string[] { }); } public void ConnectedCallback() { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("connectedCallback", new object?[] { }, new string[] { }); } /// /// Opens the component. @@ -194,7 +194,7 @@ public void ConnectedCallback() /// public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -208,7 +208,7 @@ public async Task ShowAsync() /// public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -220,7 +220,7 @@ public bool Show() /// public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -233,7 +233,7 @@ public async Task HideAsync() /// public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -245,7 +245,7 @@ public bool Hide() /// public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -258,7 +258,7 @@ public async Task ToggleAsync() /// public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/BaseComboBox.cs b/src/components/Blazor/BaseComboBox.cs index 7b75d62d..c2196687 100644 --- a/src/components/Blazor/BaseComboBox.cs +++ b/src/components/Blazor/BaseComboBox.cs @@ -44,11 +44,11 @@ public bool Open public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Shows the component. @@ -57,7 +57,7 @@ public void SetNativeElement(Object element) /// or if it was already open. public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -68,7 +68,7 @@ public async Task ShowAsync() /// or if it was already open. public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -78,7 +78,7 @@ public bool Show() /// or if it was already closed. public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -89,7 +89,7 @@ public async Task HideAsync() /// or if it was already closed. public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -98,7 +98,7 @@ public bool Hide() /// when the open state was changed. public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -108,7 +108,7 @@ public async Task ToggleAsync() /// when the open state was changed. public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/BaseOptionLike.cs b/src/components/Blazor/BaseOptionLike.cs index 3337d842..89d83320 100644 --- a/src/components/Blazor/BaseOptionLike.cs +++ b/src/components/Blazor/BaseOptionLike.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -129,11 +129,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index 71558f96..2df18402 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -54,10 +54,10 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// The type of the button, which determines its behavior and semantics. /// - /// – no default action. - /// – submits the associated form when + /// no default action. + /// submits the associated form when /// clicked. - /// – resets the associated form fields to + /// resets the associated form fields to /// their initial values. /// /// Ignored when the button is rendered as a link (i.e. is set). @@ -125,12 +125,12 @@ public string? Download /// /// Where to open the linked document. Only effective when is set. /// - /// – current browsing context + /// current browsing context /// (default browser behavior). - /// – new tab or window. - /// – parent browsing context; falls back to + /// new tab or window. + /// parent browsing context; falls back to /// if none. - /// – top-level browsing context; falls back to + /// top-level browsing context; falls back to /// if none. /// /// @@ -241,7 +241,7 @@ public string? Commandfor [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -250,7 +250,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the button. @@ -259,7 +259,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -268,22 +268,22 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Simulates a mouse click on the button, triggering its click handler and any associated form action. /// public async Task ClickAsync() { - await InvokeMethod("click", new object[] { }, new string[] { }); + await InvokeMethod("click", new object?[] { }, new string[] { }); } /// @@ -291,7 +291,7 @@ public async Task ClickAsync() /// public void Click() { - InvokeMethodSync("click", new object[] { }, new string[] { }); + InvokeMethodSync("click", new object?[] { }, new string[] { }); } private string? _focusRef = null; diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index 349e8b4e..edfdcb7f 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -138,11 +138,11 @@ public string[]? SelectedItems public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } private string? _selectRef = null; diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 145ec074..1efcf2f6 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -62,7 +62,7 @@ public DateTime Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } @@ -72,7 +72,7 @@ public async Task GetCurrentValueAsync() /// public DateTime GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } private DateTime[]? _values; @@ -104,7 +104,7 @@ public DateTime[]? Values /// public async Task GetCurrentValuesAsync() { - var iv = await InvokeMethod("p:Values", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); } @@ -115,7 +115,7 @@ public async Task GetCurrentValuesAsync() /// public DateTime[] GetCurrentValues() { - var iv = InvokeMethodSync("p:Values", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); } private DateTime _activeDate = DateTime.MinValue; diff --git a/src/components/Blazor/CalendarBase.cs b/src/components/Blazor/CalendarBase.cs index 90d4daa0..5fa51b12 100644 --- a/src/components/Blazor/CalendarBase.cs +++ b/src/components/Blazor/CalendarBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -172,11 +172,11 @@ public IgbDateRangeDescriptor[]? DisabledDates public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CalendarFormatOptions.cs b/src/components/Blazor/CalendarFormatOptions.cs index 244ba39c..dd3e7262 100644 --- a/src/components/Blazor/CalendarFormatOptions.cs +++ b/src/components/Blazor/CalendarFormatOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -66,7 +66,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -78,7 +78,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Card.cs b/src/components/Blazor/Card.cs index a193d23f..82ca8c85 100644 --- a/src/components/Blazor/Card.cs +++ b/src/components/Blazor/Card.cs @@ -83,11 +83,11 @@ public bool Elevated public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CardActions.cs b/src/components/Blazor/CardActions.cs index c1f7f97e..ebb199e9 100644 --- a/src/components/Blazor/CardActions.cs +++ b/src/components/Blazor/CardActions.cs @@ -81,11 +81,11 @@ public ContentOrientation Orientation public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CardContent.cs b/src/components/Blazor/CardContent.cs index eb5bda3c..d76d5e77 100644 --- a/src/components/Blazor/CardContent.cs +++ b/src/components/Blazor/CardContent.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/CardHeader.cs b/src/components/Blazor/CardHeader.cs index 5648ce2e..9d38fba3 100644 --- a/src/components/Blazor/CardHeader.cs +++ b/src/components/Blazor/CardHeader.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/CardMedia.cs b/src/components/Blazor/CardMedia.cs index f2deaac0..cad8cf13 100644 --- a/src/components/Blazor/CardMedia.cs +++ b/src/components/Blazor/CardMedia.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 5c054b35..4d341823 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -278,7 +278,7 @@ public HorizontalTransitionAnimation AnimationType /// public async Task GetTotalAsync() { - var iv = await InvokeMethod("p:Total", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Total", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -287,7 +287,7 @@ public async Task GetTotalAsync() /// public double GetTotal() { - var iv = InvokeMethodSync("p:Total", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Total", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -296,7 +296,7 @@ public double GetTotal() /// public async Task GetCurrentAsync() { - var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Current", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -305,7 +305,7 @@ public async Task GetCurrentAsync() /// public double GetCurrent() { - var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Current", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -314,7 +314,7 @@ public double GetCurrent() /// public async Task GetIsPlayingAsync() { - var iv = await InvokeMethod("p:IsPlaying", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:IsPlaying", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -323,7 +323,7 @@ public async Task GetIsPlayingAsync() /// public bool GetIsPlaying() { - var iv = InvokeMethodSync("p:IsPlaying", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:IsPlaying", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -332,7 +332,7 @@ public bool GetIsPlaying() /// public async Task GetIsPausedAsync() { - var iv = await InvokeMethod("p:IsPaused", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:IsPaused", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -341,24 +341,24 @@ public async Task GetIsPausedAsync() /// public bool GetIsPaused() { - var iv = InvokeMethodSync("p:IsPaused", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:IsPaused", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Resumes playing of the carousel slides. /// public async Task PlayAsync() { - await InvokeMethod("play", new object[] { }, new string[] { }); + await InvokeMethod("play", new object?[] { }, new string[] { }); } /// @@ -366,14 +366,14 @@ public async Task PlayAsync() /// public void Play() { - InvokeMethodSync("play", new object[] { }, new string[] { }); + InvokeMethodSync("play", new object?[] { }, new string[] { }); } /// /// Pauses the rotation of the carousel slides. /// public async Task PauseAsync() { - await InvokeMethod("pause", new object[] { }, new string[] { }); + await InvokeMethod("pause", new object?[] { }, new string[] { }); } /// @@ -381,7 +381,7 @@ public async Task PauseAsync() /// public void Pause() { - InvokeMethodSync("pause", new object[] { }, new string[] { }); + InvokeMethodSync("pause", new object?[] { }, new string[] { }); } /// /// Switches to the next slide, running any animations. @@ -391,7 +391,7 @@ public void Pause() /// public async Task NextAsync() { - var iv = await InvokeMethod("next", new object[] { }, new string[] { }); + var iv = await InvokeMethod("next", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -403,7 +403,7 @@ public async Task NextAsync() /// public bool Next() { - var iv = InvokeMethodSync("next", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("next", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -414,7 +414,7 @@ public bool Next() /// public async Task PrevAsync() { - var iv = await InvokeMethod("prev", new object[] { }, new string[] { }); + var iv = await InvokeMethod("prev", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -426,7 +426,7 @@ public async Task PrevAsync() /// public bool Prev() { - var iv = InvokeMethodSync("prev", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("prev", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -438,7 +438,7 @@ public bool Prev() /// public async Task SelectAsync(double index, CarouselAnimationDirection? animationDirection = null) { - var iv = await InvokeMethod("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); + var iv = await InvokeMethod("select", new object?[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); return ReturnToBoolean(iv); } @@ -450,7 +450,7 @@ public async Task SelectAsync(double index, CarouselAnimationDirection? an /// public bool Select(double index, CarouselAnimationDirection? animationDirection = null) { - var iv = InvokeMethodSync("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); + var iv = InvokeMethodSync("select", new object?[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/CarouselIndicator.cs b/src/components/Blazor/CarouselIndicator.cs index 725a9065..0d21712f 100644 --- a/src/components/Blazor/CarouselIndicator.cs +++ b/src/components/Blazor/CarouselIndicator.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/CarouselSlide.cs b/src/components/Blazor/CarouselSlide.cs index f64b9a6f..71c4b3f2 100644 --- a/src/components/Blazor/CarouselSlide.cs +++ b/src/components/Blazor/CarouselSlide.cs @@ -80,11 +80,11 @@ public bool Active public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index 7017b512..ada66a01 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -125,18 +125,18 @@ public IgbChatOptions? Options public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Scrolls the view to a specific message by id. /// public async Task ScrollToMessageAsync(String messageId) { - await InvokeMethod("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); + await InvokeMethod("scrollToMessage", new object?[] { StringToString(messageId) }, new string[] { "String" }); } /// @@ -144,7 +144,7 @@ public async Task ScrollToMessageAsync(String messageId) /// public void ScrollToMessage(String messageId) { - InvokeMethodSync("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); + InvokeMethodSync("scrollToMessage", new object?[] { StringToString(messageId) }, new string[] { "String" }); } private string? _messageCreatedRef = null; diff --git a/src/components/Blazor/ChatAttachmentRenderContext.cs b/src/components/Blazor/ChatAttachmentRenderContext.cs index 363aeb53..8f9c434a 100644 --- a/src/components/Blazor/ChatAttachmentRenderContext.cs +++ b/src/components/Blazor/ChatAttachmentRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -37,11 +37,11 @@ public IgbChatMessageAttachment? Attachment public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 563e4bf4..d3fc61ca 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -50,11 +50,11 @@ public IgbChatMessageAttachment[]? Attachments public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -69,7 +69,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -81,7 +81,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatInputRenderContext.cs b/src/components/Blazor/ChatInputRenderContext.cs index d6c3034c..05bf2be8 100644 --- a/src/components/Blazor/ChatInputRenderContext.cs +++ b/src/components/Blazor/ChatInputRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -32,11 +32,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 39f49832..98217ada 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -130,11 +130,11 @@ public string[]? Reactions public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -157,7 +157,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -177,7 +177,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index d976e3e2..3b3090a8 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -93,11 +93,11 @@ public string? Thumbnail public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -116,7 +116,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -134,7 +134,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 0c27f73f..cd20ec0b 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index ad6d9d5a..719c629e 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index fb76147b..735c5c5c 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -58,11 +58,11 @@ public string? Reaction public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -77,7 +77,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -89,7 +89,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index 3d34f708..c80256fb 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageRenderContext.cs b/src/components/Blazor/ChatMessageRenderContext.cs index 0f15966d..d696c047 100644 --- a/src/components/Blazor/ChatMessageRenderContext.cs +++ b/src/components/Blazor/ChatMessageRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -37,11 +37,11 @@ public IgbChatMessage? Message public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatOptions.cs b/src/components/Blazor/ChatOptions.cs index 9dc50801..b81984a5 100644 --- a/src/components/Blazor/ChatOptions.cs +++ b/src/components/Blazor/ChatOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -243,11 +243,11 @@ public IgbChatRenderers? Renderers public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatRenderContext.cs b/src/components/Blazor/ChatRenderContext.cs index a594f561..af3bfbab 100644 --- a/src/components/Blazor/ChatRenderContext.cs +++ b/src/components/Blazor/ChatRenderContext.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -33,11 +33,11 @@ public IgbChat? Instance public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 12a08e6b..a05d03cc 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -102,7 +102,7 @@ public bool Checked /// public async Task GetCurrentCheckedAsync() { - var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Checked", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -111,7 +111,7 @@ public async Task GetCurrentCheckedAsync() /// public bool GetCurrentChecked() { - var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Checked", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; @@ -193,18 +193,18 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Simulates a click on the control. /// public async Task ClickAsync() { - await InvokeMethod("click", new object[] { }, new string[] { }); + await InvokeMethod("click", new object?[] { }, new string[] { }); } /// @@ -212,7 +212,7 @@ public async Task ClickAsync() /// public void Click() { - InvokeMethodSync("click", new object[] { }, new string[] { }); + InvokeMethodSync("click", new object?[] { }, new string[] { }); } /// /// Sets focus on the control. @@ -221,7 +221,7 @@ public void Click() [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -230,7 +230,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the control. @@ -239,7 +239,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -248,14 +248,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -264,7 +264,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -272,7 +272,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -281,7 +281,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -290,7 +290,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -299,7 +299,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _checkedChanged = null; diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index aa2ef57e..f0ec7bbc 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index 4d044351..cdf95ba4 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -53,11 +53,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -72,7 +72,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -84,7 +84,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Chip.cs b/src/components/Blazor/Chip.cs index c01aada8..4197b321 100644 --- a/src/components/Blazor/Chip.cs +++ b/src/components/Blazor/Chip.cs @@ -140,7 +140,7 @@ public bool Selected /// public async Task GetCurrentSelectedAsync() { - var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Selected", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -149,7 +149,7 @@ public async Task GetCurrentSelectedAsync() /// public bool GetCurrentSelected() { - var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Selected", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } private StyleVariant _variant = StyleVariant.Primary; @@ -174,11 +174,11 @@ public StyleVariant Variant public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } private EventCallback? _selectedChanged = null; diff --git a/src/components/Blazor/CircularGradient.cs b/src/components/Blazor/CircularGradient.cs index acc26ad2..31111055 100644 --- a/src/components/Blazor/CircularGradient.cs +++ b/src/components/Blazor/CircularGradient.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -122,11 +122,11 @@ public double Opacity public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index f23fab93..fdc47498 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -430,7 +430,7 @@ public T[]? Value /// The selected values, represented by when provided. public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv).Cast().ToArray(); } @@ -440,7 +440,7 @@ public async Task GetCurrentValueAsync() /// The selected values, represented by when provided. public T[] GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv).Cast().ToArray(); } private string? _selectionRef; @@ -451,7 +451,7 @@ public T[] GetCurrentValue() /// The selected items as provided in the source. public async Task GetSelectionAsync() { - var iv = await InvokeMethod("p:Selection", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); } @@ -461,7 +461,7 @@ public async Task GetSelectionAsync() /// The selected items as provided in the source. public object[] GetSelection() { - var iv = InvokeMethodSync("p:Selection", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); } private bool _disabled = false; @@ -647,7 +647,7 @@ public string GroupHeaderTemplateScript [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -656,7 +656,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the component. @@ -665,7 +665,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -674,7 +674,7 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// @@ -685,7 +685,7 @@ public void BlurComponent() /// the corresponding value should be used in place of the item reference. public async Task SelectAsync(object[] items) { - await InvokeMethod("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + await InvokeMethod("select", new object?[] { ObjectArrayToParam(items) }, new string[] { "" }); } /// @@ -696,7 +696,7 @@ public async Task SelectAsync(object[] items) /// the corresponding value should be used in place of the item reference. public void Select(object[] items) { - InvokeMethodSync("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + InvokeMethodSync("select", new object?[] { ObjectArrayToParam(items) }, new string[] { "" }); } /// @@ -707,7 +707,7 @@ public void Select(object[] items) /// the corresponding value should be used in place of the item reference. public async Task DeselectAsync(object[] items) { - await InvokeMethod("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + await InvokeMethod("deselect", new object?[] { ObjectArrayToParam(items) }, new string[] { "" }); } /// @@ -718,14 +718,14 @@ public async Task DeselectAsync(object[] items) /// the corresponding value should be used in place of the item reference. public void Deselect(object[] items) { - InvokeMethodSync("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + InvokeMethodSync("deselect", new object?[] { ObjectArrayToParam(items) }, new string[] { "" }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -734,7 +734,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -742,7 +742,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -751,7 +751,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -760,7 +760,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -769,7 +769,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index c072178f..122ea611 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,7 +47,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 4d8f58ee..8d2a92ba 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -125,11 +125,11 @@ public ComboChangeType ChangeType public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -146,7 +146,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -160,7 +160,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs index 521b93b9..bfbcb851 100644 --- a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index e071fc72..81e5c3ea 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -41,7 +41,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -51,7 +51,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs index 0a0f1543..0395696c 100644 --- a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 91505a08..5dbf41eb 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index ab4a1df7..09dc39a2 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -56,11 +56,11 @@ public IgbDateRangeValue? DateRange public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 7597fd5c..4301854f 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -137,7 +137,7 @@ public DateTime? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } @@ -146,7 +146,7 @@ public DateTime? Value /// public DateTime? GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } private DateTime _activeDate = DateTime.MinValue; @@ -581,7 +581,7 @@ public bool Invalid /// public async Task ClearAsync() { - await InvokeMethod("clear", new object[] { }, new string[] { }); + await InvokeMethod("clear", new object?[] { }, new string[] { }); } /// @@ -589,7 +589,7 @@ public async Task ClearAsync() /// public void Clear() { - InvokeMethodSync("clear", new object[] { }, new string[] { }); + InvokeMethodSync("clear", new object?[] { }, new string[] { }); } /// @@ -597,7 +597,7 @@ public void Clear() /// public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) { - await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + await InvokeMethod("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -605,7 +605,7 @@ public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) /// public void StepUp(DatePart? datePart = null, double delta = -1) { - InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + InvokeMethodSync("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -613,7 +613,7 @@ public void StepUp(DatePart? datePart = null, double delta = -1) /// public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) { - await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + await InvokeMethod("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -621,14 +621,14 @@ public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) /// public void StepDown(DatePart? datePart = null, double delta = -1) { - InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + InvokeMethodSync("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// /// Selects the text in the input of the component. /// public async Task SelectAsync() { - await InvokeMethod("select", new object[] { }, new string[] { }); + await InvokeMethod("select", new object?[] { }, new string[] { }); } /// @@ -636,14 +636,14 @@ public async Task SelectAsync() /// public void Select() { - InvokeMethodSync("select", new object[] { }, new string[] { }); + InvokeMethodSync("select", new object?[] { }, new string[] { }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -652,7 +652,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -660,7 +660,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -669,7 +669,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -678,7 +678,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -687,7 +687,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index c1b5f6de..b3b389e8 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Components; @@ -66,7 +66,7 @@ public IgbDateRangeValue? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); if (iv == null) { @@ -86,7 +86,7 @@ public IgbDateRangeValue? Value /// public IgbDateRangeValue? GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); if (iv == null) { @@ -742,7 +742,7 @@ public bool Invalid /// public async Task ClearAsync() { - await InvokeMethod("clear", new object[] { }, new string[] { }); + await InvokeMethod("clear", new object?[] { }, new string[] { }); } /// @@ -750,14 +750,14 @@ public async Task ClearAsync() /// public void Clear() { - InvokeMethodSync("clear", new object[] { }, new string[] { }); + InvokeMethodSync("clear", new object?[] { }, new string[] { }); } /// /// Selects a date range value in the picker. /// public async Task SelectAsync(IgbDateRangeValue value) { - await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + await InvokeMethod("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); } /// @@ -765,14 +765,14 @@ public async Task SelectAsync(IgbDateRangeValue value) /// public void Select(IgbDateRangeValue value) { - InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + InvokeMethodSync("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -781,7 +781,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -789,7 +789,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -798,7 +798,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -807,7 +807,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } /// @@ -816,7 +816,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/DateRangeValue.cs b/src/components/Blazor/DateRangeValue.cs index 1633f15a..a6b288ae 100644 --- a/src/components/Blazor/DateRangeValue.cs +++ b/src/components/Blazor/DateRangeValue.cs @@ -51,11 +51,11 @@ public DateTime End public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/DateRangeValueDetail.cs b/src/components/Blazor/DateRangeValueDetail.cs index e4a7c2c3..88bae3c9 100644 --- a/src/components/Blazor/DateRangeValueDetail.cs +++ b/src/components/Blazor/DateRangeValueDetail.cs @@ -54,11 +54,11 @@ public DateTime End public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -73,7 +73,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -85,7 +85,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 1894d80b..7216d08e 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,7 +47,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index 0d4d7043..d1c12785 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -60,7 +60,7 @@ public DateTime? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } @@ -69,7 +69,7 @@ public DateTime? Value /// public DateTime? GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } @@ -78,7 +78,7 @@ public DateTime? Value /// public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) { - await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + await InvokeMethod("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -86,7 +86,7 @@ public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) /// public void StepUp(DatePart? datePart = null, double delta = -1) { - InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + InvokeMethodSync("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -94,7 +94,7 @@ public void StepUp(DatePart? datePart = null, double delta = -1) /// public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) { - await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + await InvokeMethod("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// @@ -102,14 +102,14 @@ public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) /// public void StepDown(DatePart? datePart = null, double delta = -1) { - InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + InvokeMethodSync("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); } /// /// Clears the component of any user input. /// public async Task ClearAsync() { - await InvokeMethod("clear", new object[] { }, new string[] { }); + await InvokeMethod("clear", new object?[] { }, new string[] { }); } /// @@ -117,7 +117,7 @@ public async Task ClearAsync() /// public void Clear() { - InvokeMethodSync("clear", new object[] { }, new string[] { }); + InvokeMethodSync("clear", new object?[] { }, new string[] { }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index 6d9a67ba..6f67e68b 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -346,18 +346,18 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Selects all the text inside the input. /// public async Task SelectAsync() { - await InvokeMethod("select", new object[] { }, new string[] { }); + await InvokeMethod("select", new object?[] { }, new string[] { }); } /// @@ -365,7 +365,7 @@ public async Task SelectAsync() /// public void Select() { - InvokeMethodSync("select", new object[] { }, new string[] { }); + InvokeMethodSync("select", new object?[] { }, new string[] { }); } /// /// Sets focus on the control. @@ -374,7 +374,7 @@ public void Select() [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -383,7 +383,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the control. @@ -392,7 +392,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -401,14 +401,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Clears the component of any user input. /// public async Task ClearAsync() { - await InvokeMethod("clear", new object[] { }, new string[] { }); + await InvokeMethod("clear", new object?[] { }, new string[] { }); } /// @@ -416,26 +416,26 @@ public async Task ClearAsync() /// public void Clear() { - InvokeMethodSync("clear", new object[] { }, new string[] { }); + InvokeMethodSync("clear", new object?[] { }, new string[] { }); } public async Task HasDatePartsAsync() { - var iv = await InvokeMethod("hasDateParts", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hasDateParts", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } public bool HasDateParts() { - var iv = InvokeMethodSync("hasDateParts", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hasDateParts", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } public async Task HasTimePartsAsync() { - var iv = await InvokeMethod("hasTimeParts", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hasTimeParts", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } public bool HasTimeParts() { - var iv = InvokeMethodSync("hasTimeParts", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hasTimeParts", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -444,7 +444,7 @@ public bool HasTimeParts() /// public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String? direction = null) { - await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + await InvokeMethod("setSelectionRange", new object?[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } /// @@ -452,7 +452,7 @@ public async Task SetSelectionRangeAsync(double start = -1, double end = -1, Str /// public void SetSelectionRange(double start = -1, double end = -1, String? direction = null) { - InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + InvokeMethodSync("setSelectionRange", new object?[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } /// @@ -460,7 +460,7 @@ public void SetSelectionRange(double start = -1, double end = -1, String? direct /// public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String? selectMode = null) { - await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + await InvokeMethod("setRangeText", new object?[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } /// @@ -468,14 +468,14 @@ public async Task SetRangeTextAsync(String replacement, double start = -1, doubl /// public void SetRangeText(String replacement, double start = -1, double end = -1, String? selectMode = null) { - InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + InvokeMethodSync("setRangeText", new object?[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -484,7 +484,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -492,7 +492,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -501,7 +501,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -510,7 +510,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -519,7 +519,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index 7a66eef0..621a5e39 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -199,11 +199,11 @@ public string? ReturnValue public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Opens the dialog with an animated fade-in transition. @@ -212,7 +212,7 @@ public void SetNativeElement(Object element) /// or if it was already open. public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -223,7 +223,7 @@ public async Task ShowAsync() /// or if it was already open. public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -233,7 +233,7 @@ public bool Show() /// or if it was already closed. public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -244,7 +244,7 @@ public async Task HideAsync() /// or if it was already closed. public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -254,7 +254,7 @@ public bool Hide() /// when the transition completed successfully. public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -265,7 +265,7 @@ public async Task ToggleAsync() /// when the transition completed successfully. public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/Divider.cs b/src/components/Blazor/Divider.cs index e3d7af16..a0b05d30 100644 --- a/src/components/Blazor/Divider.cs +++ b/src/components/Blazor/Divider.cs @@ -120,11 +120,11 @@ public DividerType LineType public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 341fb777..c18d0230 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -154,7 +154,7 @@ public bool SameWidth /// public async Task GetItemsAsync() { - var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); if (iv == null) { @@ -174,7 +174,7 @@ public async Task GetItemsAsync() /// public IgbDropdownItem[] GetItems() { - var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); if (iv == null) { @@ -194,7 +194,7 @@ public IgbDropdownItem[] GetItems() /// public async Task GetGroupsAsync() { - var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); if (iv == null) { @@ -214,7 +214,7 @@ public async Task GetGroupsAsync() /// public IgbDropdownGroup[] GetGroups() { - var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); if (iv == null) { @@ -234,7 +234,7 @@ public IgbDropdownGroup[] GetGroups() /// public async Task GetSelectedItemAsync() { - var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:SelectedItem", new object?[] { }, new string[] { }); if (iv == null) { @@ -254,7 +254,7 @@ public IgbDropdownGroup[] GetGroups() /// public IgbDropdownItem? GetSelectedItem() { - var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:SelectedItem", new object?[] { }, new string[] { }); if (iv == null) { @@ -294,7 +294,7 @@ public override object FindByName(string name) /// The found item, or if no such item exists. public async Task NavigateToAsync(Object index) { - var iv = await InvokeMethod("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); + var iv = await InvokeMethod("navigateTo", new object?[] { ObjectToParam(index) }, new string[] { "Json" }); if (iv == null) { @@ -315,7 +315,7 @@ public async Task NavigateToAsync(Object index) /// The found item, or if no such item exists. public IgbDropdownItem NavigateTo(Object index) { - var iv = InvokeMethodSync("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); + var iv = InvokeMethodSync("navigateTo", new object?[] { ObjectToParam(index) }, new string[] { "Json" }); if (iv == null) { @@ -335,7 +335,7 @@ public IgbDropdownItem NavigateTo(Object index) /// The found item, or if no such item exists. public async Task SelectAsync(Object value) { - var iv = await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + var iv = await InvokeMethod("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); if (iv == null) { @@ -356,7 +356,7 @@ public async Task SelectAsync(Object value) /// The found item, or if no such item exists. public IgbDropdownItem Select(Object value) { - var iv = InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + var iv = InvokeMethodSync("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); if (iv == null) { @@ -372,18 +372,18 @@ public IgbDropdownItem Select(Object value) } public async Task DisconnectedCallbackAsync() { - await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("disconnectedCallback", new object?[] { }, new string[] { }); } public void DisconnectedCallback() { - InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("disconnectedCallback", new object?[] { }, new string[] { }); } /// /// Clears the current selection of the dropdown. /// public async Task ClearSelectionAsync() { - await InvokeMethod("clearSelection", new object[] { }, new string[] { }); + await InvokeMethod("clearSelection", new object?[] { }, new string[] { }); } /// @@ -391,7 +391,7 @@ public async Task ClearSelectionAsync() /// public void ClearSelection() { - InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); + InvokeMethodSync("clearSelection", new object?[] { }, new string[] { }); } private string? _openingRef = null; diff --git a/src/components/Blazor/DropdownGroup.cs b/src/components/Blazor/DropdownGroup.cs index fe636ea2..24e992fb 100644 --- a/src/components/Blazor/DropdownGroup.cs +++ b/src/components/Blazor/DropdownGroup.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/DropdownHeader.cs b/src/components/Blazor/DropdownHeader.cs index 254d6202..0832da6b 100644 --- a/src/components/Blazor/DropdownHeader.cs +++ b/src/components/Blazor/DropdownHeader.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index a6233178..fd62da1c 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ExpansionPanel.cs b/src/components/Blazor/ExpansionPanel.cs index 5acc91d3..01474146 100644 --- a/src/components/Blazor/ExpansionPanel.cs +++ b/src/components/Blazor/ExpansionPanel.cs @@ -121,11 +121,11 @@ public ExpansionPanelIndicatorPosition IndicatorPosition public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Toggles the panel open/close state. @@ -133,7 +133,7 @@ public void SetNativeElement(Object element) /// when the open state changed. public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -143,7 +143,7 @@ public async Task ToggleAsync() /// when the open state was successfully changed. public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -153,7 +153,7 @@ public bool Toggle() /// if already closed. public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -164,7 +164,7 @@ public async Task HideAsync() /// if already closed. public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -174,7 +174,7 @@ public bool Hide() /// if already open. public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -185,7 +185,7 @@ public async Task ShowAsync() /// if already open. public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 0da3091e..2381ca99 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -45,7 +45,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -55,7 +55,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/FilteringOptions.cs b/src/components/Blazor/FilteringOptions.cs index 6ba07196..1a330269 100644 --- a/src/components/Blazor/FilteringOptions.cs +++ b/src/components/Blazor/FilteringOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -70,11 +70,11 @@ public bool MatchDiacritics public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index 945b4dfa..ff546a36 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -27,7 +27,7 @@ protected override void EnsureModulesLoaded() /// The resolved culture name. public async Task GetLocalCultureAsync() { - var iv = await InvokeMethod("getLocalCulture", new object[] { }, new string[] { }); + var iv = await InvokeMethod("getLocalCulture", new object?[] { }, new string[] { }); return ReturnToString(iv); } /// @@ -37,19 +37,19 @@ public async Task GetLocalCultureAsync() /// The resolved culture name. public String GetLocalCulture() { - var iv = InvokeMethodSync("getLocalCulture", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("getLocalCulture", new object?[] { }, new string[] { }); return ReturnToString(iv); } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Highlight.cs b/src/components/Blazor/Highlight.cs index db379bd4..51f37709 100644 --- a/src/components/Blazor/Highlight.cs +++ b/src/components/Blazor/Highlight.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -112,7 +112,7 @@ public string? SearchText /// public async Task GetSizeAsync() { - var iv = await InvokeMethod("p:Size", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Size", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -124,7 +124,7 @@ public async Task GetSizeAsync() /// public double GetSize() { - var iv = InvokeMethodSync("p:Size", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Size", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -134,7 +134,7 @@ public double GetSize() /// The index of the active match, or 0 when there are no matches. public async Task GetCurrentAsync() { - var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Current", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -144,17 +144,17 @@ public async Task GetCurrentAsync() /// The index of the active match, or 0 when there are no matches. public double GetCurrent() { - var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Current", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Moves the active highlight to the next match. @@ -165,7 +165,7 @@ public void SetNativeElement(Object element) /// public async Task NextAsync(IgbHighlightNavigation options) { - await InvokeMethod("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("next", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -177,7 +177,7 @@ public async Task NextAsync(IgbHighlightNavigation options) /// public void Next(IgbHighlightNavigation options) { - InvokeMethodSync("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("next", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Moves the active highlight to the previous match. @@ -188,7 +188,7 @@ public void Next(IgbHighlightNavigation options) /// public async Task PreviousAsync(IgbHighlightNavigation options) { - await InvokeMethod("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("previous", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -200,7 +200,7 @@ public async Task PreviousAsync(IgbHighlightNavigation options) /// public void Previous(IgbHighlightNavigation options) { - InvokeMethodSync("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("previous", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -212,7 +212,7 @@ public void Previous(IgbHighlightNavigation options) /// public async Task SetActiveAsync(double index, IgbHighlightNavigation options) { - await InvokeMethod("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); + await InvokeMethod("setActive", new object?[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); } /// @@ -224,7 +224,7 @@ public async Task SetActiveAsync(double index, IgbHighlightNavigation options) /// public void SetActive(double index, IgbHighlightNavigation options) { - InvokeMethodSync("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); + InvokeMethodSync("setActive", new object?[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); } /// /// Re-runs the highlight search based on the current @@ -234,7 +234,7 @@ public void SetActive(double index, IgbHighlightNavigation options) /// public async Task SearchAsync() { - await InvokeMethod("search", new object[] { }, new string[] { }); + await InvokeMethod("search", new object?[] { }, new string[] { }); } /// @@ -245,7 +245,7 @@ public async Task SearchAsync() /// public void Search() { - InvokeMethodSync("search", new object[] { }, new string[] { }); + InvokeMethodSync("search", new object?[] { }, new string[] { }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/HighlightNavigation.cs b/src/components/Blazor/HighlightNavigation.cs index 4c68f6fc..35e90a40 100644 --- a/src/components/Blazor/HighlightNavigation.cs +++ b/src/components/Blazor/HighlightNavigation.cs @@ -34,11 +34,11 @@ public bool PreventScroll public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -51,7 +51,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -61,7 +61,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Icon.cs b/src/components/Blazor/Icon.cs index f727607b..a69f7d72 100644 --- a/src/components/Blazor/Icon.cs +++ b/src/components/Blazor/Icon.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -119,11 +119,11 @@ public bool Mirrored public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// @@ -134,7 +134,7 @@ public void SetNativeElement(Object element) /// The collection to register the icon in. Defaults to default. public async Task RegisterIconAsync(String name, String url, String? collection = null) { - await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + await InvokeMethod("registerIcon", new object?[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -145,7 +145,7 @@ public async Task RegisterIconAsync(String name, String url, String? collection /// The collection to register the icon in. Defaults to default. public void RegisterIcon(String name, String url, String? collection = null) { - InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + InvokeMethodSync("registerIcon", new object?[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -156,7 +156,7 @@ public void RegisterIcon(String name, String url, String? collection = null) /// The collection to register the icon in. Defaults to default. public async Task RegisterIconFromTextAsync(String name, String iconText, String? collection = null) { - await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + await InvokeMethod("registerIconFromText", new object?[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -167,7 +167,7 @@ public async Task RegisterIconFromTextAsync(String name, String iconText, String /// The collection to register the icon in. Defaults to default. public void RegisterIconFromText(String name, String iconText, String? collection = null) { - InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + InvokeMethodSync("registerIconFromText", new object?[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -178,7 +178,7 @@ public void RegisterIconFromText(String name, String iconText, String? collectio /// The target icon metadata (name and collection). public async Task SetIconRefAsync(String name, String collection, IgbIconMeta icon) { - await InvokeMethod("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); + await InvokeMethod("setIconRef", new object?[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); } /// @@ -189,7 +189,7 @@ public async Task SetIconRefAsync(String name, String collection, IgbIconMeta ic /// The target icon metadata (name and collection). public void SetIconRef(String name, String collection, IgbIconMeta icon) { - InvokeMethodSync("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); + InvokeMethodSync("setIconRef", new object?[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/IconButton.cs b/src/components/Blazor/IconButton.cs index e8f1aba7..8e873518 100644 --- a/src/components/Blazor/IconButton.cs +++ b/src/components/Blazor/IconButton.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -120,11 +120,11 @@ public bool Mirrored /// /// The variant of the button which determines its visual appearance. /// - /// – filled background; + /// filled background; /// highest visual emphasis (default). - /// – transparent background + /// transparent background /// with a visible border. - /// – no background or border; + /// no background or border; /// lowest visual emphasis. /// /// @@ -151,7 +151,7 @@ public IconButtonVariant Variant /// The collection to register the icon in. Defaults to default. public async Task RegisterIconAsync(String name, String url, String? collection = null) { - await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + await InvokeMethod("registerIcon", new object?[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -162,7 +162,7 @@ public async Task RegisterIconAsync(String name, String url, String? collection /// The collection to register the icon in. Defaults to default. public void RegisterIcon(String name, String url, String? collection = null) { - InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + InvokeMethodSync("registerIcon", new object?[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -173,7 +173,7 @@ public void RegisterIcon(String name, String url, String? collection = null) /// The collection to register the icon in. Defaults to default. public async Task RegisterIconFromTextAsync(String name, String iconText, String? collection = null) { - await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + await InvokeMethod("registerIconFromText", new object?[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } /// @@ -184,7 +184,7 @@ public async Task RegisterIconFromTextAsync(String name, String iconText, String /// The collection to register the icon in. Defaults to default. public void RegisterIconFromText(String name, String iconText, String? collection = null) { - InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + InvokeMethodSync("registerIconFromText", new object?[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 99f8b166..6a638ac3 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -42,7 +42,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index 2c78cc48..dfbd9cde 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -78,7 +78,7 @@ public string? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -87,7 +87,7 @@ public async Task GetCurrentValueAsync() /// public string GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } private InputType _displayType = InputType.Text; @@ -333,7 +333,7 @@ public bool ValidateOnly /// public async Task StepUpAsync(double n = -1) { - await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); + await InvokeMethod("stepUp", new object?[] { n }, new string[] { "Number" }); } /// @@ -341,14 +341,14 @@ public async Task StepUpAsync(double n = -1) /// public void StepUp(double n = -1) { - InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); + InvokeMethodSync("stepUp", new object?[] { n }, new string[] { "Number" }); } /// /// Decrements the numeric value of the input by one or more steps. /// public async Task StepDownAsync(double n = -1) { - await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); + await InvokeMethod("stepDown", new object?[] { n }, new string[] { "Number" }); } /// @@ -356,7 +356,7 @@ public async Task StepDownAsync(double n = -1) /// public void StepDown(double n = -1) { - InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); + InvokeMethodSync("stepDown", new object?[] { n }, new string[] { "Number" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index 57d07a81..ec0a19f9 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -145,18 +145,18 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Selects all the text inside the input. /// public async Task SelectAsync() { - await InvokeMethod("select", new object[] { }, new string[] { }); + await InvokeMethod("select", new object?[] { }, new string[] { }); } /// @@ -164,7 +164,7 @@ public async Task SelectAsync() /// public void Select() { - InvokeMethodSync("select", new object[] { }, new string[] { }); + InvokeMethodSync("select", new object?[] { }, new string[] { }); } /// /// Sets focus on the control. @@ -173,7 +173,7 @@ public void Select() [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -182,7 +182,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the control. @@ -191,7 +191,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -200,14 +200,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -216,7 +216,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -224,7 +224,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -233,7 +233,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -242,7 +242,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -251,7 +251,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private string? _inputOcurredRef = null; diff --git a/src/components/Blazor/List.cs b/src/components/Blazor/List.cs index 9617634b..c7aa5a4f 100644 --- a/src/components/Blazor/List.cs +++ b/src/components/Blazor/List.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/ListHeader.cs b/src/components/Blazor/ListHeader.cs index df1f508a..5dde1257 100644 --- a/src/components/Blazor/ListHeader.cs +++ b/src/components/Blazor/ListHeader.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/ListItem.cs b/src/components/Blazor/ListItem.cs index 78d11bc7..d6c7b0a4 100644 --- a/src/components/Blazor/ListItem.cs +++ b/src/components/Blazor/ListItem.cs @@ -81,11 +81,11 @@ public bool Selected public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 5ebf9bc8..91bafe42 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -91,7 +91,7 @@ public string? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -101,7 +101,7 @@ public async Task GetCurrentValueAsync() /// public string GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } private string? _mask; @@ -167,7 +167,7 @@ public bool ReadOnly /// public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String? direction = null) { - await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + await InvokeMethod("setSelectionRange", new object?[] { start, end, StringToString(direction)! }, new string[] { "Number", "Number", "String" }); } /// @@ -175,7 +175,7 @@ public async Task SetSelectionRangeAsync(double start = -1, double end = -1, Str /// public void SetSelectionRange(double start = -1, double end = -1, String? direction = null) { - InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + InvokeMethodSync("setSelectionRange", new object?[] { start, end, StringToString(direction)! }, new string[] { "Number", "Number", "String" }); } /// @@ -183,7 +183,7 @@ public void SetSelectionRange(double start = -1, double end = -1, String? direct /// public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String? selectMode = null) { - await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + await InvokeMethod("setRangeText", new object?[] { StringToString(replacement)!, start, end, StringToString(selectMode)! }, new string[] { "String", "Number", "Number", "String" }); } /// @@ -191,7 +191,7 @@ public async Task SetRangeTextAsync(String replacement, double start = -1, doubl /// public void SetRangeText(String replacement, double start = -1, double end = -1, String? selectMode = null) { - InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + InvokeMethodSync("setRangeText", new object?[] { StringToString(replacement)!, start, end, StringToString(selectMode)! }, new string[] { "String", "Number", "Number", "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index a56fbdae..7ca048c5 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -79,19 +79,19 @@ protected override ControlEventBehavior DefaultEventBehavior /// Sets the position of the drawer. /// /// - /// — anchored to the inline-start edge (default). + /// anchored to the inline-start edge (default). /// /// - /// — anchored to the inline-end edge. + /// anchored to the inline-end edge. /// /// - /// — anchored to the block-start edge. + /// anchored to the block-start edge. /// /// - /// — anchored to the block-end edge. + /// anchored to the block-end edge. /// /// - /// — rendered inline within the page flow; no modal backdrop. + /// rendered inline within the page flow; no modal backdrop. /// /// /// @@ -175,11 +175,11 @@ public string? Label public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Opens the drawer. @@ -190,7 +190,7 @@ public void SetNativeElement(Object element) /// public async Task ShowAsync() { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + var iv = await InvokeMethod("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -203,7 +203,7 @@ public async Task ShowAsync() /// public bool Show() { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("show", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -215,7 +215,7 @@ public bool Show() /// public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -228,7 +228,7 @@ public async Task HideAsync() /// public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -237,7 +237,7 @@ public bool Hide() /// public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -247,7 +247,7 @@ public async Task ToggleAsync() /// public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/NavDrawerHeaderItem.cs b/src/components/Blazor/NavDrawerHeaderItem.cs index 017ab9a7..43082e9e 100644 --- a/src/components/Blazor/NavDrawerHeaderItem.cs +++ b/src/components/Blazor/NavDrawerHeaderItem.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/NavDrawerItem.cs b/src/components/Blazor/NavDrawerItem.cs index 2e47e486..32aa645f 100644 --- a/src/components/Blazor/NavDrawerItem.cs +++ b/src/components/Blazor/NavDrawerItem.cs @@ -99,11 +99,11 @@ public bool Active public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Navbar.cs b/src/components/Blazor/Navbar.cs index 4254104c..6758ce9f 100644 --- a/src/components/Blazor/Navbar.cs +++ b/src/components/Blazor/Navbar.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/NumberEventArgs.cs b/src/components/Blazor/NumberEventArgs.cs index ed1c22fe..4e1c6ded 100644 --- a/src/components/Blazor/NumberEventArgs.cs +++ b/src/components/Blazor/NumberEventArgs.cs @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/NumberFormatSpecifier.cs b/src/components/Blazor/NumberFormatSpecifier.cs index 6d56354b..da98b11a 100644 --- a/src/components/Blazor/NumberFormatSpecifier.cs +++ b/src/components/Blazor/NumberFormatSpecifier.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -437,7 +437,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -483,7 +483,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ProgressBase.cs b/src/components/Blazor/ProgressBase.cs index 039fb3c0..85fa870e 100644 --- a/src/components/Blazor/ProgressBase.cs +++ b/src/components/Blazor/ProgressBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -189,11 +189,11 @@ public string? LabelFormat public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index 879954ab..64877f5f 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -121,7 +121,7 @@ public bool Checked /// public async Task GetCurrentCheckedAsync() { - var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Checked", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -130,7 +130,7 @@ public async Task GetCurrentCheckedAsync() /// public bool GetCurrentChecked() { - var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Checked", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; @@ -193,18 +193,18 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Simulates a click on the radio control. /// public async Task ClickAsync() { - await InvokeMethod("click", new object[] { }, new string[] { }); + await InvokeMethod("click", new object?[] { }, new string[] { }); } /// @@ -212,7 +212,7 @@ public async Task ClickAsync() /// public void Click() { - InvokeMethodSync("click", new object[] { }, new string[] { }); + InvokeMethodSync("click", new object?[] { }, new string[] { }); } /// /// Sets focus on the radio control. @@ -221,7 +221,7 @@ public void Click() [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -230,7 +230,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the radio control. @@ -239,7 +239,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -248,14 +248,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Checks for validity of the control and emits the invalid event if it's invalid. /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -264,7 +264,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -272,7 +272,7 @@ public bool CheckValidity() /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -281,7 +281,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -290,7 +290,7 @@ public bool ReportValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -299,7 +299,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _checkedChanged = null; diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index fdf70ba4..3120ca5a 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -48,7 +48,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index 83012345..885aba8b 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -53,11 +53,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -72,7 +72,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -84,7 +84,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index e15c6ce4..55467976 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -104,7 +104,7 @@ public string? Value /// The value of the checked . public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -114,17 +114,17 @@ public async Task GetCurrentValueAsync() /// The value of the checked . public string GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/RangeSliderValue.cs b/src/components/Blazor/RangeSliderValue.cs index 4c53e5fc..59bd6624 100644 --- a/src/components/Blazor/RangeSliderValue.cs +++ b/src/components/Blazor/RangeSliderValue.cs @@ -63,7 +63,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -75,7 +75,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index a3cdcaa6..bc3e9e33 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -46,7 +46,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -56,7 +56,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index 70c2ab6c..64f2e829 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -166,7 +166,7 @@ public double Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -175,7 +175,7 @@ public async Task GetCurrentValueAsync() /// public double GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } private bool _hoverPreview = false; @@ -296,11 +296,11 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Increments the value of the control by steps multiplied by the @@ -308,7 +308,7 @@ public void SetNativeElement(Object element) /// public async Task StepUpAsync(double n = 1) { - await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); + await InvokeMethod("stepUp", new object?[] { n }, new string[] { "Number" }); } /// @@ -317,7 +317,7 @@ public async Task StepUpAsync(double n = 1) /// public void StepUp(double n = 1) { - InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); + InvokeMethodSync("stepUp", new object?[] { n }, new string[] { "Number" }); } /// /// Decrements the value of the control by steps multiplied by @@ -325,7 +325,7 @@ public void StepUp(double n = 1) /// public async Task StepDownAsync(double n = 1) { - await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); + await InvokeMethod("stepDown", new object?[] { n }, new string[] { "Number" }); } /// @@ -334,14 +334,14 @@ public async Task StepDownAsync(double n = 1) /// public void StepDown(double n = 1) { - InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); + InvokeMethodSync("stepDown", new object?[] { n }, new string[] { "Number" }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -350,7 +350,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -358,7 +358,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -367,7 +367,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -376,7 +376,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -385,7 +385,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/RatingSymbol.cs b/src/components/Blazor/RatingSymbol.cs index b94c7f95..5cdde284 100644 --- a/src/components/Blazor/RatingSymbol.cs +++ b/src/components/Blazor/RatingSymbol.cs @@ -58,19 +58,19 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public async Task ConnectedCallbackAsync() { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("connectedCallback", new object?[] { }, new string[] { }); } public void ConnectedCallback() { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("connectedCallback", new object?[] { }, new string[] { }); } } diff --git a/src/components/Blazor/Ripple.cs b/src/components/Blazor/Ripple.cs index 5f7f2a04..54aefd03 100644 --- a/src/components/Blazor/Ripple.cs +++ b/src/components/Blazor/Ripple.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 9abf148d..9fc13cbd 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -77,7 +77,7 @@ public string? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -86,7 +86,7 @@ public string? Value /// public string? GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } private bool _outlined = false; @@ -228,7 +228,7 @@ public PopoverScrollStrategy ScrollStrategy /// public async Task GetItemsAsync() { - var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); if (iv == null) { @@ -248,7 +248,7 @@ public async Task GetItemsAsync() /// public IgbSelectItem[] GetItems() { - var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); if (iv == null) { @@ -268,7 +268,7 @@ public IgbSelectItem[] GetItems() /// public async Task GetGroupsAsync() { - var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); if (iv == null) { @@ -288,7 +288,7 @@ public async Task GetGroupsAsync() /// public IgbSelectGroup[] GetGroups() { - var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); if (iv == null) { @@ -308,7 +308,7 @@ public IgbSelectGroup[] GetGroups() /// public async Task GetSelectedItemAsync() { - var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:SelectedItem", new object?[] { }, new string[] { }); if (iv == null) { @@ -328,7 +328,7 @@ public IgbSelectGroup[] GetGroups() /// public IgbSelectItem? GetSelectedItem() { - var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:SelectedItem", new object?[] { }, new string[] { }); if (iv == null) { @@ -426,7 +426,7 @@ public override object FindByName(string name) [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -435,7 +435,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the component. @@ -444,7 +444,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -453,14 +453,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Checks the validity of the control and moves the focus to it if it is not valid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -469,7 +469,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -477,7 +477,7 @@ public bool ReportValidity() /// public async Task ClearSelectionAsync() { - await InvokeMethod("clearSelection", new object[] { }, new string[] { }); + await InvokeMethod("clearSelection", new object?[] { }, new string[] { }); } /// @@ -485,14 +485,14 @@ public async Task ClearSelectionAsync() /// public void ClearSelection() { - InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); + InvokeMethodSync("clearSelection", new object?[] { }, new string[] { }); } /// /// Checks the validity of the control and emits the invalid event if it is invalid. /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -501,7 +501,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -510,7 +510,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } /// @@ -519,7 +519,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/SelectGroup.cs b/src/components/Blazor/SelectGroup.cs index e9e17b9c..74174fd4 100644 --- a/src/components/Blazor/SelectGroup.cs +++ b/src/components/Blazor/SelectGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -99,11 +99,11 @@ public bool Disabled public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/SelectHeader.cs b/src/components/Blazor/SelectHeader.cs index 3257d356..05203b62 100644 --- a/src/components/Blazor/SelectHeader.cs +++ b/src/components/Blazor/SelectHeader.cs @@ -58,11 +58,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 74ff009b..19d05de9 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Slider.cs b/src/components/Blazor/Slider.cs index 47b8ae7e..c83b9bd9 100644 --- a/src/components/Blazor/Slider.cs +++ b/src/components/Blazor/Slider.cs @@ -77,7 +77,7 @@ public double Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } @@ -86,7 +86,7 @@ public async Task GetCurrentValueAsync() /// public double GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDouble(iv); } private bool _invalid = false; @@ -116,7 +116,7 @@ public bool Invalid /// Optional step increment. If no parameter is passed, it defaults to 1. public async Task StepUpAsync(double stepIncrement = 1) { - await InvokeMethod("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); + await InvokeMethod("stepUp", new object?[] { stepIncrement }, new string[] { "Number" }); } /// @@ -126,7 +126,7 @@ public async Task StepUpAsync(double stepIncrement = 1) /// Optional step increment. If no parameter is passed, it defaults to 1. public void StepUp(double stepIncrement = 1) { - InvokeMethodSync("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); + InvokeMethodSync("stepUp", new object?[] { stepIncrement }, new string[] { "Number" }); } /// /// Decrements the value of the slider by stepDecrement * step, where @@ -135,7 +135,7 @@ public void StepUp(double stepIncrement = 1) /// Optional step decrement. If no parameter is passed, it defaults to 1. public async Task StepDownAsync(double stepDecrement = 1) { - await InvokeMethod("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); + await InvokeMethod("stepDown", new object?[] { stepDecrement }, new string[] { "Number" }); } /// @@ -145,14 +145,14 @@ public async Task StepDownAsync(double stepDecrement = 1) /// Optional step decrement. If no parameter is passed, it defaults to 1. public void StepDown(double stepDecrement = 1) { - InvokeMethodSync("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); + InvokeMethodSync("stepDown", new object?[] { stepDecrement }, new string[] { "Number" }); } /// /// Checks the validity of the control and shows the browser message if it is invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -161,7 +161,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -169,7 +169,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -178,7 +178,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -187,7 +187,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -196,7 +196,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/SliderBase.cs b/src/components/Blazor/SliderBase.cs index 2558f3a0..8e170c67 100644 --- a/src/components/Blazor/SliderBase.cs +++ b/src/components/Blazor/SliderBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -398,11 +398,11 @@ public IgbNumberFormatSpecifier? ValueFormatOptions public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/SliderLabel.cs b/src/components/Blazor/SliderLabel.cs index d5ac32f1..556fc578 100644 --- a/src/components/Blazor/SliderLabel.cs +++ b/src/components/Blazor/SliderLabel.cs @@ -59,11 +59,11 @@ protected override ControlEventBehavior DefaultEventBehavior public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } } diff --git a/src/components/Blazor/Splitter.cs b/src/components/Blazor/Splitter.cs index 3d6c01f9..ff9d4a25 100644 --- a/src/components/Blazor/Splitter.cs +++ b/src/components/Blazor/Splitter.cs @@ -281,18 +281,18 @@ public string? EndSize public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Toggles the collapsed state of the specified pane. /// public async Task ToggleAsync(PanePosition position) { - await InvokeMethod("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); + await InvokeMethod("toggle", new object?[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); } /// @@ -300,7 +300,7 @@ public async Task ToggleAsync(PanePosition position) /// public void Toggle(PanePosition position) { - InvokeMethodSync("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); + InvokeMethodSync("toggle", new object?[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); } private string? _resizeStartRef = null; diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index 938390f1..8e798e34 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,7 +47,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/SplitterResizeEventArgsDetail.cs b/src/components/Blazor/SplitterResizeEventArgsDetail.cs index e7e50487..54a377e3 100644 --- a/src/components/Blazor/SplitterResizeEventArgsDetail.cs +++ b/src/components/Blazor/SplitterResizeEventArgsDetail.cs @@ -74,11 +74,11 @@ public double Delta public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -95,7 +95,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -109,7 +109,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Step.cs b/src/components/Blazor/Step.cs index d03b3bfc..e3268ba5 100644 --- a/src/components/Blazor/Step.cs +++ b/src/components/Blazor/Step.cs @@ -163,11 +163,11 @@ public bool Complete public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index d590a1e1..f1d2b830 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -63,7 +63,7 @@ protected override ControlEventBehavior DefaultEventBehavior /// public async Task GetStepsAsync() { - var iv = await InvokeMethod("p:Steps", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Steps", new object?[] { }, new string[] { }); if (iv == null) { @@ -83,7 +83,7 @@ public async Task GetStepsAsync() /// public IgbStep[] GetSteps() { - var iv = InvokeMethodSync("p:Steps", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Steps", new object?[] { }, new string[] { }); if (iv == null) { @@ -252,18 +252,18 @@ public StepperTitlePosition TitlePosition public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Activates the step at a given index. /// public async Task NavigateToAsync(double index) { - await InvokeMethod("navigateTo", new object[] { index }, new string[] { "Number" }); + await InvokeMethod("navigateTo", new object?[] { index }, new string[] { "Number" }); } /// @@ -271,14 +271,14 @@ public async Task NavigateToAsync(double index) /// public void NavigateTo(double index) { - InvokeMethodSync("navigateTo", new object[] { index }, new string[] { "Number" }); + InvokeMethodSync("navigateTo", new object?[] { index }, new string[] { "Number" }); } /// /// Activates the next enabled step. /// public async Task NextAsync() { - await InvokeMethod("next", new object[] { }, new string[] { }); + await InvokeMethod("next", new object?[] { }, new string[] { }); } /// @@ -286,14 +286,14 @@ public async Task NextAsync() /// public void Next() { - InvokeMethodSync("next", new object[] { }, new string[] { }); + InvokeMethodSync("next", new object?[] { }, new string[] { }); } /// /// Activates the previous enabled step. /// public async Task PrevAsync() { - await InvokeMethod("prev", new object[] { }, new string[] { }); + await InvokeMethod("prev", new object?[] { }, new string[] { }); } /// @@ -301,14 +301,14 @@ public async Task PrevAsync() /// public void Prev() { - InvokeMethodSync("prev", new object[] { }, new string[] { }); + InvokeMethodSync("prev", new object?[] { }, new string[] { }); } /// /// Resets the stepper to its initial state, i.e. activates the first step. /// public async Task ResetAsync() { - await InvokeMethod("reset", new object[] { }, new string[] { }); + await InvokeMethod("reset", new object?[] { }, new string[] { }); } /// @@ -316,7 +316,7 @@ public async Task ResetAsync() /// public void Reset() { - InvokeMethodSync("reset", new object[] { }, new string[] { }); + InvokeMethodSync("reset", new object?[] { }, new string[] { }); } private string? _activeStepChangingRef = null; diff --git a/src/components/Blazor/Tab.cs b/src/components/Blazor/Tab.cs index d5478a44..2545868f 100644 --- a/src/components/Blazor/Tab.cs +++ b/src/components/Blazor/Tab.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -145,11 +145,11 @@ public bool Disabled public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index edbd35eb..6ffd3f6b 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index dc4b093f..b9edadf5 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -197,7 +197,7 @@ public TabsActivation Activation /// The label of the selected tab, or its ID if no label is set. public async Task GetSelectedAsync() { - var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -207,7 +207,7 @@ public async Task GetSelectedAsync() /// The label of the selected tab, or its ID if no label is set. public string GetSelected() { - var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -227,18 +227,18 @@ public override object FindByName(string name) } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Selects the specified tab and displays the corresponding panel. /// public async Task SelectAsync(String id) { - await InvokeMethod("select", new object[] { StringToString(id) }, new string[] { "String" }); + await InvokeMethod("select", new object?[] { StringToString(id) }, new string[] { "String" }); } /// @@ -246,7 +246,7 @@ public async Task SelectAsync(String id) /// public void Select(String id) { - InvokeMethodSync("select", new object[] { StringToString(id) }, new string[] { "String" }); + InvokeMethodSync("select", new object?[] { StringToString(id) }, new string[] { "String" }); } private string? _changeRef = null; diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 274e3632..28d047f9 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -310,7 +310,7 @@ public string? Value /// public async Task GetCurrentValueAsync() { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -319,7 +319,7 @@ public async Task GetCurrentValueAsync() /// public string GetCurrentValue() { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } private bool _spellcheck = true; @@ -444,18 +444,18 @@ public bool Invalid public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Selects all text within the control. /// public async Task SelectAsync() { - await InvokeMethod("select", new object[] { }, new string[] { }); + await InvokeMethod("select", new object?[] { }, new string[] { }); } /// @@ -463,14 +463,14 @@ public async Task SelectAsync() /// public void Select() { - InvokeMethodSync("select", new object[] { }, new string[] { }); + InvokeMethodSync("select", new object?[] { }, new string[] { }); } /// /// Checks for validity of the control and shows the browser message if it's invalid. /// public async Task ReportValidityAsync() { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -479,7 +479,7 @@ public async Task ReportValidityAsync() /// public bool ReportValidity() { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("reportValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -487,7 +487,7 @@ public bool ReportValidity() /// public async Task CheckValidityAsync() { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + var iv = await InvokeMethod("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -496,7 +496,7 @@ public async Task CheckValidityAsync() /// public bool CheckValidity() { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("checkValidity", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -505,7 +505,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } /// @@ -514,7 +514,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/ThemeProvider.cs b/src/components/Blazor/ThemeProvider.cs index 9b0557a6..4feadac9 100644 --- a/src/components/Blazor/ThemeProvider.cs +++ b/src/components/Blazor/ThemeProvider.cs @@ -103,11 +103,11 @@ public ThemeVariant Variant public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index 7a484754..63f3ac4f 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -141,7 +141,7 @@ public double? RowStart /// public async Task GetFullscreenAsync() { - var iv = await InvokeMethod("p:Fullscreen", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Fullscreen", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -150,7 +150,7 @@ public async Task GetFullscreenAsync() /// public bool GetFullscreen() { - var iv = InvokeMethodSync("p:Fullscreen", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Fullscreen", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } private bool _maximized = false; @@ -255,11 +255,11 @@ public double Position public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } private string? _tileFullscreenRef = null; diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 48f07616..2af65c58 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -49,7 +49,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -59,7 +59,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 38690435..68b76497 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -54,11 +54,11 @@ public bool State public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -73,7 +73,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -85,7 +85,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index d4dc330c..73dbe973 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -44,7 +44,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index 41c4f1ee..1ddb79a8 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -179,7 +179,7 @@ public string? Gap /// public async Task GetTilesAsync() { - var iv = await InvokeMethod("p:Tiles", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Tiles", new object?[] { }, new string[] { }); if (iv == null) { @@ -199,7 +199,7 @@ public async Task GetTilesAsync() /// public IgbTile[] GetTiles() { - var iv = InvokeMethodSync("p:Tiles", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Tiles", new object?[] { }, new string[] { }); if (iv == null) { @@ -235,18 +235,18 @@ public override object FindByName(string name) } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Returns the properties of the current tile collections as a JSON payload. /// public async Task SaveLayoutAsync() { - var iv = await InvokeMethod("saveLayout", new object[] { }, new string[] { }); + var iv = await InvokeMethod("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); } @@ -255,7 +255,7 @@ public async Task SaveLayoutAsync() /// public String SaveLayout() { - var iv = InvokeMethodSync("saveLayout", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); } /// @@ -263,7 +263,7 @@ public String SaveLayout() /// public async Task LoadLayoutAsync(String data) { - await InvokeMethod("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); + await InvokeMethod("loadLayout", new object?[] { StringToString(data) }, new string[] { "String" }); } /// @@ -271,7 +271,7 @@ public async Task LoadLayoutAsync(String data) /// public void LoadLayout(String data) { - InvokeMethodSync("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); + InvokeMethodSync("loadLayout", new object?[] { StringToString(data) }, new string[] { "String" }); } private string? _tileFullscreenRef = null; diff --git a/src/components/Blazor/ToggleButton.cs b/src/components/Blazor/ToggleButton.cs index 0c4bd4be..609e9a02 100644 --- a/src/components/Blazor/ToggleButton.cs +++ b/src/components/Blazor/ToggleButton.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -121,11 +121,11 @@ public bool Disabled public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Sets focus on the button. @@ -134,7 +134,7 @@ public void SetNativeElement(Object element) [WCWidgetMemberName("Focus")] public async Task FocusComponentAsync(IgbFocusOptions options) { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + await InvokeMethod("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// @@ -143,7 +143,7 @@ public async Task FocusComponentAsync(IgbFocusOptions options) [WCWidgetMemberName("Focus")] public void FocusComponent(IgbFocusOptions options) { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + InvokeMethodSync("focus", new object?[] { ObjectToParam(options) }, new string[] { "Json" }); } /// /// Removes focus from the button. @@ -152,7 +152,7 @@ public void FocusComponent(IgbFocusOptions options) [WCWidgetMemberName("Blur")] public async Task BlurComponentAsync() { - await InvokeMethod("blur", new object[] { }, new string[] { }); + await InvokeMethod("blur", new object?[] { }, new string[] { }); } /// @@ -161,14 +161,14 @@ public async Task BlurComponentAsync() [WCWidgetMemberName("Blur")] public void BlurComponent() { - InvokeMethodSync("blur", new object[] { }, new string[] { }); + InvokeMethodSync("blur", new object?[] { }, new string[] { }); } /// /// Simulates a mouse click on the button. /// public async Task ClickAsync() { - await InvokeMethod("click", new object[] { }, new string[] { }); + await InvokeMethod("click", new object?[] { }, new string[] { }); } /// @@ -176,7 +176,7 @@ public async Task ClickAsync() /// public void Click() { - InvokeMethodSync("click", new object[] { }, new string[] { }); + InvokeMethodSync("click", new object?[] { }, new string[] { }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index ad39eda2..5dd446a4 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -274,11 +274,11 @@ public bool Sticky public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } /// /// Shows the tooltip if not already showing. @@ -286,7 +286,7 @@ public void SetNativeElement(Object element) /// public async Task ShowAsync(String? target = null) { - var iv = await InvokeMethod("show", new object[] { StringToString(target) }, new string[] { "String" }); + var iv = await InvokeMethod("show", new object?[] { StringToString(target) }, new string[] { "String" }); return ReturnToBoolean(iv); } @@ -296,7 +296,7 @@ public async Task ShowAsync(String? target = null) /// public bool Show(String? target = null) { - var iv = InvokeMethodSync("show", new object[] { StringToString(target) }, new string[] { "String" }); + var iv = InvokeMethodSync("show", new object?[] { StringToString(target) }, new string[] { "String" }); return ReturnToBoolean(iv); } /// @@ -304,7 +304,7 @@ public bool Show(String? target = null) /// public async Task HideAsync() { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + var iv = await InvokeMethod("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -313,7 +313,7 @@ public async Task HideAsync() /// public bool Hide() { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("hide", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } /// @@ -321,7 +321,7 @@ public bool Hide() /// public async Task ToggleAsync() { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + var iv = await InvokeMethod("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } @@ -330,7 +330,7 @@ public async Task ToggleAsync() /// public bool Toggle() { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("toggle", new object?[] { }, new string[] { }); return ReturnToBoolean(iv); } diff --git a/src/components/Blazor/Tree.cs b/src/components/Blazor/Tree.cs index f62b2df5..c559b6ae 100644 --- a/src/components/Blazor/Tree.cs +++ b/src/components/Blazor/Tree.cs @@ -139,19 +139,19 @@ public override object FindByName(string name) } public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public async Task ConnectedCallbackAsync() { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("connectedCallback", new object?[] { }, new string[] { }); } public void ConnectedCallback() { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("connectedCallback", new object?[] { }, new string[] { }); } private string? _selectionChangedRef = null; diff --git a/src/components/Blazor/TreeItem.cs b/src/components/Blazor/TreeItem.cs index 03cbc1fa..b1c31dc0 100644 --- a/src/components/Blazor/TreeItem.cs +++ b/src/components/Blazor/TreeItem.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -235,7 +235,7 @@ public object? Value /// public async Task GetPathAsync() { - var iv = await InvokeMethod("p:Path", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:Path", new object?[] { }, new string[] { }); if (iv == null) { @@ -255,7 +255,7 @@ public async Task GetPathAsync() /// public IgbTreeItem[] GetPath() { - var iv = InvokeMethodSync("p:Path", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:Path", new object?[] { }, new string[] { }); if (iv == null) { @@ -272,34 +272,34 @@ public IgbTreeItem[] GetPath() public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); } public async Task ConnectedCallbackAsync() { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("connectedCallback", new object?[] { }, new string[] { }); } public void ConnectedCallback() { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("connectedCallback", new object?[] { }, new string[] { }); } public async Task DisconnectedCallbackAsync() { - await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); + await InvokeMethod("disconnectedCallback", new object?[] { }, new string[] { }); } public void DisconnectedCallback() { - InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); + InvokeMethodSync("disconnectedCallback", new object?[] { }, new string[] { }); } /// /// Toggles tree item expansion state. /// public async Task ToggleAsync() { - await InvokeMethod("toggle", new object[] { }, new string[] { }); + await InvokeMethod("toggle", new object?[] { }, new string[] { }); } /// @@ -307,14 +307,14 @@ public async Task ToggleAsync() /// public void Toggle() { - InvokeMethodSync("toggle", new object[] { }, new string[] { }); + InvokeMethodSync("toggle", new object?[] { }, new string[] { }); } /// /// Expands the tree item. /// public async Task ExpandAsync() { - await InvokeMethod("expand", new object[] { }, new string[] { }); + await InvokeMethod("expand", new object?[] { }, new string[] { }); } /// @@ -322,14 +322,14 @@ public async Task ExpandAsync() /// public void Expand() { - InvokeMethodSync("expand", new object[] { }, new string[] { }); + InvokeMethodSync("expand", new object?[] { }, new string[] { }); } /// /// Collapses the tree item. /// public async Task CollapseAsync() { - await InvokeMethod("collapse", new object[] { }, new string[] { }); + await InvokeMethod("collapse", new object?[] { }, new string[] { }); } /// @@ -337,7 +337,7 @@ public async Task CollapseAsync() /// public void Collapse() { - InvokeMethodSync("collapse", new object[] { }, new string[] { }); + InvokeMethodSync("collapse", new object?[] { }, new string[] { }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 91549107..d142b536 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -44,7 +44,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index cbad08d3..f33b7676 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,7 +47,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index 1ff3493a..23d93ad7 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -43,7 +43,7 @@ internal override void SerializeCore(RendererSerializer ser) } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/VoidEventArgs.cs b/src/components/Blazor/VoidEventArgs.cs index 8e26d77b..8112240a 100644 --- a/src/components/Blazor/VoidEventArgs.cs +++ b/src/components/Blazor/VoidEventArgs.cs @@ -11,14 +11,14 @@ public partial class IgbVoidEventArgs : BaseRendererElement public override string Type { get { return "VoidEventArgs"; } } /// - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) { base.ToEventJson(control, args); } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 123530f5..b69fdd47 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -949,12 +949,12 @@ public string Serialize() private Object _semLock = new Object(); static long _invokeId = 0; - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected async Task InvokeMethod(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) { return await InvokeMethodHelper(null, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected object InvokeMethodSync(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) { return InvokeMethodHelperSync(null, methodName, arguments, types, nativeElements); } @@ -975,7 +975,7 @@ private JsonSerializerOptions SerializerOptions } } - internal object InvokeMethodHelperSync(string? target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) + internal object InvokeMethodHelperSync(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -987,7 +987,7 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object } RendererMessage m = new RendererMessage(); m.Type = ("invokeMethod"); - string[] args = new string[arguments.Length]; + string?[] args = new string?[arguments.Length]; string[] typeStrings = new string[arguments.Length]; long invokeId = _invokeId++; for (int i = 0; i < arguments.Length; i++) @@ -1029,7 +1029,7 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object Dictionary> _methodTasks = new Dictionary>(); - internal async Task InvokeMethodHelper(string? target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) + internal async Task InvokeMethodHelper(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -1037,7 +1037,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName } RendererMessage m = new RendererMessage(); m.Type = ("invokeMethod"); - string[] args = new string[arguments.Length]; + string?[] args = new string?[arguments.Length]; string[] typeStrings = new string[arguments.Length]; long invokeId = _invokeId++; for (int i = 0; i < arguments.Length; i++) @@ -2001,7 +2001,7 @@ internal T[] DowncastArray(object val) var arr = ((JsonElement)obj["value"]); if (transformArrays && arr.ValueKind == JsonValueKind.Array) { - object[] ret = new object[arr.GetArrayLength()]; + object?[] ret = new object?[arr.GetArrayLength()]; for (var i = 0; i < arr.GetArrayLength(); i++) { var item = arr[i]; @@ -2849,7 +2849,7 @@ internal string[] ReturnToStringArray(object val) for (int i = 0; i < arr.Length; i++) { string? ele = arr[i] != null ? arr[i].ToString() : null; - ret[i] = ele; + ret[i] = ele!; } return ret; } diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index bdcc4706..9e9e231d 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -1048,11 +1048,11 @@ internal string DoubleArrayToString(double[] val) } } - protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary args) { } - protected internal virtual void ToEventJson(BaseRendererControl control, Dictionary args) + protected internal virtual void ToEventJson(BaseRendererControl control, Dictionary args) { } diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 06883b3a..4e64a9ff 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -109,7 +109,7 @@ public string OnRefChanged(string path, object data) else { //Console.WriteLine("json datasource"); - _dataSources[id] = JsonDataSource.Create(data, this); + _dataSources[id] = JsonDataSource.Create(data, this)!; } } _idLookup[data] = id; diff --git a/src/componentsBase/WebInputs/Chat.cs b/src/componentsBase/WebInputs/Chat.cs index 4d08fe52..375a3178 100644 --- a/src/componentsBase/WebInputs/Chat.cs +++ b/src/componentsBase/WebInputs/Chat.cs @@ -8,13 +8,13 @@ public partial class IgbChat { public IgbChatDraftMessage GetCurrentDraftMessage() { - var iv = InvokeMethodSync("p:DraftMessage", new object[] { }, new string[] { }); + var iv = InvokeMethodSync("p:DraftMessage", new object?[] { }, new string[] { }); return ReturnToObject(iv, "ChatDraftMessage"); } public async Task GetCurrentDraftMessageAsync() { - var iv = await InvokeMethod("p:DraftMessage", new object[] { }, new string[] { }); + var iv = await InvokeMethod("p:DraftMessage", new object?[] { }, new string[] { }); return ReturnToObject(iv, "ChatDraftMessage"); } } diff --git a/src/componentsBase/WebInputs/DateTimeInput.cs b/src/componentsBase/WebInputs/DateTimeInput.cs index 548124aa..3889de08 100644 --- a/src/componentsBase/WebInputs/DateTimeInput.cs +++ b/src/componentsBase/WebInputs/DateTimeInput.cs @@ -1,39 +1,39 @@ -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { public partial class IgbDateTimeInput { public async Task StepUpAsync() { - await InvokeMethod("stepUp", new object[] { }, new string[] { }); + await InvokeMethod("stepUp", new object?[] { }, new string[] { }); } public void StepUp() { - InvokeMethodSync("stepUp", new object[] { }, new string[] { }); + InvokeMethodSync("stepUp", new object?[] { }, new string[] { }); } public async Task StepUpAsync(DatePart datePart) { - await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); + await InvokeMethod("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); } public void StepUp(DatePart datePart) { - InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); + InvokeMethodSync("stepUp", new object?[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); } public async Task StepDownAsync() { - await InvokeMethod("stepDown", new object[] { }, new string[] { }); + await InvokeMethod("stepDown", new object?[] { }, new string[] { }); } public void StepDown() { - InvokeMethodSync("stepDown", new object[] { }, new string[] { }); + InvokeMethodSync("stepDown", new object?[] { }, new string[] { }); } public async Task StepDownAsync(DatePart datePart) { - await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); + await InvokeMethod("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); } public void StepDown(DatePart datePart) { - InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); + InvokeMethodSync("stepDown", new object?[] { ObjectToParam(datePart, typeof(DatePart)) }, new string[] { "Json" }); } } } diff --git a/src/componentsBase/WebInputs/Dropdown.cs b/src/componentsBase/WebInputs/Dropdown.cs index 241e4fab..0b6c62ee 100644 --- a/src/componentsBase/WebInputs/Dropdown.cs +++ b/src/componentsBase/WebInputs/Dropdown.cs @@ -20,7 +20,7 @@ public partial class IgbDropdown public async Task ShowAsync(Object target_) { //Console.WriteLine(ComponentToJson(target_)); - var iv = await InvokeMethod("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + var iv = await InvokeMethod("show", new object?[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); return ReturnToBoolean(iv); } @@ -38,7 +38,7 @@ public async Task ShowAsync(Object target_) /// or if it was already open. public bool Show(Object target_) { - var iv = InvokeMethodSync("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + var iv = InvokeMethodSync("show", new object?[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); return ReturnToBoolean(iv); } @@ -55,7 +55,7 @@ public bool Show(Object target_) /// when the open state was changed. public async Task ToggleAsync(Object target_) { - var iv = await InvokeMethod("toggle", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + var iv = await InvokeMethod("toggle", new object?[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); return ReturnToBoolean(iv); } @@ -72,7 +72,7 @@ public async Task ToggleAsync(Object target_) /// when the open state was changed. public bool Toggle(Object target_) { - var iv = InvokeMethodSync("toggle", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + var iv = InvokeMethodSync("toggle", new object?[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); return ReturnToBoolean(iv); } From c1d5fa51cccf197940f8e0177f530d5c61e58894 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 18:41:39 +0300 Subject: [PATCH 06/64] Fix CS8602 - mark as not null. --- src/components/Blazor/CheckboxBase.cs | 2 +- src/components/Blazor/Combo.cs | 2 +- src/components/Blazor/Radio.cs | 2 +- src/components/Blazor/RadioGroup.cs | 2 +- src/components/Blazor/Select.cs | 2 +- src/componentsBase/BaseRendererControl.cs | 90 +++---- src/componentsBase/BaseRendererElement.cs | 2 +- src/componentsBase/CollectionAdapter.cs | 20 +- src/componentsBase/DataSourceManager.cs | 18 +- src/componentsBase/DynamicContentHolder.cs | 10 +- src/componentsBase/JsonDataSource.cs | 14 +- src/componentsBase/JsonDataSourceItem.cs | 34 +-- src/componentsBase/JsonDataSourceSchema.cs | 44 ++-- src/componentsBase/RendererSerializer.cs | 80 +++---- src/componentsBase/RuntimeHelper.cs | 8 +- src/componentsBase/UnmarshalledDataSource.cs | 222 +++++++++--------- stories/Components/Stories/Chat.stories.razor | 10 +- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 8 +- tests/IgniteUI.Blazor.Tests/CheckboxTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 10 +- .../DateRangePickerTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/RadioTests.cs | 4 +- .../IgniteUI.Blazor.Tests/RangeSliderTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/SplitterTests.cs | 6 +- tests/IgniteUI.Blazor.Tests/StepperTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/SwitchTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TabsTests.cs | 2 +- .../IgniteUI.Blazor.Tests/TileManagerTests.cs | 8 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 2 +- 30 files changed, 310 insertions(+), 310 deletions(-) diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index a05d03cc..c71cb52f 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -389,7 +389,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args.Detail.Checked); + newValueChecked = (bool)(args!.Detail!.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index fdc47498..07d355d6 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -859,7 +859,7 @@ public EventCallback Change var newValueValue = default(T[]); { - newValueValue = (T[])(DowncastArray(args.Detail.NewValue)); + newValueValue = (T[])(DowncastArray(args!.Detail!.NewValue)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index 64877f5f..22e124dc 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -389,7 +389,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args.Detail.Checked); + newValueChecked = (bool)(args!.Detail!.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 55467976..5585fcc3 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -214,7 +214,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail.Value!; + newValueValue = (string)args!.Detail!.Value!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 9fc13cbd..ff3d088e 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -609,7 +609,7 @@ public EventCallback Change var newValueValue = default(string?); { - newValueValue = (string?)(args.Detail.Value); + newValueValue = (string?)(args!.Detail!.Value); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index b69fdd47..ad7acc50 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -293,7 +293,7 @@ private Dictionary GatherSimpleAttributes() var ser = Serialize(); var data = System.Text.Json.JsonSerializer.Deserialize>(ser); Dictionary ret = new Dictionary(); - foreach (var key in data.Keys) + foreach (var key in data!.Keys) { var currKey = key; var currValue = data[key]; @@ -365,13 +365,13 @@ private object ArrayToSimpleAttributeValue(JsonElement currValue) protected virtual string TransformSimpleKey(string key) { key = Camelize(key); - return _sequenceInfo.TransformKey(key); + return _sequenceInfo!.TransformKey(key); } protected virtual bool IsTransformedEnumValue(string key) { key = Camelize(key); - if (_sequenceInfo.IsTransformedEnum(key)) + if (_sequenceInfo!.IsTransformedEnum(key)) { return true; } @@ -382,7 +382,7 @@ protected virtual object TransformPotentialEnumValue(string key, object value) { key = Camelize(key); //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); - if (_sequenceInfo.IsTransformedEnum(key)) + if (_sequenceInfo!.IsTransformedEnum(key)) { //Console.WriteLine("transforming enum value...."); @@ -478,7 +478,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.AddAttribute(2, "data-ig-id", _containerId); EnsureSequenceInfo(); - foreach (var key in _sequenceInfo.AttributeKeys) + foreach (var key in _sequenceInfo!.AttributeKeys) { if (attributes.ContainsKey(key)) { @@ -684,7 +684,7 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin dynamicContent.UpdateTemplate(template); } - Holder.AddDynamicContent(dynamicContent); + Holder!.AddDynamicContent(dynamicContent); break; } case "Remove": @@ -693,7 +693,7 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin { DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; _dynamicContentInfos.Remove(contentId); - Holder.RemoveDynamicContent(dynamicContent); + Holder!.RemoveDynamicContent(dynamicContent); } break; } @@ -799,7 +799,7 @@ public async Task EnsureReady() //Console.WriteLine("ensuring ready: " + this.GetType().Name); while (!this._ready) { - bool ready = await JsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }); + bool ready = await JsRuntime!.InvokeAsync("igCheckReady", new object[] { _containerId }); //Console.WriteLine(ready + " -> " + this.GetType().Name); if (ready) { @@ -1012,7 +1012,7 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object var str = ((JsonElement)ret).GetString(); var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); - if (retDict.ContainsKey("retType") && + if (retDict!.ContainsKey("retType") && retDict["retType"] is JsonElement && ((JsonElement)retDict["retType"]).GetString() == "promise") { @@ -1065,7 +1065,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); ret = retDict; - if (retDict.ContainsKey("retType") && + if (retDict!.ContainsKey("retType") && retDict["retType"] is JsonElement && ((JsonElement)retDict["retType"]).GetString() == "promise") { @@ -1289,7 +1289,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal } else { - refId = _dataSourceManager.OnRefChanged(propertyName, newValue); + refId = _dataSourceManager!.OnRefChanged(propertyName, newValue); } } else if (newValue == null) @@ -1302,7 +1302,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal { var str = newValue.ToString(); - if (str.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::")) + if (str!.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::")) { OnRefChanged(refId, "\"" + newValue.ToString() + "\""); } @@ -1325,7 +1325,7 @@ internal string DateToString(DateTime val) /// The datasource that is being changed. public void SuspendNotifications(object dataSource) { - _dataSourceManager.SuspendNotifications(dataSource); + _dataSourceManager!.SuspendNotifications(dataSource); } /// /// Resumes data change notifications. @@ -1334,12 +1334,12 @@ public void SuspendNotifications(object dataSource) /// Whether to notify the component that the datasource items changed. public void ResumeNotifications(object dataSource, bool notify = true) { - _dataSourceManager.ResumeNotifications(dataSource, notify); + _dataSourceManager!.ResumeNotifications(dataSource, notify); } public void NotifyInsertItem(object dataSource, int index, object refItem) { - if (!_dataSourceManager.HasRefId(dataSource)) + if (!_dataSourceManager!.HasRefId(dataSource)) { return; } @@ -1353,7 +1353,7 @@ public void NotifyInsertItem(object dataSource, int index, object refItem) public void NotifyRemoveItem(object dataSource, int index, object oldItem) { - if (!_dataSourceManager.HasRefId(dataSource)) + if (!_dataSourceManager!.HasRefId(dataSource)) { return; } @@ -1367,7 +1367,7 @@ public void NotifyRemoveItem(object dataSource, int index, object oldItem) public void NotifyClearItems(object dataSource) { - if (!_dataSourceManager.HasRefId(dataSource)) + if (!_dataSourceManager!.HasRefId(dataSource)) { return; } @@ -1381,7 +1381,7 @@ public void NotifyClearItems(object dataSource) public void NotifySetItem(object dataSource, int index, object oldItem, object newItem) { - if (!_dataSourceManager.HasRefId(dataSource)) + if (!_dataSourceManager!.HasRefId(dataSource)) { return; } @@ -1395,7 +1395,7 @@ public void NotifySetItem(object dataSource, int index, object oldItem, object n public void NotifyUpdateItem(object dataSource, int index, object refItem, bool syncDataOnly = false) { - if (!_dataSourceManager.HasRefId(dataSource)) + if (!_dataSourceManager!.HasRefId(dataSource)) { return; } @@ -1420,7 +1420,7 @@ public void OnRefChanged(string refName, object? refValue) { m.SetData("dataIntents", dataIntents); } - if (ds.DataSourceType == JSDataSourceType.Json) + if (ds!.DataSourceType == JSDataSourceType.Json) { if (!ds.IsSent) { @@ -1614,7 +1614,7 @@ private void Update() //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); while (_messageQueue.Count > 0) { - RendererMessage m = _messageQueue.First.Value; + RendererMessage m = _messageQueue!.First!.Value; _messageQueue.RemoveFirst(); ProcessMessage(m); } @@ -1631,7 +1631,7 @@ private void UpdateSync() while (_messageQueue.Count > 0) { - RendererMessage m = _messageQueue.First.Value; + RendererMessage m = _messageQueue!.First!.Value; _messageQueue.RemoveFirst(); ProcessMessageSync(m); } @@ -1710,14 +1710,14 @@ private async Task SendJsonImmediate(RendererMessage m) if (m.NativeElements != null) { - return await JsRuntime.InvokeAsync("igSendMessage", + return await JsRuntime!.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), m.NativeElements }); } else { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return await JsRuntime.InvokeAsync("igSendMessage", + return await JsRuntime!.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); } @@ -1738,13 +1738,13 @@ private object SendJsonImmediateSync(RendererMessage m) if (nativeElements != null) { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, + return this!.JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, + return this!.JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef()}); } } @@ -1760,13 +1760,13 @@ private void SendJson(string json, ElementReference[] nativeElements) if (nativeElements != null) { - JsRuntime.InvokeAsync("igSendMessage", + JsRuntime!.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { - JsRuntime.InvokeAsync("igSendMessage", + JsRuntime!.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); } @@ -1832,14 +1832,14 @@ private void SendJsonSync(string json, ElementReference[] nativeElements) if (nativeElements != null) { - JsInProcessRuntime.Invoke("igSendMessage", + JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { - JsInProcessRuntime.Invoke("igSendMessage", + JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); @@ -1951,12 +1951,12 @@ internal T[] DowncastArray(object val) String id = ((JsonElement)obj["id"]).ToString(); if (id.Contains("/")) { - returnValue = _dataSourceManager.FindItem(id); + returnValue = _dataSourceManager!.FindItem(id); } else { Guid uuid = Guid.Parse(id); - returnValue = _dataSourceManager.FindItem(uuid); + returnValue = _dataSourceManager!.FindItem(uuid); } } else @@ -2251,7 +2251,7 @@ internal long ReturnToLong(object val) try { var arr = JsonSerializer.Deserialize(val?.ToString(), SerializerOptions); - DateTime[] ret = new DateTime[arr.Length]; + DateTime[] ret = new DateTime[arr!.Length]; for (int i = 0; i < arr.Length; i++) { Object ele = arr[i]!; @@ -2402,7 +2402,7 @@ internal void ObjectToParam(SerializationContext context, object val) return; } var w = context.Writer; - Guid id = _dataSourceManager.FindItemId(val); + Guid id = _dataSourceManager!.FindItemId(val); var typeName = ""; @@ -2485,7 +2485,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object w.WriteNull(propertyName); return; } - Guid id = _dataSourceManager.FindItemId(val); + Guid id = _dataSourceManager!.FindItemId(val); string typeName = ""; if (val is JsonSerializable) @@ -2783,7 +2783,7 @@ internal object[] ReturnToObjectArray(object val) try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - Object[] ret = new Object[arr.Length]; + Object[] ret = new Object[arr!.Length]; for (int i = 0; i < arr.Length; i++) { Object ele = arr[i]; @@ -2813,7 +2813,7 @@ internal object[] ReturnToObjectArray(object val) try { var arr = JsonSerializer.Deserialize[]>(val.ToString(), SerializerOptions); - T[] ret = new T[arr.Length]; + T[] ret = new T[arr!.Length]; for (int i = 0; i < arr.Length; i++) { Object ele = arr[i]; @@ -2845,7 +2845,7 @@ internal string[] ReturnToStringArray(object val) { var valStr = val.ToString(); var arr = JsonSerializer.Deserialize(valStr!, SerializerOptions); - string[] ret = new string[arr.Length]; + string[] ret = new string[arr!.Length]; for (int i = 0; i < arr.Length; i++) { string? ele = arr[i] != null ? arr[i].ToString() : null; @@ -2869,7 +2869,7 @@ internal double[] ReturnToDoubleArray(object val) try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - double[] ret = new double[arr.Length]; + double[] ret = new double[arr!.Length]; for (int i = 0; i < arr.Length; i++) { double ele = arr[i] != null ? Convert.ToDouble(arr[i]) : double.NaN; @@ -2893,7 +2893,7 @@ internal int[] ReturnToIntArray(object val) try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - int[] ret = new int[arr.Length]; + int[] ret = new int[arr!.Length]; for (int i = 0; i < arr.Length; i++) { int ele = arr[i] != null ? Convert.ToInt32(arr[i]) : int.MinValue; @@ -3066,7 +3066,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) var obj = JsonSerializer.Deserialize>((string)args.ToString(), SerializerOptions); //Console.WriteLine(args.ToString()); - object sender = obj["sender"]; + object sender = obj!["sender"]; if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) { sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString()!, SerializerOptions)!; @@ -3099,7 +3099,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) // Avoid double unwrapping primitive value types. This primarily only applies to events with primitive types for event args which // there are not many of. bool needsConversion = true; - if (dict.ContainsKey("retType")) + if (dict!.ContainsKey("retType")) { var retType = ((JsonElement)dict["retType"]).ToString(); if ("string".Equals(retType) || @@ -3180,7 +3180,7 @@ public async Task SetResourceStringAsync(string grouping, string id, str { return null; } - return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); + return await JsRuntime!.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); } public async Task SetResourceStringAsync(string grouping, string json) @@ -3189,7 +3189,7 @@ public async Task SetResourceStringAsync(string grouping, string json) { return null; } - return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); + return await JsRuntime!.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); } protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, JsonElement jsonElement) @@ -3531,7 +3531,7 @@ public bool IsRuntimeValid(bool reevaluate = false) { if (reevaluate && _isRemoteRuntime) { - _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); + _isRuntimeValid = (bool)_remoteRuntimeProp!.GetValue(JsRuntime); } } return _isRuntimeValid; diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 9e9e231d..27b56564 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -251,7 +251,7 @@ private void FlushRefs() { while (_queuedChanges.Count > 0) { - RefChange c = _queuedChanges.First.Value; + RefChange c = _queuedChanges!.First!.Value; _queuedChanges.RemoveFirst(); OnRefChanged(c.propertyName, c.oldValue, c.newValue, c.isScript, c.isElement, c.refChanged); } diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 90921c7c..2ca12f07 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -1,4 +1,4 @@ -using System.Collections.Specialized; +using System.Collections.Specialized; namespace IgniteUI.Blazor.Controls { @@ -125,7 +125,7 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) } var mapWasEmpty = manualSet.Count == 0; - for (var i = 0; i < this._query.Count; i++) + for (var i = 0; i < this!._query!.Count; i++) { item = this._query[i]; @@ -137,7 +137,7 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) } else { - var key = this.CollisionChecker(item); + var key = this!.CollisionChecker!(item); if (key == null) { this._manualItems.Insert(i, item); @@ -169,7 +169,7 @@ private void SyncItems() Dictionary manualMap = new Dictionary(); T item = default(T)!; - for (var i = 0; i < this._allList.Count; i++) + for (var i = 0; i < this!._allList!.Count; i++) { item = this._allList[i]; targetMap[item] = true; @@ -232,8 +232,8 @@ private void SyncItems() if (!queryMap.ContainsKey(item) && !manualMap.ContainsKey(item)) { this._allList.RemoveAt(i); - this._target.RemoveAt(i); - this._onItemRemoved(item); + this!._target!.RemoveAt(i); + this!._onItemRemoved!(item); } } @@ -266,8 +266,8 @@ private void SyncItems() else { this._allList.Insert(ins, insItem); - this._target.Insert(ins, this._toTarget(insItem)); - this._onItemAdded(insItem); + this!._target!.Insert(ins, this!._toTarget!(insItem)); + this!._onItemAdded!(insItem); ind++; ins++; } @@ -275,8 +275,8 @@ private void SyncItems() else { this._allList.Add(insItem); - this._target.Add(this._toTarget(insItem)); - this._onItemAdded(insItem); + this!._target!.Add(this!._toTarget!(insItem)); + this!._onItemAdded!(insItem); ind++; ins++; } diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 4e64a9ff..7521d5a2 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -1,4 +1,4 @@ -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { internal class DataSourceManager { @@ -101,7 +101,7 @@ public string OnRefChanged(string path, object data) IncrementRef(id); if (!_dataSources.ContainsKey(id)) { - if (_helper.IsInproc && !_helper.IsForcedJsonDataMarshalling) + if (_helper!.IsInproc && !_helper.IsForcedJsonDataMarshalling) { //Console.WriteLine("unmarshalled datasource"); _dataSources[id] = UnmarshalledDataSource.Create(data, this, _helper); @@ -113,7 +113,7 @@ public string OnRefChanged(string path, object data) } } _idLookup[data] = id; - _refSink.OnRefChanged(id, _dataSources[id]); + _refSink!.OnRefChanged(id, _dataSources[id]); } if (data == null) @@ -164,7 +164,7 @@ void DecrementRef(string id) } _dataSources.Remove(id); _refsById.Remove(id); - _refSink.OnRefChanged(id, null); + _refSink!.OnRefChanged(id, null); } } } @@ -183,7 +183,7 @@ public void NotifyInsertItem(string refName, int index, object refItem) object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem newItem = dataSource.NotifyInsertItem(data, index, refItem); - _refSink.OnRefNotifyInsertItem(dataSource, refName, index, newItem); + _refSink!.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } public void NotifyRemoveItem(String refName, int index, Object oldItem) @@ -198,7 +198,7 @@ public void NotifyRemoveItem(String refName, int index, Object oldItem) Object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem oldItemJson = dataSource.NotifyRemoveItem(data, index, oldItem); - _refSink.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); + _refSink!.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); } } public void NotifyClearItems(string refName) @@ -213,7 +213,7 @@ public void NotifyClearItems(string refName) Object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; dataSource.NotifyClearItems(data); - _refSink.OnRefNotifyClearItems(dataSource, refName, dataSource); + _refSink!.OnRefNotifyClearItems(dataSource, refName, dataSource); } } public void NotifySetItem(string refName, int index, object oldItem, object newItem) @@ -228,7 +228,7 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem? oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; IJSDataSourceItem newItemJson = dataSource.NotifySetItem(data, index, oldItem, newItem); - _refSink.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); + _refSink!.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); } } public void NotifyUpdateItem(string refName, int index, object refItem, bool syncDataOnly) @@ -242,7 +242,7 @@ public void NotifyUpdateItem(string refName, int index, object refItem, bool syn object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem newItemJson = dataSource.NotifyUpdateItem(data, index, refItem); - _refSink.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); + _refSink!.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); } } diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 9164d42e..215d12bb 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -29,7 +29,7 @@ protected override void OnInitialized() public void AddDynamicContent(DynamicContentInfo content) { _contentInfos[content.RefName] = content; - _contentInfoNode[content.RefName] = DynamicContentInfo.AddLast(content); + _contentInfoNode[content.RefName] = DynamicContentInfo!.AddLast(content); _isDirty = true; } @@ -39,7 +39,7 @@ public void RemoveDynamicContent(DynamicContentInfo content) { _contentInfos.Remove(content.RefName); - DynamicContentInfo.Remove(_contentInfoNode[content.RefName]); + DynamicContentInfo!.Remove(_contentInfoNode[content.RefName]); _contentInfoNode.Remove(content.RefName); _isDirty = true; @@ -71,7 +71,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.AddAttribute(1, "class", "ig-dynamic-content-holder"); builder.AddAttribute(2, "style", "display: none"); builder.AddMarkupContent(3, "\r\n"); - var current = DynamicContentInfo.First; + var current = DynamicContentInfo!.First; while (current != null) { var item = current.Value; @@ -206,7 +206,7 @@ public Task GetInstanceAsync() if (component != null) { - foreach (var item in toSignal) + foreach (var item in toSignal!) { item.SetResult(Component); } diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 1d4a9ca6..7b2bac0f 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -120,7 +120,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager.GetRefId(_originalData); + var refName = _manager!.GetRefId(_originalData); if (refName == null) { return; @@ -137,7 +137,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager.GetRefId(_originalData); + var refName = _manager!.GetRefId(_originalData); if (refName == null) { return; @@ -154,7 +154,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager.GetRefId(_originalData); + var refName = _manager!.GetRefId(_originalData); if (refName == null) { return; @@ -167,7 +167,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager.GetRefId(_originalData); + var refName = _manager!.GetRefId(_originalData); if (refName == null) { return; @@ -179,7 +179,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs } case NotifyCollectionChangedAction.Reset: { - var refName = _manager.GetRefId(_originalData); + var refName = _manager!.GetRefId(_originalData); if (refName == null) { return; @@ -388,10 +388,10 @@ private void Add(object? item) if (schema != null) { - for (int i = 0; i < schema.PropertyNames.Length; i++) + for (int i = 0; i < schema!.PropertyNames!.Length; i++) { var propertyName = schema.PropertyNames[i]; - var propertyType = schema.PropertyTypes[i]; + var propertyType = schema!.PropertyTypes![i]; if (propertyType == JSDataSourceSchemaType.ObjectValue) { var subSchema = schema.GetSubSchema(propertyName); diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 6e591dfd..0fa93b8e 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -160,21 +160,21 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m _values["value"] = item; _valueTypes["value"] = schema.PrimitiveType; } - for (int i = 0; i < schema.PropertyNames.Length; i++) + for (int i = 0; i < schema!.PropertyNames!.Length; i++) { String name = schema.PropertyNames[i]; - Func propGetter = schema.PropertyGetters[i]; - JSDataSourceSchemaType type = schema.PropertyTypes[i]; + Func propGetter = schema!.PropertyGetters![i]; + JSDataSourceSchemaType type = schema!.PropertyTypes![i]; Object val = schema.ResolveValue(name, item, propGetter, this, type, manager); _values[name] = val; _valueTypes[name] = type; } - for (int i = 0; i < schema.Fields.Length; i++) + for (int i = 0; i < schema!.Fields!.Length; i++) { String name = schema.Fields[i].Name; - Func fieldGetter = schema.FieldGetters[i]; - JSDataSourceSchemaType type = schema.FieldTypes[i]; + Func fieldGetter = schema!.FieldGetters![i]; + JSDataSourceSchemaType type = schema!.FieldTypes![i]; Object val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); _values[name] = val; @@ -223,16 +223,16 @@ public void GetDateCacheAsJson(JSDataSourceSchema? schema, System.Text.Json.Utf8 } parentKey = parentKey != null ? parentKey + "." : ""; - for (int i = 0; i < schema.PropertyTypes.Length; i++) + for (int i = 0; i < schema!.PropertyTypes!.Length; i++) { if (schema.PropertyTypes[i] == JSDataSourceSchemaType.DateTimeValue || schema.PropertyTypes[i] == JSDataSourceSchemaType.NullableDateTimeValue) { - writer.WriteStringValue(parentKey + schema.PropertyNames[i]); + writer.WriteStringValue(parentKey + schema!.PropertyNames![i]); } if (schema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) { - var subSchema = schema.GetSubSchema(schema.PropertyNames[i]); + var subSchema = schema.GetSubSchema(schema!.PropertyNames![i]); if (subSchema != null) { if (subSchema.IsDataSource) @@ -261,7 +261,7 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer) ((JsonDataSource)_source).ToJson(writer); return; } - if (_schema.IsPrimitive) + if (_schema!.IsPrimitive) { ValueToJson("value", new System.Text.Json.JsonEncodedText(), writer); return; @@ -271,17 +271,17 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer) var propertyNames = _schema.PropertyNames; var jsonPropertyNames = _schema.JsonPropertyNames; - var len = propertyNames.Length; + var len = propertyNames!.Length; for (var i = 0; i < len; i++) { - ValueToJson(propertyNames[i], jsonPropertyNames[i], writer); + ValueToJson(propertyNames[i], jsonPropertyNames![i], writer); } var fieldNames = _schema.FieldNames; var jsonFieldNames = _schema.JsonFieldNames; - len = fieldNames.Length; + len = fieldNames!.Length; for (var i = 0; i < len; i++) { - ValueToJson(fieldNames[i], jsonFieldNames[i], writer); + ValueToJson(fieldNames[i], jsonFieldNames![i], writer); } writer.WriteString("___id", _parentId != null ? _parentId + "/" + _id.ToString() : _id.ToString()); @@ -304,12 +304,12 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.Json writer.WriteStartObject(propertyName); - var propertyNames = _schema.PropertyNames; + var propertyNames = _schema!.PropertyNames; var jsonPropertyNames = _schema.JsonPropertyNames; - var len = propertyNames.Length; + var len = propertyNames!.Length; for (var i = 0; i < len; i++) { - ValueToJson(propertyNames[i], jsonPropertyNames[i], writer); + ValueToJson(propertyNames[i], jsonPropertyNames![i], writer); } writer.WriteString("___id", _id); diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 0d468727..51eaf683 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -29,15 +29,15 @@ private bool HasDataIntents() if (_subSchemas["___self"] != null) { //Console.WriteLine("has item schema"); - return _subSchemas["___self"].HasDataIntents(); + return _subSchemas!["___self"]!.HasDataIntents(); } } } else { - for (var i = 0; i < PropertyDataIntents.Length; i++) + for (var i = 0; i < PropertyDataIntents!.Length; i++) { - var prop = PropertyNames[i]; + var prop = PropertyNames![i]; if (_subSchemas.ContainsKey(prop)) { var sub = _subSchemas[prop]; @@ -55,9 +55,9 @@ private bool HasDataIntents() return true; } } - for (var i = 0; i < FieldDataIntents.Length; i++) + for (var i = 0; i < FieldDataIntents!.Length; i++) { - var field = FieldNames[i]; + var field = FieldNames![i]; if (_subSchemas.ContainsKey(field)) { var sub = _subSchemas[field]; @@ -108,23 +108,23 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J { //Console.WriteLine("has item schema"); uw.WriteBoolean("subProps", true); - _subSchemas["___self"].WriteDataIntentsAsJson("subIntents", uw); + _subSchemas!["___self"]!.WriteDataIntentsAsJson("subIntents", uw); } } } else { - for (var i = 0; i < PropertyNames.Length; i++) + for (var i = 0; i < PropertyNames!.Length; i++) { var currProp = PropertyNames[i]; - var intents = PropertyDataIntents[i]; + var intents = PropertyDataIntents![i]; if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas[currProp].HasDataIntents()) + if (_subSchemas![currProp]!.HasDataIntents()) { var sub = _subSchemas[currProp]; - if (sub.IsDataSource) + if (sub!.IsDataSource) { uw.WriteStartObject(currProp); uw.WriteBoolean("subProps", true); @@ -151,17 +151,17 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J } } - for (var i = 0; i < Fields.Length; i++) + for (var i = 0; i < Fields!.Length; i++) { - var currProp = FieldNames[i]; - var intents = FieldDataIntents[i]; + var currProp = FieldNames![i]; + var intents = FieldDataIntents![i]; if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas[currProp].HasDataIntents()) + if (_subSchemas![currProp]!.HasDataIntents()) { var sub = _subSchemas[currProp]; - if (sub.IsDataSource) + if (sub!.IsDataSource) { uw.WriteStartObject(currProp); uw.WriteBoolean("subProps", true); @@ -425,7 +425,7 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) if (subObject is IEnumerable) { var collection = subObject as IEnumerable; - foreach (var item in collection) + foreach (var item in collection!) { if (item != null) { @@ -436,7 +436,7 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) } if (itemSchema != null) { - schema.SetSubSchema("Items", itemSchema); + schema!.SetSubSchema("Items", itemSchema); } } else @@ -446,12 +446,12 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) if (itemSchema != null) { - for (int i = 0; i < itemSchema.PropertyTypes.Length; i++) + for (int i = 0; i < itemSchema!.PropertyTypes!.Length; i++) { if (itemSchema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) { - var obj = itemSchema.PropertyGetters[i](subObject); - itemSchema.SetSubSchema(itemSchema.PropertyNames[i], BuildSubObjectSchema(obj)); + var obj = itemSchema!.PropertyGetters![i](subObject); + itemSchema.SetSubSchema(itemSchema!.PropertyNames![i], BuildSubObjectSchema(obj)); } } } @@ -518,11 +518,11 @@ public bool IsNullable(string propertyName) //TODO: maybe true here. return false; } - for (int i = 0; i < PropertyNames.Length; i++) + for (int i = 0; i < PropertyNames!.Length; i++) { if (PropertyNames[i] == propertyName) { - return IsNullable(Properties[i].PropertyType); + return IsNullable(Properties![i].PropertyType); } } return false; diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 914f2f9b..c0422b4f 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Globalization; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Components; @@ -37,7 +37,7 @@ public string? Type public void AddBooleanProp(string propertyName, bool value) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -50,7 +50,7 @@ public void AddBooleanProp(string propertyName, bool value) public void AddStringProp(string propertyName, string value) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (propertyName != "name" && propertyName != "type") { @@ -69,7 +69,7 @@ public void AddPrimitiveProp(object? val) if (val is Array) { var objArr = (IList)val; - _context.Writer.WriteStartArray(); + _context!.Writer.WriteStartArray(); for (var i = 0; i < objArr.Count; i++) { var subVal = objArr[i]; @@ -79,49 +79,49 @@ public void AddPrimitiveProp(object? val) } else if (val is double) { - _context.Writer.WriteNumberValue((double)val); + _context!.Writer.WriteNumberValue((double)val); } else if (val is int) { - _context.Writer.WriteNumberValue((int)val); + _context!.Writer.WriteNumberValue((int)val); } else if (val is long) { - _context.Writer.WriteNumberValue((long)val); + _context!.Writer.WriteNumberValue((long)val); } else if (val is short) { - _context.Writer.WriteNumberValue((short)val); + _context!.Writer.WriteNumberValue((short)val); } else if (val is bool) { - _context.Writer.WriteBooleanValue((bool)val); + _context!.Writer.WriteBooleanValue((bool)val); } else if (val is DateTime) { - _context.Writer.WriteStringValue("@d:" + ((DateTime)val).ToString("o")); + _context!.Writer.WriteStringValue("@d:" + ((DateTime)val).ToString("o")); } else if (val is string) { - _context.Writer.WriteStringValue(val.ToString()); + _context!.Writer.WriteStringValue(val.ToString()); } else { // ObjectToParam this thing if (_component is BaseRendererElement) { - (_component as BaseRendererElement).ObjectToParam(_context, val); + (_component as BaseRendererElement)!.ObjectToParam(_context, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl).ObjectToParam(_context, val); + (_component as BaseRendererControl)!.ObjectToParam(_context, val); } } } public void AddPrimitiveProp(string propertyName, object val) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -173,11 +173,11 @@ public void AddPrimitiveProp(string propertyName, object val) // ObjectToParam this thing if (_component is BaseRendererElement) { - (_component as BaseRendererElement).ObjectToParam(_context, propertyName, val); + (_component as BaseRendererElement)!.ObjectToParam(_context, propertyName, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl).ObjectToParam(_context, propertyName, val); + (_component as BaseRendererControl)!.ObjectToParam(_context, propertyName, val); } } } @@ -198,7 +198,7 @@ public void AddArrayProp(string propertyName, IEnumerable values) } } var context = _context; - if (!containsSub && _context.Filter != null) + if (!containsSub && _context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -212,11 +212,11 @@ public void AddArrayProp(string propertyName, IEnumerable values) if (items == null) { //_properties.Add("\"" + propertyName + "\"" + ": null"); - context.Writer.WriteNull(propertyName); + context!.Writer.WriteNull(propertyName); return; } //string[] strValues = new string[values.Length]; - context.Writer.WriteStartArray(propertyName); + context!.Writer.WriteStartArray(propertyName); foreach (object? val in items) { if (val is String) @@ -262,11 +262,11 @@ public void AddArrayProp(string propertyName, IEnumerable values) { if (_component is BaseRendererElement) { - (_component as BaseRendererElement).ObjectToParam(context, val); + (_component as BaseRendererElement)!.ObjectToParam(context, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl).ObjectToParam(context, val); + (_component as BaseRendererControl)!.ObjectToParam(context, val); } } } @@ -286,7 +286,7 @@ protected string Camelize(string value) public void AddEnumProp(string propertyName, Enum value) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -313,7 +313,7 @@ public void AddEnumProp(string propertyName, Enum value) public void AddNumberProp(String propertyName, Object value) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -345,7 +345,7 @@ public void AddNumberProp(String propertyName, Object value) public void AddDateTimeProp(String propertyName, DateTime? value) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -360,17 +360,17 @@ public void Start(string? propertyName = null) { if (propertyName != null) { - _context.Writer.WriteStartObject(propertyName); + _context!.Writer.WriteStartObject(propertyName); } else { - _context.Writer.WriteStartObject(); + _context!.Writer.WriteStartObject(); } } public void End() { - _context.Writer.WriteString("type", Type); + _context!.Writer.WriteString("type", Type); _context.Writer.WriteEndObject(); } @@ -381,7 +381,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) if (value == null) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -392,12 +392,12 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) context = new SerializationContext(_context.Writer, null); } } - context.Writer.WriteNull(propertyName); + context!.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; } - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -413,7 +413,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) public void AddStringArrayProp(String propertyName, string[] values) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -455,7 +455,7 @@ public void AddStringArrayProp(String propertyName, string[] values) public void AddDateArrayProp(String propertyName, DateTime[] values) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -501,7 +501,7 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) private Regex _colorSplitRegex = new Regex("[\\s,]+(?![^(]*\\))"); public void AddStringArrayProp(String propertyName, string values) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -543,7 +543,7 @@ public void AddStringArrayProp(String propertyName, string values) public void AddEnumArrayProp(String propertyName, object values) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -572,7 +572,7 @@ public void AddEnumArrayProp(String propertyName, object values) public void AddIntArrayProp(String propertyName, int[] values) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -600,7 +600,7 @@ public void AddIntArrayProp(String propertyName, int[] values) public void AddDoubleArrayProp(string propertyName, double[] numbers) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -631,7 +631,7 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T { if (array == null) { - if (_context.Filter != null) + if (_context!.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -645,7 +645,7 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T } var context = _context; - if (_context.Filter != null) + if (_context!.Filter != null) { if (_context.Filter(_name, propertyName)) { @@ -653,7 +653,7 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T } } //List items = new List(); - context.Writer.WriteStartArray(propertyName); + context!.Writer.WriteStartArray(propertyName); for (int i = 0; i < array.Length; i++) { //string c = numbers[i].ToString(CultureInfo.InvariantCulture); @@ -675,7 +675,7 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T public void AddCollectionProp(string propertyName, BaseCollection coll) { var context = _context; - if (_context.Filter != null) + if (_context!.Filter != null) { if (_context.Filter(_name, propertyName)) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index ea6844bf..52290f3f 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using System.Runtime.CompilerServices; using Microsoft.JSInterop; @@ -44,7 +44,7 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) _unmarshalledRuntime = _inprocRuntime as IJSUnmarshalledRuntime; #else //Console.WriteLine("inproc type: " + _inprocRuntime.GetType().Name); - var unmarshalled = inprocRuntime.GetType().GetMethods().Where(m => m.Name == "InvokeUnmarshalled").ToList(); + var unmarshalled = inprocRuntime!.GetType().GetMethods().Where(m => m.Name == "InvokeUnmarshalled").ToList(); var name = inprocRuntime.GetType().Assembly.GetName(); if (unmarshalled.Count > 0) @@ -136,7 +136,7 @@ public string SendUnmarshalledColumnDataIntentsMessage(string methodName, string if (_callSendUnmarshalledColumnMessage != null) { //Console.WriteLine("invoking sadness"); - return _callSendUnmarshalledColumnDataIntentMessage(_inprocRuntime, methodName, refName, dataIntents); + return _callSendUnmarshalledColumnDataIntentMessage!(_inprocRuntime, methodName, refName, dataIntents); } #endif _inprocRuntime.InvokeVoid(methodName, new object[] { refName, dataIntents }); @@ -145,6 +145,6 @@ public string SendUnmarshalledColumnDataIntentsMessage(string methodName, string } public bool IsInproc { get; private set; } - public bool IsForcedJsonDataMarshalling { get { return _igBlazor.Settings.ForceJsonDataMarshalling; } } + public bool IsForcedJsonDataMarshalling { get { return _igBlazor!.Settings.ForceJsonDataMarshalling; } } } } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index d33f4823..d1f57f28 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Specialized; using System.Runtime.InteropServices; @@ -170,7 +170,7 @@ public UnmarshalledDataSource() { extraCols = 0; } - columns = new UnmarshalledColumnData[schema.PropertyNames.Length + schema.FieldNames.Length + extraCols]; + columns = new UnmarshalledColumnData[schema!.PropertyNames!.Length + schema!.FieldNames!.Length + extraCols]; for (var k = 0; k < columns.Length; k++) { columns[k] = null; @@ -178,13 +178,13 @@ public UnmarshalledDataSource() } int i = 0; - for (i = 0; i < schema.PropertyNames.Length; i++) + for (i = 0; i < schema!.PropertyNames!.Length; i++) { - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema.PropertyNames[i], schema.TypedPropertyGetters[i], schema.PropertyGetters[i], false, schema.PropertyTypes[i], oldValue, newValue); + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema.PropertyNames[i], schema!.TypedPropertyGetters![i], schema!.PropertyGetters![i], false, schema!.PropertyTypes![i], oldValue, newValue); } - for (int j = 0; j < _schema.FieldNames.Length; i++, j++) + for (int j = 0; j < _schema!.FieldNames!.Length; i++, j++) { - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema.FieldNames[j], schema.TypedFieldGetters[j], schema.FieldGetters[j], false, schema.FieldTypes[j], oldValue, newValue); + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema!.FieldNames![j], schema!.TypedFieldGetters![j], schema!.FieldGetters![j], false, schema!.FieldTypes![j], oldValue, newValue); } } if (schema.IsPrimitive) @@ -220,7 +220,7 @@ public UnmarshalledDataSource() if (columns[columns.Length - 1] == null) { columns[columns.Length - 1] = CreateColumn(parentPath, "___id", schema, JSDataSourceSchemaType.StringValue, idGetter, untypedIdGetter, true); - columns[columns.Length - 1].IsIDColumn = true; + columns![columns.Length - 1]!.IsIDColumn = true; } columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___id", idGetter, untypedIdGetter, true, JSDataSourceSchemaType.StringValue, oldValue, newValue); } @@ -433,7 +433,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (!schema.IsPrimitive) { - floatVal = floatingPointGetter(item); + floatVal = floatingPointGetter!(item); } else { @@ -442,7 +442,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } if (index == size) { - column.DoubleValues[index] = floatVal; + column!.DoubleValues![index] = floatVal; } else { @@ -460,12 +460,12 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa double? floatVal = null; if (item != null) { - floatVal = nullableFloatingPointGetter(item); + floatVal = nullableFloatingPointGetter!(item); } if (index == size) { - column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues[index] = floatVal == null; + column!.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; + column!.NullValues![index] = floatVal == null; } else { @@ -488,7 +488,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (!schema.IsPrimitive) { - intVal = integerGetter(item); + intVal = integerGetter!(item); } else { @@ -497,7 +497,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } if (index == size) { - column.IntValues[index] = intVal; + column!.IntValues![index] = intVal; } else { @@ -516,12 +516,12 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa int? intVal = null; if (item != null) { - intVal = nullableIntegerGetter(item); + intVal = nullableIntegerGetter!(item); } if (index == size) { - column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues[index] = intVal == null; + column!.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; + column!.NullValues![index] = intVal == null; } else { @@ -541,7 +541,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (!schema.IsPrimitive) { - longVal = longGetter(item); + longVal = longGetter!(item); } else { @@ -550,7 +550,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } if (index == size) { - column.LongValues[index] = longVal; + column!.LongValues![index] = longVal; } else { @@ -566,12 +566,12 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa long? longVal = null; if (item != null) { - longVal = nullableLongGetter(item); + longVal = nullableLongGetter!(item); } if (index == size) { - column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues[index] = longVal == null; + column!.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; + column!.NullValues![index] = longVal == null; } else { @@ -594,14 +594,14 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (column.IsIDColumn) { - idVal = idGetter(item); + idVal = idGetter!(item); stringVal = _parentId != null ? _parentId + "/" + idVal.ToString() : idVal.ToString(); } else if (!schema.IsPrimitive) { try { - stringVal = stringGetter(item); + stringVal = stringGetter!(item); } catch { @@ -619,7 +619,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column.StringValues[index] = stringVal; + column!.StringValues![index] = stringVal; } else { @@ -636,7 +636,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column.IDValues[index] = idVal; + column!.IDValues![index] = idVal; } else { @@ -656,7 +656,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { try { - stringVal = stringGetter(item); + stringVal = stringGetter!(item); } catch { @@ -669,7 +669,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column.StringValues[index] = stringVal; + column!.StringValues![index] = stringVal; } else { @@ -686,7 +686,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa object? objVal = null; if (item != null) { - objVal = objectGetter(item); + objVal = objectGetter!(item); } if (objVal != null && column.SubColumns == null) { @@ -716,7 +716,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa UnmarshalledColumn?[]? cols = null; if (objVal != null) { - var id = _idGetter(item); + var id = _idGetter!(item); var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); @@ -730,7 +730,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } if (index == size) { - column.SubDataSourceValues[index] = cols; + column!.SubDataSourceValues![index] = cols; } else { @@ -746,7 +746,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Insert(size, subColumn, index, objVal); + subColumn!.Insert!(size, subColumn, index, objVal); } } } @@ -768,7 +768,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa object? objVal = null; if (item != null) { - objVal = objectGetter(item); + objVal = objectGetter!(item); } if (objVal != null && column.SubColumns == null) { @@ -803,7 +803,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa var subcols = sub.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].GetValueOrDefault().ActualCount; + primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); @@ -812,7 +812,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { case JSDataSourceSchemaType.StringArrayValue: primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.StringValues[i] = (string)v; i++; @@ -821,7 +821,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.DateTimeArrayValue: case JSDataSourceSchemaType.CalendarArrayValue: primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.StringValues[i] = ((DateTime)v).ToString("o"); i++; @@ -832,7 +832,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.IntArrayValue: case JSDataSourceSchemaType.ShortArrayValue: primcol.IntValues = new int[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.IntValues[i] = Convert.ToInt32(v); i++; @@ -842,7 +842,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.SingleArrayValue: case JSDataSourceSchemaType.DecimalArrayValue: primcol.DoubleValues = new double[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.DoubleValues[i] = Convert.ToDouble(v); i++; @@ -850,7 +850,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; case JSDataSourceSchemaType.LongArrayValue: primcol.LongValues = new long[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.LongValues[i] = Convert.ToInt64(v); i++; @@ -867,7 +867,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } if (index == size) { - column.SubDataSourceValues[index] = cols; + column!.SubDataSourceValues![index] = cols; } else { @@ -883,7 +883,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Insert(size, subColumn, index, objVal); + subColumn!.Insert!(size, subColumn, index, objVal); } } } @@ -902,9 +902,9 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa double floatVal = double.NaN; if (newItem != null) { - floatVal = floatingPointGetter(newItem); + floatVal = floatingPointGetter!(newItem); } - column.DoubleValues[index] = floatVal; + column!.DoubleValues![index] = floatVal; }; break; case JSDataSourceSchemaType.NullableDoubleValue: @@ -915,10 +915,10 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa double? floatVal = null; if (newItem != null) { - floatVal = nullableFloatingPointGetter(newItem); + floatVal = nullableFloatingPointGetter!(newItem); } - column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues[index] = floatVal == null; + column!.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; + column!.NullValues![index] = floatVal == null; }; break; case JSDataSourceSchemaType.BooleanValue: @@ -930,9 +930,9 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa int intVal = int.MinValue; if (newItem != null) { - intVal = integerGetter(newItem); + intVal = integerGetter!(newItem); } - column.IntValues[index] = intVal; + column!.IntValues![index] = intVal; }; break; case JSDataSourceSchemaType.NullableBooleanValue: @@ -944,10 +944,10 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa int? intVal = null; if (newItem != null) { - intVal = nullableIntegerGetter(newItem); + intVal = nullableIntegerGetter!(newItem); } - column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues[index] = intVal == null; + column!.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; + column!.NullValues![index] = intVal == null; }; break; case JSDataSourceSchemaType.LongValue: @@ -956,9 +956,9 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa long longVal = long.MinValue; if (newItem != null) { - longVal = longGetter(newItem); + longVal = longGetter!(newItem); } - column.LongValues[index] = longVal; + column!.LongValues![index] = longVal; }; break; case JSDataSourceSchemaType.NullableLongValue: @@ -967,10 +967,10 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa long? longVal = null; if (newItem != null) { - longVal = nullableLongGetter(newItem); + longVal = nullableLongGetter!(newItem); } - column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues[index] = longVal == null; + column!.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; + column!.NullValues![index] = longVal == null; }; break; case JSDataSourceSchemaType.StringValue: @@ -982,26 +982,26 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa Guid idVal = Guid.Empty; if (column.IsIDColumn && oldItem != newItem) { - var oldId = column.IDValues[index]; + var oldId = column!.IDValues![index]; OnRemoveId(oldId); } if (newItem != null) { if (column.IsIDColumn) { - idVal = idGetter(newItem); + idVal = idGetter!(newItem); stringVal = idVal.ToString(); } else { - stringVal = stringGetter(newItem); + stringVal = stringGetter!(newItem); } } - column.StringValues[index] = stringVal; + column!.StringValues![index] = stringVal; if (column.IsIDColumn) { - column.IDValues[index] = idVal; + column!.IDValues![index] = idVal; } }; break; @@ -1012,9 +1012,9 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa string? stringVal = null; if (newItem != null) { - stringVal = stringGetter(newItem); + stringVal = stringGetter!(newItem); } - column.StringValues[index] = stringVal; + column!.StringValues![index] = stringVal; }; break; case JSDataSourceSchemaType.ObjectValue: @@ -1023,13 +1023,13 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa object? objVal = null; if (newItem != null) { - objVal = objectGetter(newItem); + objVal = objectGetter!(newItem); } object? oldObjVal = null; if (oldItem != null) { - oldObjVal = objectGetter(oldItem); + oldObjVal = objectGetter!(oldItem); } if (objVal != null && column.SubColumns == null) @@ -1061,7 +1061,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); cols = sub.GetColumns(""); } - column.SubDataSourceValues[index] = cols; + column!.SubDataSourceValues![index] = cols; } else { @@ -1070,7 +1070,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Update(size, subColumn, index, oldObjVal, objVal); + subColumn!.Update!(size, subColumn, index, oldObjVal, objVal); } } } @@ -1092,13 +1092,13 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa object? objVal = null; if (newItem != null) { - objVal = objectGetter(newItem); + objVal = objectGetter!(newItem); } object? oldObjVal = null; if (oldItem != null) { - oldObjVal = objectGetter(oldItem); + oldObjVal = objectGetter!(oldItem); } if (column.IsSubDataSource) @@ -1110,7 +1110,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa var subcols = sub.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].GetValueOrDefault().ActualCount; + primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); @@ -1119,7 +1119,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { case JSDataSourceSchemaType.StringArrayValue: primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.StringValues[i] = (string)v; i++; @@ -1128,7 +1128,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.DateTimeArrayValue: case JSDataSourceSchemaType.CalendarArrayValue: primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.StringValues[i] = ((DateTime)v).ToString("o"); i++; @@ -1139,7 +1139,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.IntArrayValue: case JSDataSourceSchemaType.ShortArrayValue: primcol.IntValues = new int[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.IntValues[i] = Convert.ToInt32(v); i++; @@ -1149,7 +1149,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa case JSDataSourceSchemaType.SingleArrayValue: case JSDataSourceSchemaType.DecimalArrayValue: primcol.DoubleValues = new double[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.DoubleValues[i] = Convert.ToDouble(v); i++; @@ -1157,7 +1157,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa break; case JSDataSourceSchemaType.LongArrayValue: primcol.LongValues = new long[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) + foreach (var v in (objVal as IEnumerable)!) { primcol.LongValues[i] = Convert.ToInt64(v); i++; @@ -1173,7 +1173,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa cols[subcols.Length] = primcol; } - column.SubDataSourceValues[index] = cols; + column!.SubDataSourceValues![index] = cols; } else { @@ -1182,7 +1182,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Update(size, subColumn, index, oldItem, newItem); + subColumn!.Update!(size, subColumn, index, oldItem, newItem); } } } @@ -1200,7 +1200,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.DoubleValues[index] = double.NaN; + column!.DoubleValues![index] = double.NaN; } else { @@ -1216,8 +1216,8 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.DoubleValues[index] = double.NaN; - column.NullValues[index] = false; + column!.DoubleValues![index] = double.NaN; + column!.NullValues![index] = false; } else { @@ -1236,7 +1236,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.IntValues[index] = 0; + column!.IntValues![index] = 0; } else { @@ -1253,8 +1253,8 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.IntValues[index] = 0; - column.NullValues[index] = false; + column!.IntValues![index] = 0; + column!.NullValues![index] = false; } else { @@ -1270,7 +1270,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.LongValues[index] = 0; + column!.LongValues![index] = 0; } else { @@ -1284,8 +1284,8 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.LongValues[index] = 0; - column.NullValues[index] = false; + column!.LongValues![index] = 0; + column!.NullValues![index] = false; } else { @@ -1303,13 +1303,13 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (column.IsIDColumn) { - var oldId = column.IDValues[index]; + var oldId = column!.IDValues![index]; OnRemoveId(oldId); } if (index == (size - 1)) { - column.StringValues[index] = null; + column!.StringValues![index] = null; } else { @@ -1320,7 +1320,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.IDValues[index] = Guid.Empty; + column!.IDValues![index] = Guid.Empty; } else { @@ -1336,7 +1336,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.StringValues[index] = null; + column!.StringValues![index] = null; } else { @@ -1363,7 +1363,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { if (index == (size - 1)) { - column.SubDataSourceValues[index] = null; + column!.SubDataSourceValues![index] = null; } else { @@ -1378,7 +1378,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Remove(size, subColumn, index); + subColumn!.Remove!(size, subColumn, index); } } } @@ -1447,7 +1447,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { for (var i = 0; i < size; i++) { - OnRemoveId(column.IDValues[i]); + OnRemoveId(column!.IDValues![i]); } } @@ -1490,7 +1490,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn.Clear(size, subColumn); + subColumn!.Clear!(size, subColumn); } } } @@ -1563,7 +1563,7 @@ private void GetColumns(string refName, UnmarshalledColumnData[] columns, List x.Id == userMessage.Id)) + if (!_basicMessages.Any(x => x.Id == userMessage!.Id)) { _basicMessages = [.. _basicMessages, userMessage]; } @@ -110,13 +110,13 @@ await Task.Delay(700); _basicOptions.IsTyping = false; - _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage.Text)]; + _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage!.Text)]; } private async Task OnTemplateMessageCreated(IgbChatMessageEventArgs args) { var userMessage = args.Detail; - if (!_templateMessages.Any(x => x.Id == userMessage.Id)) + if (!_templateMessages.Any(x => x.Id == userMessage!.Id)) { _templateMessages = [.. _templateMessages, userMessage]; } @@ -127,7 +127,7 @@ await Task.Delay(700); _templateOptions.IsTyping = false; - _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage.Text)]; + _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage!.Text)]; } private static IgbChatMessage BuildAgentReply(string prompt) @@ -195,4 +195,4 @@ return "I can help with NuGet setup, theme registration, EventCallback wiring, and component usage in Ignite UI Blazor Lite."; } -} \ No newline at end of file +} diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index 2c9312b7..7161a92c 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -25,7 +25,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "m-1", "text": "hello", "sender": "user-1"}}}""", assert: args => { - Assert.Equal("m-1", args.Detail.Id); + Assert.Equal("m-1", args!.Detail!.Id); Assert.Equal("hello", args.Detail.Text); Assert.Equal("user-1", args.Detail.Sender); }) @@ -33,7 +33,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "a-1", "name": "photo.png", "url": "https://host/photo.png"}}}""", assert: args => { - Assert.Equal("a-1", args.Detail.Id); + Assert.Equal("a-1", args!.Detail!.Id); Assert.Equal("photo.png", args.Detail.Name); Assert.Equal("https://host/photo.png", args.Detail.Url); }) @@ -43,8 +43,8 @@ public class ChatTests : ComponentWithContractTestBase { // The reaction's message currently decoded by value // (it is NOT restored by reference to an instance in Messages on the current stack). - Assert.Equal("like", args.Detail.Reaction); - Assert.Equal("m-1", args.Detail.Message.Id); + Assert.Equal("like", args!.Detail!.Reaction); + Assert.Equal("m-1", args!.Detail!.Message!.Id); Assert.Equal("hello", args.Detail.Message.Text); }) .Prop(c => c.Options, diff --git a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs index 2872ada4..1fe8629f 100644 --- a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs @@ -20,7 +20,7 @@ public class CheckboxTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "checkbox-value"}}}""", assert: args => { - Assert.True(args.Detail.Checked); + Assert.True(args!.Detail!.Checked); Assert.Equal("checkbox-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 30528983..f095ad48 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -65,7 +65,7 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail(UuidRef(interop, cut, 0), UuidRef(interop, cut, 0))), assert: (cut, args) => { - Assert.Same(_valueItem1, Assert.Single(args.Detail.NewValue)); + Assert.Same(_valueItem1, Assert.Single(args!.Detail!.NewValue)); Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); Assert.Equal(ComboChangeType.Selection, args.Detail.ChangeType); }) @@ -76,7 +76,7 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail("", UuidRef(interop, cut, 0), "deselection")), assert: (cut, args) => { - Assert.Empty(args.Detail.NewValue); + Assert.Empty(args!.Detail!.NewValue); Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); // TODO: wire detail carries kind as "type", but FromEventJson reads "changeType", so // Detail.ChangeType never decodes and stays default (wrong for deselection events): @@ -90,9 +90,9 @@ internal static string ChangeDetail(string newValues, string items, string type assert: (cut, args) => { // Multi-selection: every element resolves back to its original data instance. - Assert.Equal([_valueItem1, _valueItem2], args.Detail.NewValue); + Assert.Equal([_valueItem1, _valueItem2], args!.Detail!.NewValue); Assert.Equal([_valueItem1, _valueItem2], args.Detail.Items); - Assert.Same(args.Detail.NewValue[0], args.Detail.Items[0]); + Assert.Same(args!.Detail!.NewValue![0], args!.Detail!.Items![0]); }) .Event(c => c.Focus) .Event(c => c.Blur) @@ -306,7 +306,7 @@ public class ComboValueKeyTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => ComboTests.ChangeDetail("2", ComboTests.UuidRef(interop, cut, 1))), assert: (cut, args) => { - Assert.Equal(2.0, Assert.Single(args.Detail.NewValue)); // numbers decode as double + Assert.Equal(2.0, Assert.Single(args!.Detail!.NewValue)); // numbers decode as double Assert.Same(_item2, Assert.Single(args.Detail.Items)); // Two-way Value propagation through the generated wrapper works when T // matches the key value type. diff --git a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs index 764b34e7..e56f66bf 100644 --- a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs @@ -46,7 +46,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args!.Detail!.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, @@ -67,7 +67,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args!.Detail!.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Prop(c => c.Open, true) diff --git a/tests/IgniteUI.Blazor.Tests/RadioTests.cs b/tests/IgniteUI.Blazor.Tests/RadioTests.cs index a268c0cb..d0256c59 100644 --- a/tests/IgniteUI.Blazor.Tests/RadioTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RadioTests.cs @@ -20,7 +20,7 @@ public class RadioTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "option1"}}}""", assert: args => { - Assert.True(args.Detail.Checked); + Assert.True(args!.Detail!.Checked); Assert.Equal("option1", args.Detail.Value); }) // The bound value uses checked: @@ -127,7 +127,7 @@ public class RadioGroupTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "selected-option"}}}""", assert: args => { - Assert.True(args.Detail.Checked); + Assert.True(args!.Detail!.Checked); Assert.Equal("selected-option", args.Detail.Value); }) // The group binds the selected option's value: diff --git a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs index e7b70d8b..7dddcf49 100644 --- a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs @@ -13,14 +13,14 @@ public class RangeSliderTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 20, "upper": 80}}}""", assert: args => { - Assert.Equal(20, args.Detail.Lower); + Assert.Equal(20, args!.Detail!.Lower); Assert.Equal(80, args.Detail.Upper); }) .Event(c => c.Change, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 25, "upper": 75}}}""", assert: args => { - Assert.Equal(25, args.Detail.Lower); + Assert.Equal(25, args!.Detail!.Lower); Assert.Equal(75, args.Detail.Upper); }); diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index 4a3b87bf..1a526ff7 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -74,7 +74,7 @@ public class SelectTests : ComponentWithContractTestBase assert: (cut, args) => { Assert.Same(cut.FindComponents()[1].Instance, args.Detail); - Assert.Equal("ca", args.Detail.Value); // Change propagates Detail.Value into Select.Value + Assert.Equal("ca", args!.Detail!.Value); // Change propagates Detail.Value into Select.Value }) // The detail is the selected item; the binding receives that item's Value. .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs index b67af729..91766e36 100644 --- a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs @@ -13,7 +13,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 120, "endPanelSize": 80, "delta": 0}}}""", assert: args => { - Assert.Equal(120, args.Detail.StartPanelSize); + Assert.Equal(120, args!.Detail!.StartPanelSize); Assert.Equal(80, args.Detail.EndPanelSize); Assert.Equal(0, args.Detail.Delta); }) @@ -21,7 +21,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 130, "endPanelSize": 70, "delta": 10}}}""", assert: args => { - Assert.Equal(130, args.Detail.StartPanelSize); + Assert.Equal(130, args!.Detail!.StartPanelSize); Assert.Equal(70, args.Detail.EndPanelSize); Assert.Equal(10, args.Detail.Delta); }) @@ -29,7 +29,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 150, "endPanelSize": 50, "delta": 30}}}""", assert: args => { - Assert.Equal(150, args.Detail.StartPanelSize); + Assert.Equal(150, args!.Detail!.StartPanelSize); Assert.Equal(50, args.Detail.EndPanelSize); Assert.Equal(30, args.Detail.Delta); }); diff --git a/tests/IgniteUI.Blazor.Tests/StepperTests.cs b/tests/IgniteUI.Blazor.Tests/StepperTests.cs index 3d0ceb79..635cc264 100644 --- a/tests/IgniteUI.Blazor.Tests/StepperTests.cs +++ b/tests/IgniteUI.Blazor.Tests/StepperTests.cs @@ -36,12 +36,12 @@ public class StepperTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"oldIndex": 0, "newIndex": 1}}}""", assert: args => { - Assert.Equal(0, args.Detail.OldIndex); + Assert.Equal(0, args!.Detail!.OldIndex); Assert.Equal(1, args.Detail.NewIndex); }) .Event(c => c.ActiveStepChanged, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"index": 1}}}""", - assert: args => Assert.Equal(1, args.Detail.Index)); + assert: args => Assert.Equal(1, args!.Detail!.Index)); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); diff --git a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs index 9e506f0b..845ab1b4 100644 --- a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs @@ -20,7 +20,7 @@ public class SwitchTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "switch-value"}}}""", assert: args => { - Assert.True(args.Detail.Checked); + Assert.True(args!.Detail!.Checked); Assert.Equal("switch-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/TabsTests.cs b/tests/IgniteUI.Blazor.Tests/TabsTests.cs index b934f335..0252b51f 100644 --- a/tests/IgniteUI.Blazor.Tests/TabsTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TabsTests.cs @@ -37,7 +37,7 @@ public class TabsTests : ComponentWithContractTestBase Assert.Same(cut.Instance.ActualTabsCollection[1], args.Detail); // The handler owns selection for every child: it writes each tab's Selected and // pushes it through that tab's @bind-Selected, which is IgbTab's only route. - Assert.True(args.Detail.Selected); + Assert.True(args!.Detail!.Selected); Assert.False(cut.Instance.ActualTabsCollection[0].Selected); Assert.False(tabSelection[0]); Assert.True(tabSelection[1]); diff --git a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs index 7130802f..92a971af 100644 --- a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs @@ -60,7 +60,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": true}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args.Detail.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args!.Detail!.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, @@ -68,7 +68,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": false}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args.Detail.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args!.Detail!.Tile); Assert.False(args.Detail.State); }); @@ -276,14 +276,14 @@ public class TileTests : ComponentWithContractTestBase """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": true}}}""", assert: (tile, args) => { - Assert.Same(tile, args.Detail.Tile); + Assert.Same(tile, args!.Detail!.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": false}}}""", assert: (tile, args) => { - Assert.Same(tile, args.Detail.Tile); + Assert.Same(tile, args!.Detail!.Tile); Assert.False(args.Detail.State); }); diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index 79418d81..a5c4c5ff 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -43,7 +43,7 @@ public class TreeTests : ComponentWithContractTestBase .Event(c => c.SelectionChanged, arrange, argsJson: FromRender.Of((interop, cut) => $$$$$"""{"detail": {"retType": "object", "type": "", "value": {"newSelection": {"retType": "Array", "type": "", "value": [{"refType": "name", "id": "{{{{{interop.ContainerIdOf(cut, "igc-tree-item:nth-of-type(2)")}}}}}"}]}}}}"""), - assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail.NewSelection[0])); + assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args!.Detail!.NewSelection![0])); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); From 9c49ff1c9ab523fc4665e00e38904a4b4ce4c99d Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 24 Aug 2026 19:30:50 +0300 Subject: [PATCH 07/64] Fix CS8603 by marking types/return types as nullable. --- src/components/Blazor/Accordion.cs | 10 ++-- src/components/Blazor/Banner.cs | 4 +- src/components/Blazor/ButtonBase.cs | 18 ++++---- src/components/Blazor/ButtonGroup.cs | 4 +- src/components/Blazor/Calendar.cs | 6 +-- src/components/Blazor/Carousel.cs | 6 +-- src/components/Blazor/Chat.cs | 14 +++--- src/components/Blazor/ChatRenderers.cs | 30 ++++++------ src/components/Blazor/CheckboxBase.cs | 6 +-- src/components/Blazor/Chip.cs | 4 +- src/components/Blazor/Combo.cs | 24 +++++----- .../Blazor/ComboChangeEventArgsDetail.cs | 4 +- src/components/Blazor/DatePicker.cs | 12 ++--- src/components/Blazor/DateRangePicker.cs | 12 ++--- src/components/Blazor/DateTimeInput.cs | 8 ++-- src/components/Blazor/Dialog.cs | 4 +- src/components/Blazor/Dropdown.cs | 28 +++++------ src/components/Blazor/ExpansionPanel.cs | 8 ++-- src/components/Blazor/FormatSpecifier.cs | 4 +- src/components/Blazor/Input.cs | 6 +-- src/components/Blazor/InputBase.cs | 6 +-- src/components/Blazor/MaskInput.cs | 6 +-- src/components/Blazor/NavDrawer.cs | 14 +++--- src/components/Blazor/Radio.cs | 6 +-- src/components/Blazor/RadioGroup.cs | 6 +-- src/components/Blazor/RangeSlider.cs | 6 +-- src/components/Blazor/Rating.cs | 4 +- src/components/Blazor/Select.cs | 24 +++++----- src/components/Blazor/Slider.cs | 4 +- src/components/Blazor/Snackbar.cs | 4 +- src/components/Blazor/Splitter.cs | 6 +-- src/components/Blazor/Stepper.cs | 8 ++-- src/components/Blazor/Tabs.cs | 8 ++-- src/components/Blazor/Textarea.cs | 12 ++--- src/components/Blazor/Tile.cs | 16 +++---- src/components/Blazor/TileManager.cs | 26 +++++------ src/components/Blazor/Tooltip.cs | 8 ++-- src/components/Blazor/Tree.cs | 14 +++--- src/components/Blazor/TreeItem.cs | 4 +- src/componentsBase/BaseCollection.cs | 2 +- src/componentsBase/BaseRendererControl.cs | 44 +++++++++--------- src/componentsBase/BaseRendererElement.cs | 46 +++++++++---------- src/componentsBase/DataAdapters.cs | 6 +-- src/componentsBase/DataSourceManager.cs | 8 ++-- src/componentsBase/DynamicContentHolder.cs | 4 +- src/componentsBase/EventCallbackExtensions.cs | 2 +- .../IgbComponentRendererContainer.cs | 4 +- src/componentsBase/JsonDataSource.cs | 8 ++-- src/componentsBase/JsonDataSourceSchema.cs | 10 ++-- src/componentsBase/MarshalByValueFactory.cs | 2 +- src/componentsBase/RendererSerializer.cs | 2 +- src/componentsBase/RuntimeHelper.cs | 4 +- src/componentsBase/UnmarshalledDataSource.cs | 30 ++++++------ src/componentsBase/WebViewCallback.cs | 2 +- 54 files changed, 284 insertions(+), 284 deletions(-) diff --git a/src/components/Blazor/Accordion.cs b/src/components/Blazor/Accordion.cs index 53257a20..ea7148fa 100644 --- a/src/components/Blazor/Accordion.cs +++ b/src/components/Blazor/Accordion.cs @@ -80,7 +80,7 @@ public bool SingleExpand } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -148,7 +148,7 @@ public void ShowAll() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -220,7 +220,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -292,7 +292,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -364,7 +364,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/Banner.cs b/src/components/Blazor/Banner.cs index b6a8e768..b252ed49 100644 --- a/src/components/Blazor/Banner.cs +++ b/src/components/Blazor/Banner.cs @@ -168,7 +168,7 @@ public bool Toggle() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -240,7 +240,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index 2df18402..89f1b261 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -54,10 +54,10 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// The type of the button, which determines its behavior and semantics. /// - /// no default action. - /// submits the associated form when + /// � no default action. + /// � submits the associated form when /// clicked. - /// resets the associated form fields to + /// � resets the associated form fields to /// their initial values. /// /// Ignored when the button is rendered as a link (i.e. is set). @@ -125,12 +125,12 @@ public string? Download /// /// Where to open the linked document. Only effective when is set. /// - /// current browsing context + /// � current browsing context /// (default browser behavior). - /// new tab or window. - /// parent browsing context; falls back to + /// � new tab or window. + /// � parent browsing context; falls back to /// if none. - /// top-level browsing context; falls back to + /// � top-level browsing context; falls back to /// if none. /// /// @@ -305,7 +305,7 @@ public void Click() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -377,7 +377,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index edfdcb7f..10089d74 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -156,7 +156,7 @@ public void SetNativeElement(Object element) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string SelectScript + public string? SelectScript { set @@ -228,7 +228,7 @@ public EventCallback Select /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string DeselectScript + public string? DeselectScript { set diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 1efcf2f6..e05c1648 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -102,7 +102,7 @@ public DateTime[]? Values /// Used when is set to /// or . /// - public async Task GetCurrentValuesAsync() + public async Task GetCurrentValuesAsync() { var iv = await InvokeMethod("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); @@ -113,7 +113,7 @@ public async Task GetCurrentValuesAsync() /// Used when is set to /// or . /// - public DateTime[] GetCurrentValues() + public DateTime[]? GetCurrentValues() { var iv = InvokeMethodSync("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); @@ -352,7 +352,7 @@ public EventCallback ValuesChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 4d341823..8bab66be 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -465,7 +465,7 @@ public bool Select(double index, CarouselAnimationDirection? animationDirection /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string SlideChangedScript + public string? SlideChangedScript { set @@ -537,7 +537,7 @@ public EventCallback SlideChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string PlayingScript + public string? PlayingScript { set @@ -609,7 +609,7 @@ public EventCallback Playing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string PausedScript + public string? PausedScript { set diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index ada66a01..a24e5a1c 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -158,7 +158,7 @@ public void ScrollToMessage(String messageId) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string MessageCreatedScript + public string? MessageCreatedScript { set @@ -230,7 +230,7 @@ public EventCallback MessageCreated /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string MessageReactScript + public string? MessageReactScript { set @@ -302,7 +302,7 @@ public EventCallback MessageReact /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string AttachmentClickScript + public string? AttachmentClickScript { set @@ -374,7 +374,7 @@ public EventCallback AttachmentClick /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TypingChangeScript + public string? TypingChangeScript { set @@ -446,7 +446,7 @@ public EventCallback TypingChange /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputFocusScript + public string? InputFocusScript { set @@ -518,7 +518,7 @@ public EventCallback InputFocus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputBlurScript + public string? InputBlurScript { set @@ -590,7 +590,7 @@ public EventCallback InputBlur /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputChangeScript + public string? InputChangeScript { set diff --git a/src/components/Blazor/ChatRenderers.cs b/src/components/Blazor/ChatRenderers.cs index a7d0e187..7b2efa1f 100644 --- a/src/components/Blazor/ChatRenderers.cs +++ b/src/components/Blazor/ChatRenderers.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -47,7 +47,7 @@ public RenderFragment? Attachment /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string AttachmentScript + public string? AttachmentScript { get { return _attachmentScript; } @@ -106,7 +106,7 @@ public RenderFragment? AttachmentContent /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string AttachmentContentScript + public string? AttachmentContentScript { get { return _attachmentContentScript; } @@ -165,7 +165,7 @@ public RenderFragment? AttachmentHeader /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string AttachmentHeaderScript + public string? AttachmentHeaderScript { get { return _attachmentHeaderScript; } @@ -224,7 +224,7 @@ public RenderFragment? Input /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string InputScript + public string? InputScript { get { return _inputScript; } @@ -283,7 +283,7 @@ public RenderFragment? InputActions /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string InputActionsScript + public string? InputActionsScript { get { return _inputActionsScript; } @@ -342,7 +342,7 @@ public RenderFragment? InputActionsEnd /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string InputActionsEndScript + public string? InputActionsEndScript { get { return _inputActionsEndScript; } @@ -401,7 +401,7 @@ public RenderFragment? InputActionsStart /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string InputActionsStartScript + public string? InputActionsStartScript { get { return _inputActionsStartScript; } @@ -460,7 +460,7 @@ public RenderFragment? Message /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string MessageScript + public string? MessageScript { get { return _messageScript; } @@ -519,7 +519,7 @@ public RenderFragment? MessageActions /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string MessageActionsScript + public string? MessageActionsScript { get { return _messageActionsScript; } @@ -578,7 +578,7 @@ public RenderFragment? MessageAttachments /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string MessageAttachmentsScript + public string? MessageAttachmentsScript { get { return _messageAttachmentsScript; } @@ -637,7 +637,7 @@ public RenderFragment? MessageContent /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string MessageContentScript + public string? MessageContentScript { get { return _messageContentScript; } @@ -696,7 +696,7 @@ public RenderFragment? MessageHeader /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string MessageHeaderScript + public string? MessageHeaderScript { get { return _messageHeaderScript; } @@ -755,7 +755,7 @@ public RenderFragment? SendButton /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string SendButtonScript + public string? SendButtonScript { get { return _sendButtonScript; } @@ -814,7 +814,7 @@ public RenderFragment? SuggestionPrefix /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string SuggestionPrefixScript + public string? SuggestionPrefixScript { get { return _suggestionPrefixScript; } diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index c71cb52f..21b4552d 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -344,7 +344,7 @@ public EventCallback CheckedChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -451,7 +451,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -523,7 +523,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/Chip.cs b/src/components/Blazor/Chip.cs index 4197b321..fd4c586f 100644 --- a/src/components/Blazor/Chip.cs +++ b/src/components/Blazor/Chip.cs @@ -223,7 +223,7 @@ public EventCallback SelectedChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string RemoveScript + public string? RemoveScript { set @@ -295,7 +295,7 @@ public EventCallback Remove /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string SelectScript + public string? SelectScript { set diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index 07d355d6..0cb2835a 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -73,7 +73,7 @@ public Object? Data ///Provides a means of setting Data in the JavaScript environment. [Parameter] - public string DataScript + public string? DataScript { get { return _dataScript; } @@ -449,7 +449,7 @@ public T[] GetCurrentValue() /// Returns the current selection of the combo. /// /// The selected items as provided in the source. - public async Task GetSelectionAsync() + public async Task GetSelectionAsync() { var iv = await InvokeMethod("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); @@ -459,7 +459,7 @@ public async Task GetSelectionAsync() /// Returns the current selection of the combo. /// /// The selected items as provided in the source. - public object[] GetSelection() + public object[]? GetSelection() { var iv = InvokeMethodSync("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); @@ -561,7 +561,7 @@ public RenderFragment? ItemTemplate /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string ItemTemplateScript + public string? ItemTemplateScript { get { return _itemTemplateScript; } @@ -620,7 +620,7 @@ public RenderFragment? GroupHeaderTemplate /// igRegisterScript("MyTemplate", function (ctx) { return ...; }, false). /// [Parameter] - public string GroupHeaderTemplateScript + public string? GroupHeaderTemplateScript { get { return _groupHeaderTemplateScript; } @@ -814,7 +814,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -921,7 +921,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -993,7 +993,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set @@ -1065,7 +1065,7 @@ public EventCallback Blur /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -1137,7 +1137,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -1209,7 +1209,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -1281,7 +1281,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 8d2a92ba..8fb0e478 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -38,7 +38,7 @@ public object[]? NewValue ///Provides a means of setting NewValue in the JavaScript environment. [Parameter] - public string NewValueScript + public string? NewValueScript { get { return _newValueScript; } @@ -86,7 +86,7 @@ public object[]? Items ///Provides a means of setting Items in the JavaScript environment. [Parameter] - public string ItemsScript + public string? ItemsScript { get { return _itemsScript; } diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 4301854f..4a297da2 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -732,7 +732,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -804,7 +804,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -876,7 +876,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -948,7 +948,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set @@ -1020,7 +1020,7 @@ public EventCallback Closed /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -1127,7 +1127,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputScript + public string? InputScript { set diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index b3b389e8..45e186c4 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -861,7 +861,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -933,7 +933,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -1005,7 +1005,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -1077,7 +1077,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set @@ -1149,7 +1149,7 @@ public EventCallback Closed /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -1261,7 +1261,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputScript + public string? InputScript { set diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index d1c12785..c3d1951b 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -162,7 +162,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputOcurredScript + public string? InputOcurredScript { set @@ -234,7 +234,7 @@ public EventCallback InputOcurred /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -341,7 +341,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -413,7 +413,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index 621a5e39..08075c25 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -280,7 +280,7 @@ public bool Toggle() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -352,7 +352,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index c18d0230..48db13a3 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -152,7 +152,7 @@ public bool SameWidth /// /// Returns the items of the dropdown. /// - public async Task GetItemsAsync() + public async Task GetItemsAsync() { var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); @@ -172,7 +172,7 @@ public async Task GetItemsAsync() /// /// Returns the items of the dropdown. /// - public IgbDropdownItem[] GetItems() + public IgbDropdownItem[]? GetItems() { var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); @@ -192,7 +192,7 @@ public IgbDropdownItem[] GetItems() /// /// Returns the group items of the dropdown. /// - public async Task GetGroupsAsync() + public async Task GetGroupsAsync() { var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); @@ -212,7 +212,7 @@ public async Task GetGroupsAsync() /// /// Returns the group items of the dropdown. /// - public IgbDropdownGroup[] GetGroups() + public IgbDropdownGroup[]? GetGroups() { var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); @@ -270,7 +270,7 @@ public IgbDropdownGroup[] GetGroups() } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -292,7 +292,7 @@ public override object FindByName(string name) /// Navigates to the item at the specified index. /// /// The found item, or if no such item exists. - public async Task NavigateToAsync(Object index) + public async Task NavigateToAsync(Object index) { var iv = await InvokeMethod("navigateTo", new object?[] { ObjectToParam(index) }, new string[] { "Json" }); @@ -313,7 +313,7 @@ public async Task NavigateToAsync(Object index) /// Navigates to the item at the specified index. /// /// The found item, or if no such item exists. - public IgbDropdownItem NavigateTo(Object index) + public IgbDropdownItem? NavigateTo(Object index) { var iv = InvokeMethodSync("navigateTo", new object?[] { ObjectToParam(index) }, new string[] { "Json" }); @@ -333,7 +333,7 @@ public IgbDropdownItem NavigateTo(Object index) /// Selects the item with the specified value. /// /// The found item, or if no such item exists. - public async Task SelectAsync(Object value) + public async Task SelectAsync(Object value) { var iv = await InvokeMethod("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); @@ -354,7 +354,7 @@ public async Task SelectAsync(Object value) /// Selects the item with the specified value. /// /// The found item, or if no such item exists. - public IgbDropdownItem Select(Object value) + public IgbDropdownItem? Select(Object value) { var iv = InvokeMethodSync("select", new object?[] { ObjectToParam(value) }, new string[] { "Json" }); @@ -405,7 +405,7 @@ public void ClearSelection() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -477,7 +477,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -549,7 +549,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -621,7 +621,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set @@ -693,7 +693,7 @@ public EventCallback Closed /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/ExpansionPanel.cs b/src/components/Blazor/ExpansionPanel.cs index 01474146..9042bd16 100644 --- a/src/components/Blazor/ExpansionPanel.cs +++ b/src/components/Blazor/ExpansionPanel.cs @@ -200,7 +200,7 @@ public bool Show() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -272,7 +272,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -344,7 +344,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -416,7 +416,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index ff546a36..bb482e16 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -25,7 +25,7 @@ protected override void EnsureModulesLoaded() /// reports a bare language code. /// /// The resolved culture name. - public async Task GetLocalCultureAsync() + public async Task GetLocalCultureAsync() { var iv = await InvokeMethod("getLocalCulture", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -35,7 +35,7 @@ public async Task GetLocalCultureAsync() /// reports a bare language code. /// /// The resolved culture name. - public String GetLocalCulture() + public String? GetLocalCulture() { var iv = InvokeMethodSync("getLocalCulture", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index dfbd9cde..dc30d32c 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -76,7 +76,7 @@ public string? Value /// /// Returns the current value of the control. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -85,7 +85,7 @@ public async Task GetCurrentValueAsync() /// /// Returns the current value of the control. /// - public string GetCurrentValue() + public string? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -401,7 +401,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index ec0a19f9..d77db535 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -265,7 +265,7 @@ public void SetCustomValidity(String message) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputOcurredScript + public string? InputOcurredScript { set @@ -340,7 +340,7 @@ public EventCallback InputOcurred /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -412,7 +412,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 91bafe42..e115e671 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -89,7 +89,7 @@ public string? Value /// Returns the current value of the input. /// Regardless of the current , an empty value returns an empty string. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -99,7 +99,7 @@ public async Task GetCurrentValueAsync() /// Returns the current value of the input. /// Regardless of the current , an empty value returns an empty string. /// - public string GetCurrentValue() + public string? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -236,7 +236,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index 7ca048c5..e007e624 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -79,19 +79,19 @@ protected override ControlEventBehavior DefaultEventBehavior /// Sets the position of the drawer. /// /// - /// anchored to the inline-start edge (default). + /// � anchored to the inline-start edge (default). /// /// - /// anchored to the inline-end edge. + /// � anchored to the inline-end edge. /// /// - /// anchored to the block-start edge. + /// � anchored to the block-start edge. /// /// - /// anchored to the block-end edge. + /// � anchored to the block-end edge. /// /// - /// rendered inline within the page flow; no modal backdrop. + /// � rendered inline within the page flow; no modal backdrop. /// /// /// @@ -262,7 +262,7 @@ public bool Toggle() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -334,7 +334,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index 22e124dc..a909916e 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -344,7 +344,7 @@ public EventCallback CheckedChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -451,7 +451,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -523,7 +523,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 5585fcc3..0277074e 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -102,7 +102,7 @@ public string? Value /// Gets the current value of the group. /// /// The value of the checked . - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -112,7 +112,7 @@ public async Task GetCurrentValueAsync() /// Gets the current value of the group. /// /// The value of the checked . - public string GetCurrentValue() + public string? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -169,7 +169,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/RangeSlider.cs b/src/components/Blazor/RangeSlider.cs index 560cfdd8..028fa2fe 100644 --- a/src/components/Blazor/RangeSlider.cs +++ b/src/components/Blazor/RangeSlider.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -140,7 +140,7 @@ public string? ThumbLabelUpper /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputScript + public string? InputScript { set @@ -212,7 +212,7 @@ public EventCallback Input /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index 64f2e829..6b4dbf80 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -430,7 +430,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -537,7 +537,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string HoverScript + public string? HoverScript { set diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index ff3d088e..e235c91e 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -226,7 +226,7 @@ public PopoverScrollStrategy ScrollStrategy /// /// Returns the items of the component. /// - public async Task GetItemsAsync() + public async Task GetItemsAsync() { var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); @@ -246,7 +246,7 @@ public async Task GetItemsAsync() /// /// Returns the items of the component. /// - public IgbSelectItem[] GetItems() + public IgbSelectItem[]? GetItems() { var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); @@ -266,7 +266,7 @@ public IgbSelectItem[] GetItems() /// /// Returns the groups of the component. /// - public async Task GetGroupsAsync() + public async Task GetGroupsAsync() { var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); @@ -286,7 +286,7 @@ public async Task GetGroupsAsync() /// /// Returns the groups of the component. /// - public IgbSelectGroup[] GetGroups() + public IgbSelectGroup[]? GetGroups() { var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); @@ -401,7 +401,7 @@ public bool Invalid } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -564,7 +564,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -671,7 +671,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -743,7 +743,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set @@ -815,7 +815,7 @@ public EventCallback Blur /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -887,7 +887,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -959,7 +959,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -1031,7 +1031,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/Slider.cs b/src/components/Blazor/Slider.cs index c83b9bd9..c1fd411f 100644 --- a/src/components/Blazor/Slider.cs +++ b/src/components/Blazor/Slider.cs @@ -241,7 +241,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputScript + public string? InputScript { set @@ -313,7 +313,7 @@ public EventCallback Input /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/Snackbar.cs b/src/components/Blazor/Snackbar.cs index 136eb402..ee8a773b 100644 --- a/src/components/Blazor/Snackbar.cs +++ b/src/components/Blazor/Snackbar.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -89,7 +89,7 @@ public string? ActionText /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ActionScript + public string? ActionScript { set diff --git a/src/components/Blazor/Splitter.cs b/src/components/Blazor/Splitter.cs index ff9d4a25..80ba414d 100644 --- a/src/components/Blazor/Splitter.cs +++ b/src/components/Blazor/Splitter.cs @@ -314,7 +314,7 @@ public void Toggle(PanePosition position) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ResizeStartScript + public string? ResizeStartScript { set @@ -386,7 +386,7 @@ public EventCallback ResizeStart /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ResizingScript + public string? ResizingScript { set @@ -458,7 +458,7 @@ public EventCallback Resizing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ResizeEndScript + public string? ResizeEndScript { set diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index f1d2b830..865a5c60 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -61,7 +61,7 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// Returns all of the stepper's steps. /// - public async Task GetStepsAsync() + public async Task GetStepsAsync() { var iv = await InvokeMethod("p:Steps", new object?[] { }, new string[] { }); @@ -81,7 +81,7 @@ public async Task GetStepsAsync() /// /// Returns all of the stepper's steps. /// - public IgbStep[] GetSteps() + public IgbStep[]? GetSteps() { var iv = InvokeMethodSync("p:Steps", new object?[] { }, new string[] { }); @@ -330,7 +330,7 @@ public void Reset() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ActiveStepChangingScript + public string? ActiveStepChangingScript { set @@ -402,7 +402,7 @@ public EventCallback ActiveStepChanging /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ActiveStepChangedScript + public string? ActiveStepChangedScript { set diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index b9edadf5..b8110024 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -195,7 +195,7 @@ public TabsActivation Activation /// Gets the currently selected tab. /// /// The label of the selected tab, or its ID if no label is set. - public async Task GetSelectedAsync() + public async Task GetSelectedAsync() { var iv = await InvokeMethod("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -205,14 +205,14 @@ public async Task GetSelectedAsync() /// Gets the currently selected tab. /// /// The label of the selected tab, or its ID if no label is set. - public string GetSelected() + public string? GetSelected() { var iv = InvokeMethodSync("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -260,7 +260,7 @@ public void Select(String id) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 28d047f9..cf2c1f30 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -308,7 +308,7 @@ public string? Value /// /// Returns the current value of the component. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -317,7 +317,7 @@ public async Task GetCurrentValueAsync() /// /// Returns the current value of the component. /// - public string GetCurrentValue() + public string? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -559,7 +559,7 @@ public EventCallback ValueChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string InputScript + public string? InputScript { set @@ -631,7 +631,7 @@ public EventCallback Input /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ChangeScript + public string? ChangeScript { set @@ -738,7 +738,7 @@ internal void EnsureChangeHandled() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string FocusScript + public string? FocusScript { set @@ -810,7 +810,7 @@ public EventCallback Focus /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string BlurScript + public string? BlurScript { set diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index 63f3ac4f..8a5a564e 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -273,7 +273,7 @@ public void SetNativeElement(Object element) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileFullscreenScript + public string? TileFullscreenScript { set @@ -345,7 +345,7 @@ public EventCallback TileFullscreen /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileMaximizeScript + public string? TileMaximizeScript { set @@ -417,7 +417,7 @@ public EventCallback TileMaximize /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragStartScript + public string? TileDragStartScript { set @@ -489,7 +489,7 @@ public EventCallback TileDragStart /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragEndScript + public string? TileDragEndScript { set @@ -561,7 +561,7 @@ public EventCallback TileDragEnd /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragCancelScript + public string? TileDragCancelScript { set @@ -633,7 +633,7 @@ public EventCallback TileDragCancel /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeStartScript + public string? TileResizeStartScript { set @@ -705,7 +705,7 @@ public EventCallback TileResizeStart /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeEndScript + public string? TileResizeEndScript { set @@ -777,7 +777,7 @@ public EventCallback TileResizeEnd /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeCancelScript + public string? TileResizeCancelScript { set diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index 1ddb79a8..6c37a210 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -177,7 +177,7 @@ public string? Gap /// /// Gets the tiles sorted by their position in the layout. /// - public async Task GetTilesAsync() + public async Task GetTilesAsync() { var iv = await InvokeMethod("p:Tiles", new object?[] { }, new string[] { }); @@ -197,7 +197,7 @@ public async Task GetTilesAsync() /// /// Gets the tiles sorted by their position in the layout. /// - public IgbTile[] GetTiles() + public IgbTile[]? GetTiles() { var iv = InvokeMethodSync("p:Tiles", new object?[] { }, new string[] { }); @@ -215,7 +215,7 @@ public IgbTile[] GetTiles() } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -244,7 +244,7 @@ public void SetNativeElement(Object element) /// /// Returns the properties of the current tile collections as a JSON payload. /// - public async Task SaveLayoutAsync() + public async Task SaveLayoutAsync() { var iv = await InvokeMethod("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -253,7 +253,7 @@ public async Task SaveLayoutAsync() /// /// Returns the properties of the current tile collections as a JSON payload. /// - public String SaveLayout() + public String? SaveLayout() { var iv = InvokeMethodSync("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -285,7 +285,7 @@ public void LoadLayout(String data) /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileFullscreenScript + public string? TileFullscreenScript { set @@ -357,7 +357,7 @@ public EventCallback TileFullscreen /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileMaximizeScript + public string? TileMaximizeScript { set @@ -429,7 +429,7 @@ public EventCallback TileMaximize /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragStartScript + public string? TileDragStartScript { set @@ -501,7 +501,7 @@ public EventCallback TileDragStart /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragEndScript + public string? TileDragEndScript { set @@ -573,7 +573,7 @@ public EventCallback TileDragEnd /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileDragCancelScript + public string? TileDragCancelScript { set @@ -645,7 +645,7 @@ public EventCallback TileDragCancel /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeStartScript + public string? TileResizeStartScript { set @@ -717,7 +717,7 @@ public EventCallback TileResizeStart /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeEndScript + public string? TileResizeEndScript { set @@ -789,7 +789,7 @@ public EventCallback TileResizeEnd /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string TileResizeCancelScript + public string? TileResizeCancelScript { set diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index 5dd446a4..70beaec2 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -345,7 +345,7 @@ public bool Toggle() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpeningScript + public string? OpeningScript { set @@ -417,7 +417,7 @@ public EventCallback Opening /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string OpenedScript + public string? OpenedScript { set @@ -489,7 +489,7 @@ public EventCallback Opened /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosingScript + public string? ClosingScript { set @@ -561,7 +561,7 @@ public EventCallback Closing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ClosedScript + public string? ClosedScript { set diff --git a/src/components/Blazor/Tree.cs b/src/components/Blazor/Tree.cs index c559b6ae..9c342b6e 100644 --- a/src/components/Blazor/Tree.cs +++ b/src/components/Blazor/Tree.cs @@ -119,7 +119,7 @@ public TreeSelection Selection } /// - public override object FindByName(string name) + public override object? FindByName(string name) { var baseResult = base.FindByName(name); if (baseResult != null) @@ -165,7 +165,7 @@ public void ConnectedCallback() /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string SelectionChangedScript + public string? SelectionChangedScript { set @@ -237,7 +237,7 @@ public EventCallback SelectionChanged /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ItemExpandingScript + public string? ItemExpandingScript { set @@ -309,7 +309,7 @@ public EventCallback ItemExpanding /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ItemExpandedScript + public string? ItemExpandedScript { set @@ -381,7 +381,7 @@ public EventCallback ItemExpanded /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ItemCollapsingScript + public string? ItemCollapsingScript { set @@ -453,7 +453,7 @@ public EventCallback ItemCollapsing /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ItemCollapsedScript + public string? ItemCollapsedScript { set @@ -525,7 +525,7 @@ public EventCallback ItemCollapsed /// igRegisterScript("MyHandler", function (args) { }, false). /// [Parameter] - public string ActiveItemScript + public string? ActiveItemScript { set diff --git a/src/components/Blazor/TreeItem.cs b/src/components/Blazor/TreeItem.cs index b1c31dc0..51073343 100644 --- a/src/components/Blazor/TreeItem.cs +++ b/src/components/Blazor/TreeItem.cs @@ -233,7 +233,7 @@ public object? Value /// /// Returns the full path to the tree item, starting from the top-most ancestor. /// - public async Task GetPathAsync() + public async Task GetPathAsync() { var iv = await InvokeMethod("p:Path", new object?[] { }, new string[] { }); @@ -253,7 +253,7 @@ public async Task GetPathAsync() /// /// Returns the full path to the tree item, starting from the top-most ancestor. /// - public IgbTreeItem[] GetPath() + public IgbTreeItem[]? GetPath() { var iv = InvokeMethodSync("p:Path", new object?[] { }, new string[] { }); diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 3017bf33..b61576bb 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -212,7 +212,7 @@ public void Serialize(SerializationContext context, string? propertyName = null) //return "[" + string.Join(", \n", vals) + "]"; } - public object FindByName(string name) + public object? FindByName(string name) { //TODO: hash map for (var i = 0; i < this.Count; i++) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index ad7acc50..010ad204 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -635,7 +635,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.CloseElement(); } - internal Dictionary[] DeserializeDictionaryArray(string batch) + internal Dictionary[]? DeserializeDictionaryArray(string batch) { return JsonSerializer.Deserialize[]>(batch, SerializerOptions); } @@ -1023,7 +1023,7 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object } //Console.WriteLine("got return"); //Console.WriteLine(ret); - return ret; + return ret!; } @@ -1572,7 +1572,7 @@ private void SendMessage(RendererMessage m) QueueUpdate(); } - private async Task SendMessageImmediate(RendererMessage m) + private async Task SendMessageImmediate(RendererMessage m) { if (disposedValue) { @@ -1583,7 +1583,7 @@ private async Task SendMessageImmediate(RendererMessage m) return await SendJsonImmediate(m); } - private object SendMessageSyncImmediate(RendererMessage m) + private object? SendMessageSyncImmediate(RendererMessage m) { if (disposedValue) { @@ -1687,7 +1687,7 @@ private void ProcessMessageSync(RendererMessage m) SendJsonSync(json, m.NativeElements); } - private async Task SendJsonImmediate(RendererMessage m) + private async Task SendJsonImmediate(RendererMessage m) { if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { @@ -1846,12 +1846,12 @@ private void SendJsonSync(string json, ElementReference[] nativeElements) } } - internal object ReturnToPrimitive(object returnValue) + internal object? ReturnToPrimitive(object returnValue) { return ConvertReturnValue(returnValue, true); } - internal T[] DowncastArray(object val) + internal T[]? DowncastArray(object val) { if (val == null) { @@ -2335,7 +2335,7 @@ internal bool ReturnToBoolean(object val) } } - internal string ComponentToJson(object val, int index) + internal string? ComponentToJson(object val, int index) { if (val is BaseRendererControl || val is BaseRendererElement) { @@ -2588,7 +2588,7 @@ internal void ObjectToParam(SerializationContext c, Type type, object val) ObjectToParam(c, val); } - internal string ReturnToString(object val) + internal string? ReturnToString(object val) { if (val == null) { @@ -2617,7 +2617,7 @@ protected virtual bool UseCamelEnumValues } } - protected string Camelize(string value) + protected string? Camelize(string? value) { if (value == null || value.Length == 0) { @@ -2626,7 +2626,7 @@ protected string Camelize(string value) return value.Substring(0, 1).ToLower() + value.Substring(1); } - protected string ToPascal(string value) + protected string? ToPascal(string? value) { if (value == null || value.Length == 0) { @@ -2635,7 +2635,7 @@ protected string ToPascal(string value) return value.Substring(0, 1).ToUpper() + value.Substring(1); } - internal string EnumToString(T val) where T : struct + internal string? EnumToString(T val) where T : struct { if (UseCamelEnumValues) { @@ -2665,7 +2665,7 @@ internal T StringToEnum(Object val) where T : struct return default(T); } - internal string ObjectArrayToParam(object[] arr) + internal string? ObjectArrayToParam(object[] arr) { if (arr == null) { @@ -2706,7 +2706,7 @@ internal string ObjectArrayToParam(object[] arr) // } } - internal string StringArrayToString(string[] arr) + internal string? StringArrayToString(string[] arr) { // object jarr = new JSONArray(); // try { @@ -2727,7 +2727,7 @@ internal string StringArrayToString(string[] arr) } } - internal string IntArrayToString(int[] arr) + internal string? IntArrayToString(int[] arr) { // object jarr = new JSONArray(); // try { @@ -2748,7 +2748,7 @@ internal string IntArrayToString(int[] arr) } } - internal string DoubleArrayToString(double[] arr) + internal string? DoubleArrayToString(double[] arr) { // object jarr = new JSONArray(); // try { @@ -2769,7 +2769,7 @@ internal string DoubleArrayToString(double[] arr) } } - internal object[] ReturnToObjectArray(object val) + internal object[]? ReturnToObjectArray(object val) { if (val == null) { @@ -2830,7 +2830,7 @@ internal object[] ReturnToObjectArray(object val) } } - internal string[] ReturnToStringArray(object val) + internal string[]? ReturnToStringArray(object val) { if (val == null) { @@ -2859,7 +2859,7 @@ internal string[] ReturnToStringArray(object val) } } - internal double[] ReturnToDoubleArray(object val) + internal double[]? ReturnToDoubleArray(object val) { if (val == null) { @@ -2883,7 +2883,7 @@ internal double[] ReturnToDoubleArray(object val) } } - internal int[] ReturnToIntArray(object val) + internal int[]? ReturnToIntArray(object val) { if (val == null) { @@ -3174,7 +3174,7 @@ private void SendCleanupMessage() var ret = SendMessageImmediate(m); } - public async Task SetResourceStringAsync(string grouping, string id, string value) + public async Task SetResourceStringAsync(string grouping, string id, string value) { if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { @@ -3183,7 +3183,7 @@ public async Task SetResourceStringAsync(string grouping, string id, str return await JsRuntime!.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); } - public async Task SetResourceStringAsync(string grouping, string json) + public async Task SetResourceStringAsync(string grouping, string json) { if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 27b56564..ccbd61e3 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -17,7 +17,7 @@ protected IIgniteUIBlazor IgBlazor { get { - return _igBlazor; + return _igBlazor!; } set { @@ -81,7 +81,7 @@ internal void DetachChild(BaseRendererElement child) } } - protected virtual string ParentTypeName + protected virtual string? ParentTypeName { get { @@ -559,7 +559,7 @@ protected void EnsureValid() } } - protected object CurrParent + protected object? CurrParent { get { @@ -641,7 +641,7 @@ internal DateTime ReturnToDate(Object val) } } - internal String ComponentToJson(object val, int index) + internal String? ComponentToJson(object val, int index) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -680,7 +680,7 @@ internal string BooleanToString(bool val) } } - internal string EnumToString(T val) where T : struct + internal string? EnumToString(T val) where T : struct { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -706,7 +706,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string ObjectArrayToParam(object[] arr) + internal string? ObjectArrayToParam(object[] arr) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -719,7 +719,7 @@ internal string ObjectArrayToParam(object[] arr) } } - internal object[] ReturnToObjectArray(Object val) + internal object[]? ReturnToObjectArray(Object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -732,11 +732,11 @@ internal object[] ReturnToObjectArray(Object val) } } - internal T[] ReturnToObjectArray(Object val) + internal T[]? ReturnToObjectArray(Object val) { return ReturnToObjectArray(val, null); } - internal T[] ReturnToObjectArray(Object val, string? typeGuess) + internal T[]? ReturnToObjectArray(Object val, string? typeGuess) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -749,7 +749,7 @@ internal T[] ReturnToObjectArray(Object val, string? typeGuess) } } - internal string[] ReturnToStringArray(Object val) + internal string[]? ReturnToStringArray(Object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -762,7 +762,7 @@ internal string[] ReturnToStringArray(Object val) } } - internal int[] ReturnToIntArray(Object val) + internal int[]? ReturnToIntArray(Object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -775,7 +775,7 @@ internal int[] ReturnToIntArray(Object val) } } - internal double[] ReturnToDoubleArray(Object val) + internal double[]? ReturnToDoubleArray(Object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -840,7 +840,7 @@ internal void ObjectToParam(SerializationContext c, object val) } } - internal string ReturnToString(object val) + internal string? ReturnToString(object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -866,7 +866,7 @@ internal bool ReturnToBoolean(object val) } } - internal object ConvertReturnValue(object val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object? ConvertReturnValue(object val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -879,7 +879,7 @@ internal object ConvertReturnValue(object val, string? typeGuess = null, bool ac } } - internal object ReturnToPrimitive(object val) + internal object? ReturnToPrimitive(object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -892,7 +892,7 @@ internal object ReturnToPrimitive(object val) } } - internal T[] DowncastArray(object val) + internal T[]? DowncastArray(object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -996,7 +996,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action add(); } - internal string StringToString(object val) + internal string? StringToString(object val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1009,7 +1009,7 @@ internal string StringToString(object val) } } - internal string StringArrayToString(string[] val) + internal string? StringArrayToString(string[] val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1022,7 +1022,7 @@ internal string StringArrayToString(string[] val) } } - internal string IntArrayToString(int[] val) + internal string? IntArrayToString(int[] val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1035,7 +1035,7 @@ internal string IntArrayToString(int[] val) } } - internal string DoubleArrayToString(double[] val) + internal string? DoubleArrayToString(double[] val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1057,13 +1057,13 @@ protected internal virtual void ToEventJson(BaseRendererControl control, Diction } - public virtual object FindByName(string name) + public virtual object? FindByName(string name) { return null; } - protected async Task SetResourceStringAsync(string grouping, string id, string value) + protected async Task SetResourceStringAsync(string grouping, string id, string value) { if (CurrParent == null) { @@ -1078,7 +1078,7 @@ protected async Task SetResourceStringAsync(string grouping, string id, return await ((BaseRendererControl)CurrParent).SetResourceStringAsync(grouping, id, value); } } - protected async Task SetResourceStringAsync(string grouping, string json) + protected async Task SetResourceStringAsync(string grouping, string json) { if (CurrParent == null) { diff --git a/src/componentsBase/DataAdapters.cs b/src/componentsBase/DataAdapters.cs index 2bdcaff9..13ac3c75 100644 --- a/src/componentsBase/DataAdapters.cs +++ b/src/componentsBase/DataAdapters.cs @@ -1,4 +1,4 @@ -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { public class LocalJson { @@ -7,13 +7,13 @@ public LocalJson(string json) _json = json; } - public static LocalJson From(string json) + public static LocalJson? From(string json) { return new LocalJson(json); } private string? _json; - public string Json { get { return _json; } } + public string? Json { get { return _json; } } internal string ToRef() { diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 7521d5a2..36fab833 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -22,7 +22,7 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) private Dictionary _idLookup = new Dictionary(); private Dictionary _suspensionLookup = new Dictionary(); - public object FindItem(Guid id) + public object? FindItem(Guid id) { foreach (var data in _dataSources.Values) @@ -34,7 +34,7 @@ public object FindItem(Guid id) } return null; } - public object FindItem(string id) + public object? FindItem(string id) { foreach (var data in _dataSources.Values) { @@ -70,7 +70,7 @@ public Guid FindItemId(object item) return Guid.Empty; } - public string OnRefChanged(string path, object data) + public string? OnRefChanged(string path, object data) { string? id = null; if (_refs.ContainsKey(path)) @@ -293,7 +293,7 @@ public void ResumeNotifications(object dataSource, bool notify = true) } } - public IJSDataSource GetDataSource(string id) + public IJSDataSource? GetDataSource(string id) { if (_dataSources.ContainsKey(id)) { diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 215d12bb..2518cd44 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -239,7 +239,7 @@ public DynamicContentInfo() private bool _hasPopulatedContext = false; - public RenderFragment Template + public RenderFragment? Template { get { @@ -250,7 +250,7 @@ public RenderFragment Template _template = value; } } - public T Context + public T? Context { get { diff --git a/src/componentsBase/EventCallbackExtensions.cs b/src/componentsBase/EventCallbackExtensions.cs index d10a7d0c..a15c4077 100644 --- a/src/componentsBase/EventCallbackExtensions.cs +++ b/src/componentsBase/EventCallbackExtensions.cs @@ -54,7 +54,7 @@ private static class CallbackFields /// Use as guard against (unlikely) fields rename in old versions that won't resolve. internal static readonly bool Resolved = Delegate != null && Receiver != null; - private static FieldInfo Field(string name) => + private static FieldInfo? Field(string name) => typeof(EventCallback).GetField(name, BindingFlags.NonPublic | BindingFlags.Instance); } #endif diff --git a/src/componentsBase/IgbComponentRendererContainer.cs b/src/componentsBase/IgbComponentRendererContainer.cs index e046f4d3..1985e69c 100644 --- a/src/componentsBase/IgbComponentRendererContainer.cs +++ b/src/componentsBase/IgbComponentRendererContainer.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls @@ -8,7 +8,7 @@ public class IgbComponentRendererContainer : ComponentBase private Type? _componentType; [Parameter] - public Type ComponentType + public Type? ComponentType { get { diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 7b2bac0f..988d9a4e 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -217,7 +217,7 @@ public bool HasId(string id) } } - public IJSDataSourceItem LookupById(Guid id) + public IJSDataSourceItem? LookupById(Guid id) { if (_uuidToItem.ContainsKey(id)) { @@ -226,11 +226,11 @@ public IJSDataSourceItem LookupById(Guid id) return null; } - public object LookupOriginal(Guid id) + public object? LookupOriginal(Guid id) { return ToOriginal(LookupById(id)); } - public object LookupOriginal(string id) + public object? LookupOriginal(string id) { if (id.Contains("/")) { @@ -269,7 +269,7 @@ public Guid IdFromOriginal(object item) return itm.Id; } - public IJSDataSourceItem FromOriginal(object item) + public IJSDataSourceItem? FromOriginal(object item) { if (_originalToItem.ContainsKey(item)) { diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 51eaf683..d6078523 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -288,7 +288,7 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) for (int i = 0; i < names.Count; i++) { var key = names[i]; - s.PropertyGetters[i] = (o) => ((IDictionary)o)[key]; + s.PropertyGetters[i] = (o) => ((IDictionary)o)[key]!; } for (int i = 0; i < names.Count; i++) { @@ -358,7 +358,7 @@ public static JSDataSourceSchema Create(Type c) return s; } - public object ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager manager) + public object? ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager manager) { if (item == null) { @@ -413,7 +413,7 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt return JsonDataSourceItem.Create(value, subSchema, manager, rootItem); } - public JSDataSourceSchema BuildSubObjectSchema(object subObject) + public JSDataSourceSchema? BuildSubObjectSchema(object subObject) { if (subObject == null) { @@ -458,7 +458,7 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) return schema; } - public object ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager manager) + public object? ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager manager) { try { @@ -532,7 +532,7 @@ public bool IsNullable(Type propertyType) return propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(Nullable<>); } - public JSDataSourceSchema GetSubSchema(string propertyName) + public JSDataSourceSchema? GetSubSchema(string propertyName) { if (_subSchemas.ContainsKey(propertyName)) { diff --git a/src/componentsBase/MarshalByValueFactory.cs b/src/componentsBase/MarshalByValueFactory.cs index 58f7aeee..9b3ab990 100644 --- a/src/componentsBase/MarshalByValueFactory.cs +++ b/src/componentsBase/MarshalByValueFactory.cs @@ -135,7 +135,7 @@ internal static bool MustMarshalByValue(string typeName) return false; } - internal static object CreateInstance(string typeName) + internal static object? CreateInstance(string typeName) { switch (typeName) { diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index c0422b4f..2e286061 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -275,7 +275,7 @@ public void AddArrayProp(string propertyName, IEnumerable values) //_properties.Add("\"" + propertyName + "\"" + ": [" + String.Join(", ", strValues) + " ]"); } - protected string Camelize(string value) + protected string? Camelize(string? value) { if (value == null || value.Length == 0) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 52290f3f..0fc370da 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -105,7 +105,7 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) } } - public unsafe string SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn?[]? columns) + public unsafe string? SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn?[]? columns) { #if NET5_0 if (_unmarshalledRuntime != null) @@ -124,7 +124,7 @@ public unsafe string SendUnmarshalledColumnMessage(string methodName, string ref return null; } - public string SendUnmarshalledColumnDataIntentsMessage(string methodName, string refName, string dataIntents) + public string? SendUnmarshalledColumnDataIntentsMessage(string methodName, string refName, string dataIntents) { #if NET5_0 if (_unmarshalledRuntime != null) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index d1f57f28..7cb40f5a 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -405,7 +405,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val == null ? null : val.Value.ToString("o"); + return val == null ? null! : val.Value.ToString("o"); }; } else @@ -414,7 +414,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val == null ? null : val.Value.ToString("o"); + return val == null ? null! : val.Value.ToString("o"); }; } break; @@ -1860,7 +1860,7 @@ private void EnsureCapacity(int required) } } - public static IJSDataSource CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) { if (data == null) { @@ -1882,7 +1882,7 @@ public static IJSDataSource CreateWithSchema(Object data, JSDataSourceSchema sch } return null; } - public static IJSDataSource CreateWithSchema(Object data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + public static IJSDataSource? CreateWithSchema(Object data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) { if (data == null) { @@ -2027,7 +2027,7 @@ public bool HasId(string id) } } - public object LookupOriginal(Guid id) + public object? LookupOriginal(Guid id) { if (_uuidToOriginal.ContainsKey(id)) { @@ -2035,7 +2035,7 @@ public object LookupOriginal(Guid id) } return null; } - public object LookupOriginal(string id) + public object? LookupOriginal(string id) { if (id.Contains("/")) { @@ -2073,7 +2073,7 @@ public bool HasOriginal(object item) return _originalToUuid.ContainsKey(item); } - public static IJSDataSource Create(Object data, DataSourceManager manager, RuntimeHelper helper) + public static IJSDataSource? Create(Object data, DataSourceManager manager, RuntimeHelper helper) { if (data == null) { @@ -2297,7 +2297,7 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu // } // } - public static JSDataSourceSchema ExtractSchema(object item) + public static JSDataSourceSchema? ExtractSchema(object item) { if (item == null) { @@ -2364,7 +2364,7 @@ public static JSDataSourceSchema ExtractSchema(object item) return JSDataSourceSchema.Create(c); } - private static Type GetIListTypeArg(Type itemType) + private static Type? GetIListTypeArg(Type itemType) { foreach (var inter in itemType.GetInterfaces()) { @@ -2380,7 +2380,7 @@ private static Type GetIListTypeArg(Type itemType) return null; } - private static Type GetIEnumerableTypeArg(Type itemType) + private static Type? GetIEnumerableTypeArg(Type itemType) { foreach (var inter in itemType.GetInterfaces()) { @@ -2455,7 +2455,7 @@ private static bool IsPrimitive(Type type) return false; } - public string GetDataIntentsAsJson() + public string? GetDataIntentsAsJson() { if (_schema != null) { @@ -2492,7 +2492,7 @@ private void EnsureSchema(object item) } } - public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) + public IJSDataSourceItem? NotifyInsertItem(object data, int index, Object item) { EnsureSchema(item); if (_schema == null && item == null) @@ -2509,7 +2509,7 @@ public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) return null; } - public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem) + public IJSDataSourceItem? NotifyRemoveItem(object data, int index, object oldItem) { EnsureSchema(oldItem); if (_schema == null) @@ -2568,7 +2568,7 @@ public void NotifyClearItems(Object data) } } - public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) + public IJSDataSourceItem? NotifySetItem(Object data, int index, Object oldItem, Object newItem) { EnsureSchema(newItem); if (_schema == null) @@ -2581,7 +2581,7 @@ public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, O return null; } - public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) + public IJSDataSourceItem? NotifyUpdateItem(object data, int index, object item) { EnsureSchema(item); if (_schema == null) diff --git a/src/componentsBase/WebViewCallback.cs b/src/componentsBase/WebViewCallback.cs index c1b5a47f..a48c2f62 100644 --- a/src/componentsBase/WebViewCallback.cs +++ b/src/componentsBase/WebViewCallback.cs @@ -69,7 +69,7 @@ private void ForControls(Action act) } } - private BaseRendererControl GetControl(string key) + private BaseRendererControl? GetControl(string key) { if (_controlsMap.ContainsKey(key)) { From 32cbc7885a66b27a24a98c534ce3e85313ae62d8 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 10:52:14 +0300 Subject: [PATCH 08/64] Fix CS8604: Adds guards / ArgumentNullException.ThrowIfNull / signature changes. --- src/components/Blazor/Combo.cs | 4 +- src/componentsBase/BaseCollection.cs | 2 +- src/componentsBase/BaseRendererControl.cs | 142 ++++++++++-------- src/componentsBase/BaseRendererElement.cs | 58 +++---- src/componentsBase/CollectionAdapter.cs | 2 +- src/componentsBase/DataSourceManager.cs | 20 ++- src/componentsBase/DynamicContentHolder.cs | 28 ++-- .../IgbComponentRendererContainer.cs | 2 +- src/componentsBase/IgbTemplateContent.razor | 2 +- src/componentsBase/JsonDataSource.cs | 11 +- src/componentsBase/JsonDataSourceItem.cs | 8 +- src/componentsBase/JsonDataSourceSchema.cs | 37 +++-- src/componentsBase/JsonSerializable.cs | 4 +- src/componentsBase/MarshalByValueFactory.cs | 2 +- src/componentsBase/RendererMessage.cs | 2 +- src/componentsBase/RendererSerializer.cs | 34 +++-- src/componentsBase/RuntimeHelper.cs | 10 +- src/componentsBase/UnmarshalledDataSource.cs | 71 ++++++--- src/componentsBase/Utils.cs | 2 +- stories/Components/Stories/Chat.stories.razor | 4 +- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 18 +-- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 2 +- 23 files changed, 267 insertions(+), 200 deletions(-) diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index 0cb2835a..d49c2e35 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -431,7 +431,7 @@ public T[]? Value public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); - return ReturnToObjectArray(iv).Cast().ToArray(); + return (ReturnToObjectArray(iv) ?? Array.Empty()).Cast().ToArray(); } /// @@ -441,7 +441,7 @@ public async Task GetCurrentValueAsync() public T[] GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); - return ReturnToObjectArray(iv).Cast().ToArray(); + return (ReturnToObjectArray(iv) ?? Array.Empty()).Cast().ToArray(); } private string? _selectionRef; diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index b61576bb..5f27bdea 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -142,7 +142,7 @@ protected override void ClearItems() NotifyParent(); } - public void Serialize(SerializationContext context, string? propertyName = null) + public void Serialize(SerializationContext? context, string? propertyName = null) { //var vals = new List(); if (propertyName != null) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 010ad204..8ef8c44e 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -443,7 +443,7 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) } var wc = (WCEnumNameAttribute)attr; var wcEnumName = Camelize(wc.Name); - wcEnumTransform.Add(f.Name.ToLower(), wcEnumName); + wcEnumTransform.Add(f.Name.ToLower(), wcEnumName!); } } } @@ -500,7 +500,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) attributeVal = TransformPotentialEnumValue(key, attributeVal); } //Console.WriteLine("adding attribute: " + tKey + ", " + attributes[key]); - builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey)), attributeVal); + builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey))!, attributeVal); } } @@ -644,7 +644,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) private Dictionary _contentTemplates = new Dictionary(); private Dictionary _contentTemplateTypes = new Dictionary(); - internal void UpdateTemplate(string templateId, object template, Type type) + internal void UpdateTemplate(string templateId, object? template, Type type) { _contentTemplates[templateId] = template; _contentTemplateTypes[templateId] = type; @@ -659,12 +659,16 @@ internal void UpdateTemplate(string templateId, object template, Type type) return null; } - internal void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string? args) + internal void AdjustDynamicContent(string? containerId, string? contentType, string? templateId, string? contentId, string? actionType, string? args) { switch (actionType) { case "Add": { + if (contentType == null || templateId == null || contentId == null) + { + return; + } DynamicContentInfo? dynamicContent = BuildDynamicContentInfo(contentType, templateId); if (dynamicContent == null) { @@ -689,6 +693,10 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin } case "Remove": { + if (contentId == null) + { + return; + } if (_dynamicContentInfos.ContainsKey(contentId)) { DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; @@ -699,6 +707,10 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin } case "Update": { + if (contentId == null) + { + return; + } if (_dynamicContentInfos.ContainsKey(contentId)) { DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; @@ -716,9 +728,9 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin } } - protected Type? TemplateContentType(string templateId) + protected Type? TemplateContentType(string? templateId) { - if (!_contentTemplateTypes.ContainsKey(templateId)) + if (templateId == null || !_contentTemplateTypes.ContainsKey(templateId)) { return null; } @@ -727,14 +739,14 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin } private Dictionary> _dynamicContentBuilders = new Dictionary>(); - private DynamicContentInfo? BuildDynamicContentInfo(string contentType, string templateId) + private DynamicContentInfo? BuildDynamicContentInfo(string? contentType, string? templateId) { var templateContentType = TemplateContentType(templateId); if (templateContentType != null) { if (!_dynamicContentBuilders.ContainsKey(templateContentType)) { - if (contentType == "TemplateContent" && templateContentType != null) + if (contentType == "TemplateContent") { var createType = typeof(DynamicContentInfo<>).MakeGenericType(templateContentType); var nonGen = typeof(DynamicContentInfo); @@ -750,14 +762,9 @@ internal void AdjustDynamicContent(string containerId, string contentType, strin _dynamicContentBuilders[templateContentType] = () => null!; } } + return _dynamicContentBuilders[templateContentType](); } - else - { - //TODO: other types - _dynamicContentBuilders[templateContentType!] = () => null!; - } - - return _dynamicContentBuilders[templateContentType!](); + return null; } protected virtual bool NeedsDynamicContent @@ -818,8 +825,12 @@ internal void OnReady() QueueUpdate(); } - protected internal void MarkPropDirty(string propertyName) + protected internal void MarkPropDirty(string? propertyName) { + if (propertyName == null) + { + return; + } _isDirty[propertyName] = true; _hasDirty = true; _serializeDirty = true; @@ -914,7 +925,7 @@ public virtual string? Type } } - public void Serialize(SerializationContext context, string? propertyName = null) + public void Serialize(SerializationContext? context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; @@ -1010,7 +1021,7 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); + var retDict = JsonSerializer.Deserialize>(str!, SerializerOptions); if (retDict!.ContainsKey("retType") && retDict["retType"] is JsonElement && @@ -1062,7 +1073,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); + var retDict = JsonSerializer.Deserialize>(str!, SerializerOptions); ret = retDict; if (retDict!.ContainsKey("retType") && @@ -1077,7 +1088,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName } else { - tcs.SetResult(ret); + tcs.SetResult(ret!); } } var result = await tcs.Task; @@ -1311,7 +1322,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal OnRefChanged(refId, "\"script:::" + newValue.ToString() + "\""); } } - refChanged(refId, oldValue, newValue); + refChanged(refId!, oldValue, newValue); } internal string DateToString(DateTime val) @@ -1749,7 +1760,7 @@ private object SendJsonImmediateSync(RendererMessage m) } } - private void SendJson(string json, ElementReference[] nativeElements) + private void SendJson(string json, ElementReference[]? nativeElements) { //json = "window.sendMessage(`" + this._containerId + "`, `" + json + "`)"; //Console.WriteLine(json); @@ -1826,7 +1837,7 @@ internal void DetachChild(BaseCollection child) } } - private void SendJsonSync(string json, ElementReference[] nativeElements) + private void SendJsonSync(string json, ElementReference[]? nativeElements) { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; @@ -1846,12 +1857,12 @@ private void SendJsonSync(string json, ElementReference[] nativeElements) } } - internal object? ReturnToPrimitive(object returnValue) + internal object? ReturnToPrimitive(object? returnValue) { return ConvertReturnValue(returnValue, true); } - internal T[]? DowncastArray(object val) + internal T[]? DowncastArray(object? val) { if (val == null) { @@ -2071,7 +2082,7 @@ private void SendJsonSync(string json, ElementReference[] nativeElements) return null; } var ret = obj["value"].ToString(); - returnValue = JsonSerializer.Deserialize>(ret, SerializerOptions); + returnValue = JsonSerializer.Deserialize>(ret!, SerializerOptions); } } else @@ -2108,18 +2119,18 @@ public void OnInvokeReturn(long invokeId, Object returnValue) if (returnValue is JsonElement && ((JsonElement)returnValue).ValueKind == JsonValueKind.String) { var str = ((JsonElement)returnValue).GetString(); - result = JsonSerializer.Deserialize>(str, SerializerOptions); + result = JsonSerializer.Deserialize>(str!, SerializerOptions); } InvokeAsync(() => { if (_methodTasks.ContainsKey(invokeId)) { - _methodTasks[invokeId].SetResult(result); + _methodTasks[invokeId].SetResult(result!); } else { - _methodReturns.Add(invokeId, result); + _methodReturns.Add(invokeId, result!); } }); } @@ -2173,7 +2184,7 @@ internal int ReturnToInt(object? val) } else if (val != null) { - return int.Parse(val.ToString()); + return int.Parse(val.ToString()!); } return 0; } @@ -2203,7 +2214,7 @@ internal double ReturnToDouble(object? val) else if (val != null) { //Console.WriteLine(val); - return Double.Parse(val.ToString()); + return Double.Parse(val.ToString()!); } return double.NaN; } @@ -2233,7 +2244,7 @@ internal long ReturnToLong(object val) else { //Console.WriteLine(val); - return (long)Double.Parse(val.ToString()); + return (long)Double.Parse(val.ToString()!); } } @@ -2250,7 +2261,7 @@ internal long ReturnToLong(object val) } try { - var arr = JsonSerializer.Deserialize(val?.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize(val?.ToString()!, SerializerOptions); DateTime[] ret = new DateTime[arr!.Length]; for (int i = 0; i < arr.Length; i++) { @@ -2314,7 +2325,7 @@ internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) } } - internal bool ReturnToBoolean(object val) + internal bool ReturnToBoolean(object? val) { if (val == null) { @@ -2331,7 +2342,7 @@ internal bool ReturnToBoolean(object val) } else { - return Boolean.Parse(val.ToString()); + return Boolean.Parse(val.ToString()!); } } @@ -2366,7 +2377,7 @@ internal String BooleanToString(bool val) return ((bool)val).ToString().ToLower(); } - internal string ObjectToParam(object val) + internal string ObjectToParam(object? val) { using (MemoryStream ms = new MemoryStream()) { @@ -2380,7 +2391,7 @@ internal string ObjectToParam(object val) } } - internal string ObjectToParam(object val, Type type) + internal string ObjectToParam(object? val, Type type) { using (MemoryStream ms = new MemoryStream()) { @@ -2394,8 +2405,9 @@ internal string ObjectToParam(object val, Type type) } } - internal void ObjectToParam(SerializationContext context, object val) + internal void ObjectToParam(SerializationContext? context, object? val) { + ArgumentNullException.ThrowIfNull(context); if (val == null) { context.Writer.WriteNullValue(); @@ -2477,7 +2489,7 @@ internal void ObjectToParam(SerializationContext context, object val) w.WriteStringValue(val.ToString()); } } - internal void ObjectToParam(SerializationContext c, string propertyName, object val) + internal void ObjectToParam(SerializationContext c, string propertyName, object? val) { var w = c.Writer; if (val == null) @@ -2559,7 +2571,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object w.WriteString(propertyName, val.ToString()); } } - internal void ObjectToParam(SerializationContext c, Type type, object val) + internal void ObjectToParam(SerializationContext c, Type type, object? val) { if (type.IsEnum) { @@ -2588,7 +2600,7 @@ internal void ObjectToParam(SerializationContext c, Type type, object val) ObjectToParam(c, val); } - internal string? ReturnToString(object val) + internal string? ReturnToString(object? val) { if (val == null) { @@ -2645,7 +2657,7 @@ protected virtual bool UseCamelEnumValues return val.ToString(); } - internal T StringToEnum(Object val) where T : struct + internal T StringToEnum(Object? val) where T : struct { if (val == null) { @@ -2665,7 +2677,7 @@ internal T StringToEnum(Object val) where T : struct return default(T); } - internal string? ObjectArrayToParam(object[] arr) + internal string? ObjectArrayToParam(object[]? arr) { if (arr == null) { @@ -2706,7 +2718,7 @@ internal T StringToEnum(Object val) where T : struct // } } - internal string? StringArrayToString(string[] arr) + internal string? StringArrayToString(string[]? arr) { // object jarr = new JSONArray(); // try { @@ -2727,7 +2739,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string? IntArrayToString(int[] arr) + internal string? IntArrayToString(int[]? arr) { // object jarr = new JSONArray(); // try { @@ -2748,7 +2760,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string? DoubleArrayToString(double[] arr) + internal string? DoubleArrayToString(double[]? arr) { // object jarr = new JSONArray(); // try { @@ -2769,7 +2781,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal object[]? ReturnToObjectArray(object val) + internal object[]? ReturnToObjectArray(object? val) { if (val == null) { @@ -2798,12 +2810,12 @@ internal T StringToEnum(Object val) where T : struct } } - internal T[]? ReturnToObjectArray(object val) + internal T[]? ReturnToObjectArray(object? val) { return ReturnToObjectArray(val, null); } - internal T[]? ReturnToObjectArray(object val, string? typeGuess) + internal T[]? ReturnToObjectArray(object? val, string? typeGuess) { if (val == null) { @@ -2812,7 +2824,7 @@ internal T StringToEnum(Object val) where T : struct val = ConvertReturnValue(val)!; try { - var arr = JsonSerializer.Deserialize[]>(val.ToString(), SerializerOptions); + var arr = JsonSerializer.Deserialize[]>(val.ToString()!, SerializerOptions); T[] ret = new T[arr!.Length]; for (int i = 0; i < arr.Length; i++) { @@ -2830,7 +2842,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string[]? ReturnToStringArray(object val) + internal string[]? ReturnToStringArray(object? val) { if (val == null) { @@ -2859,7 +2871,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal double[]? ReturnToDoubleArray(object val) + internal double[]? ReturnToDoubleArray(object? val) { if (val == null) { @@ -3120,7 +3132,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) } } //Console.WriteLine("calling handler"); - _handlers[name + "/" + propertyName](senderObj, val); + _handlers[name + "/" + propertyName](senderObj!, val!); } catch (Exception e) { @@ -3263,7 +3275,7 @@ protected void SetPropertyValue(object item, System.Reflection.PropertyInfo prop if (type.IsArray) { var src = (Array)value; - var dest = Array.CreateInstance(type.GetElementType(), src.Length); + var dest = Array.CreateInstance(type.GetElementType()!, src.Length); Array.Copy(src, dest, src.Length); property.SetValue(item, dest); return; @@ -3401,7 +3413,7 @@ public IgniteUIBlazorSettings WithJsonSerializerOptions(IgniteUIJsonSerializerOp return newSettings; } - public IgniteUIBlazorSettings WithModulesToLoad(ReadOnlyCollection modulesToLoad) + public IgniteUIBlazorSettings WithModulesToLoad(ReadOnlyCollection? modulesToLoad) { var newSettings = new IgniteUIBlazorSettings(this); newSettings.ModulesToLoad = modulesToLoad; @@ -3566,27 +3578,27 @@ internal SequenceInfo(int startSequence) SequenceMap = new Dictionary(); } - internal string TransformKey(string attributeKey) + internal string TransformKey(string? attributeKey) { - if (_transforms.ContainsKey(attributeKey)) + if (attributeKey != null && _transforms.ContainsKey(attributeKey)) { return _transforms[attributeKey]; } - return attributeKey; + return attributeKey!; } - internal bool IsTransformedEnum(string attributeKey) + internal bool IsTransformedEnum(string? attributeKey) { - if (_enumTransforms.ContainsKey(attributeKey)) + if (attributeKey != null && _enumTransforms.ContainsKey(attributeKey)) { return true; } return false; } - internal string TransformEnumValue(string attributeKey, string fieldName) + internal string TransformEnumValue(string? attributeKey, string? fieldName) { - if (_enumTransforms.ContainsKey(attributeKey)) + if (attributeKey != null && fieldName != null && _enumTransforms.ContainsKey(attributeKey)) { var d = _enumTransforms[attributeKey]; if (d.ContainsKey(fieldName.ToLower())) @@ -3594,12 +3606,12 @@ internal string TransformEnumValue(string attributeKey, string fieldName) return d[fieldName.ToLower()]; } } - return fieldName; + return fieldName!; } - internal void AddSequence(string attributeKey, string? wcName = null, Dictionary? wcEnumTransform = null) + internal void AddSequence(string? attributeKey, string? wcName = null, Dictionary? wcEnumTransform = null) { - if (!_keysSet.Contains(attributeKey)) + if (attributeKey != null && !_keysSet.Contains(attributeKey)) { _dirty = true; _keysSet.Add(attributeKey); diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index ccbd61e3..0605884f 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -385,7 +385,7 @@ internal void OnPropertyPropagatedOut(string name, string propertyName) } } - internal void UpdateTemplate(string contentType, object template, Type type) + internal void UpdateTemplate(string contentType, object? template, Type type) { Action templateUpdate = () => { @@ -452,8 +452,12 @@ internal bool SuppressParentNotify } } - internal void MarkPropDirty(String propertyName) + internal void MarkPropDirty(String? propertyName) { + if (propertyName == null) + { + return; + } _isDirty[propertyName] = true; _hasDirty = true; _serializeDirty = true; @@ -523,7 +527,7 @@ public virtual string Type } } - public void Serialize(SerializationContext context, string? propertyName = null) + public void Serialize(SerializationContext? context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; @@ -589,7 +593,7 @@ internal T ReturnToObject(Object val, string? typeGuess) } } - internal int ReturnToInt(Object val) + internal int ReturnToInt(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -602,7 +606,7 @@ internal int ReturnToInt(Object val) } } - internal double ReturnToDouble(Object val) + internal double ReturnToDouble(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -628,7 +632,7 @@ internal long ReturnToLong(Object val) } } - internal DateTime ReturnToDate(Object val) + internal DateTime ReturnToDate(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -693,7 +697,7 @@ internal string BooleanToString(bool val) } } - internal T StringToEnum(Object val) where T : struct + internal T StringToEnum(Object? val) where T : struct { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -706,7 +710,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string? ObjectArrayToParam(object[] arr) + internal string? ObjectArrayToParam(object[]? arr) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -719,7 +723,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal object[]? ReturnToObjectArray(Object val) + internal object[]? ReturnToObjectArray(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -732,11 +736,11 @@ internal T StringToEnum(Object val) where T : struct } } - internal T[]? ReturnToObjectArray(Object val) + internal T[]? ReturnToObjectArray(Object? val) { return ReturnToObjectArray(val, null); } - internal T[]? ReturnToObjectArray(Object val, string? typeGuess) + internal T[]? ReturnToObjectArray(Object? val, string? typeGuess) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -749,7 +753,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string[]? ReturnToStringArray(Object val) + internal string[]? ReturnToStringArray(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -775,7 +779,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal double[]? ReturnToDoubleArray(Object val) + internal double[]? ReturnToDoubleArray(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -788,7 +792,7 @@ internal T StringToEnum(Object val) where T : struct } } - internal string ObjectToParam(object val) + internal string ObjectToParam(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -801,7 +805,7 @@ internal string ObjectToParam(object val) } } - internal string ObjectToParam(object val, Type type) + internal string ObjectToParam(object? val, Type type) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -814,7 +818,7 @@ internal string ObjectToParam(object val, Type type) } } - internal void ObjectToParam(SerializationContext c, string propertyName, object val) + internal void ObjectToParam(SerializationContext c, string propertyName, object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -827,7 +831,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object } } - internal void ObjectToParam(SerializationContext c, object val) + internal void ObjectToParam(SerializationContext? c, object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -840,7 +844,7 @@ internal void ObjectToParam(SerializationContext c, object val) } } - internal string? ReturnToString(object val) + internal string? ReturnToString(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -853,7 +857,7 @@ internal void ObjectToParam(SerializationContext c, object val) } } - internal bool ReturnToBoolean(object val) + internal bool ReturnToBoolean(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -866,7 +870,7 @@ internal bool ReturnToBoolean(object val) } } - internal object? ConvertReturnValue(object val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object? ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -879,7 +883,7 @@ internal bool ReturnToBoolean(object val) } } - internal object? ReturnToPrimitive(object val) + internal object? ReturnToPrimitive(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -892,7 +896,7 @@ internal bool ReturnToBoolean(object val) } } - internal T[]? DowncastArray(object val) + internal T[]? DowncastArray(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -996,7 +1000,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action add(); } - internal string? StringToString(object val) + internal string? StringToString(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1009,7 +1013,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } } - internal string? StringArrayToString(string[] val) + internal string? StringArrayToString(string[]? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1022,7 +1026,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } } - internal string? IntArrayToString(int[] val) + internal string? IntArrayToString(int[]? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1035,7 +1039,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } } - internal string? DoubleArrayToString(double[] val) + internal string? DoubleArrayToString(double[]? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -1048,7 +1052,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } } - protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary? args) { } diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 2ca12f07..27dff9a8 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -175,7 +175,7 @@ private void SyncItems() targetMap[item] = true; } - var queryArray = new List(this._query); + var queryArray = new List(this._query ?? Enumerable.Empty()); this.actualContent = queryArray; if (this.CollisionChecker != null) diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 36fab833..fd1df39a 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -70,7 +70,7 @@ public Guid FindItemId(object item) return Guid.Empty; } - public string? OnRefChanged(string path, object data) + public string? OnRefChanged(string path, object? data) { string? id = null; if (_refs.ContainsKey(path)) @@ -169,7 +169,7 @@ void DecrementRef(string id) } } - public void NotifyInsertItem(string refName, int index, object refItem) + public void NotifyInsertItem(string refName, int index, object? refItem) { if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { @@ -177,6 +177,10 @@ public void NotifyInsertItem(string refName, int index, object refItem) } //Console.WriteLine("notifying insert item"); + if (refItem == null) + { + return; + } if (_refsById.ContainsKey(refName)) { //Console.WriteLine("found by id"); @@ -186,13 +190,17 @@ public void NotifyInsertItem(string refName, int index, object refItem) _refSink!.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } - public void NotifyRemoveItem(String refName, int index, Object oldItem) + public void NotifyRemoveItem(String refName, int index, Object? oldItem) { if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { return; } + if (oldItem == null) + { + return; + } if (_refsById.ContainsKey(refName)) { Object data = _refsById[refName]; @@ -255,8 +263,12 @@ public bool HasRefId(object dataSource) return false; } - public string GetRefId(object dataSource) + public string GetRefId(object? dataSource) { + if (dataSource == null) + { + return string.Empty; + } if (_idLookup.ContainsKey(dataSource)) { return _idLookup[dataSource]; diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 2518cd44..c64dba76 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -83,7 +83,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.OpenElement(8, "div"); builder.AddAttribute(9, "id", item.RefName); builder.AddMarkupContent(10, "\r\n "); - builder.OpenComponent(11, item.ControlType); + builder.OpenComponent(11, item.ControlType!); builder.SetKey(item.RefName); builder.AddComponentReferenceCapture(12, delegate (object __value) { @@ -136,17 +136,17 @@ public object? Component public BaseRendererControl? Owner { get; internal set; } - protected virtual void OnComponentChanged(object oldValue, object component) + protected virtual void OnComponentChanged(object? oldValue, object? component) { } - public virtual void UpdateTemplate(object template) + public virtual void UpdateTemplate(object? template) { } - public virtual void UpdateContext(object context) + public virtual void UpdateContext(object? context) { } @@ -161,7 +161,7 @@ public TypedDynamicContent(Type t) } /// - protected override void OnComponentChanged(object oldValue, object component) + protected override void OnComponentChanged(object? oldValue, object? component) { //if (component != null) { @@ -180,7 +180,7 @@ protected override void OnComponentChanged(object oldValue, object component) foreach (var item in toSignal) { - item.SetResult(Component); + item.SetResult(Component!); } } @@ -208,7 +208,7 @@ public Task GetInstanceAsync() { foreach (var item in toSignal!) { - item.SetResult(Component); + item.SetResult(Component!); } } @@ -266,15 +266,15 @@ public T? Context } /// - protected override void OnComponentChanged(object oldValue, object component) + protected override void OnComponentChanged(object? oldValue, object? component) { if (component is IgbTemplateContent) { - OnContextChanged((T)Context, (T)Context); + OnContextChanged((T)Context!, (T)Context!); } } - private void OnContextChanged(T oldValue, T newValue) + private void OnContextChanged(T? oldValue, T? newValue) { if (Component is IgbTemplateContent) { @@ -290,15 +290,15 @@ private void OnContextChanged(T oldValue, T newValue) } /// - public override void UpdateTemplate(object template) + public override void UpdateTemplate(object? template) { - Template = (RenderFragment)template; + Template = (RenderFragment?)template; } /// - public override void UpdateContext(object context) + public override void UpdateContext(object? context) { - Context = (T)context; + Context = (T)context!; } } diff --git a/src/componentsBase/IgbComponentRendererContainer.cs b/src/componentsBase/IgbComponentRendererContainer.cs index 1985e69c..ae5806c2 100644 --- a/src/componentsBase/IgbComponentRendererContainer.cs +++ b/src/componentsBase/IgbComponentRendererContainer.cs @@ -43,7 +43,7 @@ public object? RootComponent } } - private void OnRootComponentChanged(object oldComponent, object newComponent) + private void OnRootComponentChanged(object? oldComponent, object? newComponent) { if (ComponentChanged != null) { diff --git a/src/componentsBase/IgbTemplateContent.razor b/src/componentsBase/IgbTemplateContent.razor index a666c729..2711de01 100644 --- a/src/componentsBase/IgbTemplateContent.razor +++ b/src/componentsBase/IgbTemplateContent.razor @@ -4,7 +4,7 @@
@if (Template != null && _hasPopulatedContext) { - @Template(Context) + @Template(Context!) }
diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 988d9a4e..a1a0156f 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -72,13 +72,18 @@ public JSDataSourceType DataSourceType public bool DateCacheReady { get { return _dateCacheReady; } } - public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager? manager, string? parentId) { if (data == null) { return null; } + if (manager == null) + { + return null; + } + if (data.GetType().IsArray) { return JsonDataSource.CreateFromArray((Object[])data, schema, manager, parentId); @@ -279,7 +284,7 @@ public Guid IdFromOriginal(object item) return null; } - public Object? ToOriginal(IJSDataSourceItem item) + public Object? ToOriginal(IJSDataSourceItem? item) { if (item == null) { @@ -412,7 +417,7 @@ private void Add(object? item) } } - private void OnAddItem(IJSDataSourceItem itemJson, Object item) + private void OnAddItem(IJSDataSourceItem itemJson, Object? item) { _uuidToItem[itemJson.Id] = itemJson; if (item != null) diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 0fa93b8e..a8fdad70 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -106,13 +106,13 @@ public string? ParentId return JSDataSourceSchema.Create(c); } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager) + public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema, DataSourceManager? manager) { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema, DataSourceManager manager, JsonDataSourceItem parentItem) + public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema, DataSourceManager? manager, JsonDataSourceItem parentItem) { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem._parentId = parentItem.ParentId != null ? parentItem.ParentId + "/" + parentItem.Id.ToString() : parentItem.Id.ToString(); @@ -127,14 +127,14 @@ public static JsonDataSourceItem Create(object? item, JSDataSourceSchema? schema return newItem; } - public static JsonDataSourceItem CreateWithId(object item, Guid id, JSDataSourceSchema schema, DataSourceManager manager) + public static JsonDataSourceItem CreateWithId(object? item, Guid id, JSDataSourceSchema? schema, DataSourceManager? manager) { JsonDataSourceItem newItem = new JsonDataSourceItem(id); newItem.Read(item, schema, manager); return newItem; } - public void Refresh(object item, JSDataSourceSchema schema, DataSourceManager manager) + public void Refresh(object? item, JSDataSourceSchema? schema, DataSourceManager? manager) { Read(item, schema, manager); } diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index d6078523..4d9b663a 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -358,7 +358,7 @@ public static JSDataSourceSchema Create(Type c) return s; } - public object? ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager manager) + public object? ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager? manager) { if (item == null) { @@ -380,7 +380,7 @@ public static JSDataSourceSchema Create(Type c) } } - private object GetSubObject(String name, Object value, JsonDataSourceItem rootItem, DataSourceManager manager) + private object GetSubObject(String name, Object value, JsonDataSourceItem rootItem, DataSourceManager? manager) { bool checkedArray = _checkedArray.ContainsKey(name); if (!checkedArray && value != null) @@ -458,7 +458,7 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt return schema; } - public object? ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager manager) + public object? ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager? manager) { try { @@ -532,20 +532,24 @@ public bool IsNullable(Type propertyType) return propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(Nullable<>); } - public JSDataSourceSchema? GetSubSchema(string propertyName) + public JSDataSourceSchema? GetSubSchema(string? propertyName) { - if (_subSchemas.ContainsKey(propertyName)) + if (propertyName == null || !_subSchemas.ContainsKey(propertyName)) { - return _subSchemas[propertyName]; + return null; } - return null; + return _subSchemas[propertyName]; } - public void SetSubSchema(string propertyName, JSDataSourceSchema schema) + public void SetSubSchema(string? propertyName, JSDataSourceSchema? schema) { + if (propertyName == null) + { + return; + } _subSchemas[propertyName] = schema; } - public JSDataSourceSchemaType ResolveSchemaType(Type type) + public JSDataSourceSchemaType ResolveSchemaType(Type? type) { if (type == typeof(double)) { @@ -740,8 +744,9 @@ public void AddField(FieldInfo curr) public JSDataSourceSchemaType[]? FieldTypes; public IDataIntentAttribute[]?[]? FieldDataIntents; - private System.Linq.Expressions.UnaryExpression GetConversion(Type type, System.Linq.Expressions.Expression expression) + private System.Linq.Expressions.UnaryExpression GetConversion(Type? type, System.Linq.Expressions.Expression expression) { + ArgumentNullException.ThrowIfNull(type); var isValueType = type.IsValueType; var isGenericType = type.IsGenericType; var isNullable = isGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); @@ -756,7 +761,7 @@ private System.Linq.Expressions.UnaryExpression GetConversion(Type type, System. } } - private Func GetPropertyValueGetter(Type type, PropertyInfo propertyInfo) + private Func GetPropertyValueGetter(Type? type, PropertyInfo propertyInfo) { //var propertyInfo = type.GetProperty(propertyName); @@ -772,7 +777,7 @@ private Func GetPropertyValueGetter(Type type, PropertyInfo prop } } - private Delegate GetTypedPropertyValueGetter(Type type, PropertyInfo propertyInfo) + private Delegate GetTypedPropertyValueGetter(Type? type, PropertyInfo propertyInfo) { //var propertyInfo = type.GetProperty(propertyName); @@ -794,7 +799,7 @@ private Delegate GetTypedPropertyValueGetter(Type type, PropertyInfo propertyInf } } - private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, PropertyInfo itemProp, string key) + private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, PropertyInfo? itemProp, string key) { //var propertyInfo = type.GetProperty(propertyName); @@ -804,7 +809,7 @@ private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, Pr System.Linq.Expressions.UnaryExpression conversion = this.GetConversion(dictType, param); System.Linq.Expressions.Expression strIndex = System.Linq.Expressions.ConstantExpression.Constant(key); - System.Linq.Expressions.Expression prop = System.Linq.Expressions.Expression.Property(conversion, itemProp, strIndex); + System.Linq.Expressions.Expression prop = System.Linq.Expressions.Expression.Property(conversion, itemProp!, strIndex); System.Linq.Expressions.UnaryExpression retConversion = this.GetConversion(valueType, prop); if (valueType.IsEnum) { @@ -817,7 +822,7 @@ private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, Pr } } - private Func GetFieldValueGetter(Type type, FieldInfo fieldInfo) + private Func GetFieldValueGetter(Type? type, FieldInfo fieldInfo) { //var propertyInfo = type.GetProperty(propertyName); @@ -833,7 +838,7 @@ private Func GetFieldValueGetter(Type type, FieldInfo fieldInfo) } } - private Delegate GetTypedFieldValueGetter(Type type, FieldInfo fieldInfo) + private Delegate GetTypedFieldValueGetter(Type? type, FieldInfo fieldInfo) { //var propertyInfo = type.GetProperty(propertyName); diff --git a/src/componentsBase/JsonSerializable.cs b/src/componentsBase/JsonSerializable.cs index e13a6bed..d8ace0b3 100644 --- a/src/componentsBase/JsonSerializable.cs +++ b/src/componentsBase/JsonSerializable.cs @@ -1,6 +1,6 @@ namespace IgniteUI.Blazor.Controls { - public delegate bool SerializationFilter(string name, string property); + public delegate bool SerializationFilter(string? name, string? property); public class SerializationContext { @@ -16,7 +16,7 @@ public SerializationContext(System.Text.Json.Utf8JsonWriter writer, Serializatio public interface JsonSerializable { - void Serialize(SerializationContext writer, string? propertyName = null); + void Serialize(SerializationContext? writer, string? propertyName = null); } } diff --git a/src/componentsBase/MarshalByValueFactory.cs b/src/componentsBase/MarshalByValueFactory.cs index 9b3ab990..09bd91e4 100644 --- a/src/componentsBase/MarshalByValueFactory.cs +++ b/src/componentsBase/MarshalByValueFactory.cs @@ -2,7 +2,7 @@ namespace IgniteUI.Blazor.Controls { public class MarshalByValueFactory { - internal static bool MustMarshalByValue(string typeName) + internal static bool MustMarshalByValue(string? typeName) { switch (typeName) { diff --git a/src/componentsBase/RendererMessage.cs b/src/componentsBase/RendererMessage.cs index 0412f476..5be20da5 100644 --- a/src/componentsBase/RendererMessage.cs +++ b/src/componentsBase/RendererMessage.cs @@ -17,7 +17,7 @@ public string? Type _type = value; } } - public void SetData(string key, string data) + public void SetData(string key, string? data) { _data[key] = data; } diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 2e286061..6ccef246 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -8,7 +8,7 @@ namespace IgniteUI.Blazor.Controls internal partial class RendererSerializer { - public RendererSerializer(SerializationContext context, ComponentBase component, string name) + public RendererSerializer(SerializationContext? context, ComponentBase component, string name) { _name = name; _context = context; @@ -48,7 +48,7 @@ public void AddBooleanProp(string propertyName, bool value) //_properties.Add("\"" + propertyName + "\"" + ": " + value.ToString(CultureInfo.InvariantCulture).ToLower()); } - public void AddStringProp(string propertyName, string value) + public void AddStringProp(string propertyName, string? value) { if (_context!.Filter != null) { @@ -119,7 +119,7 @@ public void AddPrimitiveProp(object? val) } } - public void AddPrimitiveProp(string propertyName, object val) + public void AddPrimitiveProp(string propertyName, object? val) { if (_context!.Filter != null) { @@ -182,7 +182,7 @@ public void AddPrimitiveProp(string propertyName, object val) } } - public void AddArrayProp(string propertyName, IEnumerable values) + public void AddArrayProp(string propertyName, IEnumerable? values) { var items = values == null ? null : values as IList ?? values.ToList(); bool containsSub = false; @@ -284,7 +284,7 @@ public void AddArrayProp(string propertyName, IEnumerable values) return value.Substring(0, 1).ToLower() + value.Substring(1); } - public void AddEnumProp(string propertyName, Enum value) + public void AddEnumProp(string propertyName, Enum? value) { if (_context!.Filter != null) { @@ -294,6 +294,12 @@ public void AddEnumProp(string propertyName, Enum value) } } + if (value == null) + { + _context.Writer.WriteNull(propertyName); + return; + } + if (Utils.TryGetWCEnumName(value.GetType(), value.ToString(), out var wcName)) { _context.Writer.WriteString(propertyName, wcName); @@ -311,7 +317,7 @@ public void AddEnumProp(string propertyName, Enum value) // return TextUtils.join("", parts); // } - public void AddNumberProp(String propertyName, Object value) + public void AddNumberProp(String propertyName, Object? value) { if (_context!.Filter != null) { @@ -374,7 +380,7 @@ public void End() _context.Writer.WriteEndObject(); } - public void AddSerializableProp(String propertyName, JsonSerializable value) + public void AddSerializableProp(String propertyName, JsonSerializable? value) { var context = _context; @@ -411,7 +417,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) //_properties.Add("\"" + propertyName + "\"" + ": " + value.Serialize()); } - public void AddStringArrayProp(String propertyName, string[] values) + public void AddStringArrayProp(String propertyName, string[]? values) { if (_context!.Filter != null) { @@ -453,7 +459,7 @@ public void AddStringArrayProp(String propertyName, string[] values) // _properties.Add("\"" + propertyName + "\"" + ": [" + arrayParts + " ]"); } - public void AddDateArrayProp(String propertyName, DateTime[] values) + public void AddDateArrayProp(String propertyName, DateTime[]? values) { if (_context!.Filter != null) { @@ -499,7 +505,7 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) } private Regex _colorSplitRegex = new Regex("[\\s,]+(?![^(]*\\))"); - public void AddStringArrayProp(String propertyName, string values) + public void AddStringArrayProp(String propertyName, string? values) { if (_context!.Filter != null) { @@ -541,7 +547,7 @@ public void AddStringArrayProp(String propertyName, string values) // _properties.Add("\"" + propertyName + "\"" + ": [" + arrayParts + " ]"); } - public void AddEnumArrayProp(String propertyName, object values) + public void AddEnumArrayProp(String propertyName, object? values) { if (_context!.Filter != null) { @@ -570,7 +576,7 @@ public void AddEnumArrayProp(String propertyName, object values) //_properties.Add("\"" + propertyName + "\"" + ": [" + string.Join(", ", strValues) + " ]"); } - public void AddIntArrayProp(String propertyName, int[] values) + public void AddIntArrayProp(String propertyName, int[]? values) { if (_context!.Filter != null) { @@ -598,7 +604,7 @@ public void AddIntArrayProp(String propertyName, int[] values) //_properties.Add("\"" + propertyName + "\"" + ": [" + string.Join(", ", strValues) + " ]"); } - public void AddDoubleArrayProp(string propertyName, double[] numbers) + public void AddDoubleArrayProp(string propertyName, double[]? numbers) { if (_context!.Filter != null) { @@ -627,7 +633,7 @@ public void AddDoubleArrayProp(string propertyName, double[] numbers) //_properties.Add("\"" + propertyName + "\": " + "[" + string.Join(", ", items) + "]"); } - public void AddSerializableArrayProp(string propertyName, T[] array) where T : JsonSerializable + public void AddSerializableArrayProp(string propertyName, T[]? array) where T : JsonSerializable { if (array == null) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 0fc370da..a64ee531 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -23,7 +23,7 @@ internal class RuntimeHelper "Microsoft.AspNetCore.Components.WebAssembly")] #endif //[System.Diagnostics.CodeAnalysis.DynamicDependency(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods, typeof(WebAssemblyJSRuntime))] - public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) + public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) { _igBlazor = igBlazor; //Console.WriteLine("initializing runtime helper"); @@ -115,11 +115,11 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) #else if (_callSendUnmarshalledColumnMessage != null) { - return _callSendUnmarshalledColumnMessage(_inprocRuntime, methodName, refName, index, columns); + return _callSendUnmarshalledColumnMessage(_inprocRuntime!, methodName, refName, index, columns); } #endif var intptr = Unsafe.AsPointer(ref columns); - _inprocRuntime.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); + _inprocRuntime!.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); return null; } @@ -136,10 +136,10 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) if (_callSendUnmarshalledColumnMessage != null) { //Console.WriteLine("invoking sadness"); - return _callSendUnmarshalledColumnDataIntentMessage!(_inprocRuntime, methodName, refName, dataIntents); + return _callSendUnmarshalledColumnDataIntentMessage!(_inprocRuntime!, methodName, refName, dataIntents); } #endif - _inprocRuntime.InvokeVoid(methodName, new object[] { refName, dataIntents }); + _inprocRuntime!.InvokeVoid(methodName, new object[] { refName, dataIntents }); return null; } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 7cb40f5a..8a5eea20 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -141,7 +141,7 @@ public UnmarshalledDataSource() }; } - private UnmarshalledColumnData[]? AdjustCapacity(string parentPath, UnmarshalledColumnData?[] columns, JSDataSourceSchema schema, int oldValue, int newValue) + private UnmarshalledColumnData[]? AdjustCapacity(string? parentPath, UnmarshalledColumnData?[]? columns, JSDataSourceSchema? schema, int oldValue, int newValue) { //Console.WriteLine("adjusting capacity, oldValue: " + oldValue + ", newValue: " + newValue); DateTime start = DateTime.Now; @@ -229,8 +229,9 @@ public UnmarshalledDataSource() return columns; } - private UnmarshalledColumnData CreateColumn(string parentPath, string propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate valueGetter, Func untypedGetter, bool isIDColumn) + private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate? valueGetter, Func? untypedGetter, bool isIDColumn) { +#pragma warning disable CS8604 // internal invariant: column arrays are allocated before element access if (parentPath != null && parentPath.Length > 0) { parentPath += "."; @@ -716,7 +717,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa UnmarshalledColumn?[]? cols = null; if (objVal != null) { - var id = _idGetter!(item); + var id = _idGetter!(item!); var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); @@ -726,7 +727,10 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { _subDataSources[id] = new Dictionary(); } - _subDataSources[id].Add(column.PropertyName, sub); + if (column.PropertyName != null && sub != null) + { + _subDataSources[id].Add(column.PropertyName, sub); + } } if (index == size) { @@ -1504,6 +1508,7 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa newColumn.Clear = clear; return newColumn; +#pragma warning restore CS8604 } private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) @@ -1536,7 +1541,7 @@ private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) return JSDataSourceSchemaType.ObjectValue; } - private void GetColumns(string refName, UnmarshalledColumnData[] columns, List? l) + private void GetColumns(string refName, UnmarshalledColumnData[]? columns, List? l) { List toDrill = new List(); @@ -1600,7 +1605,7 @@ public void SendUpdate(string containerId, string refName, int index, bool syncD _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceUpdate", containerId + ":" + refName + ":" + (syncDataOnly ? "true" : "false"), index, GetColumns(refName)); } - public void SendCreate(string containerId, string refName, string dataIntents) + public void SendCreate(string containerId, string refName, string? dataIntents) { if (dataIntents != null) { @@ -1628,11 +1633,12 @@ private void OnRemoveId(Guid oldId) } } - private UnmarshalledColumnData AdjustColumnCapacity(string parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) + private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) { +#pragma warning disable CS8604 // internal invariant: paired column arrays (NullValues) are allocated together if (column == null) { - column = CreateColumn(parentPath, propertyName, schema, type, getter, untypedGetter, isIdColumn); + column = CreateColumn(parentPath, propertyName!, schema, type, getter, untypedGetter, isIdColumn); } if (column.Type == JSDataSourceSchemaType.ObjectValue || ( @@ -1848,6 +1854,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string parentPath, Unmarshal } return column; +#pragma warning restore CS8604 } private void EnsureCapacity(int required) @@ -1860,7 +1867,7 @@ private void EnsureCapacity(int required) } } - public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + public static IJSDataSource? CreateWithSchema(Object data, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { if (data == null) { @@ -1882,7 +1889,7 @@ private void EnsureCapacity(int required) } return null; } - public static IJSDataSource? CreateWithSchema(Object data, string parentId, JSDataSourceSchema schema, DataSourceManager manager, RuntimeHelper helper) + public static IJSDataSource? CreateWithSchema(Object data, string? parentId, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { if (data == null) { @@ -2094,11 +2101,11 @@ public bool HasOriginal(object item) } return null; } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { return CreateFromIEnumerable(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string? parentId, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { UnmarshalledDataSource newData = new UnmarshalledDataSource(); newData._helper = helper; @@ -2119,11 +2126,11 @@ private static IJSDataSource CreateFromIEnumerable(IEnumerable data, string? par return newData; } - private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { return CreateFromIList(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromIList(IList data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromIList(IList data, string? parentId, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { //Console.WriteLine("test json"); //DateTime testTime = DateTime.Now; @@ -2168,11 +2175,11 @@ private static void EnsureParentSchema(UnmarshalledDataSource data) } } - private static IJSDataSource CreateFromArray(Array data, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromArray(Array data, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { return CreateFromArray(data, null, schema, manager, helper); } - private static IJSDataSource CreateFromArray(Array data, string? parentId, JSDataSourceSchema? schema, DataSourceManager manager, RuntimeHelper helper) + private static IJSDataSource CreateFromArray(Array data, string? parentId, JSDataSourceSchema? schema, DataSourceManager? manager, RuntimeHelper? helper) { UnmarshalledDataSource newData = new UnmarshalledDataSource(); newData._helper = helper; @@ -2196,7 +2203,7 @@ private static IJSDataSource CreateFromArray(Array data, string? parentId, JSDat private int _leadingNullItems = 0; - private void Add(object item) + private void Add(object? item) { if (_schema == null) { @@ -2214,8 +2221,12 @@ private void Add(object item) //_data.Add(itemJson); } - private void EnsureLeadingNullsInserted(JSDataSourceSchema schema, UnmarshalledColumnData[] columns) + private void EnsureLeadingNullsInserted(JSDataSourceSchema? schema, UnmarshalledColumnData[]? columns) { + if (schema == null || columns == null) + { + return; + } if (_leadingNullItems > 0) { //Console.WriteLine("dealing with leading nulls."); @@ -2230,10 +2241,14 @@ private void EnsureLeadingNullsInserted(JSDataSourceSchema schema, UnmarshalledC } } - private void InsertItemAt(object? item, int index, JSDataSourceSchema schema, UnmarshalledColumnData[] columns) + private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, UnmarshalledColumnData[]? columns) { EnsureLeadingNullsInserted(schema, columns); EnsureCapacity(_size + 1); + if (columns == null) + { + return; + } for (var i = 0; i < columns.Length; i++) { var column = columns[i]; @@ -2249,20 +2264,28 @@ private void InsertItemAt(object? item, int index, JSDataSourceSchema schema, Un _size++; } - private void UpdateItemAt(object oldItem, object newItem, int index, JSDataSourceSchema schema, UnmarshalledColumnData[] columns) + private void UpdateItemAt(object? oldItem, object? newItem, int index, JSDataSourceSchema schema, UnmarshalledColumnData[]? columns) { EnsureLeadingNullsInserted(schema, columns); + if (columns == null) + { + return; + } for (var i = 0; i < columns.Length; i++) { var column = columns[i]; - column!.Update!(_size, column, index, oldItem, newItem); + column!.Update!(_size, column, index, oldItem!, newItem!); } } - private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColumnData[] columns) + private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColumnData[]? columns) { EnsureLeadingNullsInserted(schema, columns); + if (columns == null) + { + return; + } for (var i = 0; i < columns.Length; i++) { var column = columns[i]; @@ -2396,7 +2419,7 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu return null; } - public static JSDataSourceSchema ExtractSchemaFromType(Type itemType) + public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) { if (itemType.IsArray) { @@ -2464,7 +2487,7 @@ private static bool IsPrimitive(Type type) return null; } - private void EnsureSchema(object item) + private void EnsureSchema(object? item) { if (item != null && _schema == null) { diff --git a/src/componentsBase/Utils.cs b/src/componentsBase/Utils.cs index 50c1a2cb..32177508 100644 --- a/src/componentsBase/Utils.cs +++ b/src/componentsBase/Utils.cs @@ -2,7 +2,7 @@ namespace IgniteUI.Blazor.Controls { internal static class Utils { - internal static bool TryGetWCEnumName(Type enumType, string enumMemberName, out string? name) + internal static bool TryGetWCEnumName(Type enumType, string? enumMemberName, out string? name) { name = null; diff --git a/stories/Components/Stories/Chat.stories.razor b/stories/Components/Stories/Chat.stories.razor index 852f75c3..050be732 100644 --- a/stories/Components/Stories/Chat.stories.razor +++ b/stories/Components/Stories/Chat.stories.razor @@ -110,7 +110,7 @@ await Task.Delay(700); _basicOptions.IsTyping = false; - _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage!.Text)]; + _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage!.Text!)]; } private async Task OnTemplateMessageCreated(IgbChatMessageEventArgs args) @@ -127,7 +127,7 @@ await Task.Delay(700); _templateOptions.IsTyping = false; - _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage!.Text)]; + _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage!.Text!)]; } private static IgbChatMessage BuildAgentReply(string prompt) diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index f095ad48..4a586589 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -49,12 +49,12 @@ internal static string ChangeDetail(string newValues, string items, string type arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), returns: FromRender.Of((interop, cut) => InteropReturn.Array( $$"""[{"refType": "uuid", "id": "{{DataItemId(interop, cut, 0)}}"}]""")), - assert: (cut, result) => Assert.Same(_valueItem1, Assert.Single(result))) + assert: (cut, result) => Assert.Same(_valueItem1, Assert.Single(result!))) .Getter(c => c.GetSelectionAsync(), c => c.GetSelection(), "Selection", arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), returns: FromRender.Of((interop, cut) => InteropReturn.Array( $$"""[{"refType": "uuid", "id": "{{DataItemId(interop, cut, 1)}}"}]""")), - assert: (cut, result) => Assert.Same(_valueItem2, Assert.Single(result))) + assert: (cut, result) => Assert.Same(_valueItem2, Assert.Single(result!))) // The payload carries uuid refs, which only exist once the data has transferred. .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), @@ -65,8 +65,8 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail(UuidRef(interop, cut, 0), UuidRef(interop, cut, 0))), assert: (cut, args) => { - Assert.Same(_valueItem1, Assert.Single(args!.Detail!.NewValue)); - Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); + Assert.Same(_valueItem1, Assert.Single(args!.Detail!.NewValue!)); + Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); Assert.Equal(ComboChangeType.Selection, args.Detail.ChangeType); }) .Event(c => c.Change, @@ -76,8 +76,8 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail("", UuidRef(interop, cut, 0), "deselection")), assert: (cut, args) => { - Assert.Empty(args!.Detail!.NewValue); - Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); + Assert.Empty(args!.Detail!.NewValue!); + Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); // TODO: wire detail carries kind as "type", but FromEventJson reads "changeType", so // Detail.ChangeType never decodes and stays default (wrong for deselection events): // Assert.Equal(ComboChangeType.Deselection, args.Detail.ChangeType); @@ -306,11 +306,11 @@ public class ComboValueKeyTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => ComboTests.ChangeDetail("2", ComboTests.UuidRef(interop, cut, 1))), assert: (cut, args) => { - Assert.Equal(2.0, Assert.Single(args!.Detail!.NewValue)); // numbers decode as double - Assert.Same(_item2, Assert.Single(args.Detail.Items)); + Assert.Equal(2.0, Assert.Single(args!.Detail!.NewValue!)); // numbers decode as double + Assert.Same(_item2, Assert.Single(args.Detail.Items!)); // Two-way Value propagation through the generated wrapper works when T // matches the key value type. - Assert.Equal(2.0, Assert.Single(cut.Instance.Value)); + Assert.Equal(2.0, Assert.Single(cut.Instance.Value!)); }) // A value-type value array (double[] here) crosses as plain JSON numbers — the keys // themselves, no data-source refs, since a keyed combo's value is the key. diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index 1a526ff7..b781d287 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -45,7 +45,7 @@ public class SelectTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-group:nth-of-type(1)")}}}"}]""")), assert: (cut, result) => { - Assert.Single(result); + Assert.Single(result!); // TODO: IgbSelectGroup never registers with Select's FindByName (no cascading-value // partial the way SelectItem has one), so the ref currently resolves to a null // Assert.Same(cut.FindComponents()[0].Instance, result[0]); diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index a5c4c5ff..b0377715 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -228,7 +228,7 @@ public class TreeItemTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array("""[{"refType": "name", "id": "mainControl"}]""")), assert: (cut, result) => { - Assert.Single(result); + Assert.Single(result!); Assert.Same(cut.Instance, result[0]); }) .Getter(c => c.GetPathAsync(), c => c.GetPath(), "Path", From c69deca829f3cd5ba9e61b6d80a2e462829e1dbb Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 11:41:09 +0300 Subject: [PATCH 09/64] Adding null-forgiving operators where possible. --- src/componentsBase/BaseCollection.cs | 4 +- src/componentsBase/BaseRendererElement.cs | 66 +++++++------- src/componentsBase/CollectionAdapter.cs | 2 +- src/componentsBase/DataAdapters.cs | 2 +- src/componentsBase/JsonDataSource.cs | 2 +- src/componentsBase/JsonDataSourceSchema.cs | 2 +- src/componentsBase/UnmarshalledDataSource.cs | 86 +++++++++---------- src/componentsBase/WebViewCallback.cs | 4 +- tests/IgniteUI.Blazor.Tests/CalendarTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/DropdownTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/StepperTests.cs | 2 +- .../IgniteUI.Blazor.Tests/TileManagerTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 4 +- 14 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 5f27bdea..11016ac3 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -147,11 +147,11 @@ public void Serialize(SerializationContext? context, string? propertyName = null //var vals = new List(); if (propertyName != null) { - context.Writer.WriteStartArray(propertyName); + context!.Writer.WriteStartArray(propertyName); } else { - context.Writer.WriteStartArray(); + context!.Writer.WriteStartArray(); } for (var i = 0; i < Count; i++) { diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 0605884f..4f56b1d9 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -589,7 +589,7 @@ internal T ReturnToObject(Object val, string? typeGuess) } else { - return ((BaseRendererControl)CurrParent).ReturnToObject(val, typeGuess); + return ((BaseRendererControl)CurrParent!).ReturnToObject(val, typeGuess); } } @@ -602,7 +602,7 @@ internal int ReturnToInt(Object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToInt(val); + return ((BaseRendererControl)CurrParent!).ReturnToInt(val); } } @@ -615,7 +615,7 @@ internal double ReturnToDouble(Object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToDouble(val); + return ((BaseRendererControl)CurrParent!).ReturnToDouble(val); } } @@ -628,7 +628,7 @@ internal long ReturnToLong(Object val) } else { - return ((BaseRendererControl)CurrParent).ReturnToLong(val); + return ((BaseRendererControl)CurrParent!).ReturnToLong(val); } } @@ -641,7 +641,7 @@ internal DateTime ReturnToDate(Object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToDate(val); + return ((BaseRendererControl)CurrParent!).ReturnToDate(val); } } @@ -654,7 +654,7 @@ internal DateTime ReturnToDate(Object? val) } else { - return ((BaseRendererControl)CurrParent).ComponentToJson(val, index); + return ((BaseRendererControl)CurrParent!).ComponentToJson(val, index); } } @@ -667,7 +667,7 @@ internal string DateToString(DateTime val) } else { - return ((BaseRendererControl)CurrParent).DateToString(val); + return ((BaseRendererControl)CurrParent!).DateToString(val); } } @@ -680,7 +680,7 @@ internal string BooleanToString(bool val) } else { - return ((BaseRendererControl)CurrParent).BooleanToString(val); + return ((BaseRendererControl)CurrParent!).BooleanToString(val); } } @@ -693,7 +693,7 @@ internal string BooleanToString(bool val) } else { - return ((BaseRendererControl)CurrParent).EnumToString(val); + return ((BaseRendererControl)CurrParent!).EnumToString(val); } } @@ -706,7 +706,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).StringToEnum(val); + return ((BaseRendererControl)CurrParent!).StringToEnum(val); } } @@ -719,7 +719,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ObjectArrayToParam(arr); + return ((BaseRendererControl)CurrParent!).ObjectArrayToParam(arr); } } @@ -732,7 +732,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val); + return ((BaseRendererControl)CurrParent!).ReturnToObjectArray(val); } } @@ -749,7 +749,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val, typeGuess); + return ((BaseRendererControl)CurrParent!).ReturnToObjectArray(val, typeGuess); } } @@ -762,7 +762,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ReturnToStringArray(val); + return ((BaseRendererControl)CurrParent!).ReturnToStringArray(val); } } @@ -775,7 +775,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ReturnToIntArray(val); + return ((BaseRendererControl)CurrParent!).ReturnToIntArray(val); } } @@ -788,7 +788,7 @@ internal T StringToEnum(Object? val) where T : struct } else { - return ((BaseRendererControl)CurrParent).ReturnToDoubleArray(val); + return ((BaseRendererControl)CurrParent!).ReturnToDoubleArray(val); } } @@ -801,7 +801,7 @@ internal string ObjectToParam(object? val) } else { - return ((BaseRendererControl)CurrParent).ObjectToParam(val); + return ((BaseRendererControl)CurrParent!).ObjectToParam(val); } } @@ -814,7 +814,7 @@ internal string ObjectToParam(object? val, Type type) } else { - return ((BaseRendererControl)CurrParent).ObjectToParam(val, type); + return ((BaseRendererControl)CurrParent!).ObjectToParam(val, type); } } @@ -827,7 +827,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object? } else { - ((BaseRendererControl)CurrParent).ObjectToParam(c, propertyName, val); + ((BaseRendererControl)CurrParent!).ObjectToParam(c, propertyName, val); } } @@ -840,7 +840,7 @@ internal void ObjectToParam(SerializationContext? c, object? val) } else { - ((BaseRendererControl)CurrParent).ObjectToParam(c, val); + ((BaseRendererControl)CurrParent!).ObjectToParam(c, val); } } @@ -853,7 +853,7 @@ internal void ObjectToParam(SerializationContext? c, object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToString(val); + return ((BaseRendererControl)CurrParent!).ReturnToString(val); } } @@ -866,7 +866,7 @@ internal bool ReturnToBoolean(object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToBoolean(val); + return ((BaseRendererControl)CurrParent!).ReturnToBoolean(val); } } @@ -879,7 +879,7 @@ internal bool ReturnToBoolean(object? val) } else { - return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); + return ((BaseRendererControl)CurrParent!).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } } @@ -892,7 +892,7 @@ internal bool ReturnToBoolean(object? val) } else { - return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); + return ((BaseRendererControl)CurrParent!).ReturnToPrimitive(val); } } @@ -905,7 +905,7 @@ internal bool ReturnToBoolean(object? val) } else { - return ((BaseRendererControl)CurrParent).DowncastArray(val); + return ((BaseRendererControl)CurrParent!).DowncastArray(val); } } @@ -921,7 +921,7 @@ internal bool ReturnToBoolean(object? val) } else { - ((BaseRendererControl)CurrParent).SetHandler(name, propertyName, handler, onArgs); + ((BaseRendererControl)CurrParent!).SetHandler(name, propertyName, handler, onArgs); } }; @@ -943,7 +943,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac } else { - ((BaseRendererControl)CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); + ((BaseRendererControl)CurrParent!).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; @@ -965,7 +965,7 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac } else { - ((BaseRendererControl)CurrParent).SetActionHandler(name, propertyName, handler, onArgs); + ((BaseRendererControl)CurrParent!).SetActionHandler(name, propertyName, handler, onArgs); } }; @@ -988,7 +988,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } else { - ((BaseRendererControl)CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); + ((BaseRendererControl)CurrParent!).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; @@ -1009,7 +1009,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } else { - return ((BaseRendererControl)CurrParent).StringToString(val); + return ((BaseRendererControl)CurrParent!).StringToString(val); } } @@ -1022,7 +1022,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } else { - return ((BaseRendererControl)CurrParent).StringArrayToString(val); + return ((BaseRendererControl)CurrParent!).StringArrayToString(val); } } @@ -1035,7 +1035,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } else { - return ((BaseRendererControl)CurrParent).IntArrayToString(val); + return ((BaseRendererControl)CurrParent!).IntArrayToString(val); } } @@ -1048,7 +1048,7 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action } else { - return ((BaseRendererControl)CurrParent).DoubleArrayToString(val); + return ((BaseRendererControl)CurrParent!).DoubleArrayToString(val); } } diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 27dff9a8..1f00e42c 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -197,7 +197,7 @@ private void SyncItems() } } } - for (var i = this._query.Count - 1; i >= 0; i--) + for (var i = this._query!.Count - 1; i >= 0; i--) { item = queryArray[i]; if (item == null) diff --git a/src/componentsBase/DataAdapters.cs b/src/componentsBase/DataAdapters.cs index 13ac3c75..4a466f97 100644 --- a/src/componentsBase/DataAdapters.cs +++ b/src/componentsBase/DataAdapters.cs @@ -17,7 +17,7 @@ public LocalJson(string json) internal string ToRef() { - return "localJson:::" + Json.Replace("\\", "\\\\").Replace("\"", "\\\""); + return "localJson:::" + Json!.Replace("\\", "\\\\").Replace("\"", "\\\""); } } diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index a1a0156f..06bb143f 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -271,7 +271,7 @@ public Guid IdFromOriginal(object item) { return Guid.Empty; } - return itm.Id; + return itm!.Id; } public IJSDataSourceItem? FromOriginal(object item) diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 4d9b663a..6c7fb451 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -591,7 +591,7 @@ public JSDataSourceSchemaType ResolveSchemaType(Type? type) { return JSDataSourceSchemaType.DateTimeValue; } - if (type.IsEnum) + if (type!.IsEnum) { var underlyingType = Enum.GetUnderlyingType(type); return ResolveSchemaType(underlyingType); diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 8a5eea20..d9c71214 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -150,7 +150,7 @@ public UnmarshalledDataSource() return null; } - if (schema.IsDataSource) + if (schema!.IsDataSource) { if (columns == null) { @@ -187,7 +187,7 @@ public UnmarshalledDataSource() columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema!.FieldNames![j], schema!.TypedFieldGetters![j], schema!.FieldGetters![j], false, schema!.FieldTypes![j], oldValue, newValue); } } - if (schema.IsPrimitive) + if (schema!.IsPrimitive) { columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___primitiveValueCollection", null, null, false, schema.PrimitiveType, oldValue, newValue); return columns; @@ -295,27 +295,27 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN floatingPointGetter = doubleGetter; break; case JSDataSourceSchemaType.SingleValue: - singleGetter = (Func)valueGetter; - floatingPointGetter = (o) => (double)singleGetter(o); + singleGetter = (Func)valueGetter!; + floatingPointGetter = (o) => (double)singleGetter!(o); break; case JSDataSourceSchemaType.BooleanValue: - boolGetter = (Func)valueGetter; - integerGetter = (o) => boolGetter(o) ? 1 : 0; + boolGetter = (Func)valueGetter!; + integerGetter = (o) => boolGetter!(o) ? 1 : 0; break; case JSDataSourceSchemaType.ByteValue: - byteGetter = (Func)valueGetter; - integerGetter = (o) => (int)byteGetter(o); + byteGetter = (Func)valueGetter!; + integerGetter = (o) => (int)byteGetter!(o); break; case JSDataSourceSchemaType.DecimalValue: - decimalGetter = (Func)valueGetter; - floatingPointGetter = (o) => (double)decimalGetter(o); + decimalGetter = (Func)valueGetter!; + floatingPointGetter = (o) => (double)decimalGetter!(o); break; case JSDataSourceSchemaType.IntValue: - integerGetter = (Func)valueGetter; + integerGetter = (Func)valueGetter!; break; case JSDataSourceSchemaType.ShortValue: - shortGetter = (Func)valueGetter; - integerGetter = (o) => (int)shortGetter(o); + shortGetter = (Func)valueGetter!; + integerGetter = (o) => (int)shortGetter!(o); break; case JSDataSourceSchemaType.LongValue: longGetter = (Func)valueGetter; @@ -323,25 +323,25 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.StringValue: if (isIDColumn) { - idGetter = (Func)valueGetter; - stringGetter = (o) => idGetter(o).ToString(); + idGetter = (Func)valueGetter!; + stringGetter = (o) => idGetter!(o).ToString(); } else { - stringGetter = (Func)valueGetter; + stringGetter = (Func)valueGetter!; } break; case JSDataSourceSchemaType.CalendarValue: case JSDataSourceSchemaType.DateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) { dateTimeGetter = (Func)valueGetter; - stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + stringGetter = (o) => ((DateTime)dateTimeGetter!(o)).ToString("o"); } else { - dateTimeGetter = (o) => (DateTime)untypedGetter(o); - stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + dateTimeGetter = (o) => (DateTime)untypedGetter!(o); + stringGetter = (o) => ((DateTime)dateTimeGetter!(o)).ToString("o"); } break; case JSDataSourceSchemaType.ObjectValue: @@ -367,51 +367,51 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN nullableFloatingPointGetter = nullableDoubleGetter; break; case JSDataSourceSchemaType.NullableSingleValue: - nullableSingleGetter = (Func)valueGetter; - nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter(o); + nullableSingleGetter = (Func)valueGetter!; + nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter!(o); break; case JSDataSourceSchemaType.NullableBooleanValue: - nullableBoolGetter = (Func)valueGetter; + nullableBoolGetter = (Func)valueGetter!; nullableIntegerGetter = (o) => { - var val = nullableBoolGetter(o); + var val = nullableBoolGetter!(o); int? t = 1; int? f = 0; return val == null ? null : (val == true) ? t : f; }; break; case JSDataSourceSchemaType.NullableByteValue: - nullableByteGetter = (Func)valueGetter; - nullableIntegerGetter = (o) => (int?)nullableByteGetter(o); + nullableByteGetter = (Func)valueGetter!; + nullableIntegerGetter = (o) => (int?)nullableByteGetter!(o); break; case JSDataSourceSchemaType.NullableDecimalValue: - nullableDecimalGetter = (Func)valueGetter; - nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter(o); + nullableDecimalGetter = (Func)valueGetter!; + nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter!(o); break; case JSDataSourceSchemaType.NullableIntValue: - nullableIntegerGetter = (Func)valueGetter; + nullableIntegerGetter = (Func)valueGetter!; break; case JSDataSourceSchemaType.NullableShortValue: - nullableShortGetter = (Func)valueGetter; - nullableIntegerGetter = (o) => (int?)nullableShortGetter(o); + nullableShortGetter = (Func)valueGetter!; + nullableIntegerGetter = (o) => (int?)nullableShortGetter!(o); break; case JSDataSourceSchemaType.NullableLongValue: nullableLongGetter = (Func)valueGetter; break; case JSDataSourceSchemaType.NullableCalendarValue: case JSDataSourceSchemaType.NullableDateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) { nullableDateTimeGetter = (Func)valueGetter; stringGetter = (o) => { - var val = nullableDateTimeGetter(o); + var val = nullableDateTimeGetter!(o); return val == null ? null! : val.Value.ToString("o"); }; } else { - nullableDateTimeGetter = (o) => (DateTime?)untypedGetter(o); + nullableDateTimeGetter = (o) => (DateTime?)untypedGetter!(o); stringGetter = (o) => { var val = nullableDateTimeGetter(o); @@ -698,7 +698,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema.IsDataSource && !column.IsSubDataSource) + if (subSchema!.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; @@ -784,7 +784,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema.IsDataSource && !column.IsSubDataSource) + if (subSchema!.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; @@ -803,8 +803,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN UnmarshalledColumn?[]? cols = null; if (objVal != null) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - var subcols = sub.GetColumns(""); + var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; + var subcols = sub!.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; @@ -1045,7 +1045,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema.IsDataSource && !column.IsSubDataSource) + if (subSchema!.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; @@ -1062,8 +1062,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN UnmarshalledColumn?[]? cols = null; if (objVal != null) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - cols = sub.GetColumns(""); + var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; + cols = sub!.GetColumns(""); } column!.SubDataSourceValues![index] = cols; } @@ -1111,7 +1111,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - var subcols = sub.GetColumns(""); + var subcols = sub!.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; @@ -2421,7 +2421,7 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) { - if (itemType.IsArray) + if (itemType!.IsArray) { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; diff --git a/src/componentsBase/WebViewCallback.cs b/src/componentsBase/WebViewCallback.cs index a48c2f62..90a50801 100644 --- a/src/componentsBase/WebViewCallback.cs +++ b/src/componentsBase/WebViewCallback.cs @@ -135,7 +135,7 @@ public void AdjustDynamicContentBatch(string containerId, string batch) if (control != null) { var arr = control.DeserializeDictionaryArray(batch); - for (var i = 0; i < arr.Length; i++) + for (var i = 0; i < arr!.Length; i++) { var item = arr[i]; string? currContainer = item.ContainsKey("containerId") ? item["containerId"].ToString() : null; @@ -149,7 +149,7 @@ public void AdjustDynamicContentBatch(string containerId, string batch) { var currControl = GetControl(currContainer); //Console.WriteLine("found target"); - currControl.AdjustDynamicContent(containerId, contentType, templateId, contentId, actionType, args); + currControl!.AdjustDynamicContent(containerId, contentType, templateId, contentId, actionType, args); } } control.RefreshDynamicContent(); diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index f0eb3b45..c5d16df4 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -14,7 +14,7 @@ public class CalendarTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array("""["2026-01-02T03:04:05.000Z", "2026-03-16T12:30:00.000Z"]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), result[0].ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 16, 12, 30, 0, DateTimeKind.Utc), result[1].ToUniversalTime()); }) diff --git a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs index ce8a7ae1..8f6bc61d 100644 --- a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs @@ -99,7 +99,7 @@ sealed class Anchor returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) @@ -108,7 +108,7 @@ sealed class Anchor returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-group:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-group:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); // TODO: unlike IgbDropdownItem (registers via the "DropdownParent" CascadingParameter, // resolved through IgbDropdown.ContentItems), IgbDropdownGroup carries no CascadingParameter // and there's no FindByNameDropdownGroup impl., so the refs currently resolve to null elements; diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index b781d287..464dc0d1 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -36,7 +36,7 @@ public class SelectTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-item:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-item:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) diff --git a/tests/IgniteUI.Blazor.Tests/StepperTests.cs b/tests/IgniteUI.Blazor.Tests/StepperTests.cs index 635cc264..bdd1f772 100644 --- a/tests/IgniteUI.Blazor.Tests/StepperTests.cs +++ b/tests/IgniteUI.Blazor.Tests/StepperTests.cs @@ -28,7 +28,7 @@ public class StepperTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-step:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-step:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); // TODO: IgbStep has no CascadingParameter registration and no FindByNameStepper impl // so the refs currently resolve to null elements }) diff --git a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs index 92a971af..3acf17a7 100644 --- a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs @@ -27,7 +27,7 @@ public class TileManagerTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index b0377715..8b11bc08 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -229,7 +229,7 @@ public class TreeItemTests : ComponentWithContractTestBase assert: (cut, result) => { Assert.Single(result!); - Assert.Same(cut.Instance, result[0]); + Assert.Same(cut.Instance, result![0]); }) .Getter(c => c.GetPathAsync(), c => c.GetPath(), "Path", host: treeHost, @@ -237,7 +237,7 @@ public class TreeItemTests : ComponentWithContractTestBase returns: FromRender.Of((interop, h) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(h, "igc-tree-item")}}}"}, {"refType": "name", "id": "mainControl"}]""")), assert: (h, result) => { - Assert.Equal(2, result.Length); + Assert.Equal(2, result!.Length); Assert.Same(h.FindComponents()[1].Instance, result[1]); // TODO: the ancestor ref only resolves through FindByName on the item // itself, which matches nothing but "mainControl" — the parent element From 825c5a98140d4cb59fb597bcab3b19f97c5ac498 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 12:20:57 +0300 Subject: [PATCH 10/64] Fix CS8769 - set nullable object params so they match props. --- src/components/Blazor/Accordion.cs | 8 +-- src/components/Blazor/Banner.cs | 4 +- src/components/Blazor/ButtonBase.cs | 4 +- src/components/Blazor/ButtonGroup.cs | 4 +- src/components/Blazor/Calendar.cs | 2 +- src/components/Blazor/Carousel.cs | 6 +- src/components/Blazor/Chat.cs | 14 ++--- src/components/Blazor/ChatRenderers.cs | 56 +++++++++---------- src/components/Blazor/CheckboxBase.cs | 6 +- src/components/Blazor/Chip.cs | 4 +- src/components/Blazor/Combo.cs | 26 ++++----- .../Blazor/ComboChangeEventArgsDetail.cs | 8 +-- src/components/Blazor/DatePicker.cs | 12 ++-- src/components/Blazor/DateRangePicker.cs | 12 ++-- src/components/Blazor/DateTimeInput.cs | 8 +-- src/components/Blazor/Dialog.cs | 4 +- src/components/Blazor/Dropdown.cs | 10 ++-- src/components/Blazor/ExpansionPanel.cs | 8 +-- src/components/Blazor/Input.cs | 2 +- src/components/Blazor/InputBase.cs | 6 +- src/components/Blazor/MaskInput.cs | 2 +- src/components/Blazor/NavDrawer.cs | 4 +- src/components/Blazor/Radio.cs | 6 +- src/components/Blazor/RadioGroup.cs | 2 +- src/components/Blazor/RangeSlider.cs | 4 +- src/components/Blazor/Rating.cs | 4 +- src/components/Blazor/Select.cs | 14 ++--- src/components/Blazor/Slider.cs | 4 +- src/components/Blazor/Snackbar.cs | 2 +- src/components/Blazor/Splitter.cs | 6 +- src/components/Blazor/Stepper.cs | 4 +- src/components/Blazor/Tabs.cs | 2 +- src/components/Blazor/Textarea.cs | 8 +-- src/components/Blazor/Tile.cs | 16 +++--- src/components/Blazor/TileManager.cs | 16 +++--- src/components/Blazor/Tooltip.cs | 8 +-- src/components/Blazor/Tree.cs | 12 ++-- src/componentsBase/CollectionAdapter.cs | 2 +- src/componentsBase/JsonDataSource.cs | 2 +- src/componentsBase/UnmarshalledDataSource.cs | 2 +- 40 files changed, 162 insertions(+), 162 deletions(-) diff --git a/src/components/Blazor/Accordion.cs b/src/components/Blazor/Accordion.cs index ea7148fa..5e07769a 100644 --- a/src/components/Blazor/Accordion.cs +++ b/src/components/Blazor/Accordion.cs @@ -156,7 +156,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -228,7 +228,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -300,7 +300,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -372,7 +372,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Banner.cs b/src/components/Blazor/Banner.cs index b252ed49..3afa9923 100644 --- a/src/components/Blazor/Banner.cs +++ b/src/components/Blazor/Banner.cs @@ -176,7 +176,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -248,7 +248,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index 89f1b261..d130deaa 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -313,7 +313,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -385,7 +385,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index 10089d74..9415a793 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -164,7 +164,7 @@ public string? SelectScript if (value != this._selectScript) { this._selectScript = value; - this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Select", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._selectRef = refName; this.MarkPropDirty("SelectRef"); @@ -236,7 +236,7 @@ public string? DeselectScript if (value != this._deselectScript) { this._deselectScript = value; - this.OnRefChanged("Deselect", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Deselect", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._deselectRef = refName; this.MarkPropDirty("DeselectRef"); diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index e05c1648..30004f66 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -360,7 +360,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 8bab66be..8b23eea0 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -473,7 +473,7 @@ public string? SlideChangedScript if (value != this._slideChangedScript) { this._slideChangedScript = value; - this.OnRefChanged("SlideChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("SlideChanged", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._slideChangedRef = refName; this.MarkPropDirty("SlideChangedRef"); @@ -545,7 +545,7 @@ public string? PlayingScript if (value != this._playingScript) { this._playingScript = value; - this.OnRefChanged("Playing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Playing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._playingRef = refName; this.MarkPropDirty("PlayingRef"); @@ -617,7 +617,7 @@ public string? PausedScript if (value != this._pausedScript) { this._pausedScript = value; - this.OnRefChanged("Paused", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Paused", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._pausedRef = refName; this.MarkPropDirty("PausedRef"); diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index a24e5a1c..80ac99d9 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -166,7 +166,7 @@ public string? MessageCreatedScript if (value != this._messageCreatedScript) { this._messageCreatedScript = value; - this.OnRefChanged("MessageCreated", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("MessageCreated", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._messageCreatedRef = refName; this.MarkPropDirty("MessageCreatedRef"); @@ -238,7 +238,7 @@ public string? MessageReactScript if (value != this._messageReactScript) { this._messageReactScript = value; - this.OnRefChanged("MessageReact", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("MessageReact", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._messageReactRef = refName; this.MarkPropDirty("MessageReactRef"); @@ -310,7 +310,7 @@ public string? AttachmentClickScript if (value != this._attachmentClickScript) { this._attachmentClickScript = value; - this.OnRefChanged("AttachmentClick", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("AttachmentClick", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._attachmentClickRef = refName; this.MarkPropDirty("AttachmentClickRef"); @@ -382,7 +382,7 @@ public string? TypingChangeScript if (value != this._typingChangeScript) { this._typingChangeScript = value; - this.OnRefChanged("TypingChange", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TypingChange", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._typingChangeRef = refName; this.MarkPropDirty("TypingChangeRef"); @@ -454,7 +454,7 @@ public string? InputFocusScript if (value != this._inputFocusScript) { this._inputFocusScript = value; - this.OnRefChanged("InputFocus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("InputFocus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputFocusRef = refName; this.MarkPropDirty("InputFocusRef"); @@ -526,7 +526,7 @@ public string? InputBlurScript if (value != this._inputBlurScript) { this._inputBlurScript = value; - this.OnRefChanged("InputBlur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("InputBlur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputBlurRef = refName; this.MarkPropDirty("InputBlurRef"); @@ -598,7 +598,7 @@ public string? InputChangeScript if (value != this._inputChangeScript) { this._inputChangeScript = value; - this.OnRefChanged("InputChange", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("InputChange", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputChangeRef = refName; this.MarkPropDirty("InputChangeRef"); diff --git a/src/components/Blazor/ChatRenderers.cs b/src/components/Blazor/ChatRenderers.cs index 7b2efa1f..cb4348b5 100644 --- a/src/components/Blazor/ChatRenderers.cs +++ b/src/components/Blazor/ChatRenderers.cs @@ -27,7 +27,7 @@ public RenderFragment? Attachment this._attachment = value; this._attachmentTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._attachmentTemplateId, this._attachment, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("Attachment", null, "template:::" + this._attachmentTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Attachment", null, "template:::" + this._attachmentTemplateId, true, false, (string refName, object? old, object? newValue) => { this._attachmentRef = refName; this.MarkPropDirty("AttachmentRef"); @@ -58,7 +58,7 @@ public string? AttachmentScript { this._attachmentScript = value; MarkPropDirty("Attachment"); - this.OnRefChanged("Attachment", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Attachment", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._attachmentRef = refName; this.MarkPropDirty("AttachmentRef"); @@ -86,7 +86,7 @@ public RenderFragment? AttachmentContent this._attachmentContent = value; this._attachmentContentTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._attachmentContentTemplateId, this._attachmentContent, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("AttachmentContent", null, "template:::" + this._attachmentContentTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("AttachmentContent", null, "template:::" + this._attachmentContentTemplateId, true, false, (string refName, object? old, object? newValue) => { this._attachmentContentRef = refName; this.MarkPropDirty("AttachmentContentRef"); @@ -117,7 +117,7 @@ public string? AttachmentContentScript { this._attachmentContentScript = value; MarkPropDirty("AttachmentContent"); - this.OnRefChanged("AttachmentContent", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("AttachmentContent", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._attachmentContentRef = refName; this.MarkPropDirty("AttachmentContentRef"); @@ -145,7 +145,7 @@ public RenderFragment? AttachmentHeader this._attachmentHeader = value; this._attachmentHeaderTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._attachmentHeaderTemplateId, this._attachmentHeader, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("AttachmentHeader", null, "template:::" + this._attachmentHeaderTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("AttachmentHeader", null, "template:::" + this._attachmentHeaderTemplateId, true, false, (string refName, object? old, object? newValue) => { this._attachmentHeaderRef = refName; this.MarkPropDirty("AttachmentHeaderRef"); @@ -176,7 +176,7 @@ public string? AttachmentHeaderScript { this._attachmentHeaderScript = value; MarkPropDirty("AttachmentHeader"); - this.OnRefChanged("AttachmentHeader", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("AttachmentHeader", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._attachmentHeaderRef = refName; this.MarkPropDirty("AttachmentHeaderRef"); @@ -204,7 +204,7 @@ public RenderFragment? Input this._input = value; this._inputTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._inputTemplateId, this._input, typeof(IgbChatInputRenderContext)); - this.OnRefChanged("Input", null, "template:::" + this._inputTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Input", null, "template:::" + this._inputTemplateId, true, false, (string refName, object? old, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); @@ -235,7 +235,7 @@ public string? InputScript { this._inputScript = value; MarkPropDirty("Input"); - this.OnRefChanged("Input", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Input", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); @@ -263,7 +263,7 @@ public RenderFragment? InputActions this._inputActions = value; this._inputActionsTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._inputActionsTemplateId, this._inputActions, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActions", null, "template:::" + this._inputActionsTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActions", null, "template:::" + this._inputActionsTemplateId, true, false, (string refName, object? old, object? newValue) => { this._inputActionsRef = refName; this.MarkPropDirty("InputActionsRef"); @@ -294,7 +294,7 @@ public string? InputActionsScript { this._inputActionsScript = value; MarkPropDirty("InputActions"); - this.OnRefChanged("InputActions", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActions", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._inputActionsRef = refName; this.MarkPropDirty("InputActionsRef"); @@ -322,7 +322,7 @@ public RenderFragment? InputActionsEnd this._inputActionsEnd = value; this._inputActionsEndTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._inputActionsEndTemplateId, this._inputActionsEnd, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActionsEnd", null, "template:::" + this._inputActionsEndTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActionsEnd", null, "template:::" + this._inputActionsEndTemplateId, true, false, (string refName, object? old, object? newValue) => { this._inputActionsEndRef = refName; this.MarkPropDirty("InputActionsEndRef"); @@ -353,7 +353,7 @@ public string? InputActionsEndScript { this._inputActionsEndScript = value; MarkPropDirty("InputActionsEnd"); - this.OnRefChanged("InputActionsEnd", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActionsEnd", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._inputActionsEndRef = refName; this.MarkPropDirty("InputActionsEndRef"); @@ -381,7 +381,7 @@ public RenderFragment? InputActionsStart this._inputActionsStart = value; this._inputActionsStartTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._inputActionsStartTemplateId, this._inputActionsStart, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActionsStart", null, "template:::" + this._inputActionsStartTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActionsStart", null, "template:::" + this._inputActionsStartTemplateId, true, false, (string refName, object? old, object? newValue) => { this._inputActionsStartRef = refName; this.MarkPropDirty("InputActionsStartRef"); @@ -412,7 +412,7 @@ public string? InputActionsStartScript { this._inputActionsStartScript = value; MarkPropDirty("InputActionsStart"); - this.OnRefChanged("InputActionsStart", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("InputActionsStart", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._inputActionsStartRef = refName; this.MarkPropDirty("InputActionsStartRef"); @@ -440,7 +440,7 @@ public RenderFragment? Message this._message = value; this._messageTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._messageTemplateId, this._message, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("Message", null, "template:::" + this._messageTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Message", null, "template:::" + this._messageTemplateId, true, false, (string refName, object? old, object? newValue) => { this._messageRef = refName; this.MarkPropDirty("MessageRef"); @@ -471,7 +471,7 @@ public string? MessageScript { this._messageScript = value; MarkPropDirty("Message"); - this.OnRefChanged("Message", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Message", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._messageRef = refName; this.MarkPropDirty("MessageRef"); @@ -499,7 +499,7 @@ public RenderFragment? MessageActions this._messageActions = value; this._messageActionsTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._messageActionsTemplateId, this._messageActions, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageActions", null, "template:::" + this._messageActionsTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageActions", null, "template:::" + this._messageActionsTemplateId, true, false, (string refName, object? old, object? newValue) => { this._messageActionsRef = refName; this.MarkPropDirty("MessageActionsRef"); @@ -530,7 +530,7 @@ public string? MessageActionsScript { this._messageActionsScript = value; MarkPropDirty("MessageActions"); - this.OnRefChanged("MessageActions", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageActions", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._messageActionsRef = refName; this.MarkPropDirty("MessageActionsRef"); @@ -558,7 +558,7 @@ public RenderFragment? MessageAttachments this._messageAttachments = value; this._messageAttachmentsTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._messageAttachmentsTemplateId, this._messageAttachments, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageAttachments", null, "template:::" + this._messageAttachmentsTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageAttachments", null, "template:::" + this._messageAttachmentsTemplateId, true, false, (string refName, object? old, object? newValue) => { this._messageAttachmentsRef = refName; this.MarkPropDirty("MessageAttachmentsRef"); @@ -589,7 +589,7 @@ public string? MessageAttachmentsScript { this._messageAttachmentsScript = value; MarkPropDirty("MessageAttachments"); - this.OnRefChanged("MessageAttachments", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageAttachments", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._messageAttachmentsRef = refName; this.MarkPropDirty("MessageAttachmentsRef"); @@ -617,7 +617,7 @@ public RenderFragment? MessageContent this._messageContent = value; this._messageContentTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._messageContentTemplateId, this._messageContent, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageContent", null, "template:::" + this._messageContentTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageContent", null, "template:::" + this._messageContentTemplateId, true, false, (string refName, object? old, object? newValue) => { this._messageContentRef = refName; this.MarkPropDirty("MessageContentRef"); @@ -648,7 +648,7 @@ public string? MessageContentScript { this._messageContentScript = value; MarkPropDirty("MessageContent"); - this.OnRefChanged("MessageContent", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageContent", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._messageContentRef = refName; this.MarkPropDirty("MessageContentRef"); @@ -676,7 +676,7 @@ public RenderFragment? MessageHeader this._messageHeader = value; this._messageHeaderTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._messageHeaderTemplateId, this._messageHeader, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageHeader", null, "template:::" + this._messageHeaderTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageHeader", null, "template:::" + this._messageHeaderTemplateId, true, false, (string refName, object? old, object? newValue) => { this._messageHeaderRef = refName; this.MarkPropDirty("MessageHeaderRef"); @@ -707,7 +707,7 @@ public string? MessageHeaderScript { this._messageHeaderScript = value; MarkPropDirty("MessageHeader"); - this.OnRefChanged("MessageHeader", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("MessageHeader", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._messageHeaderRef = refName; this.MarkPropDirty("MessageHeaderRef"); @@ -735,7 +735,7 @@ public RenderFragment? SendButton this._sendButton = value; this._sendButtonTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._sendButtonTemplateId, this._sendButton, typeof(IgbChatRenderContext)); - this.OnRefChanged("SendButton", null, "template:::" + this._sendButtonTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("SendButton", null, "template:::" + this._sendButtonTemplateId, true, false, (string refName, object? old, object? newValue) => { this._sendButtonRef = refName; this.MarkPropDirty("SendButtonRef"); @@ -766,7 +766,7 @@ public string? SendButtonScript { this._sendButtonScript = value; MarkPropDirty("SendButton"); - this.OnRefChanged("SendButton", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("SendButton", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._sendButtonRef = refName; this.MarkPropDirty("SendButtonRef"); @@ -794,7 +794,7 @@ public RenderFragment? SuggestionPrefix this._suggestionPrefix = value; this._suggestionPrefixTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._suggestionPrefixTemplateId, this._suggestionPrefix, typeof(IgbChatRenderContext)); - this.OnRefChanged("SuggestionPrefix", null, "template:::" + this._suggestionPrefixTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("SuggestionPrefix", null, "template:::" + this._suggestionPrefixTemplateId, true, false, (string refName, object? old, object? newValue) => { this._suggestionPrefixRef = refName; this.MarkPropDirty("SuggestionPrefixRef"); @@ -825,7 +825,7 @@ public string? SuggestionPrefixScript { this._suggestionPrefixScript = value; MarkPropDirty("SuggestionPrefix"); - this.OnRefChanged("SuggestionPrefix", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("SuggestionPrefix", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._suggestionPrefixRef = refName; this.MarkPropDirty("SuggestionPrefixRef"); diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 21b4552d..e010dd81 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -352,7 +352,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -459,7 +459,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -531,7 +531,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/Chip.cs b/src/components/Blazor/Chip.cs index fd4c586f..7b92ba6f 100644 --- a/src/components/Blazor/Chip.cs +++ b/src/components/Blazor/Chip.cs @@ -231,7 +231,7 @@ public string? RemoveScript if (value != this._removeScript) { this._removeScript = value; - this.OnRefChanged("Remove", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Remove", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._removeRef = refName; this.MarkPropDirty("RemoveRef"); @@ -303,7 +303,7 @@ public string? SelectScript if (value != this._selectScript) { this._selectScript = value; - this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Select", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._selectRef = refName; this.MarkPropDirty("SelectRef"); diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index d49c2e35..a8acc6b3 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -60,7 +60,7 @@ public Object? Data { MarkPropDirty("Data"); this._data = value; - this.OnRefChanged("Data", oldValue, value, false, false, (string refName, object old, object newValue) => + this.OnRefChanged("Data", oldValue, value, false, false, (string refName, object? old, object? newValue) => { this._dataRef = refName; this.MarkPropDirty("DataRef"); @@ -84,7 +84,7 @@ public string? DataScript { this._dataScript = value; MarkPropDirty("Data"); - this.OnRefChanged("Data", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Data", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._dataRef = refName; this.MarkPropDirty("DataRef"); @@ -541,7 +541,7 @@ public RenderFragment? ItemTemplate this._itemTemplate = value; this._itemTemplateTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._itemTemplateTemplateId, this._itemTemplate, typeof(object)); - this.OnRefChanged("ItemTemplate", null, "template:::" + this._itemTemplateTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("ItemTemplate", null, "template:::" + this._itemTemplateTemplateId, true, false, (string refName, object? old, object? newValue) => { this._itemTemplateRef = refName; this.MarkPropDirty("ItemTemplateRef"); @@ -572,7 +572,7 @@ public string? ItemTemplateScript { this._itemTemplateScript = value; MarkPropDirty("ItemTemplate"); - this.OnRefChanged("ItemTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("ItemTemplate", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._itemTemplateRef = refName; this.MarkPropDirty("ItemTemplateRef"); @@ -600,7 +600,7 @@ public RenderFragment? GroupHeaderTemplate this._groupHeaderTemplate = value; this._groupHeaderTemplateTemplateId = Guid.NewGuid().ToString(); this.UpdateTemplate(this._groupHeaderTemplateTemplateId, this._groupHeaderTemplate, typeof(object)); - this.OnRefChanged("GroupHeaderTemplate", null, "template:::" + this._groupHeaderTemplateTemplateId, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("GroupHeaderTemplate", null, "template:::" + this._groupHeaderTemplateTemplateId, true, false, (string refName, object? old, object? newValue) => { this._groupHeaderTemplateRef = refName; this.MarkPropDirty("GroupHeaderTemplateRef"); @@ -631,7 +631,7 @@ public string? GroupHeaderTemplateScript { this._groupHeaderTemplateScript = value; MarkPropDirty("GroupHeaderTemplate"); - this.OnRefChanged("GroupHeaderTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("GroupHeaderTemplate", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._groupHeaderTemplateRef = refName; this.MarkPropDirty("GroupHeaderTemplateRef"); @@ -822,7 +822,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -929,7 +929,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -1001,7 +1001,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); @@ -1073,7 +1073,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -1145,7 +1145,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -1217,7 +1217,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -1289,7 +1289,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 8fb0e478..1778cbb1 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -25,7 +25,7 @@ public object[]? NewValue { MarkPropDirty("NewValue"); this._newValue = value; - this.OnRefChanged("NewValue", oldValue, value, false, false, (string refName, object old, object newValue) => + this.OnRefChanged("NewValue", oldValue, value, false, false, (string refName, object? old, object? newValue) => { this._newValueRef = refName; this.MarkPropDirty("NewValueRef"); @@ -49,7 +49,7 @@ public string? NewValueScript { this._newValueScript = value; MarkPropDirty("NewValue"); - this.OnRefChanged("NewValue", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("NewValue", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._newValueRef = refName; this.MarkPropDirty("NewValueRef"); @@ -73,7 +73,7 @@ public object[]? Items { MarkPropDirty("Items"); this._items = value; - this.OnRefChanged("Items", oldValue, value, false, false, (string refName, object old, object newValue) => + this.OnRefChanged("Items", oldValue, value, false, false, (string refName, object? old, object? newValue) => { this._itemsRef = refName; this.MarkPropDirty("ItemsRef"); @@ -97,7 +97,7 @@ public string? ItemsScript { this._itemsScript = value; MarkPropDirty("Items"); - this.OnRefChanged("Items", oldValue, value, true, false, (string refName, object old, object newValue) => + this.OnRefChanged("Items", oldValue, value, true, false, (string refName, object? old, object? newValue) => { this._itemsRef = refName; this.MarkPropDirty("ItemsRef"); diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 4a297da2..97893fc8 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -740,7 +740,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -812,7 +812,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -884,7 +884,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -956,7 +956,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); @@ -1028,7 +1028,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -1135,7 +1135,7 @@ public string? InputScript if (value != this._inputScript) { this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Input", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 45e186c4..19072935 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -869,7 +869,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -941,7 +941,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -1013,7 +1013,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -1085,7 +1085,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); @@ -1157,7 +1157,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -1269,7 +1269,7 @@ public string? InputScript if (value != this._inputScript) { this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Input", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index c3d1951b..6ccefece 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -170,7 +170,7 @@ public string? InputOcurredScript if (value != this._inputOcurredScript) { this._inputOcurredScript = value; - this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputOcurredRef = refName; this.MarkPropDirty("InputOcurredRef"); @@ -242,7 +242,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -349,7 +349,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -421,7 +421,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index 08075c25..0cbb6913 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -288,7 +288,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -360,7 +360,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 48db13a3..d1333cc2 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -413,7 +413,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -485,7 +485,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -557,7 +557,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -629,7 +629,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); @@ -701,7 +701,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/ExpansionPanel.cs b/src/components/Blazor/ExpansionPanel.cs index 9042bd16..05d3efe2 100644 --- a/src/components/Blazor/ExpansionPanel.cs +++ b/src/components/Blazor/ExpansionPanel.cs @@ -208,7 +208,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -280,7 +280,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -352,7 +352,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -424,7 +424,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index dc30d32c..148c5969 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -409,7 +409,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index d77db535..b808e101 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -273,7 +273,7 @@ public string? InputOcurredScript if (value != this._inputOcurredScript) { this._inputOcurredScript = value; - this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputOcurredRef = refName; this.MarkPropDirty("InputOcurredRef"); @@ -348,7 +348,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -420,7 +420,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index e115e671..0f5cc43c 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -244,7 +244,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index e007e624..6d6d993a 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -270,7 +270,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -342,7 +342,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index a909916e..e62fe3bf 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -352,7 +352,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -459,7 +459,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -531,7 +531,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 0277074e..86e80b92 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -177,7 +177,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/RangeSlider.cs b/src/components/Blazor/RangeSlider.cs index 028fa2fe..76f2f0c3 100644 --- a/src/components/Blazor/RangeSlider.cs +++ b/src/components/Blazor/RangeSlider.cs @@ -148,7 +148,7 @@ public string? InputScript if (value != this._inputScript) { this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Input", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); @@ -220,7 +220,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index 6b4dbf80..396a9f75 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -438,7 +438,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -545,7 +545,7 @@ public string? HoverScript if (value != this._hoverScript) { this._hoverScript = value; - this.OnRefChanged("Hover", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Hover", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._hoverRef = refName; this.MarkPropDirty("HoverRef"); diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index e235c91e..adc98294 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -572,7 +572,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -679,7 +679,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -751,7 +751,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); @@ -823,7 +823,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -895,7 +895,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -967,7 +967,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -1039,7 +1039,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Slider.cs b/src/components/Blazor/Slider.cs index c1fd411f..c1984144 100644 --- a/src/components/Blazor/Slider.cs +++ b/src/components/Blazor/Slider.cs @@ -249,7 +249,7 @@ public string? InputScript if (value != this._inputScript) { this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Input", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); @@ -321,7 +321,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/Snackbar.cs b/src/components/Blazor/Snackbar.cs index ee8a773b..c24a0f02 100644 --- a/src/components/Blazor/Snackbar.cs +++ b/src/components/Blazor/Snackbar.cs @@ -97,7 +97,7 @@ public string? ActionScript if (value != this._actionScript) { this._actionScript = value; - this.OnRefChanged("Action", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Action", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._actionRef = refName; this.MarkPropDirty("ActionRef"); diff --git a/src/components/Blazor/Splitter.cs b/src/components/Blazor/Splitter.cs index 80ba414d..39bf7ea8 100644 --- a/src/components/Blazor/Splitter.cs +++ b/src/components/Blazor/Splitter.cs @@ -322,7 +322,7 @@ public string? ResizeStartScript if (value != this._resizeStartScript) { this._resizeStartScript = value; - this.OnRefChanged("ResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ResizeStart", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._resizeStartRef = refName; this.MarkPropDirty("ResizeStartRef"); @@ -394,7 +394,7 @@ public string? ResizingScript if (value != this._resizingScript) { this._resizingScript = value; - this.OnRefChanged("Resizing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Resizing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._resizingRef = refName; this.MarkPropDirty("ResizingRef"); @@ -466,7 +466,7 @@ public string? ResizeEndScript if (value != this._resizeEndScript) { this._resizeEndScript = value; - this.OnRefChanged("ResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ResizeEnd", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._resizeEndRef = refName; this.MarkPropDirty("ResizeEndRef"); diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index 865a5c60..859fe15a 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -338,7 +338,7 @@ public string? ActiveStepChangingScript if (value != this._activeStepChangingScript) { this._activeStepChangingScript = value; - this.OnRefChanged("ActiveStepChanging", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ActiveStepChanging", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._activeStepChangingRef = refName; this.MarkPropDirty("ActiveStepChangingRef"); @@ -410,7 +410,7 @@ public string? ActiveStepChangedScript if (value != this._activeStepChangedScript) { this._activeStepChangedScript = value; - this.OnRefChanged("ActiveStepChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ActiveStepChanged", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._activeStepChangedRef = refName; this.MarkPropDirty("ActiveStepChangedRef"); diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index b8110024..fa466c22 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -268,7 +268,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index cf2c1f30..60aa8391 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -567,7 +567,7 @@ public string? InputScript if (value != this._inputScript) { this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Input", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._inputRef = refName; this.MarkPropDirty("InputRef"); @@ -639,7 +639,7 @@ public string? ChangeScript if (value != this._changeScript) { this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Change", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._changeRef = refName; this.MarkPropDirty("ChangeRef"); @@ -746,7 +746,7 @@ public string? FocusScript if (value != this._focusScript) { this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Focus", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._focusRef = refName; this.MarkPropDirty("FocusRef"); @@ -818,7 +818,7 @@ public string? BlurScript if (value != this._blurScript) { this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Blur", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._blurRef = refName; this.MarkPropDirty("BlurRef"); diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index 8a5a564e..50b731b3 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -281,7 +281,7 @@ public string? TileFullscreenScript if (value != this._tileFullscreenScript) { this._tileFullscreenScript = value; - this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileFullscreenRef = refName; this.MarkPropDirty("TileFullscreenRef"); @@ -353,7 +353,7 @@ public string? TileMaximizeScript if (value != this._tileMaximizeScript) { this._tileMaximizeScript = value; - this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileMaximizeRef = refName; this.MarkPropDirty("TileMaximizeRef"); @@ -425,7 +425,7 @@ public string? TileDragStartScript if (value != this._tileDragStartScript) { this._tileDragStartScript = value; - this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragStartRef = refName; this.MarkPropDirty("TileDragStartRef"); @@ -497,7 +497,7 @@ public string? TileDragEndScript if (value != this._tileDragEndScript) { this._tileDragEndScript = value; - this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragEndRef = refName; this.MarkPropDirty("TileDragEndRef"); @@ -569,7 +569,7 @@ public string? TileDragCancelScript if (value != this._tileDragCancelScript) { this._tileDragCancelScript = value; - this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragCancelRef = refName; this.MarkPropDirty("TileDragCancelRef"); @@ -641,7 +641,7 @@ public string? TileResizeStartScript if (value != this._tileResizeStartScript) { this._tileResizeStartScript = value; - this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeStartRef = refName; this.MarkPropDirty("TileResizeStartRef"); @@ -713,7 +713,7 @@ public string? TileResizeEndScript if (value != this._tileResizeEndScript) { this._tileResizeEndScript = value; - this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeEndRef = refName; this.MarkPropDirty("TileResizeEndRef"); @@ -785,7 +785,7 @@ public string? TileResizeCancelScript if (value != this._tileResizeCancelScript) { this._tileResizeCancelScript = value; - this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeCancelRef = refName; this.MarkPropDirty("TileResizeCancelRef"); diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index 6c37a210..a954a03f 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -293,7 +293,7 @@ public string? TileFullscreenScript if (value != this._tileFullscreenScript) { this._tileFullscreenScript = value; - this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileFullscreenRef = refName; this.MarkPropDirty("TileFullscreenRef"); @@ -365,7 +365,7 @@ public string? TileMaximizeScript if (value != this._tileMaximizeScript) { this._tileMaximizeScript = value; - this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileMaximizeRef = refName; this.MarkPropDirty("TileMaximizeRef"); @@ -437,7 +437,7 @@ public string? TileDragStartScript if (value != this._tileDragStartScript) { this._tileDragStartScript = value; - this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragStartRef = refName; this.MarkPropDirty("TileDragStartRef"); @@ -509,7 +509,7 @@ public string? TileDragEndScript if (value != this._tileDragEndScript) { this._tileDragEndScript = value; - this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragEndRef = refName; this.MarkPropDirty("TileDragEndRef"); @@ -581,7 +581,7 @@ public string? TileDragCancelScript if (value != this._tileDragCancelScript) { this._tileDragCancelScript = value; - this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileDragCancelRef = refName; this.MarkPropDirty("TileDragCancelRef"); @@ -653,7 +653,7 @@ public string? TileResizeStartScript if (value != this._tileResizeStartScript) { this._tileResizeStartScript = value; - this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeStartRef = refName; this.MarkPropDirty("TileResizeStartRef"); @@ -725,7 +725,7 @@ public string? TileResizeEndScript if (value != this._tileResizeEndScript) { this._tileResizeEndScript = value; - this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeEndRef = refName; this.MarkPropDirty("TileResizeEndRef"); @@ -797,7 +797,7 @@ public string? TileResizeCancelScript if (value != this._tileResizeCancelScript) { this._tileResizeCancelScript = value; - this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._tileResizeCancelRef = refName; this.MarkPropDirty("TileResizeCancelRef"); diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index 70beaec2..a9b16569 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -353,7 +353,7 @@ public string? OpeningScript if (value != this._openingScript) { this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opening", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openingRef = refName; this.MarkPropDirty("OpeningRef"); @@ -425,7 +425,7 @@ public string? OpenedScript if (value != this._openedScript) { this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Opened", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._openedRef = refName; this.MarkPropDirty("OpenedRef"); @@ -497,7 +497,7 @@ public string? ClosingScript if (value != this._closingScript) { this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closingRef = refName; this.MarkPropDirty("ClosingRef"); @@ -569,7 +569,7 @@ public string? ClosedScript if (value != this._closedScript) { this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("Closed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._closedRef = refName; this.MarkPropDirty("ClosedRef"); diff --git a/src/components/Blazor/Tree.cs b/src/components/Blazor/Tree.cs index 9c342b6e..6797b8cf 100644 --- a/src/components/Blazor/Tree.cs +++ b/src/components/Blazor/Tree.cs @@ -173,7 +173,7 @@ public string? SelectionChangedScript if (value != this._selectionChangedScript) { this._selectionChangedScript = value; - this.OnRefChanged("SelectionChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("SelectionChanged", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._selectionChangedRef = refName; this.MarkPropDirty("SelectionChangedRef"); @@ -245,7 +245,7 @@ public string? ItemExpandingScript if (value != this._itemExpandingScript) { this._itemExpandingScript = value; - this.OnRefChanged("ItemExpanding", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ItemExpanding", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._itemExpandingRef = refName; this.MarkPropDirty("ItemExpandingRef"); @@ -317,7 +317,7 @@ public string? ItemExpandedScript if (value != this._itemExpandedScript) { this._itemExpandedScript = value; - this.OnRefChanged("ItemExpanded", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ItemExpanded", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._itemExpandedRef = refName; this.MarkPropDirty("ItemExpandedRef"); @@ -389,7 +389,7 @@ public string? ItemCollapsingScript if (value != this._itemCollapsingScript) { this._itemCollapsingScript = value; - this.OnRefChanged("ItemCollapsing", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ItemCollapsing", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._itemCollapsingRef = refName; this.MarkPropDirty("ItemCollapsingRef"); @@ -461,7 +461,7 @@ public string? ItemCollapsedScript if (value != this._itemCollapsedScript) { this._itemCollapsedScript = value; - this.OnRefChanged("ItemCollapsed", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ItemCollapsed", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._itemCollapsedRef = refName; this.MarkPropDirty("ItemCollapsedRef"); @@ -533,7 +533,7 @@ public string? ActiveItemScript if (value != this._activeItemScript) { this._activeItemScript = value; - this.OnRefChanged("ActiveItem", null, value, true, false, (string refName, object oldValue, object newValue) => + this.OnRefChanged("ActiveItem", null, value, true, false, (string refName, object? oldValue, object? newValue) => { this._activeItemRef = refName; this.MarkPropDirty("ActiveItemRef"); diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 1f00e42c..013f38b5 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -80,7 +80,7 @@ public void UpdateTarget(IList target) _target = target; } - private void OnManualChanged(object sender, NotifyCollectionChangedEventArgs args) + private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs args) { switch (args.Action) { diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 06bb143f..8ad80d87 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -109,7 +109,7 @@ private void Listen(object data) } } - private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { if (SuppressModifications) { diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index d9c71214..43318c16 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -1921,7 +1921,7 @@ private void Listen(object data) } } - private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { if (SuppressModifications) { From 5f5895256ae5490f7755bfd6651867acdf8e068c Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 14:14:10 +0300 Subject: [PATCH 11/64] Fix casting to nullable types. --- .../Blazor/ActiveStepChangedEventArgs.cs | 2 +- .../Blazor/ActiveStepChangingEventArgs.cs | 2 +- src/components/Blazor/Calendar.cs | 2 +- .../Blazor/ChatMessageAttachmentEventArgs.cs | 2 +- src/components/Blazor/ChatMessageEventArgs.cs | 2 +- src/components/Blazor/ChatMessageReaction.cs | 2 +- .../Blazor/ChatMessageReactionEventArgs.cs | 2 +- .../Blazor/CheckboxChangeEventArgs.cs | 2 +- src/components/Blazor/Combo.cs | 2 +- src/components/Blazor/ComboChangeEventArgs.cs | 2 +- .../Blazor/DateRangeValueEventArgs.cs | 2 +- .../Blazor/DropdownItemComponentEventArgs.cs | 2 +- .../ExpansionPanelComponentEventArgs.cs | 2 +- src/components/Blazor/RadioChangeEventArgs.cs | 2 +- .../Blazor/RangeSliderValueEventArgs.cs | 2 +- .../Blazor/SelectItemComponentEventArgs.cs | 2 +- .../Blazor/SplitterResizeEventArgs.cs | 2 +- .../Blazor/TabComponentEventArgs.cs | 2 +- .../Blazor/TileChangeStateEventArgs.cs | 2 +- .../Blazor/TileChangeStateEventArgsDetail.cs | 2 +- .../Blazor/TileComponentEventArgs.cs | 2 +- .../Blazor/TreeItemComponentEventArgs.cs | 2 +- .../Blazor/TreeSelectionEventArgs.cs | 2 +- src/componentsBase/BaseRendererControl.cs | 6 ++--- src/componentsBase/DynamicContentHolder.cs | 2 +- src/componentsBase/JsonDataSourceItem.cs | 8 +++---- src/componentsBase/UnmarshalledDataSource.cs | 24 +++++++++---------- 27 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 8d01378c..6f976842 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangedEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } + { this.Detail = (IgbActiveStepChangedEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 96aea911..96c6b187 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -65,7 +65,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangingEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } + { this.Detail = (IgbActiveStepChangingEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 30004f66..ec8c9768 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -415,7 +415,7 @@ public EventCallback Change if (this.Selection != CalendarSelection.Single) { - newValueValues = (DateTime[])(DowncastArray(args.Detail)); + newValueValues = (DateTime[]?)(DowncastArray(args.Detail)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index cd20ec0b..9fa8cb02 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageAttachment)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } + { this.Detail = (IgbChatMessageAttachment?)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index 719c629e..7f2b9fdf 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbChatMessage)ConvertReturnValue(args["detail"], "ChatMessage", true); } + { this.Detail = (IgbChatMessage?)ConvertReturnValue(args["detail"], "ChatMessage", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index 735c5c5c..ca0bf758 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -95,7 +95,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("message")) - { this.Message = (IgbChatMessage)ConvertReturnValue(args["message"], "ChatMessage", true); } + { this.Message = (IgbChatMessage?)ConvertReturnValue(args["message"], "ChatMessage", true); } if (args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index c80256fb..563f0358 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageReaction)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } + { this.Detail = (IgbChatMessageReaction?)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index f0ec7bbc..a3cac3b2 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbCheckboxChangeEventArgsDetail)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } + { this.Detail = (IgbCheckboxChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index a8acc6b3..f14e2eb8 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -859,7 +859,7 @@ public EventCallback Change var newValueValue = default(T[]); { - newValueValue = (T[])(DowncastArray(args!.Detail!.NewValue)); + newValueValue = (T[]?)(DowncastArray(args!.Detail!.NewValue)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 122ea611..898b7a97 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbComboChangeEventArgsDetail)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } + { this.Detail = (IgbComboChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 7216d08e..51be8d85 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbDateRangeValueDetail)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } + { this.Detail = (IgbDateRangeValueDetail?)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index fd62da1c..2c630cde 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbDropdownItem)ConvertReturnValue(args["detail"], "DropdownItem", true); } + { this.Detail = (IgbDropdownItem?)ConvertReturnValue(args["detail"], "DropdownItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 2381ca99..e1a5b277 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -61,7 +61,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbExpansionPanel)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } + { this.Detail = (IgbExpansionPanel?)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 3120ca5a..ace86d9d 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbRadioChangeEventArgsDetail)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } + { this.Detail = (IgbRadioChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index bc3e9e33..fa6c8cc1 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbRangeSliderValue)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } + { this.Detail = (IgbRangeSliderValue?)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 19d05de9..9c770976 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbSelectItem)ConvertReturnValue(args["detail"], "SelectItem", true); } + { this.Detail = (IgbSelectItem?)ConvertReturnValue(args["detail"], "SelectItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index 8e798e34..ad2507d8 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbSplitterResizeEventArgsDetail)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } + { this.Detail = (IgbSplitterResizeEventArgsDetail?)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index 6ffd3f6b..73bce826 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbTab)ConvertReturnValue(args["detail"], "Tab", true); } + { this.Detail = (IgbTab?)ConvertReturnValue(args["detail"], "Tab", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 2af65c58..6d2df6cf 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -65,7 +65,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbTileChangeStateEventArgsDetail)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } + { this.Detail = (IgbTileChangeStateEventArgsDetail?)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 68b76497..56c91654 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -91,7 +91,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("tile")) - { this.Tile = (IgbTile)ConvertReturnValue(args["tile"], "Tile", true); } + { this.Tile = (IgbTile?)ConvertReturnValue(args["tile"], "Tile", true); } if (args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 73dbe973..0949ee59 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbTile)ConvertReturnValue(args["detail"], "Tile", true); } + { this.Detail = (IgbTile?)ConvertReturnValue(args["detail"], "Tile", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index d142b536..ebfc2040 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbTreeItem)ConvertReturnValue(args["detail"], "TreeItem", true); } + { this.Detail = (IgbTreeItem?)ConvertReturnValue(args["detail"], "TreeItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index f33b7676..e2853fc3 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("detail")) - { this.Detail = (IgbTreeSelectionEventArgsDetail)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } + { this.Detail = (IgbTreeSelectionEventArgsDetail?)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 8ef8c44e..33210f85 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -362,13 +362,13 @@ private object ArrayToSimpleAttributeValue(JsonElement currValue) return ret; } - protected virtual string TransformSimpleKey(string key) + protected virtual string TransformSimpleKey(string? key) { key = Camelize(key); return _sequenceInfo!.TransformKey(key); } - protected virtual bool IsTransformedEnumValue(string key) + protected virtual bool IsTransformedEnumValue(string? key) { key = Camelize(key); if (_sequenceInfo!.IsTransformedEnum(key)) @@ -378,7 +378,7 @@ protected virtual bool IsTransformedEnumValue(string key) return false; } - protected virtual object TransformPotentialEnumValue(string key, object value) + protected virtual object TransformPotentialEnumValue(string? key, object value) { key = Camelize(key); //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index c64dba76..6c0acea3 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -282,7 +282,7 @@ private void OnContextChanged(T? oldValue, T? newValue) if (_hasPopulatedContext) { - template.Context = (T)Context; + template.Context = (T?)Context; } template.Template = Template; template.Update(); diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index a8fdad70..5f80246b 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -11,7 +11,7 @@ internal class JsonDataSourceItem private bool _isDataSource = true; private IJSDataSource? _source = null; private string? _parentId = null; - private Dictionary _values = new Dictionary(); + private Dictionary _values = new Dictionary(); private Dictionary _valueTypes = new Dictionary(); public bool IsNull @@ -165,7 +165,7 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m String name = schema.PropertyNames[i]; Func propGetter = schema!.PropertyGetters![i]; JSDataSourceSchemaType type = schema!.PropertyTypes![i]; - Object val = schema.ResolveValue(name, item, propGetter, this, type, manager); + Object? val = schema.ResolveValue(name, item, propGetter, this, type, manager); _values[name] = val; _valueTypes[name] = type; @@ -175,7 +175,7 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m String name = schema.Fields[i].Name; Func fieldGetter = schema!.FieldGetters![i]; JSDataSourceSchemaType type = schema!.FieldTypes![i]; - Object val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); + Object? val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); _values[name] = val; _valueTypes[name] = type; @@ -319,7 +319,7 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.Json private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, System.Text.Json.Utf8JsonWriter writer) { - Object value = _values[key]; + Object? value = _values[key]; if (value == null) { if (prop.Equals(default)) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 43318c16..081c8742 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -291,34 +291,34 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: - doubleGetter = (Func)valueGetter; + doubleGetter = (Func?)valueGetter; floatingPointGetter = doubleGetter; break; case JSDataSourceSchemaType.SingleValue: - singleGetter = (Func)valueGetter!; + singleGetter = (Func?)valueGetter; floatingPointGetter = (o) => (double)singleGetter!(o); break; case JSDataSourceSchemaType.BooleanValue: - boolGetter = (Func)valueGetter!; + boolGetter = (Func?)valueGetter; integerGetter = (o) => boolGetter!(o) ? 1 : 0; break; case JSDataSourceSchemaType.ByteValue: - byteGetter = (Func)valueGetter!; + byteGetter = (Func?)valueGetter; integerGetter = (o) => (int)byteGetter!(o); break; case JSDataSourceSchemaType.DecimalValue: - decimalGetter = (Func)valueGetter!; + decimalGetter = (Func?)valueGetter; floatingPointGetter = (o) => (double)decimalGetter!(o); break; case JSDataSourceSchemaType.IntValue: - integerGetter = (Func)valueGetter!; + integerGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.ShortValue: - shortGetter = (Func)valueGetter!; + shortGetter = (Func?)valueGetter; integerGetter = (o) => (int)shortGetter!(o); break; case JSDataSourceSchemaType.LongValue: - longGetter = (Func)valueGetter; + longGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.StringValue: if (isIDColumn) @@ -363,7 +363,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.NullableDoubleValue: - nullableDoubleGetter = (Func)valueGetter; + nullableDoubleGetter = (Func?)valueGetter; nullableFloatingPointGetter = nullableDoubleGetter; break; case JSDataSourceSchemaType.NullableSingleValue: @@ -396,7 +396,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN nullableIntegerGetter = (o) => (int?)nullableShortGetter!(o); break; case JSDataSourceSchemaType.NullableLongValue: - nullableLongGetter = (Func)valueGetter; + nullableLongGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.NullableCalendarValue: case JSDataSourceSchemaType.NullableDateTimeValue: @@ -720,7 +720,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN var id = _idGetter!(item!); var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); + var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); cols = sub?.GetColumns(""); if (!_subDataSources.ContainsKey(id)) @@ -1110,7 +1110,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN UnmarshalledColumn?[]? cols = null; if (objVal != null) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); + var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); var subcols = sub!.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); From a2c457f2a6b0c0c6c692e6d03470507838e0cdce Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 14:41:36 +0300 Subject: [PATCH 12/64] Minor tweaks. --- src/components/Blazor/Calendar.cs | 16 +++++----- .../Blazor/ChatAttachmentRenderContext.cs | 4 +-- src/components/Blazor/ChatDraftMessage.cs | 4 +-- .../Blazor/ChatInputRenderContext.cs | 4 +-- src/components/Blazor/ChatMessage.cs | 4 +-- .../Blazor/ChatMessageAttachment.cs | 6 ++-- src/components/Blazor/ChatMessageReaction.cs | 4 +-- .../Blazor/ChatMessageRenderContext.cs | 4 +-- src/components/Blazor/ChatOptions.cs | 4 +-- src/components/Blazor/ChatRenderContext.cs | 4 +-- .../Blazor/CheckboxChangeEventArgsDetail.cs | 4 +-- .../Blazor/ComboChangeEventArgsDetail.cs | 4 +-- src/components/Blazor/CustomDateRange.cs | 4 +-- src/components/Blazor/DateRangeValue.cs | 4 +-- src/components/Blazor/DateRangeValueDetail.cs | 4 +-- src/components/Blazor/FilteringOptions.cs | 4 +-- src/components/Blazor/FormatSpecifier.cs | 4 +-- src/components/Blazor/HighlightNavigation.cs | 4 +-- src/components/Blazor/IconMeta.cs | 2 +- .../Blazor/RadioChangeEventArgsDetail.cs | 4 +-- .../Blazor/SplitterResizeEventArgsDetail.cs | 4 +-- .../Blazor/TileChangeStateEventArgs.cs | 4 +-- .../Blazor/TileChangeStateEventArgsDetail.cs | 4 +-- src/componentsBase/BaseRendererControl.cs | 30 +++++++++---------- src/componentsBase/DataSourceManager.cs | 2 +- src/componentsBase/EventCallbackExtensions.cs | 10 +++---- src/componentsBase/JsonDataSource.cs | 2 +- src/componentsBase/RendererMessage.cs | 2 +- stories/Components/Stories/Chat.stories.razor | 4 +-- tests/IgniteUI.Blazor.Tests/CalendarTests.cs | 2 +- 30 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index ec8c9768..fed98159 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -35,14 +35,14 @@ protected override bool SupportsVisualChildren } } - private DateTime _value = DateTime.MinValue; + private DateTime? _value = DateTime.MinValue; /// /// The current value of the calendar. /// Used when is set to . /// [Parameter] - public DateTime Value + public DateTime? Value { get { return this._value; } set @@ -279,18 +279,18 @@ public IgbCalendarFormatOptions? FormatOptions } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -394,11 +394,11 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime); + var newValueValue = default(DateTime?); if (this.Selection == CalendarSelection.Single) { - newValueValue = (DateTime)(args.Detail); + newValueValue = (DateTime?)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. @@ -428,7 +428,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Values"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/ChatAttachmentRenderContext.cs b/src/components/Blazor/ChatAttachmentRenderContext.cs index 8f9c434a..ea479a7a 100644 --- a/src/components/Blazor/ChatAttachmentRenderContext.cs +++ b/src/components/Blazor/ChatAttachmentRenderContext.cs @@ -37,11 +37,11 @@ public IgbChatMessageAttachment? Attachment public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index d3fc61ca..09280119 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -50,11 +50,11 @@ public IgbChatMessageAttachment[]? Attachments public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatInputRenderContext.cs b/src/components/Blazor/ChatInputRenderContext.cs index 05bf2be8..a3fb5ce1 100644 --- a/src/components/Blazor/ChatInputRenderContext.cs +++ b/src/components/Blazor/ChatInputRenderContext.cs @@ -32,11 +32,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 98217ada..7bfbdb34 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -130,11 +130,11 @@ public string[]? Reactions public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index 3b3090a8..5e35e473 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -93,11 +93,11 @@ public string? Thumbnail public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) @@ -142,7 +142,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict if (args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } if (args.ContainsKey("name")) - { this.Name = ReturnToString(args["name"]); } + { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } if (args.ContainsKey("url")) { this.Url = ReturnToString(args["url"]); } if (args.ContainsKey("attachmentType")) diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index ca0bf758..2265efe3 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -58,11 +58,11 @@ public string? Reaction public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatMessageRenderContext.cs b/src/components/Blazor/ChatMessageRenderContext.cs index d696c047..53f549b1 100644 --- a/src/components/Blazor/ChatMessageRenderContext.cs +++ b/src/components/Blazor/ChatMessageRenderContext.cs @@ -37,11 +37,11 @@ public IgbChatMessage? Message public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatOptions.cs b/src/components/Blazor/ChatOptions.cs index b81984a5..da1e5d2c 100644 --- a/src/components/Blazor/ChatOptions.cs +++ b/src/components/Blazor/ChatOptions.cs @@ -243,11 +243,11 @@ public IgbChatRenderers? Renderers public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ChatRenderContext.cs b/src/components/Blazor/ChatRenderContext.cs index af3bfbab..36beb54c 100644 --- a/src/components/Blazor/ChatRenderContext.cs +++ b/src/components/Blazor/ChatRenderContext.cs @@ -33,11 +33,11 @@ public IgbChat? Instance public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index cdf95ba4..37e6ab5a 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -53,11 +53,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 1778cbb1..496597bf 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -125,11 +125,11 @@ public ComboChangeType ChangeType public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index 09dc39a2..5449ee9c 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -56,11 +56,11 @@ public IgbDateRangeValue? DateRange public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/DateRangeValue.cs b/src/components/Blazor/DateRangeValue.cs index a6b288ae..1633f15a 100644 --- a/src/components/Blazor/DateRangeValue.cs +++ b/src/components/Blazor/DateRangeValue.cs @@ -51,11 +51,11 @@ public DateTime End public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/DateRangeValueDetail.cs b/src/components/Blazor/DateRangeValueDetail.cs index 88bae3c9..024ec0f9 100644 --- a/src/components/Blazor/DateRangeValueDetail.cs +++ b/src/components/Blazor/DateRangeValueDetail.cs @@ -54,11 +54,11 @@ public DateTime End public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/FilteringOptions.cs b/src/components/Blazor/FilteringOptions.cs index 1a330269..2d3ef2e6 100644 --- a/src/components/Blazor/FilteringOptions.cs +++ b/src/components/Blazor/FilteringOptions.cs @@ -70,11 +70,11 @@ public bool MatchDiacritics public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index bb482e16..b707ac79 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -27,7 +27,7 @@ protected override void EnsureModulesLoaded() /// The resolved culture name. public async Task GetLocalCultureAsync() { - var iv = await InvokeMethod("getLocalCulture", new object?[] { }, new string[] { }); + var iv = await InvokeMethod("getLocalCulture", new object[] { }, new string[] { }); return ReturnToString(iv); } /// @@ -37,7 +37,7 @@ protected override void EnsureModulesLoaded() /// The resolved culture name. public String? GetLocalCulture() { - var iv = InvokeMethodSync("getLocalCulture", new object?[] { }, new string[] { }); + var iv = InvokeMethodSync("getLocalCulture", new object[] { }, new string[] { }); return ReturnToString(iv); } diff --git a/src/components/Blazor/HighlightNavigation.cs b/src/components/Blazor/HighlightNavigation.cs index 35e90a40..3095c568 100644 --- a/src/components/Blazor/HighlightNavigation.cs +++ b/src/components/Blazor/HighlightNavigation.cs @@ -34,11 +34,11 @@ public bool PreventScroll public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 6a638ac3..9229ddd3 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args.ContainsKey("name")) - { this.Name = ReturnToString(args["name"]); } + { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } if (args.ContainsKey("collection")) { this.Collection = ReturnToString(args["collection"]); } diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index 885aba8b..1164dc20 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -53,11 +53,11 @@ public string? Value public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/SplitterResizeEventArgsDetail.cs b/src/components/Blazor/SplitterResizeEventArgsDetail.cs index 54a377e3..69212b8a 100644 --- a/src/components/Blazor/SplitterResizeEventArgsDetail.cs +++ b/src/components/Blazor/SplitterResizeEventArgsDetail.cs @@ -74,11 +74,11 @@ public double Delta public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 6d2df6cf..67619e94 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -59,12 +59,12 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args?.ContainsKey("detail") == true) { this.Detail = (IgbTileChangeStateEventArgsDetail?)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 56c91654..beb45e95 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -54,11 +54,11 @@ public bool State public async Task SetNativeElementAsync(Object element) { - await InvokeMethod("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } public void SetNativeElement(Object element) { - InvokeMethodSync("setNativeElement", new object?[] { ObjectToParam(element) }, new string[] { "Json" }); + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 33210f85..9a387e8d 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -642,7 +642,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) private Dictionary _dynamicContentInfos = new Dictionary(); - private Dictionary _contentTemplates = new Dictionary(); + private Dictionary _contentTemplates = new Dictionary(); private Dictionary _contentTemplateTypes = new Dictionary(); internal void UpdateTemplate(string templateId, object? template, Type type) { @@ -1459,7 +1459,7 @@ public void OnRefChanged(string refName, object? refValue) SendMessage(m); } - void RefSink.OnRefNotifyInsertItem(IJSDataSource dataSource, string refName, int index, object refItem) + void RefSink.OnRefNotifyInsertItem(IJSDataSource dataSource, string refName, int index, object? refItem) { if (dataSource.DataSourceType == JSDataSourceType.Json) { @@ -1483,7 +1483,7 @@ void RefSink.OnRefNotifyInsertItem(IJSDataSource dataSource, string refName, int } } - void RefSink.OnRefNotifyRemoveItem(IJSDataSource dataSource, string refName, int index, object oldItem) + void RefSink.OnRefNotifyRemoveItem(IJSDataSource dataSource, string refName, int index, object? oldItem) { if (dataSource.DataSourceType == JSDataSourceType.Json) { @@ -1505,7 +1505,7 @@ void RefSink.OnRefNotifyRemoveItem(IJSDataSource dataSource, string refName, int } } - void RefSink.OnRefNotifyClearItems(IJSDataSource dataSource, string refName, object refValue) + void RefSink.OnRefNotifyClearItems(IJSDataSource dataSource, string refName, object? refValue) { if (dataSource.DataSourceType == JSDataSourceType.Json) { @@ -1526,7 +1526,7 @@ void RefSink.OnRefNotifyClearItems(IJSDataSource dataSource, string refName, obj } } - void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int index, object oldItem, object newItem) + void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int index, object? oldItem, object? newItem) { if (dataSource.DataSourceType == JSDataSourceType.Json) { @@ -1535,7 +1535,7 @@ void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int in m.SetData("refName", "\"" + refName + "\""); m.SetData("index", index.ToString()); m.SetData("oldItem", oldItem == null ? "null" : ((JsonDataSourceItem)oldItem).ToJson()); - m.SetData("newItem", oldItem == null ? "null" : ((JsonDataSourceItem)newItem).ToJson()); + m.SetData("newItem", oldItem == null ? "null" : ((JsonDataSourceItem?)newItem)?.ToJson()); if (!((JsonDataSource)dataSource).DateCacheReady) { m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); @@ -1549,7 +1549,7 @@ void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int in } } - void RefSink.OnRefNotifyUpdateItem(IJSDataSource dataSource, string refName, int index, object refItem, bool syncDataOnly) + void RefSink.OnRefNotifyUpdateItem(IJSDataSource dataSource, string refName, int index, object? refItem, bool syncDataOnly) { if (dataSource.DataSourceType == JSDataSourceType.Json) { @@ -2061,7 +2061,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) var v = ((JsonElement)obj["value"]); var str = v.ToString(); //Console.WriteLine(str); - var ev = JsonSerializer.Deserialize>(str, SerializerOptions); + var ev = JsonSerializer.Deserialize>(str, SerializerOptions); ((BaseRendererElement)o).FromEventJson(this, ev); returnValue = o; } @@ -2965,7 +2965,7 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string T a = new T(); BaseRendererElement ele = (BaseRendererElement)a; ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); + ele.FromEventJson(this, (Dictionary)args); //Console.WriteLine("invoking async"); if (onArgs != null) { @@ -2976,7 +2976,7 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string { throw task.Exception; } - ele.ToEventJson(this, (Dictionary)args); + ele.ToEventJson(this, (Dictionary)args); ele.Parent = (null); }; @@ -3024,14 +3024,14 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac T a = new T(); BaseRendererElement ele = (BaseRendererElement)a; ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); + ele.FromEventJson(this, (Dictionary)args); //Console.WriteLine("invoking async"); if (onArgs != null) { onArgs(a); } handler(a); - ele.ToEventJson(this, (Dictionary)args); + ele.ToEventJson(this, (Dictionary)args); ele.Parent = (null); }; @@ -3431,7 +3431,7 @@ internal IgniteUIBlazorSettings(IIgniteUIBlazorSettings settings) public interface IIgniteUIBlazor { IJSRuntime JsRuntime { get; } - IIgniteUIBlazorSettings Settings { get; } + IIgniteUIBlazorSettings? Settings { get; } WebCallback WebCallback { get; } void RequestLoad(string moduleName); bool IsLoadRequested(string moduleName); @@ -3529,7 +3529,7 @@ public bool IsRuntimeValid(bool reevaluate = false) } else if (_remoteRuntimeProp != null) { - _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); + _isRuntimeValid = (bool)(_remoteRuntimeProp.GetValue(JsRuntime) ?? false); _isRemoteRuntime = true; } else @@ -3543,7 +3543,7 @@ public bool IsRuntimeValid(bool reevaluate = false) { if (reevaluate && _isRemoteRuntime) { - _isRuntimeValid = (bool)_remoteRuntimeProp!.GetValue(JsRuntime); + _isRuntimeValid = (bool)(_remoteRuntimeProp!.GetValue(JsRuntime) ?? false); } } return _isRuntimeValid; diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index fd1df39a..0ee880ab 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -18,7 +18,7 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) private RefSink? _refSink; private Dictionary _refs = new Dictionary(); private Dictionary _refsById = new Dictionary(); - private Dictionary _dataSources = new Dictionary(); + private Dictionary _dataSources = new Dictionary(); private Dictionary _idLookup = new Dictionary(); private Dictionary _suspensionLookup = new Dictionary(); diff --git a/src/componentsBase/EventCallbackExtensions.cs b/src/componentsBase/EventCallbackExtensions.cs index a15c4077..36822745 100644 --- a/src/componentsBase/EventCallbackExtensions.cs +++ b/src/componentsBase/EventCallbackExtensions.cs @@ -36,10 +36,10 @@ internal static bool EqualsCompat(this EventCallback left, Event } // Mirrors .NET 10's EventCallback.Equals, need the internal fields for the checks: - MulticastDelegate? leftDelegate = (MulticastDelegate?)CallbackFields.Delegate.GetValue(left); - MulticastDelegate? rightDelegate = (MulticastDelegate?)CallbackFields.Delegate.GetValue(other); + MulticastDelegate? leftDelegate = (MulticastDelegate?)CallbackFields.Delegate?.GetValue(left); + MulticastDelegate? rightDelegate = (MulticastDelegate?)CallbackFields.Delegate?.GetValue(other); - return ReferenceEquals(CallbackFields.Receiver.GetValue(left), CallbackFields.Receiver.GetValue(other)) + return ReferenceEquals(CallbackFields.Receiver?.GetValue(left), CallbackFields.Receiver?.GetValue(other)) && (leftDelegate?.Equals(rightDelegate) ?? (rightDelegate == null)); #endif } @@ -48,8 +48,8 @@ internal static bool EqualsCompat(this EventCallback left, Event /// Resolved once per closed callback type, rather than per component instance. private static class CallbackFields { - internal static readonly FieldInfo Delegate = Field("Delegate"); - internal static readonly FieldInfo Receiver = Field("Receiver"); + internal static readonly FieldInfo? Delegate = Field("Delegate"); + internal static readonly FieldInfo? Receiver = Field("Receiver"); /// Use as guard against (unlikely) fields rename in old versions that won't resolve. internal static readonly bool Resolved = Delegate != null && Receiver != null; diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 8ad80d87..48276540 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -10,7 +10,7 @@ internal interface IJSDataSourceItem internal interface IJSDataSource { - string GetDataIntentsAsJson(); + string? GetDataIntentsAsJson(); bool SuppressModifications { get; set; } JSDataSourceType DataSourceType { get; } bool IsSent { get; set; } diff --git a/src/componentsBase/RendererMessage.cs b/src/componentsBase/RendererMessage.cs index 5be20da5..d2934f48 100644 --- a/src/componentsBase/RendererMessage.cs +++ b/src/componentsBase/RendererMessage.cs @@ -4,7 +4,7 @@ namespace IgniteUI.Blazor.Controls { internal class RendererMessage { - private Dictionary _data = new Dictionary(); + private Dictionary _data = new Dictionary(); private String? _type = null; public string? Type { diff --git a/stories/Components/Stories/Chat.stories.razor b/stories/Components/Stories/Chat.stories.razor index 050be732..b5654fdc 100644 --- a/stories/Components/Stories/Chat.stories.razor +++ b/stories/Components/Stories/Chat.stories.razor @@ -101,7 +101,7 @@ var userMessage = args.Detail; if (!_basicMessages.Any(x => x.Id == userMessage!.Id)) { - _basicMessages = [.. _basicMessages, userMessage]; + _basicMessages = [.. _basicMessages, userMessage!]; } _basicOptions.Suggestions = []; @@ -118,7 +118,7 @@ var userMessage = args.Detail; if (!_templateMessages.Any(x => x.Id == userMessage!.Id)) { - _templateMessages = [.. _templateMessages, userMessage]; + _templateMessages = [.. _templateMessages, userMessage!]; } _templateOptions.Suggestions = []; diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index c5d16df4..e8a9eb6c 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -20,7 +20,7 @@ public class CalendarTests : ComponentWithContractTestBase }) .Event(c => c.Change, argsJson: """{"detail": {"retType": "date", "value": "2026-01-02T03:04:05.000Z"}}""", - assert: args => Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), ((DateTime)args.Detail).ToUniversalTime())) + assert: args => Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), ((DateTime?)args.Detail)?.ToUniversalTime())) // Single selection: .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, argsJson: """{"detail": {"retType": "date", "value": "2026-01-02T03:04:05.000Z"}}""", From ed12c2d4417795475beed530c779e459a8cf9b8e Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 14:57:46 +0300 Subject: [PATCH 13/64] Few more tweaks around nullable params. --- .../Blazor/ActiveStepChangedEventArgs.cs | 2 +- .../ActiveStepChangedEventArgsDetail.cs | 2 +- .../Blazor/ActiveStepChangingEventArgs.cs | 2 +- .../ActiveStepChangingEventArgsDetail.cs | 2 +- .../Blazor/CalendarFormatOptions.cs | 2 +- src/components/Blazor/ChatDraftMessage.cs | 2 +- src/components/Blazor/ChatMessage.cs | 2 +- .../Blazor/ChatMessageAttachment.cs | 2 +- .../Blazor/ChatMessageAttachmentEventArgs.cs | 2 +- src/components/Blazor/ChatMessageEventArgs.cs | 2 +- src/components/Blazor/ChatMessageReaction.cs | 2 +- .../Blazor/ChatMessageReactionEventArgs.cs | 2 +- .../Blazor/CheckboxChangeEventArgs.cs | 2 +- .../Blazor/CheckboxChangeEventArgsDetail.cs | 2 +- src/components/Blazor/ComboChangeEventArgs.cs | 2 +- .../Blazor/ComboChangeEventArgsDetail.cs | 2 +- .../ComponentBoolValueChangedEventArgs.cs | 2 +- .../ComponentDataValueChangedEventArgs.cs | 2 +- .../ComponentDateValueChangedEventArgs.cs | 2 +- .../Blazor/ComponentValueChangedEventArgs.cs | 2 +- src/components/Blazor/DateRangeValueDetail.cs | 2 +- .../Blazor/DateRangeValueEventArgs.cs | 2 +- .../Blazor/DropdownItemComponentEventArgs.cs | 2 +- .../ExpansionPanelComponentEventArgs.cs | 2 +- src/components/Blazor/FormatSpecifier.cs | 2 +- src/components/Blazor/HighlightNavigation.cs | 2 +- src/components/Blazor/IconMeta.cs | 2 +- src/components/Blazor/NumberEventArgs.cs | 2 +- .../Blazor/NumberFormatSpecifier.cs | 2 +- src/components/Blazor/RadioChangeEventArgs.cs | 2 +- .../Blazor/RadioChangeEventArgsDetail.cs | 2 +- src/components/Blazor/RangeSliderValue.cs | 2 +- .../Blazor/RangeSliderValueEventArgs.cs | 2 +- .../Blazor/SelectItemComponentEventArgs.cs | 2 +- .../Blazor/SplitterResizeEventArgs.cs | 2 +- .../Blazor/SplitterResizeEventArgsDetail.cs | 2 +- .../Blazor/TabComponentEventArgs.cs | 2 +- .../Blazor/TileChangeStateEventArgsDetail.cs | 2 +- .../Blazor/TileComponentEventArgs.cs | 2 +- .../Blazor/TreeItemComponentEventArgs.cs | 2 +- .../Blazor/TreeSelectionEventArgs.cs | 2 +- .../Blazor/TreeSelectionEventArgsDetail.cs | 2 +- src/components/Blazor/VoidEventArgs.cs | 2 +- src/componentsBase/DataSourceManager.cs | 24 +++++++++---------- src/componentsBase/JsonDataSource.cs | 12 +++++----- src/componentsBase/UnmarshalledDataSource.cs | 4 ++-- 46 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 6f976842..4fa4ad45 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs index a1534519..ced28cac 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs @@ -52,7 +52,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 96c6b187..2afc6922 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs index 9d89b5c2..960f7284 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs @@ -75,7 +75,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/CalendarFormatOptions.cs b/src/components/Blazor/CalendarFormatOptions.cs index dd3e7262..080062df 100644 --- a/src/components/Blazor/CalendarFormatOptions.cs +++ b/src/components/Blazor/CalendarFormatOptions.cs @@ -78,7 +78,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 09280119..369a0a0e 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -81,7 +81,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 7bfbdb34..ab136fab 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -177,7 +177,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index 5e35e473..bbb34168 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -134,7 +134,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 9fa8cb02..ebe60dc4 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index 7f2b9fdf..ec377a44 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index 2265efe3..c9dee23d 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -89,7 +89,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index 563f0358..a54f1c93 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index a3cac3b2..26725331 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index 37e6ab5a..0350606f 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -84,7 +84,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 898b7a97..4f7cc2e6 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 496597bf..605da411 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -160,7 +160,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs index bfbcb851..05ac3162 100644 --- a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index 81e5c3ea..c1994ec5 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -51,7 +51,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs index 0395696c..b5ef0fac 100644 --- a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 5dbf41eb..2ca14726 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/DateRangeValueDetail.cs b/src/components/Blazor/DateRangeValueDetail.cs index 024ec0f9..c84f531b 100644 --- a/src/components/Blazor/DateRangeValueDetail.cs +++ b/src/components/Blazor/DateRangeValueDetail.cs @@ -85,7 +85,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 51be8d85..8b172de6 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index 2c630cde..4a448314 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index e1a5b277..3eb37469 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -55,7 +55,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index b707ac79..d62f5605 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -49,7 +49,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/HighlightNavigation.cs b/src/components/Blazor/HighlightNavigation.cs index 3095c568..f29b1326 100644 --- a/src/components/Blazor/HighlightNavigation.cs +++ b/src/components/Blazor/HighlightNavigation.cs @@ -61,7 +61,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 9229ddd3..80e9a126 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/NumberEventArgs.cs b/src/components/Blazor/NumberEventArgs.cs index 4e1c6ded..c82ac891 100644 --- a/src/components/Blazor/NumberEventArgs.cs +++ b/src/components/Blazor/NumberEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/NumberFormatSpecifier.cs b/src/components/Blazor/NumberFormatSpecifier.cs index da98b11a..3f33ea37 100644 --- a/src/components/Blazor/NumberFormatSpecifier.cs +++ b/src/components/Blazor/NumberFormatSpecifier.cs @@ -483,7 +483,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index ace86d9d..737db8f6 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index 1164dc20..a9b291e9 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -84,7 +84,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RangeSliderValue.cs b/src/components/Blazor/RangeSliderValue.cs index 59bd6624..d6aae645 100644 --- a/src/components/Blazor/RangeSliderValue.cs +++ b/src/components/Blazor/RangeSliderValue.cs @@ -75,7 +75,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index fa6c8cc1..aa1fa365 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -56,7 +56,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 9c770976..acbf9062 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index ad2507d8..00d1ab03 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/SplitterResizeEventArgsDetail.cs b/src/components/Blazor/SplitterResizeEventArgsDetail.cs index 69212b8a..b1a7ea2d 100644 --- a/src/components/Blazor/SplitterResizeEventArgsDetail.cs +++ b/src/components/Blazor/SplitterResizeEventArgsDetail.cs @@ -109,7 +109,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index 73bce826..d402ea54 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index beb45e95..69169456 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -85,7 +85,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 0949ee59..85dcb9bb 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index ebfc2040..8bd94982 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -54,7 +54,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index e2853fc3..61fde2f5 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -57,7 +57,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index 23d93ad7..e215c624 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -53,7 +53,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/components/Blazor/VoidEventArgs.cs b/src/components/Blazor/VoidEventArgs.cs index 8112240a..cddd8964 100644 --- a/src/components/Blazor/VoidEventArgs.cs +++ b/src/components/Blazor/VoidEventArgs.cs @@ -18,7 +18,7 @@ protected internal override void ToEventJson(BaseRendererControl control, Dictio } /// - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + protected internal override void FromEventJson(BaseRendererControl control, Dictionary? args) { base.FromEventJson(control, args); this.SuppressParentNotify = true; diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 0ee880ab..3220dfeb 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -153,7 +153,7 @@ void DecrementRef(string id) _refCount.Remove(id); if (_dataSources.ContainsKey(id)) { - Object data = _dataSources[id]; + Object? data = _dataSources[id]; if (data != null && _idLookup.ContainsKey(data)) { _idLookup.Remove(data); @@ -185,8 +185,8 @@ public void NotifyInsertItem(string refName, int index, object? refItem) { //Console.WriteLine("found by id"); object data = _refsById[refName]; - IJSDataSource dataSource = _dataSources[refName]; - IJSDataSourceItem newItem = dataSource.NotifyInsertItem(data, index, refItem); + IJSDataSource? dataSource = _dataSources[refName]; + IJSDataSourceItem? newItem = dataSource?.NotifyInsertItem(data, index, refItem); _refSink!.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } @@ -204,8 +204,8 @@ public void NotifyRemoveItem(String refName, int index, Object? oldItem) if (_refsById.ContainsKey(refName)) { Object data = _refsById[refName]; - IJSDataSource dataSource = _dataSources[refName]; - IJSDataSourceItem oldItemJson = dataSource.NotifyRemoveItem(data, index, oldItem); + IJSDataSource? dataSource = _dataSources[refName]; + IJSDataSourceItem? oldItemJson = dataSource?.NotifyRemoveItem(data, index, oldItem); _refSink!.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); } } @@ -219,8 +219,8 @@ public void NotifyClearItems(string refName) if (_refsById.ContainsKey(refName)) { Object data = _refsById[refName]; - IJSDataSource dataSource = _dataSources[refName]; - dataSource.NotifyClearItems(data); + IJSDataSource? dataSource = _dataSources[refName]; + dataSource?.NotifyClearItems(data); _refSink!.OnRefNotifyClearItems(dataSource, refName, dataSource); } } @@ -233,9 +233,9 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI if (_refsById.ContainsKey(refName)) { object data = _refsById[refName]; - IJSDataSource dataSource = _dataSources[refName]; - IJSDataSourceItem? oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; - IJSDataSourceItem newItemJson = dataSource.NotifySetItem(data, index, oldItem, newItem); + IJSDataSource? dataSource = _dataSources[refName]; + IJSDataSourceItem? oldItemJson = dataSource?.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; + IJSDataSourceItem? newItemJson = dataSource?.NotifySetItem(data, index, oldItem, newItem); _refSink!.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); } } @@ -248,8 +248,8 @@ public void NotifyUpdateItem(string refName, int index, object refItem, bool syn if (_refsById.ContainsKey(refName)) { object data = _refsById[refName]; - IJSDataSource dataSource = _dataSources[refName]; - IJSDataSourceItem newItemJson = dataSource.NotifyUpdateItem(data, index, refItem); + IJSDataSource? dataSource = _dataSources[refName]; + IJSDataSourceItem? newItemJson = dataSource?.NotifyUpdateItem(data, index, refItem); _refSink!.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); } } diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 48276540..21e82a63 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -17,15 +17,15 @@ internal interface IJSDataSource bool HasId(Guid id); bool HasId(string id); //IJSDataSourceItem LookupById(Guid id); - object LookupOriginal(Guid id); - object LookupOriginal(string id); + object? LookupOriginal(Guid id); + object? LookupOriginal(string id); bool HasOriginal(object item); Guid IdFromOriginal(object item); - IJSDataSourceItem NotifyInsertItem(object data, int index, Object item); - IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem); + IJSDataSourceItem? NotifyInsertItem(object data, int index, Object item); + IJSDataSourceItem? NotifyRemoveItem(object data, int index, object oldItem); void NotifyClearItems(Object data); - IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem); - IJSDataSourceItem NotifyUpdateItem(object data, int index, object item); + IJSDataSourceItem? NotifySetItem(Object data, int index, Object oldItem, Object newItem); + IJSDataSourceItem? NotifyUpdateItem(object data, int index, object item); void InsertItemWithId(string id, int index, Object item); } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 081c8742..ddf0e0d9 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -421,7 +421,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; } - Action? insert = null; + Action? insert = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: @@ -1633,7 +1633,7 @@ private void OnRemoveId(Guid oldId) } } - private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) + private UnmarshalledColumnData? AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) { #pragma warning disable CS8604 // internal invariant: paired column arrays (NullValues) are allocated together if (column == null) From 0d73f528a5c171db0cde55a2b4979ec2652e4b63 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 15:01:38 +0300 Subject: [PATCH 14/64] Refactor null checks for data sources in DataSourceManager and adjust return types in UnmarshalledDataSource --- src/componentsBase/DataSourceManager.cs | 37 ++++++++++++++++---- src/componentsBase/UnmarshalledDataSource.cs | 6 ++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 3220dfeb..d435758a 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -186,7 +186,12 @@ public void NotifyInsertItem(string refName, int index, object? refItem) //Console.WriteLine("found by id"); object data = _refsById[refName]; IJSDataSource? dataSource = _dataSources[refName]; - IJSDataSourceItem? newItem = dataSource?.NotifyInsertItem(data, index, refItem); + if (dataSource == null) + { + return; + } + + IJSDataSourceItem? newItem = dataSource.NotifyInsertItem(data, index, refItem); _refSink!.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } @@ -205,7 +210,12 @@ public void NotifyRemoveItem(String refName, int index, Object? oldItem) { Object data = _refsById[refName]; IJSDataSource? dataSource = _dataSources[refName]; - IJSDataSourceItem? oldItemJson = dataSource?.NotifyRemoveItem(data, index, oldItem); + if (dataSource == null) + { + return; + } + + IJSDataSourceItem? oldItemJson = dataSource.NotifyRemoveItem(data, index, oldItem); _refSink!.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); } } @@ -220,7 +230,12 @@ public void NotifyClearItems(string refName) { Object data = _refsById[refName]; IJSDataSource? dataSource = _dataSources[refName]; - dataSource?.NotifyClearItems(data); + if (dataSource == null) + { + return; + } + + dataSource.NotifyClearItems(data); _refSink!.OnRefNotifyClearItems(dataSource, refName, dataSource); } } @@ -234,8 +249,13 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI { object data = _refsById[refName]; IJSDataSource? dataSource = _dataSources[refName]; - IJSDataSourceItem? oldItemJson = dataSource?.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; - IJSDataSourceItem? newItemJson = dataSource?.NotifySetItem(data, index, oldItem, newItem); + if (dataSource == null) + { + return; + } + + IJSDataSourceItem? oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; + IJSDataSourceItem? newItemJson = dataSource.NotifySetItem(data, index, oldItem, newItem); _refSink!.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); } } @@ -249,7 +269,12 @@ public void NotifyUpdateItem(string refName, int index, object refItem, bool syn { object data = _refsById[refName]; IJSDataSource? dataSource = _dataSources[refName]; - IJSDataSourceItem? newItemJson = dataSource?.NotifyUpdateItem(data, index, refItem); + if (dataSource == null) + { + return; + } + + IJSDataSourceItem? newItemJson = dataSource.NotifyUpdateItem(data, index, refItem); _refSink!.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); } } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index ddf0e0d9..d439d0f3 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -190,7 +190,7 @@ public UnmarshalledDataSource() if (schema!.IsPrimitive) { columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___primitiveValueCollection", null, null, false, schema.PrimitiveType, oldValue, newValue); - return columns; + return columns!; } if (String.IsNullOrEmpty(parentPath)) { @@ -226,7 +226,7 @@ public UnmarshalledDataSource() } //Console.WriteLine("end adjusting capacity: " + (DateTime.Now - start).TotalMilliseconds); - return columns; + return columns!; } private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate? valueGetter, Func? untypedGetter, bool isIDColumn) @@ -1633,7 +1633,7 @@ private void OnRemoveId(Guid oldId) } } - private UnmarshalledColumnData? AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) + private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) { #pragma warning disable CS8604 // internal invariant: paired column arrays (NullValues) are allocated together if (column == null) From 1a6b9f16f2960ca475a4e419918389561d98cd07 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 15:45:48 +0300 Subject: [PATCH 15/64] Add more null checks. --- .../Blazor/ActiveStepChangedEventArgs.cs | 2 +- .../ActiveStepChangedEventArgsDetail.cs | 2 +- .../Blazor/ActiveStepChangingEventArgs.cs | 2 +- .../ActiveStepChangingEventArgsDetail.cs | 4 +- .../Blazor/CalendarFormatOptions.cs | 4 +- src/components/Blazor/ChatDraftMessage.cs | 4 +- src/components/Blazor/ChatMessage.cs | 12 +++--- .../Blazor/ChatMessageAttachment.cs | 10 ++--- .../Blazor/ChatMessageAttachmentEventArgs.cs | 2 +- src/components/Blazor/ChatMessageEventArgs.cs | 2 +- src/components/Blazor/ChatMessageReaction.cs | 4 +- .../Blazor/ChatMessageReactionEventArgs.cs | 2 +- .../Blazor/CheckboxChangeEventArgs.cs | 2 +- .../Blazor/CheckboxChangeEventArgsDetail.cs | 4 +- src/components/Blazor/ComboChangeEventArgs.cs | 2 +- .../Blazor/ComboChangeEventArgsDetail.cs | 6 +-- .../ComponentBoolValueChangedEventArgs.cs | 2 +- .../ComponentDataValueChangedEventArgs.cs | 2 +- .../ComponentDateValueChangedEventArgs.cs | 2 +- .../Blazor/ComponentValueChangedEventArgs.cs | 2 +- src/components/Blazor/DateRangeValueDetail.cs | 4 +- .../Blazor/DateRangeValueEventArgs.cs | 2 +- .../Blazor/DropdownItemComponentEventArgs.cs | 2 +- .../ExpansionPanelComponentEventArgs.cs | 2 +- src/components/Blazor/HighlightNavigation.cs | 2 +- src/components/Blazor/IconMeta.cs | 4 +- src/components/Blazor/NumberEventArgs.cs | 2 +- .../Blazor/NumberFormatSpecifier.cs | 38 +++++++++---------- src/components/Blazor/RadioChangeEventArgs.cs | 2 +- .../Blazor/RadioChangeEventArgsDetail.cs | 4 +- src/components/Blazor/RangeSliderValue.cs | 4 +- .../Blazor/RangeSliderValueEventArgs.cs | 2 +- .../Blazor/SelectItemComponentEventArgs.cs | 2 +- .../Blazor/SplitterResizeEventArgs.cs | 2 +- .../Blazor/SplitterResizeEventArgsDetail.cs | 6 +-- .../Blazor/TabComponentEventArgs.cs | 2 +- .../Blazor/TileChangeStateEventArgsDetail.cs | 4 +- .../Blazor/TileComponentEventArgs.cs | 2 +- .../Blazor/TreeItemComponentEventArgs.cs | 2 +- .../Blazor/TreeSelectionEventArgs.cs | 2 +- .../Blazor/TreeSelectionEventArgsDetail.cs | 2 +- src/componentsBase/BaseRendererControl.cs | 4 +- src/componentsBase/DataSourceManager.cs | 4 +- src/componentsBase/RuntimeHelper.cs | 2 +- 44 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 4fa4ad45..3b6257cb 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbActiveStepChangedEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs index ced28cac..88492c05 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs @@ -57,7 +57,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("index")) + if (args != null && args.ContainsKey("index")) { this.Index = ReturnToDouble(args["index"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 2afc6922..41821960 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbActiveStepChangingEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs index 960f7284..716b16d8 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs @@ -80,9 +80,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("oldIndex")) + if (args != null && args.ContainsKey("oldIndex")) { this.OldIndex = ReturnToDouble(args["oldIndex"]); } - if (args.ContainsKey("newIndex")) + if (args != null && args.ContainsKey("newIndex")) { this.NewIndex = ReturnToDouble(args["newIndex"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/CalendarFormatOptions.cs b/src/components/Blazor/CalendarFormatOptions.cs index 080062df..3470067e 100644 --- a/src/components/Blazor/CalendarFormatOptions.cs +++ b/src/components/Blazor/CalendarFormatOptions.cs @@ -83,9 +83,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("weekday")) + if (args != null && args.ContainsKey("weekday")) { this.Weekday = ReturnToString(args["weekday"]); } - if (args.ContainsKey("month")) + if (args != null && args.ContainsKey("month")) { this.Month = ReturnToString(args["month"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 369a0a0e..5c13d488 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -86,9 +86,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("text")) + if (args != null && args.ContainsKey("text")) { this.Text = ReturnToString(args["text"]); } - if (args.ContainsKey("attachments")) + if (args != null && args.ContainsKey("attachments")) { this.Attachments = ReturnToObjectArray(args["attachments"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index ab136fab..8e799657 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -182,17 +182,17 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("id")) + if (args != null && args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } - if (args.ContainsKey("text")) + if (args != null && args.ContainsKey("text")) { this.Text = ReturnToString(args["text"]); } - if (args.ContainsKey("sender")) + if (args != null && args.ContainsKey("sender")) { this.Sender = ReturnToString(args["sender"]); } - if (args.ContainsKey("timestamp")) + if (args != null && args.ContainsKey("timestamp")) { this.Timestamp = ReturnToString(args["timestamp"]); } - if (args.ContainsKey("attachments")) + if (args != null && args.ContainsKey("attachments")) { this.Attachments = ReturnToObjectArray(args["attachments"]); } - if (args.ContainsKey("reactions")) + if (args != null && args.ContainsKey("reactions")) { this.Reactions = ReturnToStringArray(args["reactions"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index bbb34168..8904bc12 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -139,15 +139,15 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("id")) + if (args != null && args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } - if (args.ContainsKey("name")) + if (args != null && args.ContainsKey("name")) { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } - if (args.ContainsKey("url")) + if (args != null && args.ContainsKey("url")) { this.Url = ReturnToString(args["url"]); } - if (args.ContainsKey("attachmentType")) + if (args != null && args.ContainsKey("attachmentType")) { this.AttachmentType = ReturnToString(args["attachmentType"]); } - if (args.ContainsKey("thumbnail")) + if (args != null && args.ContainsKey("thumbnail")) { this.Thumbnail = ReturnToString(args["thumbnail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index ebe60dc4..c910d5fa 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbChatMessageAttachment?)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index ec377a44..dae7cb30 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbChatMessage?)ConvertReturnValue(args["detail"], "ChatMessage", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index c9dee23d..c2606ba4 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -94,9 +94,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("message")) + if (args != null && args.ContainsKey("message")) { this.Message = (IgbChatMessage?)ConvertReturnValue(args["message"], "ChatMessage", true); } - if (args.ContainsKey("reaction")) + if (args != null && args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index a54f1c93..bb741624 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbChatMessageReaction?)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index 26725331..d8791fe7 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbCheckboxChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index 0350606f..fad4e54c 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -89,9 +89,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("checked")) + if (args != null && args.ContainsKey("checked")) { this.Checked = ReturnToBoolean(args["checked"]); } - if (args.ContainsKey("value")) + if (args != null && args.ContainsKey("value")) { this.Value = ReturnToString(args["value"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 4f7cc2e6..75085e3f 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbComboChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 605da411..fa9a80e8 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -165,11 +165,11 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("newValue")) + if (args != null && args.ContainsKey("newValue")) { this.NewValue = ReturnToObjectArray(args["newValue"]); } - if (args.ContainsKey("items")) + if (args != null && args.ContainsKey("items")) { this.Items = ReturnToObjectArray(args["items"]); } - if (args.ContainsKey("changeType")) + if (args != null && args.ContainsKey("changeType")) { this.ChangeType = StringToEnum(args["changeType"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs index 05ac3162..6b60608b 100644 --- a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = ReturnToBoolean(args["detail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index c1994ec5..ea241c1e 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -56,7 +56,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = ReturnToPrimitive(args["detail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs index b5ef0fac..38db9d70 100644 --- a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = ReturnToDate(args["detail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 2ca14726..2f61c533 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = ReturnToString(args["detail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/DateRangeValueDetail.cs b/src/components/Blazor/DateRangeValueDetail.cs index c84f531b..344f763b 100644 --- a/src/components/Blazor/DateRangeValueDetail.cs +++ b/src/components/Blazor/DateRangeValueDetail.cs @@ -90,9 +90,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("start")) + if (args != null && args.ContainsKey("start")) { this.Start = ReturnToDate(args["start"]); } - if (args.ContainsKey("end")) + if (args != null && args.ContainsKey("end")) { this.End = ReturnToDate(args["end"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 8b172de6..971027ee 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbDateRangeValueDetail?)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index 4a448314..13f39987 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbDropdownItem?)ConvertReturnValue(args["detail"], "DropdownItem", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 3eb37469..ed9550b2 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbExpansionPanel?)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/HighlightNavigation.cs b/src/components/Blazor/HighlightNavigation.cs index f29b1326..33c7b3f4 100644 --- a/src/components/Blazor/HighlightNavigation.cs +++ b/src/components/Blazor/HighlightNavigation.cs @@ -66,7 +66,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("preventScroll")) + if (args != null && args.ContainsKey("preventScroll")) { this.PreventScroll = ReturnToBoolean(args["preventScroll"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 80e9a126..6a2924a4 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -59,9 +59,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("name")) + if (args != null && args.ContainsKey("name")) { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } - if (args.ContainsKey("collection")) + if (args != null && args.ContainsKey("collection")) { this.Collection = ReturnToString(args["collection"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/NumberEventArgs.cs b/src/components/Blazor/NumberEventArgs.cs index c82ac891..0c6491f2 100644 --- a/src/components/Blazor/NumberEventArgs.cs +++ b/src/components/Blazor/NumberEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = ReturnToDouble(args["detail"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/NumberFormatSpecifier.cs b/src/components/Blazor/NumberFormatSpecifier.cs index 3f33ea37..154d48f9 100644 --- a/src/components/Blazor/NumberFormatSpecifier.cs +++ b/src/components/Blazor/NumberFormatSpecifier.cs @@ -488,43 +488,43 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("locale")) + if (args != null && args.ContainsKey("locale")) { this.Locale = ReturnToString(args["locale"]); } - if (args.ContainsKey("compactDisplay")) + if (args != null && args.ContainsKey("compactDisplay")) { this.CompactDisplay = ReturnToString(args["compactDisplay"]); } - if (args.ContainsKey("currency")) + if (args != null && args.ContainsKey("currency")) { this.Currency = ReturnToString(args["currency"]); } - if (args.ContainsKey("currencyDisplay")) + if (args != null && args.ContainsKey("currencyDisplay")) { this.CurrencyDisplay = ReturnToString(args["currencyDisplay"]); } - if (args.ContainsKey("currencySign")) + if (args != null && args.ContainsKey("currencySign")) { this.CurrencySign = ReturnToString(args["currencySign"]); } - if (args.ContainsKey("currencyCode")) + if (args != null && args.ContainsKey("currencyCode")) { this.CurrencyCode = ReturnToString(args["currencyCode"]); } - if (args.ContainsKey("localeMatcher")) + if (args != null && args.ContainsKey("localeMatcher")) { this.LocaleMatcher = ReturnToString(args["localeMatcher"]); } - if (args.ContainsKey("notation")) + if (args != null && args.ContainsKey("notation")) { this.Notation = ReturnToString(args["notation"]); } - if (args.ContainsKey("numberingSystem")) + if (args != null && args.ContainsKey("numberingSystem")) { this.NumberingSystem = ReturnToString(args["numberingSystem"]); } - if (args.ContainsKey("signDisplay")) + if (args != null && args.ContainsKey("signDisplay")) { this.SignDisplay = ReturnToString(args["signDisplay"]); } - if (args.ContainsKey("style")) + if (args != null && args.ContainsKey("style")) { this.Style = ReturnToString(args["style"]); } - if (args.ContainsKey("unit")) + if (args != null && args.ContainsKey("unit")) { this.Unit = ReturnToString(args["unit"]); } - if (args.ContainsKey("unitDisplay")) + if (args != null && args.ContainsKey("unitDisplay")) { this.UnitDisplay = ReturnToString(args["unitDisplay"]); } - if (args.ContainsKey("useGrouping")) + if (args != null && args.ContainsKey("useGrouping")) { this.UseGrouping = ReturnToBoolean(args["useGrouping"]); } - if (args.ContainsKey("minimumIntegerDigits")) + if (args != null && args.ContainsKey("minimumIntegerDigits")) { this.MinimumIntegerDigits = ReturnToInt(args["minimumIntegerDigits"]); } - if (args.ContainsKey("minimumFractionDigits")) + if (args != null && args.ContainsKey("minimumFractionDigits")) { this.MinimumFractionDigits = ReturnToInt(args["minimumFractionDigits"]); } - if (args.ContainsKey("maximumFractionDigits")) + if (args != null && args.ContainsKey("maximumFractionDigits")) { this.MaximumFractionDigits = ReturnToInt(args["maximumFractionDigits"]); } - if (args.ContainsKey("minimumSignificantDigits")) + if (args != null && args.ContainsKey("minimumSignificantDigits")) { this.MinimumSignificantDigits = ReturnToInt(args["minimumSignificantDigits"]); } - if (args.ContainsKey("maximumSignificantDigits")) + if (args != null && args.ContainsKey("maximumSignificantDigits")) { this.MaximumSignificantDigits = ReturnToInt(args["maximumSignificantDigits"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 737db8f6..432d4917 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbRadioChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index a9b291e9..d2bc4765 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -89,9 +89,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("checked")) + if (args != null && args.ContainsKey("checked")) { this.Checked = ReturnToBoolean(args["checked"]); } - if (args.ContainsKey("value")) + if (args != null && args.ContainsKey("value")) { this.Value = ReturnToString(args["value"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RangeSliderValue.cs b/src/components/Blazor/RangeSliderValue.cs index d6aae645..dd48d4af 100644 --- a/src/components/Blazor/RangeSliderValue.cs +++ b/src/components/Blazor/RangeSliderValue.cs @@ -80,9 +80,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("lower")) + if (args != null && args.ContainsKey("lower")) { this.Lower = ReturnToDouble(args["lower"]); } - if (args.ContainsKey("upper")) + if (args != null && args.ContainsKey("upper")) { this.Upper = ReturnToDouble(args["upper"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index aa1fa365..7f9a79fb 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -61,7 +61,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbRangeSliderValue?)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index acbf9062..3921adc7 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbSelectItem?)ConvertReturnValue(args["detail"], "SelectItem", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index 00d1ab03..0e90ef75 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbSplitterResizeEventArgsDetail?)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/SplitterResizeEventArgsDetail.cs b/src/components/Blazor/SplitterResizeEventArgsDetail.cs index b1a7ea2d..819ff05b 100644 --- a/src/components/Blazor/SplitterResizeEventArgsDetail.cs +++ b/src/components/Blazor/SplitterResizeEventArgsDetail.cs @@ -114,11 +114,11 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("startPanelSize")) + if (args != null && args.ContainsKey("startPanelSize")) { this.StartPanelSize = ReturnToDouble(args["startPanelSize"]); } - if (args.ContainsKey("endPanelSize")) + if (args != null && args.ContainsKey("endPanelSize")) { this.EndPanelSize = ReturnToDouble(args["endPanelSize"]); } - if (args.ContainsKey("delta")) + if (args != null && args.ContainsKey("delta")) { this.Delta = ReturnToDouble(args["delta"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index d402ea54..214d8fdb 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbTab?)ConvertReturnValue(args["detail"], "Tab", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 69169456..fbaf1317 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -90,9 +90,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("tile")) + if (args != null && args.ContainsKey("tile")) { this.Tile = (IgbTile?)ConvertReturnValue(args["tile"], "Tile", true); } - if (args.ContainsKey("state")) + if (args != null && args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 85dcb9bb..0b8c8417 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbTile?)ConvertReturnValue(args["detail"], "Tile", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 8bd94982..175d7a39 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbTreeItem?)ConvertReturnValue(args["detail"], "TreeItem", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index 61fde2f5..c08a2d71 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("detail")) + if (args != null && args.ContainsKey("detail")) { this.Detail = (IgbTreeSelectionEventArgsDetail?)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index e215c624..53037c7a 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args.ContainsKey("newSelection")) + if (args != null && args.ContainsKey("newSelection")) { this.NewSelection = ReturnToObjectArray(args["newSelection"]); } this.SuppressParentNotify = false; diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 9a387e8d..06efc0e6 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -977,9 +977,9 @@ private JsonSerializerOptions SerializerOptions { if (_serializerOptions == null) { - var def = IgBlazor.Settings.JsonSerializerOptions; + var def = IgBlazor.Settings?.JsonSerializerOptions; var options = new JsonSerializerOptions(); - options.MaxDepth = def.MaxDepth; + options.MaxDepth = def != null ? def.MaxDepth : 0; _serializerOptions = options; } return _serializerOptions; diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index d435758a..fd8c7be0 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -27,7 +27,7 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) foreach (var data in _dataSources.Values) { - if (data.HasId(id)) + if (data != null && data.HasId(id)) { return data.LookupOriginal(id); } @@ -38,7 +38,7 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) { foreach (var data in _dataSources.Values) { - if (data.HasId(id)) + if (data != null && data.HasId(id)) { return data.LookupOriginal(id); } diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index a64ee531..ce3c23d5 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -145,6 +145,6 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) } public bool IsInproc { get; private set; } - public bool IsForcedJsonDataMarshalling { get { return _igBlazor!.Settings.ForceJsonDataMarshalling; } } + public bool IsForcedJsonDataMarshalling { get { return _igBlazor?.Settings?.ForceJsonDataMarshalling ?? false; } } } } From 187d80a3d0566aa9de663b88ad4ed613317bc312 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:33:32 +0000 Subject: [PATCH 16/64] Initial plan From e56d8c5b9745d6e201af89d71a9e95acc68b27a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:40:30 +0000 Subject: [PATCH 17/64] Address review feedback: null guards, dash encoding, delegate fix Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com> --- src/components/Blazor/IconButton.cs | 6 ++-- src/componentsBase/DataAdapters.cs | 8 ++--- src/componentsBase/DynamicContentHolder.cs | 2 +- src/componentsBase/IgbTemplateContent.razor | 6 ++-- src/componentsBase/RuntimeHelper.cs | 4 +-- src/componentsBase/WebViewCallback.cs | 29 ++++++++++--------- stories/Components/Stories/Chat.stories.razor | 22 ++++++++++---- 7 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/components/Blazor/IconButton.cs b/src/components/Blazor/IconButton.cs index 8e873518..cec7d6f5 100644 --- a/src/components/Blazor/IconButton.cs +++ b/src/components/Blazor/IconButton.cs @@ -120,11 +120,11 @@ public bool Mirrored /// /// The variant of the button which determines its visual appearance. /// - /// filled background; + /// – filled background; /// highest visual emphasis (default). - /// transparent background + /// – transparent background /// with a visible border. - /// no background or border; + /// – no background or border; /// lowest visual emphasis. /// /// diff --git a/src/componentsBase/DataAdapters.cs b/src/componentsBase/DataAdapters.cs index 4a466f97..89d275cb 100644 --- a/src/componentsBase/DataAdapters.cs +++ b/src/componentsBase/DataAdapters.cs @@ -7,17 +7,17 @@ public LocalJson(string json) _json = json; } - public static LocalJson? From(string json) + public static LocalJson From(string json) { return new LocalJson(json); } - private string? _json; - public string? Json { get { return _json; } } + private string _json; + public string Json { get { return _json; } } internal string ToRef() { - return "localJson:::" + Json!.Replace("\\", "\\\\").Replace("\"", "\\\""); + return "localJson:::" + Json.Replace("\\", "\\\\").Replace("\"", "\\\""); } } diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 6c0acea3..c43dc1d9 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -282,7 +282,7 @@ private void OnContextChanged(T? oldValue, T? newValue) if (_hasPopulatedContext) { - template.Context = (T?)Context; + template.Context = Context!; } template.Template = Template; template.Update(); diff --git a/src/componentsBase/IgbTemplateContent.razor b/src/componentsBase/IgbTemplateContent.razor index 2711de01..e224a9f0 100644 --- a/src/componentsBase/IgbTemplateContent.razor +++ b/src/componentsBase/IgbTemplateContent.razor @@ -4,7 +4,7 @@
@if (Template != null && _hasPopulatedContext) { - @Template(Context!) + @Template(Context) }
@@ -14,9 +14,9 @@ public RenderFragment? Template { get; set; } private bool _hasPopulatedContext = false; - private T? _context; + private T _context = default!; [Parameter] - public T? Context + public T Context { get { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index ce3c23d5..f56c3769 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -133,10 +133,10 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, dataIntents); } #else - if (_callSendUnmarshalledColumnMessage != null) + if (_callSendUnmarshalledColumnDataIntentMessage != null) { //Console.WriteLine("invoking sadness"); - return _callSendUnmarshalledColumnDataIntentMessage!(_inprocRuntime!, methodName, refName, dataIntents); + return _callSendUnmarshalledColumnDataIntentMessage(_inprocRuntime!, methodName, refName, dataIntents); } #endif _inprocRuntime!.InvokeVoid(methodName, new object[] { refName, dataIntents }); diff --git a/src/componentsBase/WebViewCallback.cs b/src/componentsBase/WebViewCallback.cs index 90a50801..02a06558 100644 --- a/src/componentsBase/WebViewCallback.cs +++ b/src/componentsBase/WebViewCallback.cs @@ -135,21 +135,24 @@ public void AdjustDynamicContentBatch(string containerId, string batch) if (control != null) { var arr = control.DeserializeDictionaryArray(batch); - for (var i = 0; i < arr!.Length; i++) + if (arr != null) { - var item = arr[i]; - string? currContainer = item.ContainsKey("containerId") ? item["containerId"].ToString() : null; - string? contentType = item.ContainsKey("contentType") ? item["contentType"].ToString() : null; - string? templateId = item.ContainsKey("templateId") ? item["templateId"].ToString() : null; - string? contentId = item.ContainsKey("contentId") ? item["contentId"].ToString() : null; - string? actionType = item.ContainsKey("actionType") ? item["actionType"].ToString() : null; - string? args = item.ContainsKey("args") ? (item["args"] != null ? item["args"].ToString() : null) : null; - //Console.WriteLine("raising event"); - if (currContainer != null) + for (var i = 0; i < arr.Length; i++) { - var currControl = GetControl(currContainer); - //Console.WriteLine("found target"); - currControl!.AdjustDynamicContent(containerId, contentType, templateId, contentId, actionType, args); + var item = arr[i]; + string? currContainer = item.ContainsKey("containerId") ? item["containerId"].ToString() : null; + string? contentType = item.ContainsKey("contentType") ? item["contentType"].ToString() : null; + string? templateId = item.ContainsKey("templateId") ? item["templateId"].ToString() : null; + string? contentId = item.ContainsKey("contentId") ? item["contentId"].ToString() : null; + string? actionType = item.ContainsKey("actionType") ? item["actionType"].ToString() : null; + string? args = item.ContainsKey("args") ? (item["args"] != null ? item["args"].ToString() : null) : null; + //Console.WriteLine("raising event"); + if (currContainer != null) + { + var currControl = GetControl(currContainer); + //Console.WriteLine("found target"); + currControl?.AdjustDynamicContent(containerId, contentType, templateId, contentId, actionType, args); + } } } control.RefreshDynamicContent(); diff --git a/stories/Components/Stories/Chat.stories.razor b/stories/Components/Stories/Chat.stories.razor index b5654fdc..61157500 100644 --- a/stories/Components/Stories/Chat.stories.razor +++ b/stories/Components/Stories/Chat.stories.razor @@ -99,9 +99,14 @@ private async Task OnBasicMessageCreated(IgbChatMessageEventArgs args) { var userMessage = args.Detail; - if (!_basicMessages.Any(x => x.Id == userMessage!.Id)) + if (userMessage is null) { - _basicMessages = [.. _basicMessages, userMessage!]; + return; + } + + if (!_basicMessages.Any(x => x.Id == userMessage.Id)) + { + _basicMessages = [.. _basicMessages, userMessage]; } _basicOptions.Suggestions = []; @@ -110,15 +115,20 @@ await Task.Delay(700); _basicOptions.IsTyping = false; - _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage!.Text!)]; + _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage.Text ?? string.Empty)]; } private async Task OnTemplateMessageCreated(IgbChatMessageEventArgs args) { var userMessage = args.Detail; - if (!_templateMessages.Any(x => x.Id == userMessage!.Id)) + if (userMessage is null) + { + return; + } + + if (!_templateMessages.Any(x => x.Id == userMessage.Id)) { - _templateMessages = [.. _templateMessages, userMessage!]; + _templateMessages = [.. _templateMessages, userMessage]; } _templateOptions.Suggestions = []; @@ -127,7 +137,7 @@ await Task.Delay(700); _templateOptions.IsTyping = false; - _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage!.Text!)]; + _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage.Text ?? string.Empty)]; } private static IgbChatMessage BuildAgentReply(string prompt) From d522e7861fcc2a3cc573a0e09f0232501cc06c5c Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 25 Aug 2026 16:41:03 +0300 Subject: [PATCH 18/64] Fix type mismatch. --- src/componentsBase/RuntimeHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index ce3c23d5..59dcee7c 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -57,7 +57,7 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) var meth = target.MakeGenericMethod(new Type[] { typeof(string), typeof(int), - typeof(UnmarshalledColumn[]), + typeof(UnmarshalledColumn?[]), typeof(string) }); @@ -65,7 +65,7 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) var methodNameParam = Expression.Parameter(typeof(string), "methodName"); var refNameParam = Expression.Parameter(typeof(string), "refName"); var indexParam = Expression.Parameter(typeof(int), "index"); - var columnsParam = Expression.Parameter(typeof(UnmarshalledColumn[]), "columns"); + var columnsParam = Expression.Parameter(typeof(UnmarshalledColumn?[]), "columns"); var wsRuntime = Expression.Convert(jsRuntimeParam, inprocRuntime.GetType()); var call = Expression.Call(wsRuntime, meth, methodNameParam, refNameParam, From 5b1b0579937da39d976f8afb632193436d6b23cd Mon Sep 17 00:00:00 2001 From: Maya Date: Tue, 25 Aug 2026 16:58:51 +0300 Subject: [PATCH 19/64] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/componentsBase/BaseRendererControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 51a5fd1b..f42a94e6 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -2212,7 +2212,7 @@ internal double ReturnToDouble(object? val) //Console.WriteLine(val); return ((IConvertible)val).ToDouble(CultureInfo.InvariantCulture); } - else if (val != null) + else { //Console.WriteLine(val); return Double.Parse(val.ToString()!); @@ -2262,7 +2262,7 @@ internal long ReturnToLong(object val) } try { - var arr = JsonSerializer.Deserialize(val?.ToString()!, SerializerOptions); + var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); DateTime[] ret = new DateTime[arr!.Length]; for (int i = 0; i < arr.Length; i++) { From 2a7b86a20c961b4d8d9668e59ee936a34923eb8f Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 12:11:34 +0300 Subject: [PATCH 20/64] Avoid null-forgiving operator where possible in favor of actual null checks. --- src/componentsBase/BaseRendererControl.cs | 319 +++++++++++++--------- src/componentsBase/BaseRendererElement.cs | 17 +- src/componentsBase/WebInputs/Chat.cs | 4 +- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 2 +- 4 files changed, 202 insertions(+), 140 deletions(-) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index f42a94e6..87cf718d 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -739,7 +739,7 @@ internal void AdjustDynamicContent(string? containerId, string? contentType, str return _contentTemplateTypes[templateId]; } - private Dictionary> _dynamicContentBuilders = new Dictionary>(); + private Dictionary> _dynamicContentBuilders = new Dictionary>(); private DynamicContentInfo? BuildDynamicContentInfo(string? contentType, string? templateId) { var templateContentType = TemplateContentType(templateId); @@ -760,7 +760,7 @@ internal void AdjustDynamicContent(string? containerId, string? contentType, str else { //TODO: other types - _dynamicContentBuilders[templateContentType] = () => null!; + _dynamicContentBuilders[templateContentType] = () => null; } } return _dynamicContentBuilders[templateContentType](); @@ -807,11 +807,14 @@ public async Task EnsureReady() //Console.WriteLine("ensuring ready: " + this.GetType().Name); while (!this._ready) { - bool ready = await JsRuntime!.InvokeAsync("igCheckReady", new object[] { _containerId }); + bool ready = JsRuntime != null ? await JsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }) : false; //Console.WriteLine(ready + " -> " + this.GetType().Name); if (ready) { - await JsRuntime.InvokeVoidAsync("igWaitForLoaded"); + if (JsRuntime != null) + { + await JsRuntime.InvokeVoidAsync("igWaitForLoaded"); + } OnReady(); break; } @@ -961,12 +964,12 @@ public string Serialize() private Object _semLock = new Object(); static long _invokeId = 0; - protected async Task InvokeMethod(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected async Task InvokeMethod(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) { return await InvokeMethodHelper(null, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected object? InvokeMethodSync(string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements = null) { return InvokeMethodHelperSync(null, methodName, arguments, types, nativeElements); } @@ -987,7 +990,7 @@ private JsonSerializerOptions SerializerOptions } } - internal object InvokeMethodHelperSync(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) + internal object? InvokeMethodHelperSync(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -1022,26 +1025,29 @@ internal object InvokeMethodHelperSync(string? target, string methodName, object if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str!, SerializerOptions); - - if (retDict!.ContainsKey("retType") && - retDict["retType"] is JsonElement && - ((JsonElement)retDict["retType"]).GetString() == "promise") + if (str != null) { - throw new Exception($"Invocation of method \"{methodName}\" returned a promise. Please use the async version of the method to get the value."); - } + var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); - ret = retDict; + if (retDict != null && retDict.ContainsKey("retType") && + retDict["retType"] is JsonElement && + ((JsonElement)retDict["retType"]).GetString() == "promise") + { + throw new Exception($"Invocation of method \"{methodName}\" returned a promise. Please use the async version of the method to get the value."); + } + + ret = retDict; + } } //Console.WriteLine("got return"); //Console.WriteLine(ret); - return ret!; + return ret; } - Dictionary> _methodTasks = new Dictionary>(); + Dictionary> _methodTasks = new Dictionary>(); - internal async Task InvokeMethodHelper(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) + internal async Task InvokeMethodHelper(string? target, string methodName, object?[] arguments, string[] types, ElementReference[]? nativeElements) { if (!_ready) { @@ -1068,7 +1074,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName m.NativeElements = nativeElements; var ret = await SendMessageImmediate(m); - TaskCompletionSource tcs = new TaskCompletionSource(); + TaskCompletionSource tcs = new TaskCompletionSource(); _methodTasks.Add(invokeId, tcs); if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) @@ -1089,7 +1095,7 @@ internal async Task InvokeMethodHelper(string? target, string methodName } else { - tcs.SetResult(ret!); + tcs.SetResult(ret); } } var result = await tcs.Task; @@ -1299,9 +1305,9 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal } } } - else + else if (_dataSourceManager != null) { - refId = _dataSourceManager!.OnRefChanged(propertyName, newValue); + refId = _dataSourceManager.OnRefChanged(propertyName, newValue); } } else if (newValue == null) @@ -1314,7 +1320,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal { var str = newValue.ToString(); - if (str!.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::")) + if (str != null && (str.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::"))) { OnRefChanged(refId, "\"" + newValue.ToString() + "\""); } @@ -1323,7 +1329,10 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal OnRefChanged(refId, "\"script:::" + newValue.ToString() + "\""); } } - refChanged(refId!, oldValue, newValue); + if (refId != null) + { + refChanged(refId, oldValue, newValue); + } } internal string DateToString(DateTime val) @@ -1337,7 +1346,10 @@ internal string DateToString(DateTime val) /// The datasource that is being changed. public void SuspendNotifications(object dataSource) { - _dataSourceManager!.SuspendNotifications(dataSource); + if (_dataSourceManager != null) + { + _dataSourceManager.SuspendNotifications(dataSource); + } } /// /// Resumes data change notifications. @@ -1346,12 +1358,15 @@ public void SuspendNotifications(object dataSource) /// Whether to notify the component that the datasource items changed. public void ResumeNotifications(object dataSource, bool notify = true) { - _dataSourceManager!.ResumeNotifications(dataSource, notify); + if (_dataSourceManager != null) + { + _dataSourceManager.ResumeNotifications(dataSource, notify); + } } public void NotifyInsertItem(object dataSource, int index, object refItem) { - if (!_dataSourceManager!.HasRefId(dataSource)) + if (_dataSourceManager == null || !_dataSourceManager.HasRefId(dataSource)) { return; } @@ -1365,7 +1380,7 @@ public void NotifyInsertItem(object dataSource, int index, object refItem) public void NotifyRemoveItem(object dataSource, int index, object oldItem) { - if (!_dataSourceManager!.HasRefId(dataSource)) + if (_dataSourceManager == null || !_dataSourceManager.HasRefId(dataSource)) { return; } @@ -1379,7 +1394,7 @@ public void NotifyRemoveItem(object dataSource, int index, object oldItem) public void NotifyClearItems(object dataSource) { - if (!_dataSourceManager!.HasRefId(dataSource)) + if (_dataSourceManager == null || !_dataSourceManager.HasRefId(dataSource)) { return; } @@ -1393,7 +1408,7 @@ public void NotifyClearItems(object dataSource) public void NotifySetItem(object dataSource, int index, object oldItem, object newItem) { - if (!_dataSourceManager!.HasRefId(dataSource)) + if (_dataSourceManager == null || !_dataSourceManager.HasRefId(dataSource)) { return; } @@ -1407,7 +1422,7 @@ public void NotifySetItem(object dataSource, int index, object oldItem, object n public void NotifyUpdateItem(object dataSource, int index, object refItem, bool syncDataOnly = false) { - if (!_dataSourceManager!.HasRefId(dataSource)) + if (_dataSourceManager == null || !_dataSourceManager.HasRefId(dataSource)) { return; } @@ -1432,7 +1447,7 @@ public void OnRefChanged(string refName, object? refValue) { m.SetData("dataIntents", dataIntents); } - if (ds!.DataSourceType == JSDataSourceType.Json) + if (ds != null && ds.DataSourceType == JSDataSourceType.Json) { if (!ds.IsSent) { @@ -1624,11 +1639,14 @@ private void Update() } //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); - while (_messageQueue.Count > 0) + while (_messageQueue != null && _messageQueue.Count > 0) { - RendererMessage m = _messageQueue!.First!.Value; - _messageQueue.RemoveFirst(); - ProcessMessage(m); + RendererMessage? m = _messageQueue?.First?.Value; + _messageQueue?.RemoveFirst(); + if (m != null) + { + ProcessMessage(m); + } } } @@ -1701,7 +1719,7 @@ private void ProcessMessageSync(RendererMessage m) private async Task SendJsonImmediate(RendererMessage m) { - if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) { return null; } @@ -1722,21 +1740,25 @@ private void ProcessMessageSync(RendererMessage m) if (m.NativeElements != null) { - return await JsRuntime!.InvokeAsync("igSendMessage", + return await JsRuntime.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), m.NativeElements }); } else { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return await JsRuntime!.InvokeAsync("igSendMessage", + return await JsRuntime.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); } } - private object SendJsonImmediateSync(RendererMessage m) + private object? SendJsonImmediateSync(RendererMessage m) { + if (this.JsInProcessRuntime == null) + { + return null; + } if (m.Type == _description) { string ser = this.Serialize(); @@ -1750,13 +1772,13 @@ private object SendJsonImmediateSync(RendererMessage m) if (nativeElements != null) { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this!.JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, + return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this!.JsInProcessRuntime!.Invoke("igSendMessage", new object[] { this._containerId, json, + return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef()}); } } @@ -1765,20 +1787,20 @@ private void SendJson(string json, ElementReference[]? nativeElements) { //json = "window.sendMessage(`" + this._containerId + "`, `" + json + "`)"; //Console.WriteLine(json); - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) { return; } if (nativeElements != null) { - JsRuntime!.InvokeAsync("igSendMessage", + JsRuntime.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { - JsRuntime!.InvokeAsync("igSendMessage", + JsRuntime.InvokeAsync("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); } @@ -1841,17 +1863,20 @@ internal void DetachChild(BaseCollection child) private void SendJsonSync(string json, ElementReference[]? nativeElements) { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - + if (this.JsInProcessRuntime == null) + { + return; + } if (nativeElements != null) { - JsInProcessRuntime!.Invoke("igSendMessage", + JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); } else { - JsInProcessRuntime!.Invoke("igSendMessage", + JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef() }); @@ -1963,12 +1988,12 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) String id = ((JsonElement)obj["id"]).ToString(); if (id.Contains("/")) { - returnValue = _dataSourceManager!.FindItem(id); + returnValue = _dataSourceManager?.FindItem(id); } else { Guid uuid = Guid.Parse(id); - returnValue = _dataSourceManager!.FindItem(uuid); + returnValue = _dataSourceManager?.FindItem(uuid); } } else @@ -2136,20 +2161,20 @@ public void OnInvokeReturn(long invokeId, Object returnValue) }); } - internal T ReturnToObject(object val) + internal T? ReturnToObject(object val) { return ReturnToObject(val, null); } - internal T ReturnToObject(object? val, string? typeGuess) + internal T? ReturnToObject(object? val, string? typeGuess) { if (val == null) { - return default(T)!; + return default(T?); } val = ConvertReturnValue(val, false, typeGuess); - return (T)val!; + return (T?)val; } public virtual object? FindByName(string name) @@ -2183,11 +2208,11 @@ internal int ReturnToInt(object? val) { return ((IConvertible)val).ToInt32(CultureInfo.InvariantCulture); } - else if (val != null) + else { - return int.Parse(val.ToString()!); + var stringVal = val?.ToString(); + return stringVal != null ? int.Parse(stringVal) : 0; } - return 0; } internal double ReturnToDouble(object? val) @@ -2215,19 +2240,15 @@ internal double ReturnToDouble(object? val) else { //Console.WriteLine(val); - return Double.Parse(val.ToString()!); + var stringVal = val.ToString(); + return stringVal != null ? Double.Parse(stringVal) : double.NaN; } - return double.NaN; } - internal long ReturnToLong(object val) + internal long ReturnToLong(object? val) { - if (val == null) - { - return 0; - } //Console.WriteLine("converting return"); - val = ConvertReturnValue(val)!; + val = ConvertReturnValue(val); if (val == null) { return Int64.MinValue; @@ -2244,17 +2265,14 @@ internal long ReturnToLong(object val) } else { + var stringVal = val?.ToString(); //Console.WriteLine(val); - return (long)Double.Parse(val.ToString()!); + return stringVal != null ? (long)Double.Parse(stringVal) : Int64.MinValue; } } internal DateTime[]? ReturnToDateArray(object? val) { - if (val == null) - { - return null; - } val = ConvertReturnValue(val); if (val == null) { @@ -2262,11 +2280,16 @@ internal long ReturnToLong(object val) } try { - var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); + var stringVal = val?.ToString(); + if (stringVal == null) + { + return null; + } + var arr = JsonSerializer.Deserialize(stringVal, SerializerOptions); DateTime[] ret = new DateTime[arr!.Length]; for (int i = 0; i < arr.Length; i++) { - Object ele = arr[i]!; + Object? ele = arr[i]; ele = ReturnToDate(ele); ret[i] = (DateTime)ele; } @@ -2299,11 +2322,11 @@ internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) switch (RoundTripDateConversion) { case RoundTripDateConversion.UTC: - return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + return DateTime.Parse((string)val, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); case RoundTripDateConversion.Auto: case RoundTripDateConversion.Local: default: - return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return DateTime.Parse((string)val, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); } } else if (val is IConvertible) @@ -2314,25 +2337,31 @@ internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) else { //Console.WriteLine(val); + var dateString = val.ToString(); + if (dateString == null) + { + return DateTime.MinValue; + } + switch (RoundTripDateConversion) { case RoundTripDateConversion.UTC: - return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + return DateTime.Parse(dateString, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); case RoundTripDateConversion.Auto: case RoundTripDateConversion.Local: default: - return DateTime.Parse(val.ToString()!, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return DateTime.Parse(dateString, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); } } } internal bool ReturnToBoolean(object? val) { + val = ConvertReturnValue(val); if (val == null) { return false; } - val = ConvertReturnValue(val)!; if (val is bool) { return (bool)val; @@ -2343,7 +2372,8 @@ internal bool ReturnToBoolean(object? val) } else { - return Boolean.Parse(val.ToString()!); + var stringVal = val?.ToString(); + return stringVal != null ? Boolean.Parse(stringVal) : false; } } @@ -2415,7 +2445,7 @@ internal void ObjectToParam(SerializationContext? context, object? val) return; } var w = context.Writer; - Guid id = _dataSourceManager!.FindItemId(val); + Guid id = _dataSourceManager?.FindItemId(val) ?? Guid.Empty; var typeName = ""; @@ -2506,7 +2536,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object? if (val is BaseRendererControl) { - typeName = ((BaseRendererControl)val).Type!; + typeName = ((BaseRendererControl)val).Type ?? ""; } else if (val is BaseRendererElement) { @@ -2603,11 +2633,7 @@ internal void ObjectToParam(SerializationContext c, Type type, object? val) internal string? ReturnToString(object? val) { - if (val == null) - { - return null; - } - val = ConvertReturnValue(val)!; + val = ConvertReturnValue(val); if (val == null) { @@ -2660,11 +2686,7 @@ protected virtual bool UseCamelEnumValues internal T StringToEnum(Object? val) where T : struct { - if (val == null) - { - return default(T); - } - val = ConvertReturnValue(val)!; + val = ConvertReturnValue(val); if (val == null) { return default(T); @@ -2784,11 +2806,7 @@ internal T StringToEnum(Object? val) where T : struct internal object[]? ReturnToObjectArray(object? val) { - if (val == null) - { - return null; - } - val = ConvertReturnValue(val)!; + val = ConvertReturnValue(val); if (val == null) { return null; @@ -2796,12 +2814,19 @@ internal T StringToEnum(Object? val) where T : struct try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - Object[] ret = new Object[arr!.Length]; + if (arr == null) + { + return null; + } + Object[] ret = new Object[arr.Length]; for (int i = 0; i < arr.Length; i++) { - Object ele = arr[i]; - ele = ConvertReturnValue(ele)!; - ret[i] = ele; + Object? ele = arr[i]; + ele = ConvertReturnValue(ele); + if (ele != null) + { + ret[i] = ele; + } } return ret; } @@ -2818,22 +2843,35 @@ internal T StringToEnum(Object? val) where T : struct internal T[]? ReturnToObjectArray(object? val, string? typeGuess) { + val = ConvertReturnValue(val); + if (val == null) { return null; } - val = ConvertReturnValue(val)!; try { - var arr = JsonSerializer.Deserialize[]>(val.ToString()!, SerializerOptions); - T[] ret = new T[arr!.Length]; + var stringVal = val.ToString(); + if (stringVal == null) + { + return null; + } + var arr = JsonSerializer.Deserialize[]>(stringVal, SerializerOptions); + if (arr == null) + { + return null; + } + T[] ret = new T[arr.Length]; for (int i = 0; i < arr.Length; i++) { - Object ele = arr[i]; + Object? ele = arr[i]; //Console.WriteLine("converting obj"); //Console.WriteLine(ele); - ele = ConvertReturnValue(ele, false, typeGuess)!; - ret[i] = (T)ele; + ele = ConvertReturnValue(ele, false, typeGuess); + if (ele != null) + { + ret[i] = (T)ele; + } } return ret; } @@ -2845,11 +2883,7 @@ internal T StringToEnum(Object? val) where T : struct internal string[]? ReturnToStringArray(object? val) { - if (val == null) - { - return null; - } - val = ConvertReturnValue(val)!; + val = ConvertReturnValue(val); if (val == null) { return null; @@ -2857,12 +2891,20 @@ internal T StringToEnum(Object? val) where T : struct try { var valStr = val.ToString(); - var arr = JsonSerializer.Deserialize(valStr!, SerializerOptions); - string[] ret = new string[arr!.Length]; + if (valStr == null) + { + return null; + } + var arr = JsonSerializer.Deserialize(valStr, SerializerOptions); + if (arr == null) + { + return null; + } + string[] ret = new string[arr.Length]; for (int i = 0; i < arr.Length; i++) { - string? ele = arr[i] != null ? arr[i].ToString() : null; - ret[i] = ele!; + string ele = arr[i].ToString(); + ret[i] = ele; } return ret; } @@ -2874,15 +2916,24 @@ internal T StringToEnum(Object? val) where T : struct internal double[]? ReturnToDoubleArray(object? val) { + val = ConvertReturnValue(val); if (val == null) { return null; } - val = ConvertReturnValue(val)!; try { - var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - double[] ret = new double[arr!.Length]; + var stringVal = val.ToString(); + if (stringVal == null) + { + return null; + } + var arr = JsonSerializer.Deserialize(stringVal, SerializerOptions); + if (arr == null) + { + return null; + } + double[] ret = new double[arr.Length]; for (int i = 0; i < arr.Length; i++) { double ele = arr[i] != null ? Convert.ToDouble(arr[i]) : double.NaN; @@ -2896,13 +2947,13 @@ internal T StringToEnum(Object? val) where T : struct } } - internal int[]? ReturnToIntArray(object val) + internal int[]? ReturnToIntArray(object? val) { + val = ConvertReturnValue(val); if (val == null) { return null; } - val = ConvertReturnValue(val)!; try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); @@ -3077,12 +3128,21 @@ internal void OnRaiseEvent(string name, string propertyName, string args) try { var obj = JsonSerializer.Deserialize>((string)args.ToString(), SerializerOptions); + if (obj == null) + { + return; + } //Console.WriteLine(args.ToString()); - object sender = obj!["sender"]; + object sender = obj["sender"]; if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) { - sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString()!, SerializerOptions)!; + var stringVal = ((JsonElement)sender).GetString(); + if (stringVal == null) + { + return; + } + sender = JsonSerializer.Deserialize>(stringVal, SerializerOptions)!; } senderObj = ConvertReturnValue(sender); @@ -3112,7 +3172,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) // Avoid double unwrapping primitive value types. This primarily only applies to events with primitive types for event args which // there are not many of. bool needsConversion = true; - if (dict!.ContainsKey("retType")) + if (dict != null && dict.ContainsKey("retType")) { var retType = ((JsonElement)dict["retType"]).ToString(); if ("string".Equals(retType) || @@ -3244,20 +3304,20 @@ private async Task TrySendCleanupAsync() public async Task SetResourceStringAsync(string grouping, string id, string value) { - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) { return null; } - return await JsRuntime!.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); + return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); } public async Task SetResourceStringAsync(string grouping, string json) { - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) { return null; } - return await JsRuntime!.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); + return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); } protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, JsonElement jsonElement) @@ -3331,7 +3391,8 @@ protected void SetPropertyValue(object item, System.Reflection.PropertyInfo prop if (type.IsArray) { var src = (Array)value; - var dest = Array.CreateInstance(type.GetElementType()!, src.Length); + var elementType = type.GetElementType() ?? typeof(object); + var dest = Array.CreateInstance(elementType, src.Length); Array.Copy(src, dest, src.Length); property.SetValue(item, dest); return; @@ -3629,7 +3690,7 @@ internal string TransformKey(string? attributeKey) { return _transforms[attributeKey]; } - return attributeKey!; + return attributeKey ?? ""; } internal bool IsTransformedEnum(string? attributeKey) @@ -3651,7 +3712,7 @@ internal string TransformEnumValue(string? attributeKey, string? fieldName) return d[fieldName.ToLower()]; } } - return fieldName!; + return fieldName ?? ""; } internal void AddSequence(string? attributeKey, string? wcName = null, Dictionary? wcEnumTransform = null) diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 4f56b1d9..e46e638c 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -327,17 +327,17 @@ protected virtual string MethodTarget } } - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return await InvokeMethodHelper(MethodTarget, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) + protected object? InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements = null) { return InvokeMethodHelperSync(MethodTarget, methodName, arguments, types, nativeElements); } - protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) + protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (CurrParent == null) { @@ -353,7 +353,7 @@ protected async Task InvokeMethodHelper(string target, string methodName } } - protected object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) + protected object? InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[]? nativeElements) { if (CurrParent == null) { @@ -575,22 +575,23 @@ protected object? CurrParent } } - internal T ReturnToObject(Object val) + internal T? ReturnToObject(Object val) { return ReturnToObject(val, null); } - internal T ReturnToObject(Object val, string? typeGuess) + internal T? ReturnToObject(Object val, string? typeGuess) { EnsureValid(); if (CurrParent is BaseRendererElement) { return ((BaseRendererElement)CurrParent).ReturnToObject(val, typeGuess); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToObject(val, typeGuess); + return ((BaseRendererControl)CurrParent).ReturnToObject(val, typeGuess); } + return default(T); } internal int ReturnToInt(Object? val) diff --git a/src/componentsBase/WebInputs/Chat.cs b/src/componentsBase/WebInputs/Chat.cs index 375a3178..c7a47d4c 100644 --- a/src/componentsBase/WebInputs/Chat.cs +++ b/src/componentsBase/WebInputs/Chat.cs @@ -6,13 +6,13 @@ namespace IgniteUI.Blazor.Controls /// public partial class IgbChat { - public IgbChatDraftMessage GetCurrentDraftMessage() + public IgbChatDraftMessage? GetCurrentDraftMessage() { var iv = InvokeMethodSync("p:DraftMessage", new object?[] { }, new string[] { }); return ReturnToObject(iv, "ChatDraftMessage"); } - public async Task GetCurrentDraftMessageAsync() + public async Task GetCurrentDraftMessageAsync() { var iv = await InvokeMethod("p:DraftMessage", new object?[] { }, new string[] { }); return ReturnToObject(iv, "ChatDraftMessage"); diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index 7161a92c..798675a5 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -12,7 +12,7 @@ public class ChatTests : ComponentWithContractTestBase .Getter(c => c.GetCurrentDraftMessageAsync(), c => c.GetCurrentDraftMessage(), "DraftMessage", arrange: _ => { }, returns: FromRender.Of((interop, cut) => InteropReturn.Object("", """{"text": "wip draft"}""")), - assert: (cut, result) => Assert.Equal("wip draft", result.Text)) + assert: (cut, result) => Assert.Equal("wip draft", result!.Text)) .Event(c => c.TypingChange, argsJson: """{"detail": true}""", assert: args => Assert.True(args.Detail)) From 30c9576d1eb5bafc8aaed0b8b477f37c4a8ad7e8 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 14:38:16 +0300 Subject: [PATCH 21/64] Replace null-forgiving operator with checks. --- src/componentsBase/BaseRendererControl.cs | 2 +- src/componentsBase/BaseRendererElement.cs | 177 +++++++++++++--------- 2 files changed, 104 insertions(+), 75 deletions(-) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 87cf718d..3cfa5ed4 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -40,7 +40,7 @@ protected IIgniteUIBlazor IgBlazor { get { - return _igBlazor!; + return _igBlazor ?? throw new InvalidOperationException("IgBlazor accessed before dependency injection completed."); } set { diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index e46e638c..56bf1e5e 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -17,7 +17,7 @@ protected IIgniteUIBlazor IgBlazor { get { - return _igBlazor!; + return _igBlazor ?? throw new InvalidOperationException("IgBlazor accessed before dependency injection completed."); } set { @@ -186,7 +186,7 @@ protected void OnElementNameChanged(BaseRendererElement element, string oldName, { ((BaseRendererElement)CurrParent).OnElementNameChanged(element, oldName, newName); } - else + else if (CurrParent is BaseRendererControl) { ((BaseRendererControl)CurrParent).OnElementNameChanged(element, oldName, newName); } @@ -199,9 +199,9 @@ protected void OnElementNameChanged(BaseRendererElement element, string oldName, { ((BaseRendererElement)CurrParent).OnElementNameChanged(element, oldName, newName); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).OnElementNameChanged(element, oldName, newName); + ((BaseRendererControl)CurrParent).OnElementNameChanged(element, oldName, newName); } }); } @@ -249,11 +249,14 @@ private void QueueRefChange(String propertyName, Object? oldValue, Object? newVa private void FlushRefs() { - while (_queuedChanges.Count > 0) + while (_queuedChanges != null && _queuedChanges.Count > 0) { - RefChange c = _queuedChanges!.First!.Value; + RefChange? c = _queuedChanges.First?.Value; _queuedChanges.RemoveFirst(); - OnRefChanged(c.propertyName, c.oldValue, c.newValue, c.isScript, c.isElement, c.refChanged); + if (c != null) + { + OnRefChanged(c.propertyName, c.oldValue, c.newValue, c.isScript, c.isElement, c.refChanged); + } } } @@ -394,10 +397,10 @@ internal void UpdateTemplate(string contentType, object? template, Type type) ((BaseRendererControl)_parent).ChildDirty(this); ((BaseRendererControl)_parent).UpdateTemplate(contentType, template, type); } - else + else if (_parent is BaseRendererElement) { - ((BaseRendererElement)_parent!).ChildDirty(this); - ((BaseRendererElement)_parent!).UpdateTemplate(contentType, template, type); + ((BaseRendererElement)_parent).ChildDirty(this); + ((BaseRendererElement)_parent).UpdateTemplate(contentType, template, type); } }; if (_parent != null) @@ -601,10 +604,11 @@ internal int ReturnToInt(Object? val) { return ((BaseRendererElement)CurrParent).ReturnToInt(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToInt(val); + return ((BaseRendererControl)CurrParent).ReturnToInt(val); } + return default(int); } internal double ReturnToDouble(Object? val) @@ -614,10 +618,11 @@ internal double ReturnToDouble(Object? val) { return ((BaseRendererElement)CurrParent).ReturnToDouble(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToDouble(val); + return ((BaseRendererControl)CurrParent).ReturnToDouble(val); } + return default(double); } internal long ReturnToLong(Object val) @@ -627,10 +632,11 @@ internal long ReturnToLong(Object val) { return ((BaseRendererElement)CurrParent).ReturnToLong(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToLong(val); + return ((BaseRendererControl)CurrParent).ReturnToLong(val); } + return default(long); } internal DateTime ReturnToDate(Object? val) @@ -640,10 +646,11 @@ internal DateTime ReturnToDate(Object? val) { return ((BaseRendererElement)CurrParent).ReturnToDate(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToDate(val); + return ((BaseRendererControl)CurrParent).ReturnToDate(val); } + return default(DateTime); } internal String? ComponentToJson(object val, int index) @@ -653,10 +660,11 @@ internal DateTime ReturnToDate(Object? val) { return ((BaseRendererElement)CurrParent).ComponentToJson(val, index); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ComponentToJson(val, index); + return ((BaseRendererControl)CurrParent).ComponentToJson(val, index); } + return default(string); } internal string DateToString(DateTime val) @@ -666,10 +674,11 @@ internal string DateToString(DateTime val) { return ((BaseRendererElement)CurrParent).DateToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).DateToString(val); + return ((BaseRendererControl)CurrParent).DateToString(val); } + return String.Empty; } internal string BooleanToString(bool val) @@ -679,10 +688,11 @@ internal string BooleanToString(bool val) { return ((BaseRendererElement)CurrParent).BooleanToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).BooleanToString(val); + return ((BaseRendererControl)CurrParent).BooleanToString(val); } + return String.Empty; } internal string? EnumToString(T val) where T : struct @@ -692,10 +702,11 @@ internal string BooleanToString(bool val) { return ((BaseRendererElement)CurrParent).EnumToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).EnumToString(val); + return ((BaseRendererControl)CurrParent).EnumToString(val); } + return default(string); } internal T StringToEnum(Object? val) where T : struct @@ -705,10 +716,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).StringToEnum(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).StringToEnum(val); + return ((BaseRendererControl)CurrParent).StringToEnum(val); } + return default(T); } internal string? ObjectArrayToParam(object[]? arr) @@ -718,10 +730,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ObjectArrayToParam(arr); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ObjectArrayToParam(arr); + return ((BaseRendererControl)CurrParent).ObjectArrayToParam(arr); } + return default(string); } internal object[]? ReturnToObjectArray(Object? val) @@ -731,10 +744,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ReturnToObjectArray(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToObjectArray(val); + return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val); } + return default; } internal T[]? ReturnToObjectArray(Object? val) @@ -748,10 +762,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ReturnToObjectArray(val, typeGuess); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToObjectArray(val, typeGuess); + return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val, typeGuess); } + return default; } internal string[]? ReturnToStringArray(Object? val) @@ -761,10 +776,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ReturnToStringArray(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToStringArray(val); + return ((BaseRendererControl)CurrParent).ReturnToStringArray(val); } + return default; } internal int[]? ReturnToIntArray(Object val) @@ -774,10 +790,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ReturnToIntArray(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToIntArray(val); + return ((BaseRendererControl)CurrParent).ReturnToIntArray(val); } + return default; } internal double[]? ReturnToDoubleArray(Object? val) @@ -787,10 +804,11 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererElement)CurrParent).ReturnToDoubleArray(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToDoubleArray(val); + return ((BaseRendererControl)CurrParent).ReturnToDoubleArray(val); } + return default; } internal string ObjectToParam(object? val) @@ -800,10 +818,11 @@ internal string ObjectToParam(object? val) { return ((BaseRendererElement)CurrParent).ObjectToParam(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ObjectToParam(val); + return ((BaseRendererControl)CurrParent).ObjectToParam(val); } + return String.Empty; } internal string ObjectToParam(object? val, Type type) @@ -813,10 +832,11 @@ internal string ObjectToParam(object? val, Type type) { return ((BaseRendererElement)CurrParent).ObjectToParam(val, type); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ObjectToParam(val, type); + return ((BaseRendererControl)CurrParent).ObjectToParam(val, type); } + return String.Empty; } internal void ObjectToParam(SerializationContext c, string propertyName, object? val) @@ -826,9 +846,9 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object? { ((BaseRendererElement)CurrParent).ObjectToParam(c, propertyName, val); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).ObjectToParam(c, propertyName, val); + ((BaseRendererControl)CurrParent).ObjectToParam(c, propertyName, val); } } @@ -839,9 +859,9 @@ internal void ObjectToParam(SerializationContext? c, object? val) { ((BaseRendererElement)CurrParent).ObjectToParam(c, val); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).ObjectToParam(c, val); + ((BaseRendererControl)CurrParent).ObjectToParam(c, val); } } @@ -852,10 +872,11 @@ internal void ObjectToParam(SerializationContext? c, object? val) { return ((BaseRendererElement)CurrParent).ReturnToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToString(val); + return ((BaseRendererControl)CurrParent).ReturnToString(val); } + return default; } internal bool ReturnToBoolean(object? val) @@ -865,10 +886,11 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererElement)CurrParent).ReturnToBoolean(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToBoolean(val); + return ((BaseRendererControl)CurrParent).ReturnToBoolean(val); } + return default; } internal object? ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) @@ -878,10 +900,11 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererElement)CurrParent).ConvertReturnValue(val, typeGuess, acceptsNullIfMarshalDoesNotExist); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); + return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } + return default; } internal object? ReturnToPrimitive(object? val) @@ -891,10 +914,11 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererElement)CurrParent).ReturnToPrimitive(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).ReturnToPrimitive(val); + return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); } + return default; } internal T[]? DowncastArray(object? val) @@ -904,10 +928,11 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererElement)CurrParent).DowncastArray(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).DowncastArray(val); + return ((BaseRendererControl)CurrParent).DowncastArray(val); } + return default; } private List _deferredHandlers = new List(); @@ -920,9 +945,9 @@ internal bool ReturnToBoolean(object? val) { ((BaseRendererElement)CurrParent).SetHandler(name, propertyName, handler, onArgs); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).SetHandler(name, propertyName, handler, onArgs); + ((BaseRendererControl)CurrParent).SetHandler(name, propertyName, handler, onArgs); } }; @@ -942,9 +967,9 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac { ((BaseRendererElement)CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); + ((BaseRendererControl)CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; @@ -964,9 +989,9 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac { ((BaseRendererElement)CurrParent).SetActionHandler(name, propertyName, handler, onArgs); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).SetActionHandler(name, propertyName, handler, onArgs); + ((BaseRendererControl)CurrParent).SetActionHandler(name, propertyName, handler, onArgs); } }; @@ -987,9 +1012,9 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action { ((BaseRendererElement)CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); } - else + else if (CurrParent is BaseRendererControl) { - ((BaseRendererControl)CurrParent!).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); + ((BaseRendererControl)CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; @@ -1008,10 +1033,11 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action { return ((BaseRendererElement)CurrParent).StringToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).StringToString(val); + return ((BaseRendererControl)CurrParent).StringToString(val); } + return default; } internal string? StringArrayToString(string[]? val) @@ -1021,10 +1047,11 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action { return ((BaseRendererElement)CurrParent).StringArrayToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).StringArrayToString(val); + return ((BaseRendererControl)CurrParent).StringArrayToString(val); } + return default; } internal string? IntArrayToString(int[]? val) @@ -1034,10 +1061,11 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action { return ((BaseRendererElement)CurrParent).IntArrayToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).IntArrayToString(val); + return ((BaseRendererControl)CurrParent).IntArrayToString(val); } + return default; } internal string? DoubleArrayToString(double[]? val) @@ -1047,10 +1075,11 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action { return ((BaseRendererElement)CurrParent).DoubleArrayToString(val); } - else + else if (CurrParent is BaseRendererControl) { - return ((BaseRendererControl)CurrParent!).DoubleArrayToString(val); + return ((BaseRendererControl)CurrParent).DoubleArrayToString(val); } + return default; } protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary? args) From e05e74002026da1bb5bea9ae44a05112473b5df3 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 14:58:21 +0300 Subject: [PATCH 22/64] Add null checks for collection items in CollectionAdapter --- src/componentsBase/CollectionAdapter.cs | 52 ++++++++++++++++++------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 013f38b5..0f0af015 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -85,14 +85,20 @@ private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs ar switch (args.Action) { case NotifyCollectionChangedAction.Add: - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + if (args.NewItems != null && args.NewItems.Count > 0) + { + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + } break; case NotifyCollectionChangedAction.Remove: this.RemoveManualItemAt(args.OldStartingIndex); break; case NotifyCollectionChangedAction.Replace: this.RemoveManualItemAt(args.OldStartingIndex); - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + if (args.NewItems != null && args.NewItems.Count > 0) + { + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + } break; case NotifyCollectionChangedAction.Reset: this.ClearManualItems(); @@ -102,7 +108,7 @@ private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs ar public void ShiftContentToManual(IList manualCollection, Action onMoving) { - T item = default(T)!; + T? item = default(T); var manualSet = new HashSet(); if (this.CollisionChecker != null) @@ -125,7 +131,12 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) } var mapWasEmpty = manualSet.Count == 0; - for (var i = 0; i < this!._query!.Count; i++) + if (this._query == null) + { + // no collection to shift + return; + } + for (var i = 0; i < this._query.Count; i++) { item = this._query[i]; @@ -137,7 +148,7 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) } else { - var key = this!.CollisionChecker!(item); + var key = this.CollisionChecker!(item); if (key == null) { this._manualItems.Insert(i, item); @@ -168,8 +179,12 @@ private void SyncItems() Dictionary queryMap = new Dictionary(); Dictionary manualMap = new Dictionary(); - T item = default(T)!; - for (var i = 0; i < this!._allList!.Count; i++) + T? item = default(T); + if (this._allList == null) + { + return; + } + for (var i = 0; i < this._allList.Count; i++) { item = this._allList[i]; targetMap[item] = true; @@ -197,6 +212,11 @@ private void SyncItems() } } } + if (this._query == null) + { + // no collection to sync + return; + } for (var i = this._query!.Count - 1; i >= 0; i--) { item = queryArray[i]; @@ -232,14 +252,14 @@ private void SyncItems() if (!queryMap.ContainsKey(item) && !manualMap.ContainsKey(item)) { this._allList.RemoveAt(i); - this!._target!.RemoveAt(i); - this!._onItemRemoved!(item); + this._target?.RemoveAt(i); + this._onItemRemoved?.Invoke(item); } } int ind = 0; int ins = 0; - T insItem = default(T)!; + T? insItem = default(T); int maxLen = queryArray.Count + this._manualItems.Count; while (ind < maxLen) { @@ -266,8 +286,8 @@ private void SyncItems() else { this._allList.Insert(ins, insItem); - this!._target!.Insert(ins, this!._toTarget!(insItem)); - this!._onItemAdded!(insItem); + this._target?.Insert(ins, this!._toTarget!(insItem)); + this._onItemAdded?.Invoke(insItem); ind++; ins++; } @@ -275,8 +295,12 @@ private void SyncItems() else { this._allList.Add(insItem); - this!._target!.Add(this!._toTarget!(insItem)); - this!._onItemAdded!(insItem); + var convertedItem = this._toTarget?.Invoke(insItem); + if (convertedItem != null) + { + this._target?.Add(convertedItem); + } + this._onItemAdded?.Invoke(insItem); ind++; ins++; } From f79aafdfe1a5d25e325bcc3c3bee8dce5c586704 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 15:16:44 +0300 Subject: [PATCH 23/64] Remove a few more null-forgiving operators in favor of proper null checks. --- src/componentsBase/DataSourceManager.cs | 18 ++++++++-------- src/componentsBase/DynamicContentHolder.cs | 25 ++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index fd8c7be0..f10d8651 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -101,7 +101,7 @@ public Guid FindItemId(object item) IncrementRef(id); if (!_dataSources.ContainsKey(id)) { - if (_helper!.IsInproc && !_helper.IsForcedJsonDataMarshalling) + if (_helper?.IsInproc != null && !_helper.IsForcedJsonDataMarshalling) { //Console.WriteLine("unmarshalled datasource"); _dataSources[id] = UnmarshalledDataSource.Create(data, this, _helper); @@ -109,11 +109,11 @@ public Guid FindItemId(object item) else { //Console.WriteLine("json datasource"); - _dataSources[id] = JsonDataSource.Create(data, this)!; + _dataSources[id] = JsonDataSource.Create(data, this); } } _idLookup[data] = id; - _refSink!.OnRefChanged(id, _dataSources[id]); + _refSink?.OnRefChanged(id, _dataSources[id]); } if (data == null) @@ -164,7 +164,7 @@ void DecrementRef(string id) } _dataSources.Remove(id); _refsById.Remove(id); - _refSink!.OnRefChanged(id, null); + _refSink?.OnRefChanged(id, null); } } } @@ -192,7 +192,7 @@ public void NotifyInsertItem(string refName, int index, object? refItem) } IJSDataSourceItem? newItem = dataSource.NotifyInsertItem(data, index, refItem); - _refSink!.OnRefNotifyInsertItem(dataSource, refName, index, newItem); + _refSink?.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } public void NotifyRemoveItem(String refName, int index, Object? oldItem) @@ -216,7 +216,7 @@ public void NotifyRemoveItem(String refName, int index, Object? oldItem) } IJSDataSourceItem? oldItemJson = dataSource.NotifyRemoveItem(data, index, oldItem); - _refSink!.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); + _refSink?.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); } } public void NotifyClearItems(string refName) @@ -236,7 +236,7 @@ public void NotifyClearItems(string refName) } dataSource.NotifyClearItems(data); - _refSink!.OnRefNotifyClearItems(dataSource, refName, dataSource); + _refSink?.OnRefNotifyClearItems(dataSource, refName, dataSource); } } public void NotifySetItem(string refName, int index, object oldItem, object newItem) @@ -256,7 +256,7 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI IJSDataSourceItem? oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; IJSDataSourceItem? newItemJson = dataSource.NotifySetItem(data, index, oldItem, newItem); - _refSink!.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); + _refSink?.OnRefNotifySetItem(dataSource, refName, index, oldItemJson, newItemJson); } } public void NotifyUpdateItem(string refName, int index, object refItem, bool syncDataOnly) @@ -275,7 +275,7 @@ public void NotifyUpdateItem(string refName, int index, object refItem, bool syn } IJSDataSourceItem? newItemJson = dataSource.NotifyUpdateItem(data, index, refItem); - _refSink!.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); + _refSink?.OnRefNotifyUpdateItem(dataSource, refName, index, newItemJson, syncDataOnly); } } diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index c43dc1d9..7d32f38b 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -6,7 +6,10 @@ namespace IgniteUI.Blazor.Controls public class DynamicContentHolder : ComponentBase { - protected LinkedList? DynamicContentInfo + public DynamicContentHolder() { + DynamicContentInfo = new LinkedList(); + } + protected LinkedList DynamicContentInfo { get; set; @@ -16,7 +19,6 @@ protected LinkedList? DynamicContentInfo protected override void OnInitialized() { base.OnInitialized(); - DynamicContentInfo = new LinkedList(); } private bool _isDirty = false; @@ -28,8 +30,9 @@ protected override void OnInitialized() public void AddDynamicContent(DynamicContentInfo content) { + DynamicContentInfo ??= new LinkedList(); _contentInfos[content.RefName] = content; - _contentInfoNode[content.RefName] = DynamicContentInfo!.AddLast(content); + _contentInfoNode[content.RefName] = DynamicContentInfo.AddLast(content); _isDirty = true; } @@ -39,7 +42,7 @@ public void RemoveDynamicContent(DynamicContentInfo content) { _contentInfos.Remove(content.RefName); - DynamicContentInfo!.Remove(_contentInfoNode[content.RefName]); + DynamicContentInfo.Remove(_contentInfoNode[content.RefName]); _contentInfoNode.Remove(content.RefName); _isDirty = true; @@ -71,7 +74,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.AddAttribute(1, "class", "ig-dynamic-content-holder"); builder.AddAttribute(2, "style", "display: none"); builder.AddMarkupContent(3, "\r\n"); - var current = DynamicContentInfo!.First; + var current = DynamicContentInfo.First; while (current != null) { var item = current.Value; @@ -83,7 +86,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.OpenElement(8, "div"); builder.AddAttribute(9, "id", item.RefName); builder.AddMarkupContent(10, "\r\n "); - builder.OpenComponent(11, item.ControlType!); + builder.OpenComponent(11, item.ControlType); builder.SetKey(item.RefName); builder.AddComponentReferenceCapture(12, delegate (object __value) { @@ -104,7 +107,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) public abstract class DynamicContentInfo { - public Type? ControlType { get; set; } + public required Type ControlType { get; set; } public DynamicContentInfo() { RefName = Guid.NewGuid().ToString(); @@ -270,7 +273,7 @@ protected override void OnComponentChanged(object? oldValue, object? component) { if (component is IgbTemplateContent) { - OnContextChanged((T)Context!, (T)Context!); + OnContextChanged((T?)Context, (T?)Context); } } @@ -280,9 +283,9 @@ private void OnContextChanged(T? oldValue, T? newValue) { var template = (IgbTemplateContent)Component; - if (_hasPopulatedContext) + if (_hasPopulatedContext && Context != null) { - template.Context = Context!; + template.Context = Context; } template.Template = Template; template.Update(); @@ -298,7 +301,7 @@ public override void UpdateTemplate(object? template) /// public override void UpdateContext(object? context) { - Context = (T)context!; + Context = (T?)context; } } From 8569a83515868bd961013ffda529bc8fdd6a4064 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 15:45:03 +0300 Subject: [PATCH 24/64] Replacing null-forgiving operators with null checks. --- src/componentsBase/JsonDataSource.cs | 26 +++---- src/componentsBase/JsonDataSourceItem.cs | 77 ++++++++++++++------ src/componentsBase/UnmarshalledDataSource.cs | 40 ++++++---- 3 files changed, 94 insertions(+), 49 deletions(-) diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 21e82a63..899118db 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -111,7 +111,7 @@ private void Listen(object data) private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { - if (SuppressModifications) + if (SuppressModifications || _manager == null) { return; } @@ -125,7 +125,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -142,7 +142,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -159,7 +159,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -172,7 +172,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -184,7 +184,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg } case NotifyCollectionChangedAction.Reset: { - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -267,11 +267,11 @@ public bool HasOriginal(object item) public Guid IdFromOriginal(object item) { var itm = FromOriginal(item); - if (item == null) + if (itm == null) { return Guid.Empty; } - return itm!.Id; + return itm.Id; } public IJSDataSourceItem? FromOriginal(object item) @@ -391,19 +391,19 @@ private void Add(object? item) OnAddItem(itemJson, item); _data.Add(itemJson); - if (schema != null) + if (schema != null && schema.PropertyNames != null && schema.PropertyTypes != null) { - for (int i = 0; i < schema!.PropertyNames!.Length; i++) + for (int i = 0; i < schema.PropertyNames.Length; i++) { var propertyName = schema.PropertyNames[i]; - var propertyType = schema!.PropertyTypes![i]; + var propertyType = schema.PropertyTypes[i]; if (propertyType == JSDataSourceSchemaType.ObjectValue) { var subSchema = schema.GetSubSchema(propertyName); if (subSchema != null) { - var propValue = (JsonDataSourceItem)itemJson.GetValue(propertyName)!; - if (propValue.Source != null) + var propValue = (JsonDataSourceItem?)itemJson.GetValue(propertyName); + if (propValue?.Source != null) { if (!_subDataSources.ContainsKey(itemJson.Id)) { diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 5f80246b..4fbe596d 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -160,25 +160,40 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m _values["value"] = item; _valueTypes["value"] = schema.PrimitiveType; } - for (int i = 0; i < schema!.PropertyNames!.Length; i++) + var propertyNames = schema.PropertyNames; + var propertyGetters = schema.PropertyGetters; + var propertyTypes = schema.PropertyTypes; + if (propertyNames != null && propertyGetters != null && propertyTypes != null) { - String name = schema.PropertyNames[i]; - Func propGetter = schema!.PropertyGetters![i]; - JSDataSourceSchemaType type = schema!.PropertyTypes![i]; - Object? val = schema.ResolveValue(name, item, propGetter, this, type, manager); + var propertyLength = Math.Min(propertyNames.Length, Math.Min(propertyGetters.Length, propertyTypes.Length)); + for (var i = 0; i < propertyLength; i++) + { + string name = propertyNames[i]; + Func propGetter = propertyGetters[i]; + JSDataSourceSchemaType type = propertyTypes[i]; + object? val = schema.ResolveValue(name, item, propGetter, this, type, manager); - _values[name] = val; - _valueTypes[name] = type; + _values[name] = val; + _valueTypes[name] = type; + } } - for (int i = 0; i < schema!.Fields!.Length; i++) + + var fields = schema.Fields; + var fieldGetters = schema.FieldGetters; + var fieldTypes = schema.FieldTypes; + if (fields != null && fieldGetters != null && fieldTypes != null) { - String name = schema.Fields[i].Name; - Func fieldGetter = schema!.FieldGetters![i]; - JSDataSourceSchemaType type = schema!.FieldTypes![i]; - Object? val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); + var fieldLength = Math.Min(fields.Length, Math.Min(fieldGetters.Length, fieldTypes.Length)); + for (var i = 0; i < fieldLength; i++) + { + string name = fields[i].Name; + Func fieldGetter = fieldGetters[i]; + JSDataSourceSchemaType type = fieldTypes[i]; + object? val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); - _values[name] = val; - _valueTypes[name] = type; + _values[name] = val; + _valueTypes[name] = type; + } } } @@ -223,25 +238,37 @@ public void GetDateCacheAsJson(JSDataSourceSchema? schema, System.Text.Json.Utf8 } parentKey = parentKey != null ? parentKey + "." : ""; - for (int i = 0; i < schema!.PropertyTypes!.Length; i++) + + var propertyTypes = schema.PropertyTypes; + var propertyNames = schema.PropertyNames; + if (propertyTypes == null || propertyNames == null) + { + return; + } + + var propertyLength = Math.Min(propertyTypes.Length, propertyNames.Length); + for (var i = 0; i < propertyLength; i++) { - if (schema.PropertyTypes[i] == JSDataSourceSchemaType.DateTimeValue || - schema.PropertyTypes[i] == JSDataSourceSchemaType.NullableDateTimeValue) + var propertyType = propertyTypes[i]; + var propertyName = propertyNames[i]; + + if (propertyType == JSDataSourceSchemaType.DateTimeValue || + propertyType == JSDataSourceSchemaType.NullableDateTimeValue) { - writer.WriteStringValue(parentKey + schema!.PropertyNames![i]); + writer.WriteStringValue(parentKey + propertyName); } - if (schema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) + if (propertyType == JSDataSourceSchemaType.ObjectValue) { - var subSchema = schema.GetSubSchema(schema!.PropertyNames![i]); + var subSchema = schema.GetSubSchema(propertyName); if (subSchema != null) { if (subSchema.IsDataSource) { - GetDateCacheAsJson(subSchema.GetSubSchema("Items"), writer, parentKey + schema.PropertyNames[i] + "[]"); + GetDateCacheAsJson(subSchema.GetSubSchema("Items"), writer, parentKey + propertyName + "[]"); } else { - GetDateCacheAsJson(subSchema, writer, parentKey + schema.PropertyNames[i]); + GetDateCacheAsJson(subSchema, writer, parentKey + propertyName); //((JsonDataSourceItem)_values[schema.PropertyNames[i]]).GetDateCacheAsJson(writer, parentKey + schema.PropertyNames[i]); } } @@ -261,7 +288,11 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer) ((JsonDataSource)_source).ToJson(writer); return; } - if (_schema!.IsPrimitive) + if (_schema == null) + { + return; + } + if (_schema.IsPrimitive) { ValueToJson("value", new System.Text.Json.JsonEncodedText(), writer); return; diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index d439d0f3..256b0f5d 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -145,12 +145,11 @@ public UnmarshalledDataSource() { //Console.WriteLine("adjusting capacity, oldValue: " + oldValue + ", newValue: " + newValue); DateTime start = DateTime.Now; - if (columns == null && schema == null) + if (columns == null || schema == null) { return null; } - - if (schema!.IsDataSource) + if (schema.IsDataSource) { if (columns == null) { @@ -163,6 +162,15 @@ public UnmarshalledDataSource() } else { + var propertyNames = schema.PropertyNames ?? Array.Empty(); + var fieldNames = schema.FieldNames ?? Array.Empty(); + var propertyGetters = schema.PropertyGetters ?? Array.Empty>(); + var fieldGetters = schema.FieldGetters ?? Array.Empty>(); + var typedPropertyGetters = schema.TypedPropertyGetters ?? Array.Empty(); + var typedFieldGetters = schema.TypedFieldGetters ?? Array.Empty(); + var propertyTypes = schema.PropertyTypes ?? Array.Empty(); + var fieldTypes = schema.FieldTypes ?? Array.Empty(); + if (columns == null) { var extraCols = 1; @@ -170,24 +178,30 @@ public UnmarshalledDataSource() { extraCols = 0; } - columns = new UnmarshalledColumnData[schema!.PropertyNames!.Length + schema!.FieldNames!.Length + extraCols]; + columns = new UnmarshalledColumnData[propertyNames.Length + fieldNames.Length + extraCols]; for (var k = 0; k < columns.Length; k++) { columns[k] = null; } } - int i = 0; - for (i = 0; i < schema!.PropertyNames!.Length; i++) + var propertyCount = Math.Min(propertyNames.Length, Math.Min(propertyGetters.Length, propertyTypes.Length)); + var fieldCount = Math.Min(fieldNames.Length, Math.Min(fieldGetters.Length, fieldTypes.Length)); + + int i = 0; + for (; i < propertyCount; i++) { - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema.PropertyNames[i], schema!.TypedPropertyGetters![i], schema!.PropertyGetters![i], false, schema!.PropertyTypes![i], oldValue, newValue); + var typedPropertyGetter = i < typedPropertyGetters.Length ? typedPropertyGetters[i] : null; + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, propertyNames[i], typedPropertyGetter, propertyGetters[i], false, propertyTypes[i], oldValue, newValue); } - for (int j = 0; j < _schema!.FieldNames!.Length; i++, j++) + + for (int j = 0; j < fieldCount; i++, j++) { - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, schema!.FieldNames![j], schema!.TypedFieldGetters![j], schema!.FieldGetters![j], false, schema!.FieldTypes![j], oldValue, newValue); + var typedFieldGetter = j < typedFieldGetters.Length ? typedFieldGetters[j] : null; + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, fieldNames[j], typedFieldGetter, fieldGetters[j], false, fieldTypes[j], oldValue, newValue); } } - if (schema!.IsPrimitive) + if (schema.IsPrimitive) { columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___primitiveValueCollection", null, null, false, schema.PrimitiveType, oldValue, newValue); return columns!; @@ -698,7 +712,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema!.IsDataSource && !column.IsSubDataSource) + if (subSchema != null && subSchema.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; @@ -784,7 +798,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema!.IsDataSource && !column.IsSubDataSource) + if (subSchema != null && subSchema.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; @@ -1045,7 +1059,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; } - if (subSchema!.IsDataSource && !column.IsSubDataSource) + if (subSchema != null && subSchema.IsDataSource && !column.IsSubDataSource) { column.IsSubDataSource = true; var c = column.Column; From ac1b099539d40103bc18c7b6ae7010865a5893c0 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 15:54:05 +0300 Subject: [PATCH 25/64] Marking ColumnData as nullable, since it explicitly gets set to null in AdjustCapacity. --- src/componentsBase/UnmarshalledDataSource.cs | 34 ++++++++++++-------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 256b0f5d..5b202b4d 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -32,7 +32,7 @@ public UnmarshalledColumnData() public bool IsObjectColumn { get; set; } - public UnmarshalledColumnData[]? SubColumns { get; set; } + public UnmarshalledColumnData?[]? SubColumns { get; set; } public JSDataSourceSchema? SubSchema { get; set; } public Action? Insert { get; internal set; } public Action? Update { get; internal set; } @@ -93,7 +93,7 @@ public JSDataSourceType DataSourceType private string? _parentId; private DataSourceManager? _manager = null; - private UnmarshalledColumnData[]? _columns = null; + private UnmarshalledColumnData?[]? _columns = null; private Dictionary> _subDataSources = new Dictionary>(); @@ -141,7 +141,7 @@ public UnmarshalledDataSource() }; } - private UnmarshalledColumnData[]? AdjustCapacity(string? parentPath, UnmarshalledColumnData?[]? columns, JSDataSourceSchema? schema, int oldValue, int newValue) + private UnmarshalledColumnData?[]? AdjustCapacity(string? parentPath, UnmarshalledColumnData?[]? columns, JSDataSourceSchema? schema, int oldValue, int newValue) { //Console.WriteLine("adjusting capacity, oldValue: " + oldValue + ", newValue: " + newValue); DateTime start = DateTime.Now; @@ -240,7 +240,7 @@ public UnmarshalledDataSource() } //Console.WriteLine("end adjusting capacity: " + (DateTime.Now - start).TotalMilliseconds); - return columns!; + return columns; } private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate? valueGetter, Func? untypedGetter, bool isIDColumn) @@ -1555,9 +1555,9 @@ private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) return JSDataSourceSchemaType.ObjectValue; } - private void GetColumns(string refName, UnmarshalledColumnData[]? columns, List? l) + private void GetColumns(string refName, UnmarshalledColumnData?[]? columns, List? l) { - List toDrill = new List(); + List toDrill = new List(); if (columns == null) { @@ -2235,7 +2235,7 @@ private void Add(object? item) //_data.Add(itemJson); } - private void EnsureLeadingNullsInserted(JSDataSourceSchema? schema, UnmarshalledColumnData[]? columns) + private void EnsureLeadingNullsInserted(JSDataSourceSchema? schema, UnmarshalledColumnData?[]? columns) { if (schema == null || columns == null) { @@ -2255,7 +2255,7 @@ private void EnsureLeadingNullsInserted(JSDataSourceSchema? schema, Unmarshalled } } - private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, UnmarshalledColumnData[]? columns) + private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, UnmarshalledColumnData?[]? columns) { EnsureLeadingNullsInserted(schema, columns); EnsureCapacity(_size + 1); @@ -2278,7 +2278,7 @@ private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, U _size++; } - private void UpdateItemAt(object? oldItem, object? newItem, int index, JSDataSourceSchema schema, UnmarshalledColumnData[]? columns) + private void UpdateItemAt(object? oldItem, object? newItem, int index, JSDataSourceSchema schema, UnmarshalledColumnData?[]? columns) { EnsureLeadingNullsInserted(schema, columns); if (columns == null) @@ -2293,7 +2293,7 @@ private void UpdateItemAt(object? oldItem, object? newItem, int index, JSDataSou } } - private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColumnData[]? columns) + private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColumnData?[]? columns) { EnsureLeadingNullsInserted(schema, columns); if (columns == null) @@ -2303,8 +2303,11 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu for (var i = 0; i < columns.Length; i++) { var column = columns[i]; - - column!.Remove!(_size, column, index); + var remove = column?.Remove; + if (column != null && remove != null) + { + remove(_size, column, index); + } } _size--; } @@ -2572,7 +2575,12 @@ public void NotifyClearItems(Object data) { for (var i = 0; i < _columns.Length; i++) { - _columns![i]!.Clear!(_size, _columns[i]); + var column = _columns[i]; + var clear = column?.Clear; + if (column != null && clear != null) + { + clear(_size, column); + } } } } From 2c1fc66e77061144fb0981f33b21559300a0aaa9 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 16:10:45 +0300 Subject: [PATCH 26/64] Fix formatting. --- src/componentsBase/DynamicContentHolder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 7d32f38b..7f8e53ed 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -6,7 +6,8 @@ namespace IgniteUI.Blazor.Controls public class DynamicContentHolder : ComponentBase { - public DynamicContentHolder() { + public DynamicContentHolder() + { DynamicContentInfo = new LinkedList(); } protected LinkedList DynamicContentInfo From 62fd3bca82871818592859912f46d70312f2460d Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 16:19:47 +0300 Subject: [PATCH 27/64] Final codeql fixe.s. --- src/componentsBase/BaseRendererControl.cs | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 3cfa5ed4..daf13be4 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1447,7 +1447,7 @@ public void OnRefChanged(string refName, object? refValue) { m.SetData("dataIntents", dataIntents); } - if (ds != null && ds.DataSourceType == JSDataSourceType.Json) + if (ds?.DataSourceType == JSDataSourceType.Json) { if (!ds.IsSent) { @@ -1641,8 +1641,8 @@ private void Update() //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); while (_messageQueue != null && _messageQueue.Count > 0) { - RendererMessage? m = _messageQueue?.First?.Value; - _messageQueue?.RemoveFirst(); + RendererMessage? m = _messageQueue.First?.Value; + _messageQueue.RemoveFirst(); if (m != null) { ProcessMessage(m); @@ -2195,10 +2195,6 @@ public void OnInvokeReturn(long invokeId, Object returnValue) internal int ReturnToInt(object? val) { - if (val == null) - { - return 0; - } val = ConvertReturnValue(val); if (val is String) { @@ -2249,10 +2245,6 @@ internal long ReturnToLong(object? val) { //Console.WriteLine("converting return"); val = ConvertReturnValue(val); - if (val == null) - { - return Int64.MinValue; - } //Console.WriteLine(val); if (val is String) { @@ -2274,10 +2266,6 @@ internal long ReturnToLong(object? val) internal DateTime[]? ReturnToDateArray(object? val) { val = ConvertReturnValue(val); - if (val == null) - { - return null; - } try { var stringVal = val?.ToString(); @@ -2358,10 +2346,6 @@ internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) internal bool ReturnToBoolean(object? val) { val = ConvertReturnValue(val); - if (val == null) - { - return false; - } if (val is bool) { return (bool)val; From 20f3d90e36dcdc32c365c80e5c4792a5f8dc128b Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 26 Aug 2026 16:25:36 +0300 Subject: [PATCH 28/64] Apply suggestion Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/componentsBase/BaseRendererControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index daf13be4..fde73290 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1442,12 +1442,12 @@ public void OnRefChanged(string refName, object? refValue) if (refValue is IJSDataSource) { var ds = (IJSDataSource)refValue; - var dataIntents = ds == null ? null : ds.GetDataIntentsAsJson(); + var dataIntents = ds.GetDataIntentsAsJson(); if (dataIntents != null) { m.SetData("dataIntents", dataIntents); } - if (ds?.DataSourceType == JSDataSourceType.Json) + if (ds.DataSourceType == JSDataSourceType.Json) { if (!ds.IsSent) { From 0a5b9be6d50bc28335785c7140d567d96cf278f2 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 26 Aug 2026 16:57:02 +0300 Subject: [PATCH 29/64] Fix null check and update _inprocRuntime invocation. --- src/componentsBase/DataSourceManager.cs | 2 +- src/componentsBase/RuntimeHelper.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index f10d8651..303959fb 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -101,7 +101,7 @@ public Guid FindItemId(object item) IncrementRef(id); if (!_dataSources.ContainsKey(id)) { - if (_helper?.IsInproc != null && !_helper.IsForcedJsonDataMarshalling) + if (_helper?.IsInproc == true && !_helper.IsForcedJsonDataMarshalling) { //Console.WriteLine("unmarshalled datasource"); _dataSources[id] = UnmarshalledDataSource.Create(data, this, _helper); diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 8ca8704d..89320e04 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -119,7 +119,7 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) } #endif var intptr = Unsafe.AsPointer(ref columns); - _inprocRuntime!.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); + _inprocRuntime?.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); return null; } From 5bc62b9f695b5d3ecc9579c125c5df5e4be10cef Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Thu, 27 Aug 2026 16:25:21 +0300 Subject: [PATCH 30/64] Enable nullable warnings in Directory.Build.props and remove nullable setting from IgniteUI.Blazor.Lite.csproj --- Directory.Build.props | 1 + src/IgniteUI.Blazor.Lite.csproj | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e4adda19..2f8c7318 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,7 @@ Infragistics true enable + $(WarningsAsErrors);nullable enable diff --git a/src/IgniteUI.Blazor.Lite.csproj b/src/IgniteUI.Blazor.Lite.csproj index f774ad13..4e839c17 100644 --- a/src/IgniteUI.Blazor.Lite.csproj +++ b/src/IgniteUI.Blazor.Lite.csproj @@ -2,7 +2,6 @@ .Lite - enable From 054ffc08deba2f9c7442dcc95e04e57cd4bcd70c Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Thu, 27 Aug 2026 16:51:45 +0300 Subject: [PATCH 31/64] Remove redundant null-forgiving operators. --- src/components/Blazor/CheckboxBase.cs | 4 ++-- src/components/Blazor/Combo.cs | 4 ++-- src/components/Blazor/Radio.cs | 4 ++-- src/components/Blazor/RadioGroup.cs | 4 ++-- src/components/Blazor/Select.cs | 4 ++-- tests/IgniteUI.Blazor.Tests/CalendarTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 10 +++++----- tests/IgniteUI.Blazor.Tests/CheckboxTests.cs | 4 ++-- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 20 +++++++++---------- .../DateRangePickerTests.cs | 6 +++--- tests/IgniteUI.Blazor.Tests/DropdownTests.cs | 10 +++++----- tests/IgniteUI.Blazor.Tests/RadioTests.cs | 6 +++--- .../IgniteUI.Blazor.Tests/RangeSliderTests.cs | 8 ++++---- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 4 ++-- tests/IgniteUI.Blazor.Tests/SplitterTests.cs | 8 ++++---- tests/IgniteUI.Blazor.Tests/StepperTests.cs | 6 +++--- tests/IgniteUI.Blazor.Tests/SwitchTests.cs | 4 ++-- tests/IgniteUI.Blazor.Tests/TabsTests.cs | 6 +++--- .../IgniteUI.Blazor.Tests/TileManagerTests.cs | 10 +++++----- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 6 +++--- 20 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 9a9443cb..15bf853c 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -380,7 +380,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args!.Detail!.Checked); + newValueChecked = (bool)(args.Detail!.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index f14e2eb8..3fd28c4c 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -859,7 +859,7 @@ public EventCallback Change var newValueValue = default(T[]); { - newValueValue = (T[]?)(DowncastArray(args!.Detail!.NewValue)); + newValueValue = (T[]?)(DowncastArray(args.Detail!.NewValue)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index e62fe3bf..2155dd4e 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -389,7 +389,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args!.Detail!.Checked); + newValueChecked = (bool)(args.Detail!.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 86e80b92..0b481bda 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -214,7 +214,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args!.Detail!.Value!; + newValueValue = (string)args.Detail!.Value!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index adc98294..353f2214 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -609,7 +609,7 @@ public EventCallback Change var newValueValue = default(string?); { - newValueValue = (string?)(args!.Detail!.Value); + newValueValue = (string?)(args.Detail!.Value); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index e8a9eb6c..6b9078ff 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index 798675a5..ca1d6a7a 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -25,7 +25,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "m-1", "text": "hello", "sender": "user-1"}}}""", assert: args => { - Assert.Equal("m-1", args!.Detail!.Id); + Assert.Equal("m-1", args.Detail!.Id); Assert.Equal("hello", args.Detail.Text); Assert.Equal("user-1", args.Detail.Sender); }) @@ -33,7 +33,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "a-1", "name": "photo.png", "url": "https://host/photo.png"}}}""", assert: args => { - Assert.Equal("a-1", args!.Detail!.Id); + Assert.Equal("a-1", args.Detail!.Id); Assert.Equal("photo.png", args.Detail.Name); Assert.Equal("https://host/photo.png", args.Detail.Url); }) @@ -43,8 +43,8 @@ public class ChatTests : ComponentWithContractTestBase { // The reaction's message currently decoded by value // (it is NOT restored by reference to an instance in Messages on the current stack). - Assert.Equal("like", args!.Detail!.Reaction); - Assert.Equal("m-1", args!.Detail!.Message!.Id); + Assert.Equal("like", args.Detail!.Reaction); + Assert.Equal("m-1", args.Detail!.Message!.Id); Assert.Equal("hello", args.Detail.Message.Text); }) .Prop(c => c.Options, diff --git a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs index 1fe8629f..7dcc41bd 100644 --- a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class CheckboxTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "checkbox-value"}}}""", assert: args => { - Assert.True(args!.Detail!.Checked); + Assert.True(args.Detail!.Checked); Assert.Equal("checkbox-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 4a586589..0ed32617 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -65,7 +65,7 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail(UuidRef(interop, cut, 0), UuidRef(interop, cut, 0))), assert: (cut, args) => { - Assert.Same(_valueItem1, Assert.Single(args!.Detail!.NewValue!)); + Assert.Same(_valueItem1, Assert.Single(args.Detail!.NewValue!)); Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); Assert.Equal(ComboChangeType.Selection, args.Detail.ChangeType); }) @@ -76,7 +76,7 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail("", UuidRef(interop, cut, 0), "deselection")), assert: (cut, args) => { - Assert.Empty(args!.Detail!.NewValue!); + Assert.Empty(args.Detail!.NewValue!); Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); // TODO: wire detail carries kind as "type", but FromEventJson reads "changeType", so // Detail.ChangeType never decodes and stays default (wrong for deselection events): @@ -90,9 +90,9 @@ internal static string ChangeDetail(string newValues, string items, string type assert: (cut, args) => { // Multi-selection: every element resolves back to its original data instance. - Assert.Equal([_valueItem1, _valueItem2], args!.Detail!.NewValue); + Assert.Equal([_valueItem1, _valueItem2], args.Detail!.NewValue); Assert.Equal([_valueItem1, _valueItem2], args.Detail.Items); - Assert.Same(args!.Detail!.NewValue![0], args!.Detail!.Items![0]); + Assert.Same(args.Detail!.NewValue![0], args.Detail!.Items![0]); }) .Event(c => c.Focus) .Event(c => c.Blur) @@ -286,9 +286,9 @@ public void Combo_CaseSensitiveIcon_Property() // TODO: Mismatched T=int inbound handling (T[])DowncastArray(Detail.NewValue) for // two-way Value propagation: a mismatched T (e.g. the item type on a keyed combo) -// throws InvalidCastException — swallowed by OnRaiseEvent, so delivery silently dies; -// and numeric keys decode as JSON numbers → boxed double, so T=int fails the unbox -// cast too — numeric keys need T=double (or object). +// throws InvalidCastException — swallowed by OnRaiseEvent, so delivery silently dies; +// and numeric keys decode as JSON numbers → boxed double, so T=int fails the unbox +// cast too — numeric keys need T=double (or object). public class ComboValueKeyTests : ComponentWithContractTestBase> { @@ -306,13 +306,13 @@ public class ComboValueKeyTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => ComboTests.ChangeDetail("2", ComboTests.UuidRef(interop, cut, 1))), assert: (cut, args) => { - Assert.Equal(2.0, Assert.Single(args!.Detail!.NewValue!)); // numbers decode as double + Assert.Equal(2.0, Assert.Single(args.Detail!.NewValue!)); // numbers decode as double Assert.Same(_item2, Assert.Single(args.Detail.Items!)); // Two-way Value propagation through the generated wrapper works when T // matches the key value type. Assert.Equal(2.0, Assert.Single(cut.Instance.Value!)); }) - // A value-type value array (double[] here) crosses as plain JSON numbers — the keys + // A value-type value array (double[] here) crosses as plain JSON numbers — the keys // themselves, no data-source refs, since a keyed combo's value is the key. .Prop(c => c.Value, value: [1, 3], diff --git a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs index e56f66bf..41b0333c 100644 --- a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs @@ -1,4 +1,4 @@ -using IgniteUI.Blazor.Controls; +using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; namespace IgniteUI.Blazor.Tests; @@ -46,7 +46,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args!.Detail!.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail!.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, @@ -67,7 +67,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args!.Detail!.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail!.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Prop(c => c.Open, true) diff --git a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs index 8f6bc61d..90a3fc1d 100644 --- a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -9,7 +9,7 @@ public class DropdownTests : ComponentWithContractTestBase { /// /// Holds what the anchor arrangements below capture. An anchor only exists once its - /// render has run, so the specs read it back from here — the runner renders a spec's + /// render has run, so the specs read it back from here — the runner renders a spec's /// arrangement before invoking it, and gives each arranged spec its own render. /// sealed class Anchor @@ -22,7 +22,7 @@ sealed class Anchor /// /// Arranges an IgbButton as the anchor for the show/toggle target overloads. A real - /// anchor is an element outside the dropdown (that's the point of passing one — an + /// anchor is an element outside the dropdown (that's the point of passing one — an /// anchor inside it would go in the target slot instead); the interop boundary /// only sees the reference, so where the button renders is immaterial here. /// @@ -34,7 +34,7 @@ sealed class Anchor builder.CloseComponent(); }); - /// Arranges a plain element as the anchor, capturing its reference — the @ref form of a target + /// Arranges a plain element as the anchor, capturing its reference — the @ref form of a target static readonly Action> elementAnchorArrange = ps => ps.AddChildContent(builder => { @@ -43,7 +43,7 @@ sealed class Anchor builder.CloseElement(); }); - /// The wire form of the arranged component anchor — its interop instance id, assigned on render + /// The wire form of the arranged component anchor — its interop instance id, assigned on render static readonly FromRender componentAnchorArg = FromRender.Of((interop, cut) => $"containerId:::{interop.ContainerIdOf(cut, "igc-button")}"); diff --git a/tests/IgniteUI.Blazor.Tests/RadioTests.cs b/tests/IgniteUI.Blazor.Tests/RadioTests.cs index d0256c59..49ec4132 100644 --- a/tests/IgniteUI.Blazor.Tests/RadioTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RadioTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class RadioTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "option1"}}}""", assert: args => { - Assert.True(args!.Detail!.Checked); + Assert.True(args.Detail!.Checked); Assert.Equal("option1", args.Detail.Value); }) // The bound value uses checked: @@ -127,7 +127,7 @@ public class RadioGroupTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "selected-option"}}}""", assert: args => { - Assert.True(args!.Detail!.Checked); + Assert.True(args.Detail!.Checked); Assert.Equal("selected-option", args.Detail.Value); }) // The group binds the selected option's value: diff --git a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs index 7dddcf49..948982c6 100644 --- a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -6,21 +6,21 @@ namespace IgniteUI.Blazor.Tests; public class RangeSliderTests : ComponentWithContractTestBase { - // TODO: ValueFormatOptions/ValueFormat (config objects on a direct-render component — + // TODO: ValueFormatOptions/ValueFormat (config objects on a direct-render component — // they never cross as interop messages; BUG 35189 ). protected override ComponentContract InteropContract { get; } = new ComponentContract() .Event(c => c.Input, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 20, "upper": 80}}}""", assert: args => { - Assert.Equal(20, args!.Detail!.Lower); + Assert.Equal(20, args.Detail!.Lower); Assert.Equal(80, args.Detail.Upper); }) .Event(c => c.Change, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 25, "upper": 75}}}""", assert: args => { - Assert.Equal(25, args!.Detail!.Lower); + Assert.Equal(25, args.Detail!.Lower); Assert.Equal(75, args.Detail.Upper); }); diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index 464dc0d1..5cb3679f 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -74,7 +74,7 @@ public class SelectTests : ComponentWithContractTestBase assert: (cut, args) => { Assert.Same(cut.FindComponents()[1].Instance, args.Detail); - Assert.Equal("ca", args!.Detail!.Value); // Change propagates Detail.Value into Select.Value + Assert.Equal("ca", args.Detail!.Value); // Change propagates Detail.Value into Select.Value }) // The detail is the selected item; the binding receives that item's Value. .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs index 91766e36..07a6b75b 100644 --- a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -13,7 +13,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 120, "endPanelSize": 80, "delta": 0}}}""", assert: args => { - Assert.Equal(120, args!.Detail!.StartPanelSize); + Assert.Equal(120, args.Detail!.StartPanelSize); Assert.Equal(80, args.Detail.EndPanelSize); Assert.Equal(0, args.Detail.Delta); }) @@ -21,7 +21,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 130, "endPanelSize": 70, "delta": 10}}}""", assert: args => { - Assert.Equal(130, args!.Detail!.StartPanelSize); + Assert.Equal(130, args.Detail!.StartPanelSize); Assert.Equal(70, args.Detail.EndPanelSize); Assert.Equal(10, args.Detail.Delta); }) @@ -29,7 +29,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 150, "endPanelSize": 50, "delta": 30}}}""", assert: args => { - Assert.Equal(150, args!.Detail!.StartPanelSize); + Assert.Equal(150, args.Detail!.StartPanelSize); Assert.Equal(50, args.Detail.EndPanelSize); Assert.Equal(30, args.Detail.Delta); }); diff --git a/tests/IgniteUI.Blazor.Tests/StepperTests.cs b/tests/IgniteUI.Blazor.Tests/StepperTests.cs index bdd1f772..ee5bea41 100644 --- a/tests/IgniteUI.Blazor.Tests/StepperTests.cs +++ b/tests/IgniteUI.Blazor.Tests/StepperTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -36,12 +36,12 @@ public class StepperTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"oldIndex": 0, "newIndex": 1}}}""", assert: args => { - Assert.Equal(0, args!.Detail!.OldIndex); + Assert.Equal(0, args.Detail!.OldIndex); Assert.Equal(1, args.Detail.NewIndex); }) .Event(c => c.ActiveStepChanged, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"index": 1}}}""", - assert: args => Assert.Equal(1, args!.Detail!.Index)); + assert: args => Assert.Equal(1, args.Detail!.Index)); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); diff --git a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs index 845ab1b4..70eb91f9 100644 --- a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class SwitchTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "switch-value"}}}""", assert: args => { - Assert.True(args!.Detail!.Checked); + Assert.True(args.Detail!.Checked); Assert.Equal("switch-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/TabsTests.cs b/tests/IgniteUI.Blazor.Tests/TabsTests.cs index 0252b51f..7a66734c 100644 --- a/tests/IgniteUI.Blazor.Tests/TabsTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TabsTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -10,7 +10,7 @@ public class TabsTests : ComponentWithContractTestBase /// What each arranged tab's @bind-Selected received, filled during the dispatch. static readonly bool?[] tabSelection = new bool?[2]; - /// Two tabs, each binding SelectedChanged — IgbTab has no selection event of its own. + /// Two tabs, each binding SelectedChanged — IgbTab has no selection event of its own. static readonly Action> tabsArrange = ps => { tabSelection[0] = null; @@ -37,7 +37,7 @@ public class TabsTests : ComponentWithContractTestBase Assert.Same(cut.Instance.ActualTabsCollection[1], args.Detail); // The handler owns selection for every child: it writes each tab's Selected and // pushes it through that tab's @bind-Selected, which is IgbTab's only route. - Assert.True(args!.Detail!.Selected); + Assert.True(args.Detail!.Selected); Assert.False(cut.Instance.ActualTabsCollection[0].Selected); Assert.False(tabSelection[0]); Assert.True(tabSelection[1]); diff --git a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs index 3acf17a7..0ff579d0 100644 --- a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -60,7 +60,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": true}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args!.Detail!.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args.Detail!.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, @@ -68,7 +68,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": false}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args!.Detail!.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args.Detail!.Tile); Assert.False(args.Detail.State); }); @@ -276,14 +276,14 @@ public class TileTests : ComponentWithContractTestBase """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": true}}}""", assert: (tile, args) => { - Assert.Same(tile, args!.Detail!.Tile); + Assert.Same(tile, args.Detail!.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": false}}}""", assert: (tile, args) => { - Assert.Same(tile, args!.Detail!.Tile); + Assert.Same(tile, args.Detail!.Tile); Assert.False(args.Detail.State); }); diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index 8b11bc08..8a92c89e 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -43,7 +43,7 @@ public class TreeTests : ComponentWithContractTestBase .Event(c => c.SelectionChanged, arrange, argsJson: FromRender.Of((interop, cut) => $$$$$"""{"detail": {"retType": "object", "type": "", "value": {"newSelection": {"retType": "Array", "type": "", "value": [{"refType": "name", "id": "{{{{{interop.ContainerIdOf(cut, "igc-tree-item:nth-of-type(2)")}}}}}"}]}}}}"""), - assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args!.Detail!.NewSelection![0])); + assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail!.NewSelection![0])); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); @@ -240,7 +240,7 @@ public class TreeItemTests : ComponentWithContractTestBase Assert.Equal(2, result!.Length); Assert.Same(h.FindComponents()[1].Instance, result[1]); // TODO: the ancestor ref only resolves through FindByName on the item - // itself, which matches nothing but "mainControl" — the parent element + // itself, which matches nothing but "mainControl" — the parent element // currently decodes to null (observed: path = [self, null]) // Assert.Same(h.FindComponents()[0].Instance, result[0]); }); From 4305f2eceb788d9c9596deefc6dc5acc881876d0 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Thu, 27 Aug 2026 17:43:41 +0300 Subject: [PATCH 32/64] Remove redundant null-forgiving operators. --- src/components/Blazor/DateRangePicker.cs | 4 ++-- src/components/Blazor/MaskInput.cs | 8 ++++---- src/components/Blazor/Select.cs | 4 ++-- src/components/Blazor/Textarea.cs | 4 ++-- src/componentsBase/BaseCollection.cs | 4 ++-- src/componentsBase/BaseRendererControl.cs | 6 +++--- src/componentsBase/CollectionAdapter.cs | 2 +- src/componentsBase/UnmarshalledDataSource.cs | 10 +++++----- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/DropdownTests.cs | 6 +++--- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 19072935..28167ba0 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -807,7 +807,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -816,7 +816,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 0f5cc43c..3bb6d3bc 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -167,7 +167,7 @@ public bool ReadOnly /// public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String? direction = null) { - await InvokeMethod("setSelectionRange", new object?[] { start, end, StringToString(direction)! }, new string[] { "Number", "Number", "String" }); + await InvokeMethod("setSelectionRange", new object?[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } /// @@ -175,7 +175,7 @@ public async Task SetSelectionRangeAsync(double start = -1, double end = -1, Str /// public void SetSelectionRange(double start = -1, double end = -1, String? direction = null) { - InvokeMethodSync("setSelectionRange", new object?[] { start, end, StringToString(direction)! }, new string[] { "Number", "Number", "String" }); + InvokeMethodSync("setSelectionRange", new object?[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); } /// @@ -183,7 +183,7 @@ public void SetSelectionRange(double start = -1, double end = -1, String? direct /// public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String? selectMode = null) { - await InvokeMethod("setRangeText", new object?[] { StringToString(replacement)!, start, end, StringToString(selectMode)! }, new string[] { "String", "Number", "Number", "String" }); + await InvokeMethod("setRangeText", new object?[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } /// @@ -191,7 +191,7 @@ public async Task SetRangeTextAsync(String replacement, double start = -1, doubl /// public void SetRangeText(String replacement, double start = -1, double end = -1, String? selectMode = null) { - InvokeMethodSync("setRangeText", new object?[] { StringToString(replacement)!, start, end, StringToString(selectMode)! }, new string[] { "String", "Number", "Number", "String" }); + InvokeMethodSync("setRangeText", new object?[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 353f2214..5d215a56 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -510,7 +510,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -519,7 +519,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 60aa8391..9c5c9385 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -505,7 +505,7 @@ public bool CheckValidity() /// public async Task SetCustomValidityAsync(String message) { - await InvokeMethod("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + await InvokeMethod("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } /// @@ -514,7 +514,7 @@ public async Task SetCustomValidityAsync(String message) /// public void SetCustomValidity(String message) { - InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message)! }, new string[] { "String" }); + InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } private EventCallback? _valueChanged = null; diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 11016ac3..0db2b799 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -59,7 +59,7 @@ protected override void RemoveItem(int index) base.RemoveItem(index); if (item is BaseRendererElement element) { - element.Parent = null!; + element.Parent = null; } NotifyParent(); } @@ -135,7 +135,7 @@ protected override void ClearItems() var item = this[i]; if (item is BaseRendererElement element) { - element.Parent = null!; + element.Parent = null; } } base.ClearItems(); diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index fde73290..68812b8f 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -720,9 +720,9 @@ internal void AdjustDynamicContent(string? containerId, string? contentType, str if (args != null) { var argsDic = JsonSerializer.Deserialize>(args, SerializerOptions); - context = ConvertReturnValue(argsDic!); + context = ConvertReturnValue(argsDic); } - dynamicContent.UpdateContext(context!); + dynamicContent.UpdateContext(context); } break; } @@ -2152,7 +2152,7 @@ public void OnInvokeReturn(long invokeId, Object returnValue) { if (_methodTasks.ContainsKey(invokeId)) { - _methodTasks[invokeId].SetResult(result!); + _methodTasks[invokeId].SetResult(result); } else { diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 0f0af015..068f21ac 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -217,7 +217,7 @@ private void SyncItems() // no collection to sync return; } - for (var i = this._query!.Count - 1; i >= 0; i--) + for (var i = this._query.Count - 1; i >= 0; i--) { item = queryArray[i]; if (item == null) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 5b202b4d..9fe37cf8 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -204,7 +204,7 @@ public UnmarshalledDataSource() if (schema.IsPrimitive) { columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___primitiveValueCollection", null, null, false, schema.PrimitiveType, oldValue, newValue); - return columns!; + return columns; } if (String.IsNullOrEmpty(parentPath)) { @@ -350,12 +350,12 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) { dateTimeGetter = (Func)valueGetter; - stringGetter = (o) => ((DateTime)dateTimeGetter!(o)).ToString("o"); + stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); } else { dateTimeGetter = (o) => (DateTime)untypedGetter!(o); - stringGetter = (o) => ((DateTime)dateTimeGetter!(o)).ToString("o"); + stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); } break; case JSDataSourceSchemaType.ObjectValue: @@ -419,7 +419,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN nullableDateTimeGetter = (Func)valueGetter; stringGetter = (o) => { - var val = nullableDateTimeGetter!(o); + var val = nullableDateTimeGetter(o); return val == null ? null! : val.Value.ToString("o"); }; } @@ -1652,7 +1652,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha #pragma warning disable CS8604 // internal invariant: paired column arrays (NullValues) are allocated together if (column == null) { - column = CreateColumn(parentPath, propertyName!, schema, type, getter, untypedGetter, isIdColumn); + column = CreateColumn(parentPath, propertyName, schema, type, getter, untypedGetter, isIdColumn); } if (column.Type == JSDataSourceSchemaType.ObjectValue || ( diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 0ed32617..cf77b6fc 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -49,7 +49,7 @@ internal static string ChangeDetail(string newValues, string items, string type arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), returns: FromRender.Of((interop, cut) => InteropReturn.Array( $$"""[{"refType": "uuid", "id": "{{DataItemId(interop, cut, 0)}}"}]""")), - assert: (cut, result) => Assert.Same(_valueItem1, Assert.Single(result!))) + assert: (cut, result) => Assert.Same(_valueItem1, Assert.Single(result))) .Getter(c => c.GetSelectionAsync(), c => c.GetSelection(), "Selection", arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), returns: FromRender.Of((interop, cut) => InteropReturn.Array( diff --git a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs index 90a3fc1d..100e3837 100644 --- a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs @@ -91,9 +91,9 @@ sealed class Anchor elements: () => [anchor.Element]) .Method(c => c.ClearSelectionAsync(), c => c.ClearSelection(), "clearSelection") .Method(c => c.SelectAsync("item-1"), c => c.Select("item-1"), "select", - InteropReturn.Undefined, expect: null!, args: ["item-1"], types: ["Json"]) + InteropReturn.Undefined, expect: null, args: ["item-1"], types: ["Json"]) .Method(c => c.NavigateToAsync(2), c => c.NavigateTo(2), "navigateTo", - InteropReturn.Undefined, expect: null!, args: [2.0], types: ["Json"]) + InteropReturn.Undefined, expect: null, args: [2.0], types: ["Json"]) .Getter(c => c.GetItemsAsync(), c => c.GetItems(), "Items", itemsArrange, returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(2)")}}}"}]""")), @@ -115,7 +115,7 @@ sealed class Anchor // Assert.Same(cut.FindComponents()[0].Instance, result[0]); // Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) - .Getter(c => c.GetSelectedItemAsync(), c => c.GetSelectedItem(), "SelectedItem", InteropReturn.Undefined, expect: null!) + .Getter(c => c.GetSelectedItemAsync(), c => c.GetSelectedItem(), "SelectedItem", InteropReturn.Undefined, expect: null) .Getter(c => c.GetSelectedItemAsync(), c => c.GetSelectedItem(), "SelectedItem", itemsArrange, returns: FromRender.Of((interop, cut) => InteropReturn.Ref($$"""{"refType": "name", "id": "{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(1)")}}"}""")), From 207e0cdefee647f0a9d1b1d2198b386525188740 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 28 Aug 2026 10:04:22 +0300 Subject: [PATCH 33/64] fix: two behavioral changes/regressions from nullable annotation pass --- src/componentsBase/RuntimeHelper.cs | 12 +++---- src/componentsBase/UnmarshalledDataSource.cs | 38 ++++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 89320e04..b7c4f1ff 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -10,7 +10,7 @@ internal class RuntimeHelper #if NET5_0 private IJSUnmarshalledRuntime? _unmarshalledRuntime; #else - private Func? _callSendUnmarshalledColumnMessage; + private Func? _callSendUnmarshalledColumnMessage; private Func? _callSendUnmarshalledColumnDataIntentMessage; #endif private IJSInProcessRuntime? _inprocRuntime; @@ -57,7 +57,7 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) var meth = target.MakeGenericMethod(new Type[] { typeof(string), typeof(int), - typeof(UnmarshalledColumn?[]), + typeof(UnmarshalledColumn[]), typeof(string) }); @@ -65,14 +65,14 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) var methodNameParam = Expression.Parameter(typeof(string), "methodName"); var refNameParam = Expression.Parameter(typeof(string), "refName"); var indexParam = Expression.Parameter(typeof(int), "index"); - var columnsParam = Expression.Parameter(typeof(UnmarshalledColumn?[]), "columns"); + var columnsParam = Expression.Parameter(typeof(UnmarshalledColumn[]), "columns"); var wsRuntime = Expression.Convert(jsRuntimeParam, inprocRuntime.GetType()); var call = Expression.Call(wsRuntime, meth, methodNameParam, refNameParam, indexParam, columnsParam); _callSendUnmarshalledColumnMessage = - (Func)Expression.Lambda( + (Func)Expression.Lambda( call, jsRuntimeParam, methodNameParam, refNameParam, indexParam, columnsParam).Compile(); } @@ -105,12 +105,12 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) } } - public unsafe string? SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn?[]? columns) + public unsafe string? SendUnmarshalledColumnMessage(string methodName, string refName, int index, UnmarshalledColumn[]? columns) { #if NET5_0 if (_unmarshalledRuntime != null) { - return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, index, columns); + return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, index, columns); } #else if (_callSendUnmarshalledColumnMessage != null) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 9fe37cf8..79e989e7 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -26,7 +26,7 @@ public UnmarshalledColumnData() public string?[]? StringValues { get; set; } public bool[]? NullValues { get; set; } public Guid[]? IDValues { get; set; } - public UnmarshalledColumn?[]?[]? SubDataSourceValues; + public UnmarshalledColumn[]?[]? SubDataSourceValues; public UnmarshalledColumn Column { get; set; } @@ -66,7 +66,7 @@ internal struct UnmarshalledColumn [FieldOffset(40)] public string[] StringValues; [FieldOffset(40)] - public UnmarshalledColumn?[][]? SubDataSourceValues; + public UnmarshalledColumn[]?[]? SubDataSourceValues; [FieldOffset(48)] public bool[] NullValues; } @@ -145,9 +145,9 @@ public UnmarshalledDataSource() { //Console.WriteLine("adjusting capacity, oldValue: " + oldValue + ", newValue: " + newValue); DateTime start = DateTime.Now; - if (columns == null || schema == null) + if (schema == null) { - return null; + return columns; } if (schema.IsDataSource) { @@ -728,7 +728,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { - UnmarshalledColumn?[]? cols = null; + UnmarshalledColumn[]? cols = null; if (objVal != null) { var id = _idGetter!(item!); @@ -814,15 +814,15 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { - UnmarshalledColumn?[]? cols = null; + UnmarshalledColumn[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; var subcols = sub!.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; - primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; + primcol.ActualCount = subcols[0].ActualCount; + primcol.DataSourceID = subcols[0].DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); int i = 0; @@ -876,7 +876,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; } - cols = new UnmarshalledColumn?[subcols.Length + 1]; + cols = new UnmarshalledColumn[subcols.Length + 1]; for (i = 0; i < subcols.Length; i++) { cols[i] = subcols[i]; @@ -1073,7 +1073,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { - UnmarshalledColumn?[]? cols = null; + UnmarshalledColumn[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; @@ -1121,15 +1121,15 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { - UnmarshalledColumn?[]? cols = null; + UnmarshalledColumn[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); var subcols = sub!.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols![0].GetValueOrDefault().ActualCount; - primcol.DataSourceID = subcols[0].GetValueOrDefault().DataSourceID; + primcol.ActualCount = subcols[0].ActualCount; + primcol.DataSourceID = subcols[0].DataSourceID; primcol.PropertyPath = "___primitiveVal"; primcol.Type = GetArrayType(newColumn.Type); int i = 0; @@ -1183,7 +1183,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; } - cols = new UnmarshalledColumn?[subcols.Length + 1]; + cols = new UnmarshalledColumn[subcols.Length + 1]; for (i = 0; i < subcols.Length; i++) { cols[i] = subcols[i]; @@ -1555,7 +1555,7 @@ private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) return JSDataSourceSchemaType.ObjectValue; } - private void GetColumns(string refName, UnmarshalledColumnData?[]? columns, List? l) + private void GetColumns(string refName, UnmarshalledColumnData?[]? columns, List l) { List toDrill = new List(); @@ -1582,7 +1582,7 @@ private void GetColumns(string refName, UnmarshalledColumnData?[]? columns, List col.DataSourceID = refName; col.ActualCount = _size; - l!.Add(col); + l.Add(col); } } } @@ -1592,9 +1592,9 @@ private void GetColumns(string refName, UnmarshalledColumnData?[]? columns, List } } - internal UnmarshalledColumn?[]? GetColumns(string refName) + internal UnmarshalledColumn[] GetColumns(string refName) { - var l = new List(); + var l = new List(); GetColumns(refName, _columns, l); return l.ToArray(); } @@ -1664,7 +1664,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha var existingColumn = column.SubDataSourceValues; if (existingColumn == null || existingColumn.Length != newValue) { - var subColumn = new UnmarshalledColumn?[newValue][]; + var subColumn = new UnmarshalledColumn[newValue][]; if (existingColumn != null) { Array.Copy(existingColumn, subColumn, _size); From 40fff10d338cf7c1eb5ad6a63b50f3b5913669c3 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 14:58:35 +0300 Subject: [PATCH 34/64] Make EventArg Detail non-nullable. --- .../Blazor/ActiveStepChangedEventArgs.cs | 9 +++++---- .../Blazor/ActiveStepChangingEventArgs.cs | 8 ++++---- src/components/Blazor/Calendar.cs | 8 ++++---- .../Blazor/ChatMessageAttachmentEventArgs.cs | 8 ++++---- src/components/Blazor/ChatMessageEventArgs.cs | 8 ++++---- .../Blazor/ChatMessageReactionEventArgs.cs | 8 ++++---- .../Blazor/CheckboxChangeEventArgs.cs | 8 ++++---- src/components/Blazor/ComboChangeEventArgs.cs | 11 +++++------ .../ComponentDataValueChangedEventArgs.cs | 4 ++-- .../Blazor/ComponentValueChangedEventArgs.cs | 4 ++-- .../Blazor/DateRangeValueEventArgs.cs | 8 ++++---- .../Blazor/DropdownItemComponentEventArgs.cs | 6 +++--- .../ExpansionPanelComponentEventArgs.cs | 6 +++--- src/components/Blazor/RadioChangeEventArgs.cs | 8 ++++---- .../Blazor/RangeSliderValueEventArgs.cs | 8 ++++---- .../Blazor/SelectItemComponentEventArgs.cs | 6 +++--- .../Blazor/SplitterResizeEventArgs.cs | 8 ++++---- src/components/Blazor/Stepper.cs | 4 ++-- .../Blazor/TabComponentEventArgs.cs | 6 +++--- .../Blazor/TileChangeStateEventArgs.cs | 8 ++++---- .../Blazor/TileComponentEventArgs.cs | 6 +++--- .../Blazor/TreeItemComponentEventArgs.cs | 6 +++--- .../Blazor/TreeSelectionEventArgs.cs | 8 ++++---- src/componentsBase/BaseRendererControl.cs | 19 +++++++------------ src/componentsBase/BaseRendererElement.cs | 12 ++++++------ src/componentsBase/MarshalByValueFactory.cs | 5 ++++- 26 files changed, 99 insertions(+), 101 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 3b6257cb..75696f94 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -13,27 +13,28 @@ public partial class IgbActiveStepChangedEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbActiveStepChangedEventArgsDetail? _detail; + private IgbActiveStepChangedEventArgsDetail _detail = new IgbActiveStepChangedEventArgsDetail(); /// /// The payload of the event, carrying the index of the step that became active. /// [Parameter] - public IgbActiveStepChangedEventArgsDetail? Detail + public IgbActiveStepChangedEventArgsDetail Detail { get { return this._detail; } set { MarkPropDirty("Detail"); + if (this._detail != null) { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +65,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangedEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } + { this.Detail = (IgbActiveStepChangedEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 41821960..48622020 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -13,14 +13,14 @@ public partial class IgbActiveStepChangingEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbActiveStepChangingEventArgsDetail? _detail; + private IgbActiveStepChangingEventArgsDetail _detail = new IgbActiveStepChangingEventArgsDetail(); /// /// The payload of the event, carrying the index of the currently active step and the index of /// the step that is about to become active. /// [Parameter] - public IgbActiveStepChangingEventArgsDetail? Detail + public IgbActiveStepChangingEventArgsDetail Detail { get { return this._detail; } set @@ -30,11 +30,11 @@ public IgbActiveStepChangingEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -65,7 +65,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangingEventArgsDetail?)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } + { this.Detail = (IgbActiveStepChangingEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index fed98159..4bd728e4 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -35,14 +35,14 @@ protected override bool SupportsVisualChildren } } - private DateTime? _value = DateTime.MinValue; + private DateTime _value = DateTime.MinValue; /// /// The current value of the calendar. /// Used when is set to . /// [Parameter] - public DateTime? Value + public DateTime Value { get { return this._value; } set @@ -394,11 +394,11 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime?); + var newValueValue = default(DateTime); if (this.Selection == CalendarSelection.Single) { - newValueValue = (DateTime?)(args.Detail); + newValueValue = (DateTime)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index c910d5fa..83409895 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbChatMessageAttachmentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessageAttachment? _detail; + private IgbChatMessageAttachment _detail = new IgbChatMessageAttachment(); /// /// The chat message attachment the event was raised for. /// [Parameter] - public IgbChatMessageAttachment? Detail + public IgbChatMessageAttachment Detail { get { return this._detail; } set @@ -29,11 +29,11 @@ public IgbChatMessageAttachment? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageAttachment?)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } + { this.Detail = (IgbChatMessageAttachment)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index dae7cb30..203821e2 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbChatMessageEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessage? _detail; + private IgbChatMessage _detail = new IgbChatMessage(); /// /// The chat message the event was raised for. /// [Parameter] - public IgbChatMessage? Detail + public IgbChatMessage Detail { get { return this._detail; } set @@ -29,11 +29,11 @@ public IgbChatMessage? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessage?)ConvertReturnValue(args["detail"], "ChatMessage", true); } + { this.Detail = (IgbChatMessage)ConvertReturnValue(args["detail"], "ChatMessage", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index bb741624..154c4d04 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbChatMessageReactionEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessageReaction? _detail; + private IgbChatMessageReaction _detail = new IgbChatMessageReaction(); /// /// The reaction the event was raised for, together with the chat message it is associated with. /// [Parameter] - public IgbChatMessageReaction? Detail + public IgbChatMessageReaction Detail { get { return this._detail; } set @@ -29,11 +29,11 @@ public IgbChatMessageReaction? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageReaction?)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } + { this.Detail = (IgbChatMessageReaction)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index d8791fe7..4641c974 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbCheckboxChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbCheckboxChangeEventArgsDetail? _detail; + private IgbCheckboxChangeEventArgsDetail _detail = new IgbCheckboxChangeEventArgsDetail(); /// /// The payload of the event, carrying the new checked state and the value of the control. /// [Parameter] - public IgbCheckboxChangeEventArgsDetail? Detail + public IgbCheckboxChangeEventArgsDetail Detail { get { return this._detail; } set @@ -29,11 +29,11 @@ public IgbCheckboxChangeEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbCheckboxChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } + { this.Detail = (IgbCheckboxChangeEventArgsDetail)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 75085e3f..21549afc 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -12,13 +12,13 @@ public partial class IgbComboChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbComboChangeEventArgsDetail? _detail; + private IgbComboChangeEventArgsDetail _detail = new IgbComboChangeEventArgsDetail(); /// /// Describes the selection change: the new value, the items it affected and the kind of change. /// [Parameter] - public IgbComboChangeEventArgsDetail? Detail + public IgbComboChangeEventArgsDetail Detail { get { return this._detail; } set @@ -28,12 +28,11 @@ public IgbComboChangeEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); - } - this._detail = value; - } + } } } @@ -63,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbComboChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } + { this.Detail = (IgbComboChangeEventArgsDetail)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index ea241c1e..e8c73ce9 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -11,13 +11,13 @@ public partial class IgbComponentDataValueChangedEventArgs : BaseRendererElement /// public override string Type { get { return "WebComponentDataValueChangedEventArgs"; } } - private object? _detail; + private object _detail = new object(); /// /// The value carried by the event. /// [Parameter] - public object? Detail + public object Detail { get { return this._detail; } set diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 2f61c533..04647ee7 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbComponentValueChangedEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private string? _detail; + private string _detail = ""; /// /// The string value carried by the event. /// [Parameter] - public string? Detail + public string Detail { get { return this._detail; } set diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 971027ee..969d3cf6 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -12,13 +12,13 @@ public partial class IgbDateRangeValueEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbDateRangeValueDetail? _detail; + private IgbDateRangeValueDetail _detail = new IgbDateRangeValueDetail(); /// /// The date range carried by the event. /// [Parameter] - public IgbDateRangeValueDetail? Detail + public IgbDateRangeValueDetail Detail { get { return this._detail; } set @@ -28,11 +28,11 @@ public IgbDateRangeValueDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbDateRangeValueDetail?)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } + { this.Detail = (IgbDateRangeValueDetail)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index 13f39987..bc410c4b 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbDropdownItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbDropdownItem? _detail; + private IgbDropdownItem _detail = new IgbDropdownItem(); /// /// The dropdown item that became selected. /// [Parameter] - public IgbDropdownItem? Detail + public IgbDropdownItem Detail { get { return this._detail; } set @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbDropdownItem?)ConvertReturnValue(args["detail"], "DropdownItem", true); } + { this.Detail = (IgbDropdownItem)ConvertReturnValue(args["detail"], "DropdownItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index ed9550b2..94caa571 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -15,13 +15,13 @@ public partial class IgbExpansionPanelComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbExpansionPanel? _detail; + private IgbExpansionPanel _detail = new IgbExpansionPanel(); /// /// The expansion panel the event was raised for. /// [Parameter] - public IgbExpansionPanel? Detail + public IgbExpansionPanel Detail { get { return this._detail; } set @@ -61,7 +61,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbExpansionPanel?)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } + { this.Detail = (IgbExpansionPanel)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 432d4917..490517b3 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbRadioChangeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbRadioChangeEventArgsDetail? _detail; + private IgbRadioChangeEventArgsDetail _detail = new IgbRadioChangeEventArgsDetail(); /// /// The payload of the event, carrying the new checked state and the value of the radio button. /// [Parameter] - public IgbRadioChangeEventArgsDetail? Detail + public IgbRadioChangeEventArgsDetail Detail { get { return this._detail; } set @@ -29,11 +29,11 @@ public IgbRadioChangeEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbRadioChangeEventArgsDetail?)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } + { this.Detail = (IgbRadioChangeEventArgsDetail)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index 7f9a79fb..78752bc3 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -11,13 +11,13 @@ public partial class IgbRangeSliderValueEventArgs : BaseRendererElement /// public override string Type { get { return "WebRangeSliderValueEventArgs"; } } - private IgbRangeSliderValue? _detail; + private IgbRangeSliderValue _detail = new IgbRangeSliderValue(); /// /// The lower and upper thumb values of the range slider. /// [Parameter] - public IgbRangeSliderValue? Detail + public IgbRangeSliderValue Detail { get { return this._detail; } set @@ -27,11 +27,11 @@ public IgbRangeSliderValue? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbRangeSliderValue?)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } + { this.Detail = (IgbRangeSliderValue)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 3921adc7..16f292d4 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbSelectItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbSelectItem? _detail; + private IgbSelectItem _detail = new IgbSelectItem(); /// /// The select item that became selected. /// [Parameter] - public IgbSelectItem? Detail + public IgbSelectItem Detail { get { return this._detail; } set @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbSelectItem?)ConvertReturnValue(args["detail"], "SelectItem", true); } + { this.Detail = (IgbSelectItem)ConvertReturnValue(args["detail"], "SelectItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index 0e90ef75..85621265 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -12,13 +12,13 @@ public partial class IgbSplitterResizeEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbSplitterResizeEventArgsDetail? _detail; + private IgbSplitterResizeEventArgsDetail _detail = new IgbSplitterResizeEventArgsDetail(); /// /// The current sizes of the panes adjacent to the resized splitter bar. /// [Parameter] - public IgbSplitterResizeEventArgsDetail? Detail + public IgbSplitterResizeEventArgsDetail Detail { get { return this._detail; } set @@ -28,11 +28,11 @@ public IgbSplitterResizeEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbSplitterResizeEventArgsDetail?)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } + { this.Detail = (IgbSplitterResizeEventArgsDetail)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index 859fe15a..fe8e973d 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -442,7 +442,7 @@ public EventCallback ActiveStepChanged if (!value.EqualsCompat(_activeStepChanged)) { _activeStepChanged = value; - this.SetHandler(this.Name, "ActiveStepChanged", value); + this.SetHandlerSimple(this.Name, "ActiveStepChanged", value, val => ReturnToObject(val)!); this.OnRefChanged("ActiveStepChanged", null, "event:::ActiveStepChanged", true, false, (refName, oldValue, newValue) => { this._activeStepChangedRef = refName; @@ -453,7 +453,7 @@ public EventCallback ActiveStepChanged else { _activeStepChanged = null; - this.SetHandler(this.Name, "ActiveStepChanged", null); + this.SetHandlerSimple(this.Name, "ActiveStepChanged", null, val => ReturnToObject(val)!); this.OnRefChanged("ActiveStepChanged", null, null, true, false, (refName, oldValue, newValue) => { this._activeStepChangedRef = null; diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index 214d8fdb..f0386b2d 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbTabComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTab? _detail; + private IgbTab _detail = new IgbTab(); /// /// The tab that became selected. /// [Parameter] - public IgbTab? Detail + public IgbTab Detail { get { return this._detail; } set @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTab?)ConvertReturnValue(args["detail"], "Tab", true); } + { this.Detail = (IgbTab)ConvertReturnValue(args["detail"], "Tab", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 67619e94..6ae53003 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -14,13 +14,13 @@ public partial class IgbTileChangeStateEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTileChangeStateEventArgsDetail? _detail; + private IgbTileChangeStateEventArgsDetail _detail = new IgbTileChangeStateEventArgsDetail(); /// /// The affected tile and the state it is changing to. /// [Parameter] - public IgbTileChangeStateEventArgsDetail? Detail + public IgbTileChangeStateEventArgsDetail Detail { get { return this._detail; } set @@ -30,11 +30,11 @@ public IgbTileChangeStateEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -65,7 +65,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args?.ContainsKey("detail") == true) - { this.Detail = (IgbTileChangeStateEventArgsDetail?)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } + { this.Detail = (IgbTileChangeStateEventArgsDetail)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 0b8c8417..5e8cf0bf 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -14,13 +14,13 @@ public partial class IgbTileComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTile? _detail; + private IgbTile _detail = new IgbTile(); /// /// The tile the operation applies to. /// [Parameter] - public IgbTile? Detail + public IgbTile Detail { get { return this._detail; } set @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTile?)ConvertReturnValue(args["detail"], "Tile", true); } + { this.Detail = (IgbTile)ConvertReturnValue(args["detail"], "Tile", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 175d7a39..79b92bbb 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -14,13 +14,13 @@ public partial class IgbTreeItemComponentEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeItem? _detail; + private IgbTreeItem _detail = new IgbTreeItem(); /// /// The tree item the event applies to. /// [Parameter] - public IgbTreeItem? Detail + public IgbTreeItem Detail { get { return this._detail; } set @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTreeItem?)ConvertReturnValue(args["detail"], "TreeItem", true); } + { this.Detail = (IgbTreeItem)ConvertReturnValue(args["detail"], "TreeItem", true); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index c08a2d71..9ad2c502 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -12,13 +12,13 @@ public partial class IgbTreeSelectionEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeSelectionEventArgsDetail? _detail; + private IgbTreeSelectionEventArgsDetail _detail = new IgbTreeSelectionEventArgsDetail(); /// /// The selection the tree is about to apply. /// [Parameter] - public IgbTreeSelectionEventArgsDetail? Detail + public IgbTreeSelectionEventArgsDetail Detail { get { return this._detail; } set @@ -28,11 +28,11 @@ public IgbTreeSelectionEventArgsDetail? Detail { this.DetachChild(this._detail); } + this._detail = value; if (value != null) { this.AttachChild(value); } - this._detail = value; } } @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTreeSelectionEventArgsDetail?)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } + { this.Detail = (IgbTreeSelectionEventArgsDetail)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } this.SuppressParentNotify = false; } diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 68812b8f..74c263c7 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1883,7 +1883,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) } } - internal object? ReturnToPrimitive(object? returnValue) + internal object ReturnToPrimitive(object? returnValue) { return ConvertReturnValue(returnValue, true); } @@ -1915,7 +1915,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) return (T[])val; } - internal object? ConvertReturnValue(object? returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object ConvertReturnValue(object? returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { try { @@ -2071,7 +2071,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) if (obj["value"] == null || ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) { - return null; + return returnValue ?? new object(); } object? o = null; @@ -2105,7 +2105,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) { if (acceptsNullIfMarshalDoesNotExist) { - return null; + return returnValue ?? new object(); } var ret = obj["value"].ToString(); returnValue = JsonSerializer.Deserialize>(ret!, SerializerOptions); @@ -2124,7 +2124,7 @@ private void SendJsonSync(string json, ElementReference[]? nativeElements) Console.WriteLine(e.ToString()); } - return returnValue; + return returnValue ?? new object(); } public void OnInvokeReturn(long invokeId, Object returnValue) @@ -2615,15 +2615,10 @@ internal void ObjectToParam(SerializationContext c, Type type, object? val) ObjectToParam(c, val); } - internal string? ReturnToString(object? val) + internal string ReturnToString(object? val) { val = ConvertReturnValue(val); - - if (val == null) - { - return null; - } - return val.ToString(); + return val?.ToString() ?? String.Empty; } internal string? StringToString(object? val) diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 56bf1e5e..107ae62d 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -865,7 +865,7 @@ internal void ObjectToParam(SerializationContext? c, object? val) } } - internal string? ReturnToString(object? val) + internal string ReturnToString(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -876,7 +876,7 @@ internal void ObjectToParam(SerializationContext? c, object? val) { return ((BaseRendererControl)CurrParent).ReturnToString(val); } - return default; + return String.Empty; } internal bool ReturnToBoolean(object? val) @@ -893,7 +893,7 @@ internal bool ReturnToBoolean(object? val) return default; } - internal object? ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -904,10 +904,10 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } - return default; + return default(object) ?? new object(); } - internal object? ReturnToPrimitive(object? val) + internal object ReturnToPrimitive(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -918,7 +918,7 @@ internal bool ReturnToBoolean(object? val) { return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); } - return default; + return default(object) ?? new object(); } internal T[]? DowncastArray(object? val) diff --git a/src/componentsBase/MarshalByValueFactory.cs b/src/componentsBase/MarshalByValueFactory.cs index 09bd91e4..f19a08da 100644 --- a/src/componentsBase/MarshalByValueFactory.cs +++ b/src/componentsBase/MarshalByValueFactory.cs @@ -154,7 +154,10 @@ internal static bool MustMarshalByValue(string? typeName) break; case "ActiveStepChangedEventArgs": case "WebActiveStepChangedEventArgs": - return new IgbActiveStepChangedEventArgs(); + return new IgbActiveStepChangedEventArgs + { + Detail = new IgbActiveStepChangedEventArgsDetail() + }; break; case "ActiveStepChangedEventArgsDetail": case "WebActiveStepChangedEventArgsDetail": From c6570c49df886800c5c754e9ecfc8fee1e00ccf4 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 15:05:36 +0300 Subject: [PATCH 35/64] Make DateTime across components non-nullable. --- src/components/Blazor/Calendar.cs | 8 +++--- src/components/Blazor/DatePicker.cs | 28 ++++++++++---------- src/components/Blazor/DateRangePicker.cs | 8 +++--- src/components/Blazor/DateTimeInput.cs | 20 +++++++------- src/components/Blazor/DateTimeInputBase.cs | 8 +++--- src/componentsBase/RendererSerializer.cs | 4 +-- src/componentsBase/UnmarshalledDataSource.cs | 12 ++++----- tests/IgniteUI.Blazor.Tests/CalendarTests.cs | 2 +- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 4bd728e4..ec8c9768 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -279,18 +279,18 @@ public IgbCalendarFormatOptions? FormatOptions } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -428,7 +428,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Values"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 97893fc8..d7e037a1 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -112,13 +112,13 @@ public bool ReadOnly } } - private DateTime? _value = DateTime.MinValue; + private DateTime _value = DateTime.MinValue; /// /// The value of the picker. /// [Parameter] - public DateTime? Value + public DateTime Value { get { return this._value; } set @@ -135,7 +135,7 @@ public DateTime? Value /// /// Gets the current value of the picker. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -144,7 +144,7 @@ public DateTime? Value /// /// Gets the current value of the picker. /// - public DateTime? GetCurrentValue() + public DateTime GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -169,13 +169,13 @@ public DateTime ActiveDate } } - private DateTime? _min = DateTime.MinValue; + private DateTime _min = DateTime.MinValue; /// /// The minimum value required for the date picker to remain valid. /// [Parameter] - public DateTime? Min + public DateTime Min { get { return this._min; } set @@ -188,13 +188,13 @@ public DateTime? Min } } - private DateTime? _max = DateTime.MinValue; + private DateTime _max = DateTime.MinValue; /// /// The maximum value required for the date picker to remain valid. /// [Parameter] - public DateTime? Max + public DateTime Max { get { return this._max; } set @@ -690,18 +690,18 @@ public void SetCustomValidity(String message) InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -1062,10 +1062,10 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime?); + var newValueValue = default(DateTime); { - newValueValue = (DateTime?)(args.Detail); + newValueValue = (DateTime)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. @@ -1078,7 +1078,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Value"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 28167ba0..692274ef 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -450,13 +450,13 @@ public string? InputFormat } } - private DateTime? _min = DateTime.MinValue; + private DateTime _min = DateTime.MinValue; /// /// The minimum value required for the date range picker to remain valid. /// [Parameter] - public DateTime? Min + public DateTime Min { get { return this._min; } set @@ -469,13 +469,13 @@ public DateTime? Min } } - private DateTime? _max = DateTime.MinValue; + private DateTime _max = DateTime.MinValue; /// /// The maximum value required for the date range picker to remain valid. /// [Parameter] - public DateTime? Max + public DateTime Max { get { return this._max; } set diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index 6ccefece..1c9416db 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -35,13 +35,13 @@ protected override bool SupportsVisualChildren } } - private DateTime? _value = DateTime.MinValue; + private DateTime _value = DateTime.MinValue; /// /// The value of the input. /// [Parameter] - public DateTime? Value + public DateTime Value { get { return this._value; } set @@ -58,7 +58,7 @@ public DateTime? Value /// /// Returns the current value of the input. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -67,7 +67,7 @@ public DateTime? Value /// /// Returns the current value of the input. /// - public DateTime? GetCurrentValue() + public DateTime GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -120,18 +120,18 @@ public void Clear() InvokeMethodSync("clear", new object?[] { }, new string[] { }); } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -276,10 +276,10 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime?); + var newValueValue = default(DateTime); { - newValueValue = (DateTime?)(args.Detail); + newValueValue = (DateTime)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. @@ -292,7 +292,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Value"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index 6f67e68b..122f9bd3 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -107,13 +107,13 @@ public string? InputFormat } } - private DateTime? _min = DateTime.MinValue; + private DateTime _min = DateTime.MinValue; /// /// The minimum value required for the input to remain valid. /// [Parameter] - public DateTime? Min + public DateTime Min { get { return this._min; } set @@ -126,13 +126,13 @@ public DateTime? Min } } - private DateTime? _max = DateTime.MinValue; + private DateTime _max = DateTime.MinValue; /// /// The maximum value required for the input to remain valid. /// [Parameter] - public DateTime? Max + public DateTime Max { get { return this._max; } set diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 6ccef246..edaf0b1c 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -349,7 +349,7 @@ public void AddNumberProp(String propertyName, Object? value) //_properties.Add("\"" + propertyName + "\"" + ": " + Convert.ToString(value, CultureInfo.InvariantCulture)); } - public void AddDateTimeProp(String propertyName, DateTime? value) + public void AddDateTimeProp(String propertyName, DateTime value) { if (_context!.Filter != null) { @@ -358,7 +358,7 @@ public void AddDateTimeProp(String propertyName, DateTime? value) return; } } - _context.Writer.WriteString(propertyName, value != null ? value.Value.ToString("o") : null); + _context.Writer.WriteString(propertyName, value.ToString("o")); //_properties.Add("\"" + propertyName + "\"" + ": \"" + value.ToString("o") + "\""); } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 79e989e7..f9339f60 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -299,7 +299,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN Func? nullableDecimalGetter = null; Func? nullableBoolGetter = null; Func? nullableByteGetter = null; - Func? nullableDateTimeGetter = null; + Func? nullableDateTimeGetter = null; Func? nullableFloatingPointGetter = null; switch (newColumn.Type) @@ -414,22 +414,22 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.NullableCalendarValue: case JSDataSourceSchemaType.NullableDateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) + if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) { - nullableDateTimeGetter = (Func)valueGetter; + nullableDateTimeGetter = (Func)valueGetter; stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val == null ? null! : val.Value.ToString("o"); + return val.ToString("o"); }; } else { - nullableDateTimeGetter = (o) => (DateTime?)untypedGetter!(o); + nullableDateTimeGetter = (o) => (DateTime)untypedGetter!(o); stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val == null ? null! : val.Value.ToString("o"); + return val.ToString("o"); }; } break; diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index 6b9078ff..a59cb227 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -20,7 +20,7 @@ public class CalendarTests : ComponentWithContractTestBase }) .Event(c => c.Change, argsJson: """{"detail": {"retType": "date", "value": "2026-01-02T03:04:05.000Z"}}""", - assert: args => Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), ((DateTime?)args.Detail)?.ToUniversalTime())) + assert: args => Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), ((DateTime)args.Detail).ToUniversalTime())) // Single selection: .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, argsJson: """{"detail": {"retType": "date", "value": "2026-01-02T03:04:05.000Z"}}""", From 3e16486825dec6110e2d1c5651f1cb8d6f3b9be1 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 16:33:24 +0300 Subject: [PATCH 36/64] Adjust public props to match type of client component props and defaults. --- src/components/Blazor/ButtonGroup.cs | 4 +-- src/components/Blazor/Calendar.cs | 19 +++++++----- src/components/Blazor/CalendarBase.cs | 8 ++--- src/components/Blazor/Chat.cs | 10 +++--- src/components/Blazor/Combo.cs | 12 +++---- src/components/Blazor/ComboChangeEventArgs.cs | 4 +-- .../Blazor/ComboChangeEventArgsDetail.cs | 8 ++--- src/components/Blazor/CustomDateRange.cs | 6 ++-- src/components/Blazor/DatePicker.cs | 8 ++--- src/components/Blazor/DateRangePicker.cs | 12 +++---- src/components/Blazor/Input.cs | 28 ++++++++--------- src/components/Blazor/MaskInput.cs | 16 +++++----- src/components/Blazor/SelectGroup.cs | 4 +-- src/components/Blazor/Tile.cs | 8 ++--- src/componentsBase/BaseRendererControl.cs | 31 +++++++++---------- src/componentsBase/BaseRendererElement.cs | 6 ++-- 16 files changed, 93 insertions(+), 91 deletions(-) diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index 9415a793..e60a2dc3 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -116,13 +116,13 @@ public ButtonGroupSelection Selection } } - private string[]? _selectedItems; + private string[] _selectedItems = Array.Empty(); /// /// Gets or sets the values of the currently selected buttons. /// [Parameter] - public string[]? SelectedItems + public string[] SelectedItems { get { return this._selectedItems; } set diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index ec8c9768..d00a0c21 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -75,7 +75,7 @@ public DateTime GetCurrentValue() var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); } - private DateTime[]? _values; + private DateTime[] _values = Array.Empty(); /// /// The current values of the calendar. @@ -83,7 +83,7 @@ public DateTime GetCurrentValue() /// or . /// [Parameter] - public DateTime[]? Values + public DateTime[] Values { get { return this._values; } set @@ -102,7 +102,7 @@ public DateTime[]? Values /// Used when is set to /// or . /// - public async Task GetCurrentValuesAsync() + public async Task GetCurrentValuesAsync() { var iv = await InvokeMethod("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); @@ -113,7 +113,7 @@ public DateTime[]? Values /// Used when is set to /// or . /// - public DateTime[]? GetCurrentValues() + public DateTime[] GetCurrentValues() { var iv = InvokeMethodSync("p:Values", new object?[] { }, new string[] { }); return ReturnToDateArray(iv); @@ -254,13 +254,16 @@ public CalendarActiveView ActiveView } } - private IgbCalendarFormatOptions? _formatOptions; + private IgbCalendarFormatOptions _formatOptions = new IgbCalendarFormatOptions() { + Month = "long", + Weekday = "narrow", + }; /// /// The options used to format the months and the weekdays in the calendar views. /// [Parameter] - public IgbCalendarFormatOptions? FormatOptions + public IgbCalendarFormatOptions FormatOptions { get { return this._formatOptions; } set @@ -270,11 +273,11 @@ public IgbCalendarFormatOptions? FormatOptions { this.DetachChild(this._formatOptions); } + this._formatOptions = value; if (value != null) { this.AttachChild(value); } - this._formatOptions = value; } } @@ -415,7 +418,7 @@ public EventCallback Change if (this.Selection != CalendarSelection.Single) { - newValueValues = (DateTime[]?)(DowncastArray(args.Detail)); + newValueValues = (DateTime[])(DowncastArray(args.Detail)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/CalendarBase.cs b/src/components/Blazor/CalendarBase.cs index 1e1cbab1..9e2da128 100644 --- a/src/components/Blazor/CalendarBase.cs +++ b/src/components/Blazor/CalendarBase.cs @@ -122,13 +122,13 @@ public IgbCalendarResourceStrings? ResourceStrings } } - private IgbDateRangeDescriptor[]? _specialDates; + private IgbDateRangeDescriptor[] _specialDates = Array.Empty(); /// /// Gets/Sets the special dates for the component. /// [Parameter] - public IgbDateRangeDescriptor[]? SpecialDates + public IgbDateRangeDescriptor[] SpecialDates { get { return this._specialDates; } set @@ -141,13 +141,13 @@ public IgbDateRangeDescriptor[]? SpecialDates } } - private IgbDateRangeDescriptor[]? _disabledDates; + private IgbDateRangeDescriptor[] _disabledDates = Array.Empty(); /// /// Gets/Sets the disabled dates for the component. /// [Parameter] - public IgbDateRangeDescriptor[]? DisabledDates + public IgbDateRangeDescriptor[] DisabledDates { get { return this._disabledDates; } set diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index 80ac99d9..a3c8a8a4 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -49,14 +49,14 @@ public IgbChat() : base() this.Options = new IgbChatOptions(); } - private IgbChatMessage[]? _messages; + private IgbChatMessage[] _messages = Array.Empty(); /// /// The list of chat messages currently displayed. /// Use this property to set or update the message history. /// [Parameter] - public IgbChatMessage[]? Messages + public IgbChatMessage[] Messages { get { return this._messages; } set @@ -69,14 +69,14 @@ public IgbChatMessage[]? Messages } } - private IgbChatDraftMessage? _draftMessage; + private IgbChatDraftMessage _draftMessage = new IgbChatDraftMessage(); /// /// The chat message currently being composed but not yet sent. /// Includes the draft text and any attachments. /// [Parameter] - public IgbChatDraftMessage? DraftMessage + public IgbChatDraftMessage DraftMessage { get { return this._draftMessage; } set @@ -86,11 +86,11 @@ public IgbChatDraftMessage? DraftMessage { this.DetachChild(this._draftMessage); } + this._draftMessage = value; if (value != null) { this.AttachChild(value); } - this._draftMessage = value; } } diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index 3fd28c4c..d487374f 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -320,13 +320,13 @@ public GroupingDirection GroupSorting } } - private IgbFilteringOptions? _filteringOptions; + private IgbFilteringOptions _filteringOptions = new IgbFilteringOptions(); /// /// An object that configures the filtering of the combo. /// [Parameter] - public IgbFilteringOptions? FilteringOptions + public IgbFilteringOptions FilteringOptions { get { return this._filteringOptions; } set @@ -336,11 +336,11 @@ public IgbFilteringOptions? FilteringOptions { this.DetachChild(this._filteringOptions); } + this._filteringOptions = value; if (value != null) { this.AttachChild(value); } - this._filteringOptions = value; } } @@ -401,7 +401,7 @@ public bool DisableClear } } - private T[]? _value; + private T[] _value = Array.Empty(); /// /// The value of the control, that is the currently selected items. @@ -410,7 +410,7 @@ public bool DisableClear /// of . /// [Parameter] - public T[]? Value + public T[] Value { get { return this._value; } set @@ -859,7 +859,7 @@ public EventCallback Change var newValueValue = default(T[]); { - newValueValue = (T[]?)(DowncastArray(args.Detail!.NewValue)); + newValueValue = (T[])(DowncastArray(args.Detail.NewValue)); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 21549afc..91ff351b 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -32,8 +32,8 @@ public IgbComboChangeEventArgsDetail Detail if (value != null) { this.AttachChild(value); - } } - + } + } } internal override void SerializeCore(RendererSerializer ser) diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index fa9a80e8..5b5b5db3 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -10,10 +10,10 @@ public partial class IgbComboChangeEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; private string? _newValueRef; - private object[]? _newValue; + private object[] _newValue = Array.Empty(); [Parameter] - public object[]? NewValue + public object[] NewValue { get { return this._newValue; } @@ -58,10 +58,10 @@ public string? NewValueScript } } private string? _itemsRef; - private object[]? _items; + private object[] _items = Array.Empty() ; [Parameter] - public object[]? Items + public object[] Items { get { return this._items; } diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index 5449ee9c..004d3b05 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -29,13 +29,13 @@ public string? Label } } - private IgbDateRangeValue? _dateRange; + private IgbDateRangeValue _dateRange = new IgbDateRangeValue(); /// /// The date range applied when the chip is selected. /// [Parameter] - public IgbDateRangeValue? DateRange + public IgbDateRangeValue DateRange { get { return this._dateRange; } set @@ -45,11 +45,11 @@ public IgbDateRangeValue? DateRange { this.DetachChild(this._dateRange); } + this._dateRange = value; if (value != null) { this.AttachChild(value); } - this._dateRange = value; } } diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index d7e037a1..452c2eb6 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -283,13 +283,13 @@ public bool HideOutsideDays } } - private IgbDateRangeDescriptor[]? _disabledDates; + private IgbDateRangeDescriptor[] _disabledDates = Array.Empty(); /// /// Gets/sets disabled dates. /// [Parameter] - public IgbDateRangeDescriptor[]? DisabledDates + public IgbDateRangeDescriptor[] DisabledDates { get { return this._disabledDates; } set @@ -302,13 +302,13 @@ public IgbDateRangeDescriptor[]? DisabledDates } } - private IgbDateRangeDescriptor[]? _specialDates; + private IgbDateRangeDescriptor[] _specialDates = Array.Empty(); /// /// Gets/sets special dates. /// [Parameter] - public IgbDateRangeDescriptor[]? SpecialDates + public IgbDateRangeDescriptor[] SpecialDates { get { return this._specialDates; } set diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 692274ef..8ec20a95 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -100,13 +100,13 @@ public IgbDateRangeValue? Value return retVal; } - private IgbCustomDateRange[]? _customRanges; + private IgbCustomDateRange[] _customRanges = Array.Empty(); /// /// Renders chips with custom ranges based on the elements of the array. /// [Parameter] - public IgbCustomDateRange[]? CustomRanges + public IgbCustomDateRange[] CustomRanges { get { return this._customRanges; } set @@ -488,13 +488,13 @@ public DateTime Max } } - private IgbDateRangeDescriptor[]? _disabledDates; + private IgbDateRangeDescriptor[] _disabledDates = Array.Empty(); /// /// Gets/sets disabled dates. /// [Parameter] - public IgbDateRangeDescriptor[]? DisabledDates + public IgbDateRangeDescriptor[] DisabledDates { get { return this._disabledDates; } set @@ -641,13 +641,13 @@ public bool HideOutsideDays } } - private IgbDateRangeDescriptor[]? _specialDates; + private IgbDateRangeDescriptor[] _specialDates = Array.Empty(); /// /// Gets/sets special dates. /// [Parameter] - public IgbDateRangeDescriptor[]? SpecialDates + public IgbDateRangeDescriptor[] SpecialDates { get { return this._specialDates; } set diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index 148c5969..c2df36d4 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -130,7 +130,7 @@ public bool ReadOnly } } - private string? _inputMode; + private string _inputMode = string.Empty; /// /// The input mode attribute of the control. @@ -139,7 +139,7 @@ public bool ReadOnly /// [Parameter] [WCAttributeName("inputmode")] - public string? InputMode + public string InputMode { get { return this._inputMode; } set @@ -171,14 +171,14 @@ public string? Pattern } } - private double? _minLength = 0; + private double _minLength = 0; /// /// The minimum string length required by the control. /// [Parameter] [WCAttributeName("minlength")] - public double? MinLength + public double MinLength { get { return this._minLength; } set @@ -191,14 +191,14 @@ public double? MinLength } } - private double? _maxLength = 0; + private double _maxLength = 0; /// /// The maximum string length of the control. /// [Parameter] [WCAttributeName("maxlength")] - public double? MaxLength + public double MaxLength { get { return this._maxLength; } set @@ -211,13 +211,13 @@ public double? MaxLength } } - private double? _min = 0; + private double _min = 0; /// /// The min attribute of the control. /// [Parameter] - public double? Min + public double Min { get { return this._min; } set @@ -230,13 +230,13 @@ public double? Min } } - private double? _max = 0; + private double _max = 0; /// /// The max attribute of the control. /// [Parameter] - public double? Max + public double Max { get { return this._max; } set @@ -249,13 +249,13 @@ public double? Max } } - private double? _step = 0; + private double _step = 0; /// /// The step attribute of the control. /// [Parameter] - public double? Step + public double Step { get { return this._step; } set @@ -287,13 +287,13 @@ public bool Autofocus } } - private string? _autocomplete; + private string _autocomplete = string.Empty; /// /// The autocomplete attribute of the control. /// [Parameter] - public string? Autocomplete + public string Autocomplete { get { return this._autocomplete; } set diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 3bb6d3bc..e29d206f 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -64,14 +64,14 @@ public MaskInputValueMode ValueMode } } - private string? _value; + private string _value = string.Empty; /// /// The value of the input. /// Regardless of the current , an empty value returns an empty string. /// [Parameter] - public string? Value + public string Value { get { return this._value; } set @@ -89,7 +89,7 @@ public string? Value /// Returns the current value of the input. /// Regardless of the current , an empty value returns an empty string. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -99,18 +99,18 @@ public string? Value /// Returns the current value of the input. /// Regardless of the current , an empty value returns an empty string. /// - public string? GetCurrentValue() + public string GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); } - private string? _mask; + private string _mask = "CCCCCCCCCC"; /// /// The masked pattern of the component. /// [Parameter] - public string? Mask + public string Mask { get { return this._mask; } set @@ -123,13 +123,13 @@ public string? Mask } } - private string? _prompt; + private string _prompt = "_"; /// /// The prompt symbol to use for unfilled parts of the mask pattern. /// [Parameter] - public string? Prompt + public string Prompt { get { return this._prompt; } set diff --git a/src/components/Blazor/SelectGroup.cs b/src/components/Blazor/SelectGroup.cs index 811ecd1c..03a53ae7 100644 --- a/src/components/Blazor/SelectGroup.cs +++ b/src/components/Blazor/SelectGroup.cs @@ -58,13 +58,13 @@ protected override ControlEventBehavior DefaultEventBehavior get { return ControlEventBehavior.Immediate; } } - private IgbSelectItem[]? _items; + private IgbSelectItem[] _items = Array.Empty(); /// /// All child components. /// [Parameter] - public IgbSelectItem[]? Items + public IgbSelectItem[] Items { get { return this._items; } set diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index 0436da9f..a508f4d7 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -97,13 +97,13 @@ public double RowSpan } } - private double? _colStart = 0; + private double _colStart = 0; /// /// The starting column for the tile. /// [Parameter] - public double? ColStart + public double ColStart { get { return this._colStart; } set @@ -116,13 +116,13 @@ public double? ColStart } } - private double? _rowStart = 0; + private double _rowStart = 0; /// /// The starting row for the tile. /// [Parameter] - public double? RowStart + public double RowStart { get { return this._rowStart; } set diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 74c263c7..882cd241 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1888,13 +1888,8 @@ internal object ReturnToPrimitive(object? returnValue) return ConvertReturnValue(returnValue, true); } - internal T[]? DowncastArray(object? val) + internal T[] DowncastArray(object val) { - if (val == null) - { - return null; - } - if (val is T[]) { return (T[])val; @@ -2263,7 +2258,7 @@ internal long ReturnToLong(object? val) } } - internal DateTime[]? ReturnToDateArray(object? val) + internal DateTime[] ReturnToDateArray(object? val) { val = ConvertReturnValue(val); try @@ -2271,13 +2266,17 @@ internal long ReturnToLong(object? val) var stringVal = val?.ToString(); if (stringVal == null) { - return null; + return Array.Empty(); } - var arr = JsonSerializer.Deserialize(stringVal, SerializerOptions); - DateTime[] ret = new DateTime[arr!.Length]; + var arr = JsonSerializer.Deserialize(stringVal, SerializerOptions); + if (arr == null) + { + return Array.Empty(); + } + DateTime[] ret = new DateTime[arr.Length]; for (int i = 0; i < arr.Length; i++) { - Object? ele = arr[i]; + Object ele = arr[i]; ele = ReturnToDate(ele); ret[i] = (DateTime)ele; } @@ -2285,7 +2284,7 @@ internal long ReturnToLong(object? val) } catch (Exception e) { - return null; + return Array.Empty(); } } @@ -2783,19 +2782,19 @@ internal T StringToEnum(Object? val) where T : struct } } - internal object[]? ReturnToObjectArray(object? val) + internal object[] ReturnToObjectArray(object? val) { val = ConvertReturnValue(val); if (val == null) { - return null; + return Array.Empty(); } try { var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); if (arr == null) { - return null; + return Array.Empty(); } Object[] ret = new Object[arr.Length]; for (int i = 0; i < arr.Length; i++) @@ -2811,7 +2810,7 @@ internal T StringToEnum(Object? val) where T : struct } catch (Exception e) { - return null; + return Array.Empty(); } } diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 107ae62d..a6ffc2c7 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -737,7 +737,7 @@ internal T StringToEnum(Object? val) where T : struct return default(string); } - internal object[]? ReturnToObjectArray(Object? val) + internal object[] ReturnToObjectArray(Object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -748,7 +748,7 @@ internal T StringToEnum(Object? val) where T : struct { return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val); } - return default; + return Array.Empty(); } internal T[]? ReturnToObjectArray(Object? val) @@ -921,7 +921,7 @@ internal object ReturnToPrimitive(object? val) return default(object) ?? new object(); } - internal T[]? DowncastArray(object? val) + internal T[]? DowncastArray(object val) { EnsureValid(); if (CurrParent is BaseRendererElement) From 9d207a79c9b0c8724ab3b40bccae839c576386e5 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 16:35:12 +0300 Subject: [PATCH 37/64] fix formatting --- src/components/Blazor/Calendar.cs | 3 ++- src/components/Blazor/ComboChangeEventArgsDetail.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index d00a0c21..e8ecb5b2 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -254,7 +254,8 @@ public CalendarActiveView ActiveView } } - private IgbCalendarFormatOptions _formatOptions = new IgbCalendarFormatOptions() { + private IgbCalendarFormatOptions _formatOptions = new IgbCalendarFormatOptions() + { Month = "long", Weekday = "narrow", }; diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 5b5b5db3..05db4645 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -58,7 +58,7 @@ public string? NewValueScript } } private string? _itemsRef; - private object[] _items = Array.Empty() ; + private object[] _items = Array.Empty(); [Parameter] public object[] Items From c1ea51e96f716ed56c05b3aee8a198c5fe87b0e8 Mon Sep 17 00:00:00 2001 From: Maya Date: Fri, 28 Aug 2026 16:38:58 +0300 Subject: [PATCH 38/64] Potential fix for pull request finding 'Constant condition' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/componentsBase/BaseRendererElement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index a6ffc2c7..a600980a 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -904,7 +904,7 @@ internal object ConvertReturnValue(object? val, string? typeGuess = null, bool a { return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } - return default(object) ?? new object(); + return new object(); } internal object ReturnToPrimitive(object? val) From 7b7fea6432a58fc60449fcebe591abbc4bc2010c Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 17:56:17 +0300 Subject: [PATCH 39/64] Remove default object fallback. --- src/componentsBase/BaseRendererElement.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index a6ffc2c7..6e788689 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -904,7 +904,7 @@ internal object ConvertReturnValue(object? val, string? typeGuess = null, bool a { return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } - return default(object) ?? new object(); + return new object(); } internal object ReturnToPrimitive(object? val) @@ -918,7 +918,7 @@ internal object ReturnToPrimitive(object? val) { return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); } - return default(object) ?? new object(); + return new object(); } internal T[]? DowncastArray(object val) From 74a0217a1670dc98159b7d8e1cea3a023b0fa8b7 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Fri, 28 Aug 2026 18:34:33 +0300 Subject: [PATCH 40/64] Fix tests. --- src/components/Blazor/Stepper.cs | 4 ++-- src/componentsBase/BaseRendererControl.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index fe8e973d..859fe15a 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -442,7 +442,7 @@ public EventCallback ActiveStepChanged if (!value.EqualsCompat(_activeStepChanged)) { _activeStepChanged = value; - this.SetHandlerSimple(this.Name, "ActiveStepChanged", value, val => ReturnToObject(val)!); + this.SetHandler(this.Name, "ActiveStepChanged", value); this.OnRefChanged("ActiveStepChanged", null, "event:::ActiveStepChanged", true, false, (refName, oldValue, newValue) => { this._activeStepChangedRef = refName; @@ -453,7 +453,7 @@ public EventCallback ActiveStepChanged else { _activeStepChanged = null; - this.SetHandlerSimple(this.Name, "ActiveStepChanged", null, val => ReturnToObject(val)!); + this.SetHandler(this.Name, "ActiveStepChanged", null); this.OnRefChanged("ActiveStepChanged", null, null, true, false, (refName, oldValue, newValue) => { this._activeStepChangedRef = null; diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 882cd241..2c075bc0 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -2026,7 +2026,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f } else if ("undefined".Equals(retType)) { - returnValue = null; + return null!; } else if ("Array".Equals(retType)) { @@ -2066,7 +2066,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f if (obj["value"] == null || ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) { - return returnValue ?? new object(); + return null!; } object? o = null; @@ -2100,7 +2100,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f { if (acceptsNullIfMarshalDoesNotExist) { - return returnValue ?? new object(); + return null!; } var ret = obj["value"].ToString(); returnValue = JsonSerializer.Deserialize>(ret!, SerializerOptions); @@ -2119,7 +2119,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f Console.WriteLine(e.ToString()); } - return returnValue ?? new object(); + return returnValue!; } public void OnInvokeReturn(long invokeId, Object returnValue) From ee923529d22a40cebf4b72bdca2a2b3f6a22838f Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 31 Aug 2026 10:18:35 +0300 Subject: [PATCH 41/64] ButtonGroup selection event args are nullable string. So setting it to match. --- src/components/Blazor/ComponentValueChangedEventArgs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 04647ee7..d8d83a2e 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -13,13 +13,13 @@ public partial class IgbComponentValueChangedEventArgs : BaseRendererElement private static bool _marshalByValue = true; - private string _detail = ""; + private string? _detail = ""; /// /// The string value carried by the event. /// [Parameter] - public string Detail + public string? Detail { get { return this._detail; } set From 56586ce7a9a613db3893b59cbc5d4cd9a5496495 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Mon, 31 Aug 2026 10:43:54 +0300 Subject: [PATCH 42/64] Remove redundant null-forgiving operators. --- src/components/Blazor/CheckboxBase.cs | 4 +- src/components/Blazor/DateRangePicker.cs | 4 +- src/components/Blazor/Dropdown.cs | 12 +- src/components/Blazor/Radio.cs | 4 +- src/components/Blazor/RadioGroup.cs | 4 +- src/components/Blazor/Select.cs | 8 +- src/componentsBase/BaseRendererControl.cs | 4 +- src/componentsBase/CollectionAdapter.cs | 6 +- src/componentsBase/JsonDataSourceSchema.cs | 14 +-- src/componentsBase/UnmarshalledDataSource.cs | 110 +++++++++--------- tests/IgniteUI.Blazor.Tests/CalendarTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 10 +- tests/IgniteUI.Blazor.Tests/CheckboxTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 20 ++-- .../DateRangePickerTests.cs | 6 +- tests/IgniteUI.Blazor.Tests/RadioTests.cs | 6 +- .../IgniteUI.Blazor.Tests/RangeSliderTests.cs | 6 +- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/SplitterTests.cs | 8 +- tests/IgniteUI.Blazor.Tests/StepperTests.cs | 6 +- tests/IgniteUI.Blazor.Tests/SwitchTests.cs | 4 +- tests/IgniteUI.Blazor.Tests/TabsTests.cs | 4 +- .../IgniteUI.Blazor.Tests/TileManagerTests.cs | 10 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 4 +- 24 files changed, 133 insertions(+), 133 deletions(-) diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index 15bf853c..3184a558 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -380,7 +380,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args.Detail!.Checked); + newValueChecked = (bool)(args.Detail.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 8ec20a95..5b140277 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -72,7 +72,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv)!; + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDateRangeValue); @@ -92,7 +92,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv)!; + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDateRangeValue); diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index d1333cc2..32c538cf 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -240,7 +240,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -260,7 +260,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -300,7 +300,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -321,7 +321,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -341,7 +341,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -362,7 +362,7 @@ public bool SameWidth { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv)!; + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index 2155dd4e..c68b250d 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -389,7 +389,7 @@ public EventCallback Change var newValueChecked = default(bool); { - newValueChecked = (bool)(args.Detail!.Checked); + newValueChecked = (bool)(args.Detail.Checked); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 0b481bda..64ef22cb 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -214,7 +214,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail!.Value!; + newValueValue = (string)args.Detail.Value!; if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index 5d215a56..cfc151c0 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { @@ -314,7 +314,7 @@ public PopoverScrollStrategy ScrollStrategy { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv)!; + var retVal = (IgbSelectItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbSelectItem); @@ -334,7 +334,7 @@ public PopoverScrollStrategy ScrollStrategy { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv)!; + var retVal = (IgbSelectItem)ConvertReturnValue(iv); if (retVal == null) { return default(IgbSelectItem); @@ -609,7 +609,7 @@ public EventCallback Change var newValueValue = default(string?); { - newValueValue = (string?)(args.Detail!.Value); + newValueValue = (string?)(args.Detail.Value); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 2c075bc0..f3508a07 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1661,7 +1661,7 @@ private void UpdateSync() while (_messageQueue.Count > 0) { - RendererMessage m = _messageQueue!.First!.Value; + RendererMessage m = _messageQueue.First!.Value; _messageQueue.RemoveFirst(); ProcessMessageSync(m); } @@ -3171,7 +3171,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) } } //Console.WriteLine("calling handler"); - _handlers[name + "/" + propertyName](senderObj!, val!); + _handlers[name + "/" + propertyName](senderObj, val!); } catch (Exception e) { diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 068f21ac..5cd29b70 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -87,7 +87,7 @@ private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs ar case NotifyCollectionChangedAction.Add: if (args.NewItems != null && args.NewItems.Count > 0) { - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]!); } break; case NotifyCollectionChangedAction.Remove: @@ -97,7 +97,7 @@ private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs ar this.RemoveManualItemAt(args.OldStartingIndex); if (args.NewItems != null && args.NewItems.Count > 0) { - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems![0]!); + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]!); } break; case NotifyCollectionChangedAction.Reset: @@ -286,7 +286,7 @@ private void SyncItems() else { this._allList.Insert(ins, insItem); - this._target?.Insert(ins, this!._toTarget!(insItem)); + this._target?.Insert(ins, this._toTarget!(insItem)); this._onItemAdded?.Invoke(insItem); ind++; ins++; diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 6c7fb451..96bc7146 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -29,7 +29,7 @@ private bool HasDataIntents() if (_subSchemas["___self"] != null) { //Console.WriteLine("has item schema"); - return _subSchemas!["___self"]!.HasDataIntents(); + return _subSchemas["___self"]!.HasDataIntents(); } } } @@ -108,7 +108,7 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J { //Console.WriteLine("has item schema"); uw.WriteBoolean("subProps", true); - _subSchemas!["___self"]!.WriteDataIntentsAsJson("subIntents", uw); + _subSchemas["___self"]!.WriteDataIntentsAsJson("subIntents", uw); } } } @@ -121,7 +121,7 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas![currProp]!.HasDataIntents()) + if (_subSchemas[currProp]!.HasDataIntents()) { var sub = _subSchemas[currProp]; if (sub!.IsDataSource) @@ -158,7 +158,7 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas![currProp]!.HasDataIntents()) + if (_subSchemas[currProp]!.HasDataIntents()) { var sub = _subSchemas[currProp]; if (sub!.IsDataSource) @@ -446,12 +446,12 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt if (itemSchema != null) { - for (int i = 0; i < itemSchema!.PropertyTypes!.Length; i++) + for (int i = 0; i < itemSchema.PropertyTypes!.Length; i++) { if (itemSchema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) { - var obj = itemSchema!.PropertyGetters![i](subObject); - itemSchema.SetSubSchema(itemSchema!.PropertyNames![i], BuildSubObjectSchema(obj)); + var obj = itemSchema.PropertyGetters![i](subObject); + itemSchema.SetSubSchema(itemSchema.PropertyNames![i], BuildSubObjectSchema(obj)); } } } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index f9339f60..97c7debe 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -234,7 +234,7 @@ public UnmarshalledDataSource() if (columns[columns.Length - 1] == null) { columns[columns.Length - 1] = CreateColumn(parentPath, "___id", schema, JSDataSourceSchemaType.StringValue, idGetter, untypedIdGetter, true); - columns![columns.Length - 1]!.IsIDColumn = true; + columns[columns.Length - 1]!.IsIDColumn = true; } columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___id", idGetter, untypedIdGetter, true, JSDataSourceSchemaType.StringValue, oldValue, newValue); } @@ -338,7 +338,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (isIDColumn) { idGetter = (Func)valueGetter!; - stringGetter = (o) => idGetter!(o).ToString(); + stringGetter = (o) => idGetter(o).ToString(); } else { @@ -382,13 +382,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.NullableSingleValue: nullableSingleGetter = (Func)valueGetter!; - nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter!(o); + nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter(o); break; case JSDataSourceSchemaType.NullableBooleanValue: nullableBoolGetter = (Func)valueGetter!; nullableIntegerGetter = (o) => { - var val = nullableBoolGetter!(o); + var val = nullableBoolGetter(o); int? t = 1; int? f = 0; return val == null ? null : (val == true) ? t : f; @@ -396,18 +396,18 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.NullableByteValue: nullableByteGetter = (Func)valueGetter!; - nullableIntegerGetter = (o) => (int?)nullableByteGetter!(o); + nullableIntegerGetter = (o) => (int?)nullableByteGetter(o); break; case JSDataSourceSchemaType.NullableDecimalValue: nullableDecimalGetter = (Func)valueGetter!; - nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter!(o); + nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter(o); break; case JSDataSourceSchemaType.NullableIntValue: nullableIntegerGetter = (Func)valueGetter!; break; case JSDataSourceSchemaType.NullableShortValue: nullableShortGetter = (Func)valueGetter!; - nullableIntegerGetter = (o) => (int?)nullableShortGetter!(o); + nullableIntegerGetter = (o) => (int?)nullableShortGetter(o); break; case JSDataSourceSchemaType.NullableLongValue: nullableLongGetter = (Func?)valueGetter; @@ -457,7 +457,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.DoubleValues![index] = floatVal; + column.DoubleValues![index] = floatVal; } else { @@ -479,8 +479,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; - column!.NullValues![index] = floatVal == null; + column.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues![index] = floatVal == null; } else { @@ -512,7 +512,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.IntValues![index] = intVal; + column.IntValues![index] = intVal; } else { @@ -535,8 +535,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; - column!.NullValues![index] = intVal == null; + column.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues![index] = intVal == null; } else { @@ -565,7 +565,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.LongValues![index] = longVal; + column.LongValues![index] = longVal; } else { @@ -585,8 +585,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; - column!.NullValues![index] = longVal == null; + column.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues![index] = longVal == null; } else { @@ -634,7 +634,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column!.StringValues![index] = stringVal; + column.StringValues![index] = stringVal; } else { @@ -651,7 +651,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column!.IDValues![index] = idVal; + column.IDValues![index] = idVal; } else { @@ -684,7 +684,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { //Console.WriteLine("stringvalues null: " + column.PropertyName); } - column!.StringValues![index] = stringVal; + column.StringValues![index] = stringVal; } else { @@ -731,7 +731,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN UnmarshalledColumn[]? cols = null; if (objVal != null) { - var id = _idGetter!(item!); + var id = _idGetter!(item); var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); @@ -748,7 +748,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.SubDataSourceValues![index] = cols; + column.SubDataSourceValues![index] = cols; } else { @@ -818,7 +818,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; - var subcols = sub!.GetColumns(""); + var subcols = sub.GetColumns(""); UnmarshalledColumn primcol = new UnmarshalledColumn(); primcol.ActualCount = subcols[0].ActualCount; @@ -885,7 +885,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column!.SubDataSourceValues![index] = cols; + column.SubDataSourceValues![index] = cols; } else { @@ -922,7 +922,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { floatVal = floatingPointGetter!(newItem); } - column!.DoubleValues![index] = floatVal; + column.DoubleValues![index] = floatVal; }; break; case JSDataSourceSchemaType.NullableDoubleValue: @@ -935,8 +935,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { floatVal = nullableFloatingPointGetter!(newItem); } - column!.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; - column!.NullValues![index] = floatVal == null; + column.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues![index] = floatVal == null; }; break; case JSDataSourceSchemaType.BooleanValue: @@ -950,7 +950,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { intVal = integerGetter!(newItem); } - column!.IntValues![index] = intVal; + column.IntValues![index] = intVal; }; break; case JSDataSourceSchemaType.NullableBooleanValue: @@ -964,8 +964,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { intVal = nullableIntegerGetter!(newItem); } - column!.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; - column!.NullValues![index] = intVal == null; + column.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues![index] = intVal == null; }; break; case JSDataSourceSchemaType.LongValue: @@ -976,7 +976,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { longVal = longGetter!(newItem); } - column!.LongValues![index] = longVal; + column.LongValues![index] = longVal; }; break; case JSDataSourceSchemaType.NullableLongValue: @@ -987,8 +987,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { longVal = nullableLongGetter!(newItem); } - column!.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; - column!.NullValues![index] = longVal == null; + column.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues![index] = longVal == null; }; break; case JSDataSourceSchemaType.StringValue: @@ -1000,7 +1000,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN Guid idVal = Guid.Empty; if (column.IsIDColumn && oldItem != newItem) { - var oldId = column!.IDValues![index]; + var oldId = column.IDValues![index]; OnRemoveId(oldId); } if (newItem != null) @@ -1016,10 +1016,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } } - column!.StringValues![index] = stringVal; + column.StringValues![index] = stringVal; if (column.IsIDColumn) { - column!.IDValues![index] = idVal; + column.IDValues![index] = idVal; } }; break; @@ -1032,7 +1032,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { stringVal = stringGetter!(newItem); } - column!.StringValues![index] = stringVal; + column.StringValues![index] = stringVal; }; break; case JSDataSourceSchemaType.ObjectValue: @@ -1077,9 +1077,9 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (objVal != null) { var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; - cols = sub!.GetColumns(""); + cols = sub.GetColumns(""); } - column!.SubDataSourceValues![index] = cols; + column.SubDataSourceValues![index] = cols; } else { @@ -1191,7 +1191,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN cols[subcols.Length] = primcol; } - column!.SubDataSourceValues![index] = cols; + column.SubDataSourceValues![index] = cols; } else { @@ -1218,7 +1218,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.DoubleValues![index] = double.NaN; + column.DoubleValues![index] = double.NaN; } else { @@ -1234,8 +1234,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.DoubleValues![index] = double.NaN; - column!.NullValues![index] = false; + column.DoubleValues![index] = double.NaN; + column.NullValues![index] = false; } else { @@ -1254,7 +1254,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.IntValues![index] = 0; + column.IntValues![index] = 0; } else { @@ -1271,8 +1271,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.IntValues![index] = 0; - column!.NullValues![index] = false; + column.IntValues![index] = 0; + column.NullValues![index] = false; } else { @@ -1288,7 +1288,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.LongValues![index] = 0; + column.LongValues![index] = 0; } else { @@ -1302,8 +1302,8 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.LongValues![index] = 0; - column!.NullValues![index] = false; + column.LongValues![index] = 0; + column.NullValues![index] = false; } else { @@ -1321,13 +1321,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (column.IsIDColumn) { - var oldId = column!.IDValues![index]; + var oldId = column.IDValues![index]; OnRemoveId(oldId); } if (index == (size - 1)) { - column!.StringValues![index] = null; + column.StringValues![index] = null; } else { @@ -1338,7 +1338,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.IDValues![index] = Guid.Empty; + column.IDValues![index] = Guid.Empty; } else { @@ -1354,7 +1354,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.StringValues![index] = null; + column.StringValues![index] = null; } else { @@ -1381,7 +1381,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (index == (size - 1)) { - column!.SubDataSourceValues![index] = null; + column.SubDataSourceValues![index] = null; } else { @@ -1465,7 +1465,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { for (var i = 0; i < size; i++) { - OnRemoveId(column!.IDValues![i]); + OnRemoveId(column.IDValues![i]); } } @@ -2272,7 +2272,7 @@ private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, U continue; } //Console.WriteLine(column.PropertyName); - column!.Insert!(_size, column, index, item); + column.Insert!(_size, column, index, item); } _size++; diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index a59cb227..f0eb3b45 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -14,7 +14,7 @@ public class CalendarTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array("""["2026-01-02T03:04:05.000Z", "2026-03-16T12:30:00.000Z"]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); Assert.Equal(new DateTime(2026, 1, 2, 3, 4, 5, DateTimeKind.Utc), result[0].ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 16, 12, 30, 0, DateTimeKind.Utc), result[1].ToUniversalTime()); }) diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index ca1d6a7a..d4b9233c 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -25,7 +25,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "m-1", "text": "hello", "sender": "user-1"}}}""", assert: args => { - Assert.Equal("m-1", args.Detail!.Id); + Assert.Equal("m-1", args.Detail.Id); Assert.Equal("hello", args.Detail.Text); Assert.Equal("user-1", args.Detail.Sender); }) @@ -33,7 +33,7 @@ public class ChatTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"id": "a-1", "name": "photo.png", "url": "https://host/photo.png"}}}""", assert: args => { - Assert.Equal("a-1", args.Detail!.Id); + Assert.Equal("a-1", args.Detail.Id); Assert.Equal("photo.png", args.Detail.Name); Assert.Equal("https://host/photo.png", args.Detail.Url); }) @@ -43,8 +43,8 @@ public class ChatTests : ComponentWithContractTestBase { // The reaction's message currently decoded by value // (it is NOT restored by reference to an instance in Messages on the current stack). - Assert.Equal("like", args.Detail!.Reaction); - Assert.Equal("m-1", args.Detail!.Message!.Id); + Assert.Equal("like", args.Detail.Reaction); + Assert.Equal("m-1", args.Detail.Message!.Id); Assert.Equal("hello", args.Detail.Message.Text); }) .Prop(c => c.Options, diff --git a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs index 7dcc41bd..2872ada4 100644 --- a/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CheckboxTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class CheckboxTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "checkbox-value"}}}""", assert: args => { - Assert.True(args.Detail!.Checked); + Assert.True(args.Detail.Checked); Assert.Equal("checkbox-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index cf77b6fc..63b77e56 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -65,8 +65,8 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail(UuidRef(interop, cut, 0), UuidRef(interop, cut, 0))), assert: (cut, args) => { - Assert.Same(_valueItem1, Assert.Single(args.Detail!.NewValue!)); - Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); + Assert.Same(_valueItem1, Assert.Single(args.Detail.NewValue)); + Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); Assert.Equal(ComboChangeType.Selection, args.Detail.ChangeType); }) .Event(c => c.Change, @@ -76,8 +76,8 @@ internal static string ChangeDetail(string newValues, string items, string type argsJson: FromRender.Of((interop, cut) => ChangeDetail("", UuidRef(interop, cut, 0), "deselection")), assert: (cut, args) => { - Assert.Empty(args.Detail!.NewValue!); - Assert.Same(_valueItem1, Assert.Single(args.Detail.Items!)); + Assert.Empty(args.Detail.NewValue); + Assert.Same(_valueItem1, Assert.Single(args.Detail.Items)); // TODO: wire detail carries kind as "type", but FromEventJson reads "changeType", so // Detail.ChangeType never decodes and stays default (wrong for deselection events): // Assert.Equal(ComboChangeType.Deselection, args.Detail.ChangeType); @@ -90,9 +90,9 @@ internal static string ChangeDetail(string newValues, string items, string type assert: (cut, args) => { // Multi-selection: every element resolves back to its original data instance. - Assert.Equal([_valueItem1, _valueItem2], args.Detail!.NewValue); + Assert.Equal([_valueItem1, _valueItem2], args.Detail.NewValue); Assert.Equal([_valueItem1, _valueItem2], args.Detail.Items); - Assert.Same(args.Detail!.NewValue![0], args.Detail!.Items![0]); + Assert.Same(args.Detail.NewValue[0], args.Detail.Items[0]); }) .Event(c => c.Focus) .Event(c => c.Blur) @@ -306,11 +306,11 @@ public class ComboValueKeyTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => ComboTests.ChangeDetail("2", ComboTests.UuidRef(interop, cut, 1))), assert: (cut, args) => { - Assert.Equal(2.0, Assert.Single(args.Detail!.NewValue!)); // numbers decode as double - Assert.Same(_item2, Assert.Single(args.Detail.Items!)); + Assert.Equal(2.0, Assert.Single(args.Detail.NewValue)); // numbers decode as double + Assert.Same(_item2, Assert.Single(args.Detail.Items)); // Two-way Value propagation through the generated wrapper works when T // matches the key value type. - Assert.Equal(2.0, Assert.Single(cut.Instance.Value!)); + Assert.Equal(2.0, Assert.Single(cut.Instance.Value)); }) // A value-type value array (double[] here) crosses as plain JSON numbers — the keys // themselves, no data-source refs, since a keyed combo's value is the key. diff --git a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs index 41b0333c..764b34e7 100644 --- a/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DateRangePickerTests.cs @@ -1,4 +1,4 @@ -using IgniteUI.Blazor.Controls; +using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; namespace IgniteUI.Blazor.Tests; @@ -46,7 +46,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail!.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, @@ -67,7 +67,7 @@ public class DateRangePickerTests : ComponentWithContractTestBase { - Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail!.Start.ToUniversalTime()); + Assert.Equal(new DateTime(2026, 3, 1, 0, 0, 0, DateTimeKind.Utc), args.Detail.Start.ToUniversalTime()); Assert.Equal(new DateTime(2026, 3, 10, 0, 0, 0, DateTimeKind.Utc), args.Detail.End.ToUniversalTime()); }) .Prop(c => c.Open, true) diff --git a/tests/IgniteUI.Blazor.Tests/RadioTests.cs b/tests/IgniteUI.Blazor.Tests/RadioTests.cs index 49ec4132..a268c0cb 100644 --- a/tests/IgniteUI.Blazor.Tests/RadioTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RadioTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class RadioTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "option1"}}}""", assert: args => { - Assert.True(args.Detail!.Checked); + Assert.True(args.Detail.Checked); Assert.Equal("option1", args.Detail.Value); }) // The bound value uses checked: @@ -127,7 +127,7 @@ public class RadioGroupTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "selected-option"}}}""", assert: args => { - Assert.True(args.Detail!.Checked); + Assert.True(args.Detail.Checked); Assert.Equal("selected-option", args.Detail.Value); }) // The group binds the selected option's value: diff --git a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs index 948982c6..ac942fa2 100644 --- a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -13,14 +13,14 @@ public class RangeSliderTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 20, "upper": 80}}}""", assert: args => { - Assert.Equal(20, args.Detail!.Lower); + Assert.Equal(20, args.Detail.Lower); Assert.Equal(80, args.Detail.Upper); }) .Event(c => c.Change, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"lower": 25, "upper": 75}}}""", assert: args => { - Assert.Equal(25, args.Detail!.Lower); + Assert.Equal(25, args.Detail.Lower); Assert.Equal(75, args.Detail.Upper); }); diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index 5cb3679f..e4bcc83b 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -74,7 +74,7 @@ public class SelectTests : ComponentWithContractTestBase assert: (cut, args) => { Assert.Same(cut.FindComponents()[1].Instance, args.Detail); - Assert.Equal("ca", args.Detail!.Value); // Change propagates Detail.Value into Select.Value + Assert.Equal("ca", args.Detail.Value); // Change propagates Detail.Value into Select.Value }) // The detail is the selected item; the binding receives that item's Value. .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs index 07a6b75b..b67af729 100644 --- a/tests/IgniteUI.Blazor.Tests/SplitterTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SplitterTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -13,7 +13,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 120, "endPanelSize": 80, "delta": 0}}}""", assert: args => { - Assert.Equal(120, args.Detail!.StartPanelSize); + Assert.Equal(120, args.Detail.StartPanelSize); Assert.Equal(80, args.Detail.EndPanelSize); Assert.Equal(0, args.Detail.Delta); }) @@ -21,7 +21,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 130, "endPanelSize": 70, "delta": 10}}}""", assert: args => { - Assert.Equal(130, args.Detail!.StartPanelSize); + Assert.Equal(130, args.Detail.StartPanelSize); Assert.Equal(70, args.Detail.EndPanelSize); Assert.Equal(10, args.Detail.Delta); }) @@ -29,7 +29,7 @@ public class SplitterTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"startPanelSize": 150, "endPanelSize": 50, "delta": 30}}}""", assert: args => { - Assert.Equal(150, args.Detail!.StartPanelSize); + Assert.Equal(150, args.Detail.StartPanelSize); Assert.Equal(50, args.Detail.EndPanelSize); Assert.Equal(30, args.Detail.Delta); }); diff --git a/tests/IgniteUI.Blazor.Tests/StepperTests.cs b/tests/IgniteUI.Blazor.Tests/StepperTests.cs index ee5bea41..2e6f5122 100644 --- a/tests/IgniteUI.Blazor.Tests/StepperTests.cs +++ b/tests/IgniteUI.Blazor.Tests/StepperTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -36,12 +36,12 @@ public class StepperTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"oldIndex": 0, "newIndex": 1}}}""", assert: args => { - Assert.Equal(0, args.Detail!.OldIndex); + Assert.Equal(0, args.Detail.OldIndex); Assert.Equal(1, args.Detail.NewIndex); }) .Event(c => c.ActiveStepChanged, argsJson: """{"detail": {"retType": "object", "type": "", "value": {"index": 1}}}""", - assert: args => Assert.Equal(1, args.Detail!.Index)); + assert: args => Assert.Equal(1, args.Detail.Index)); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); diff --git a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs index 70eb91f9..9e506f0b 100644 --- a/tests/IgniteUI.Blazor.Tests/SwitchTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SwitchTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -20,7 +20,7 @@ public class SwitchTests : ComponentWithContractTestBase argsJson: """{"detail": {"retType": "object", "type": "", "value": {"checked": true, "value": "switch-value"}}}""", assert: args => { - Assert.True(args.Detail!.Checked); + Assert.True(args.Detail.Checked); Assert.Equal("switch-value", args.Detail.Value); }) .Bind(c => c.Checked, c => c.CheckedChanged, via: c => c.Change, diff --git a/tests/IgniteUI.Blazor.Tests/TabsTests.cs b/tests/IgniteUI.Blazor.Tests/TabsTests.cs index 7a66734c..7f0906b7 100644 --- a/tests/IgniteUI.Blazor.Tests/TabsTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TabsTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -37,7 +37,7 @@ public class TabsTests : ComponentWithContractTestBase Assert.Same(cut.Instance.ActualTabsCollection[1], args.Detail); // The handler owns selection for every child: it writes each tab's Selected and // pushes it through that tab's @bind-Selected, which is IgbTab's only route. - Assert.True(args.Detail!.Selected); + Assert.True(args.Detail.Selected); Assert.False(cut.Instance.ActualTabsCollection[0].Selected); Assert.False(tabSelection[0]); Assert.True(tabSelection[1]); diff --git a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs index 0ff579d0..76831957 100644 --- a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; @@ -60,7 +60,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": true}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args.Detail!.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args.Detail.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, @@ -68,7 +68,7 @@ public class TileManagerTests : ComponentWithContractTestBase argsJson: FromRender.Of((interop, cut) => $$$$"""{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "{{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}}"}, "state": false}}}"""), assert: (cut, args) => { - Assert.Same(cut.FindComponents()[1].Instance, args.Detail!.Tile); + Assert.Same(cut.FindComponents()[1].Instance, args.Detail.Tile); Assert.False(args.Detail.State); }); @@ -276,14 +276,14 @@ public class TileTests : ComponentWithContractTestBase """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": true}}}""", assert: (tile, args) => { - Assert.Same(tile, args.Detail!.Tile); + Assert.Same(tile, args.Detail.Tile); Assert.True(args.Detail.State); }) .Event(c => c.TileMaximize, """{"detail": {"retType": "object", "type": "", "value": {"tile": {"refType": "name", "id": "mainControl"}, "state": false}}}""", assert: (tile, args) => { - Assert.Same(tile, args.Detail!.Tile); + Assert.Same(tile, args.Detail.Tile); Assert.False(args.Detail.State); }); diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index 8a92c89e..666b8526 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -43,7 +43,7 @@ public class TreeTests : ComponentWithContractTestBase .Event(c => c.SelectionChanged, arrange, argsJson: FromRender.Of((interop, cut) => $$$$$"""{"detail": {"retType": "object", "type": "", "value": {"newSelection": {"retType": "Array", "type": "", "value": [{"refType": "name", "id": "{{{{{interop.ContainerIdOf(cut, "igc-tree-item:nth-of-type(2)")}}}}}"}]}}}}"""), - assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail!.NewSelection![0])); + assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail.NewSelection![0])); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); From 2a4099f7ad17659af51574c0b86329258b24bcd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:21:52 +0000 Subject: [PATCH 43/64] Initial plan From 00dc2d60b25faa1ea16af1f64aaca14f2f4abb1b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:27:35 +0000 Subject: [PATCH 44/64] Fix review-thread follow-ups and encoding cleanup Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com> --- src/components/Blazor/ButtonBase.cs | 14 +++++------ src/components/Blazor/NavDrawer.cs | 10 ++++---- src/componentsBase/BaseRendererControl.cs | 15 +++++------- src/componentsBase/CollectionAdapter.cs | 24 +++++++++++++++---- src/componentsBase/RuntimeHelper.cs | 18 +++++++++----- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 8 +++---- tests/IgniteUI.Blazor.Tests/DropdownTests.cs | 10 ++++---- .../IgniteUI.Blazor.Tests/RangeSliderTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TabsTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 2 +- 10 files changed, 62 insertions(+), 43 deletions(-) diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index d130deaa..5fe2ff97 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -54,10 +54,10 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// The type of the button, which determines its behavior and semantics. /// - /// � no default action. - /// � submits the associated form when + /// — no default action. + /// — submits the associated form when /// clicked. - /// � resets the associated form fields to + /// — resets the associated form fields to /// their initial values. /// /// Ignored when the button is rendered as a link (i.e. is set). @@ -125,12 +125,12 @@ public string? Download /// /// Where to open the linked document. Only effective when is set. /// - /// � current browsing context + /// — current browsing context /// (default browser behavior). - /// � new tab or window. - /// � parent browsing context; falls back to + /// — new tab or window. + /// — parent browsing context; falls back to /// if none. - /// � top-level browsing context; falls back to + /// — top-level browsing context; falls back to /// if none. /// /// diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index 6d6d993a..d5b2909a 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -79,19 +79,19 @@ protected override ControlEventBehavior DefaultEventBehavior /// Sets the position of the drawer. /// /// - /// � anchored to the inline-start edge (default). + /// — anchored to the inline-start edge (default). /// /// - /// � anchored to the inline-end edge. + /// — anchored to the inline-end edge. /// /// - /// � anchored to the block-start edge. + /// — anchored to the block-start edge. /// /// - /// � anchored to the block-end edge. + /// — anchored to the block-end edge. /// /// - /// � rendered inline within the page flow; no modal backdrop. + /// — rendered inline within the page flow; no modal backdrop. /// /// /// diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index f3508a07..75dc2ac9 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1641,12 +1641,9 @@ private void Update() //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); while (_messageQueue != null && _messageQueue.Count > 0) { - RendererMessage? m = _messageQueue.First?.Value; + RendererMessage m = _messageQueue.First!.Value; _messageQueue.RemoveFirst(); - if (m != null) - { - ProcessMessage(m); - } + ProcessMessage(m); } } @@ -2201,7 +2198,7 @@ internal int ReturnToInt(object? val) } else { - var stringVal = val?.ToString(); + var stringVal = val.ToString(); return stringVal != null ? int.Parse(stringVal) : 0; } } @@ -2252,7 +2249,7 @@ internal long ReturnToLong(object? val) } else { - var stringVal = val?.ToString(); + var stringVal = val.ToString(); //Console.WriteLine(val); return stringVal != null ? (long)Double.Parse(stringVal) : Int64.MinValue; } @@ -2263,7 +2260,7 @@ internal DateTime[] ReturnToDateArray(object? val) val = ConvertReturnValue(val); try { - var stringVal = val?.ToString(); + var stringVal = val.ToString(); if (stringVal == null) { return Array.Empty(); @@ -2355,7 +2352,7 @@ internal bool ReturnToBoolean(object? val) } else { - var stringVal = val?.ToString(); + var stringVal = val.ToString(); return stringVal != null ? Boolean.Parse(stringVal) : false; } } diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 5cd29b70..c55752a6 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -285,8 +285,18 @@ private void SyncItems() } else { + var convertedItem = this._toTarget?.Invoke(insItem); + if (this._target != null && convertedItem == null) + { + ind++; + continue; + } + this._allList.Insert(ins, insItem); - this._target?.Insert(ins, this._toTarget!(insItem)); + if (this._target != null) + { + this._target.Insert(ins, convertedItem!); + } this._onItemAdded?.Invoke(insItem); ind++; ins++; @@ -294,11 +304,17 @@ private void SyncItems() } else { - this._allList.Add(insItem); var convertedItem = this._toTarget?.Invoke(insItem); - if (convertedItem != null) + if (this._target != null && convertedItem == null) + { + ind++; + continue; + } + + this._allList.Add(insItem); + if (this._target != null) { - this._target?.Add(convertedItem); + this._target.Add(convertedItem!); } this._onItemAdded?.Invoke(insItem); ind++; diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index b7c4f1ff..89e5e6cd 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -113,13 +113,16 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, index, columns); } #else - if (_callSendUnmarshalledColumnMessage != null) + if (_callSendUnmarshalledColumnMessage != null && _inprocRuntime != null) { - return _callSendUnmarshalledColumnMessage(_inprocRuntime!, methodName, refName, index, columns); + return _callSendUnmarshalledColumnMessage(_inprocRuntime, methodName, refName, index, columns); } #endif var intptr = Unsafe.AsPointer(ref columns); - _inprocRuntime?.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); + if (_inprocRuntime != null) + { + _inprocRuntime.InvokeVoid(methodName, new object[] { refName, index, (int)intptr }); + } return null; } @@ -133,13 +136,16 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) return _unmarshalledRuntime.InvokeUnmarshalled(methodName, refName, dataIntents); } #else - if (_callSendUnmarshalledColumnDataIntentMessage != null) + if (_callSendUnmarshalledColumnDataIntentMessage != null && _inprocRuntime != null) { //Console.WriteLine("invoking sadness"); - return _callSendUnmarshalledColumnDataIntentMessage(_inprocRuntime!, methodName, refName, dataIntents); + return _callSendUnmarshalledColumnDataIntentMessage(_inprocRuntime, methodName, refName, dataIntents); } #endif - _inprocRuntime!.InvokeVoid(methodName, new object[] { refName, dataIntents }); + if (_inprocRuntime != null) + { + _inprocRuntime.InvokeVoid(methodName, new object[] { refName, dataIntents }); + } return null; } diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 63b77e56..3cf0e004 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -286,9 +286,9 @@ public void Combo_CaseSensitiveIcon_Property() // TODO: Mismatched T=int inbound handling (T[])DowncastArray(Detail.NewValue) for // two-way Value propagation: a mismatched T (e.g. the item type on a keyed combo) -// throws InvalidCastException — swallowed by OnRaiseEvent, so delivery silently dies; -// and numeric keys decode as JSON numbers → boxed double, so T=int fails the unbox -// cast too — numeric keys need T=double (or object). +// throws InvalidCastException — swallowed by OnRaiseEvent, so delivery silently dies; +// and numeric keys decode as JSON numbers → boxed double, so T=int fails the unbox +// cast too — numeric keys need T=double (or object). public class ComboValueKeyTests : ComponentWithContractTestBase> { @@ -312,7 +312,7 @@ public class ComboValueKeyTests : ComponentWithContractTestBase // matches the key value type. Assert.Equal(2.0, Assert.Single(cut.Instance.Value)); }) - // A value-type value array (double[] here) crosses as plain JSON numbers — the keys + // A value-type value array (double[] here) crosses as plain JSON numbers — the keys // themselves, no data-source refs, since a keyed combo's value is the key. .Prop(c => c.Value, value: [1, 3], diff --git a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs index 100e3837..0ed9bf22 100644 --- a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using IgniteUI.Blazor.Controls; using IgniteUI.Blazor.Tests.Interop; using Microsoft.AspNetCore.Components; @@ -9,7 +9,7 @@ public class DropdownTests : ComponentWithContractTestBase { /// /// Holds what the anchor arrangements below capture. An anchor only exists once its - /// render has run, so the specs read it back from here — the runner renders a spec's + /// render has run, so the specs read it back from here — the runner renders a spec's /// arrangement before invoking it, and gives each arranged spec its own render. /// sealed class Anchor @@ -22,7 +22,7 @@ sealed class Anchor /// /// Arranges an IgbButton as the anchor for the show/toggle target overloads. A real - /// anchor is an element outside the dropdown (that's the point of passing one — an + /// anchor is an element outside the dropdown (that's the point of passing one — an /// anchor inside it would go in the target slot instead); the interop boundary /// only sees the reference, so where the button renders is immaterial here. /// @@ -34,7 +34,7 @@ sealed class Anchor builder.CloseComponent(); }); - /// Arranges a plain element as the anchor, capturing its reference — the @ref form of a target + /// Arranges a plain element as the anchor, capturing its reference — the @ref form of a target static readonly Action> elementAnchorArrange = ps => ps.AddChildContent(builder => { @@ -43,7 +43,7 @@ sealed class Anchor builder.CloseElement(); }); - /// The wire form of the arranged component anchor — its interop instance id, assigned on render + /// The wire form of the arranged component anchor — its interop instance id, assigned on render static readonly FromRender componentAnchorArg = FromRender.Of((interop, cut) => $"containerId:::{interop.ContainerIdOf(cut, "igc-button")}"); diff --git a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs index ac942fa2..e7b70d8b 100644 --- a/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs +++ b/tests/IgniteUI.Blazor.Tests/RangeSliderTests.cs @@ -6,7 +6,7 @@ namespace IgniteUI.Blazor.Tests; public class RangeSliderTests : ComponentWithContractTestBase { - // TODO: ValueFormatOptions/ValueFormat (config objects on a direct-render component — + // TODO: ValueFormatOptions/ValueFormat (config objects on a direct-render component — // they never cross as interop messages; BUG 35189 ). protected override ComponentContract InteropContract { get; } = new ComponentContract() .Event(c => c.Input, diff --git a/tests/IgniteUI.Blazor.Tests/TabsTests.cs b/tests/IgniteUI.Blazor.Tests/TabsTests.cs index 7f0906b7..b934f335 100644 --- a/tests/IgniteUI.Blazor.Tests/TabsTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TabsTests.cs @@ -10,7 +10,7 @@ public class TabsTests : ComponentWithContractTestBase /// What each arranged tab's @bind-Selected received, filled during the dispatch. static readonly bool?[] tabSelection = new bool?[2]; - /// Two tabs, each binding SelectedChanged — IgbTab has no selection event of its own. + /// Two tabs, each binding SelectedChanged — IgbTab has no selection event of its own. static readonly Action> tabsArrange = ps => { tabSelection[0] = null; diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index 666b8526..44f6d070 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -240,7 +240,7 @@ public class TreeItemTests : ComponentWithContractTestBase Assert.Equal(2, result!.Length); Assert.Same(h.FindComponents()[1].Instance, result[1]); // TODO: the ancestor ref only resolves through FindByName on the item - // itself, which matches nothing but "mainControl" — the parent element + // itself, which matches nothing but "mainControl" — the parent element // currently decodes to null (observed: path = [self, null]) // Assert.Same(h.FindComponents()[0].Instance, result[0]); }); From 5ef77b9387d9ef0fd7fbf649c9d2211fb17f88f3 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 1 Sep 2026 13:46:11 +0300 Subject: [PATCH 45/64] Adjust Chat API methods and evt args to match client-side nullability. --- src/components/Blazor/ChatDraftMessage.cs | 4 ++-- src/components/Blazor/ChatMessageReaction.cs | 12 ++++++------ src/componentsBase/WebInputs/Chat.cs | 10 ++++++---- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 5c13d488..da14fa4a 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -9,13 +9,13 @@ public partial class IgbChatDraftMessage : BaseRendererElement private static bool _marshalByValue = true; - private string? _text; + private string _text = string.Empty; /// /// The textual content of the draft message. /// [Parameter] - public string? Text + public string Text { get { return this._text; } set diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index c2606ba4..a48cee85 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -12,13 +12,13 @@ public partial class IgbChatMessageReaction : BaseRendererElement private static bool _marshalByValue = true; - private IgbChatMessage? _message; + private IgbChatMessage _message = new IgbChatMessage(); /// /// The chat message that the reaction is associated with. /// [Parameter] - public IgbChatMessage? Message + public IgbChatMessage Message { get { return this._message; } set @@ -28,21 +28,21 @@ public IgbChatMessage? Message { this.DetachChild(this._message); } + this._message = value; if (value != null) { this.AttachChild(value); } - this._message = value; } } - private string? _reaction; + private string _reaction = string.Empty; /// /// The string representation of the reaction, such as an emoji or a string; /// [Parameter] - public string? Reaction + public string Reaction { get { return this._reaction; } set @@ -95,7 +95,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("message")) - { this.Message = (IgbChatMessage?)ConvertReturnValue(args["message"], "ChatMessage", true); } + { this.Message = (IgbChatMessage)ConvertReturnValue(args["message"], "ChatMessage", true); } if (args != null && args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } diff --git a/src/componentsBase/WebInputs/Chat.cs b/src/componentsBase/WebInputs/Chat.cs index c7a47d4c..70907a99 100644 --- a/src/componentsBase/WebInputs/Chat.cs +++ b/src/componentsBase/WebInputs/Chat.cs @@ -6,16 +6,18 @@ namespace IgniteUI.Blazor.Controls /// public partial class IgbChat { - public IgbChatDraftMessage? GetCurrentDraftMessage() + public IgbChatDraftMessage GetCurrentDraftMessage() { var iv = InvokeMethodSync("p:DraftMessage", new object?[] { }, new string[] { }); - return ReturnToObject(iv, "ChatDraftMessage"); + var result = ReturnToObject(iv, "ChatDraftMessage"); + return result ?? new IgbChatDraftMessage(); } - public async Task GetCurrentDraftMessageAsync() + public async Task GetCurrentDraftMessageAsync() { var iv = await InvokeMethod("p:DraftMessage", new object?[] { }, new string[] { }); - return ReturnToObject(iv, "ChatDraftMessage"); + var result = ReturnToObject(iv, "ChatDraftMessage"); + return result ?? new IgbChatDraftMessage(); } } } diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index d4b9233c..2c9312b7 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -12,7 +12,7 @@ public class ChatTests : ComponentWithContractTestBase .Getter(c => c.GetCurrentDraftMessageAsync(), c => c.GetCurrentDraftMessage(), "DraftMessage", arrange: _ => { }, returns: FromRender.Of((interop, cut) => InteropReturn.Object("", """{"text": "wip draft"}""")), - assert: (cut, result) => Assert.Equal("wip draft", result!.Text)) + assert: (cut, result) => Assert.Equal("wip draft", result.Text)) .Event(c => c.TypingChange, argsJson: """{"detail": true}""", assert: args => Assert.True(args.Detail)) @@ -44,7 +44,7 @@ public class ChatTests : ComponentWithContractTestBase // The reaction's message currently decoded by value // (it is NOT restored by reference to an instance in Messages on the current stack). Assert.Equal("like", args.Detail.Reaction); - Assert.Equal("m-1", args.Detail.Message!.Id); + Assert.Equal("m-1", args.Detail.Message.Id); Assert.Equal("hello", args.Detail.Message.Text); }) .Prop(c => c.Options, From 09b2be5d20825c2e5717b2103ea1be95a606e283 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 1 Sep 2026 14:26:34 +0300 Subject: [PATCH 46/64] Adjust API methods and evt args to match client-side nullability. Update tests. --- src/components/Blazor/Combo.cs | 4 +-- src/components/Blazor/Dropdown.cs | 36 +++++-------------- src/components/Blazor/Select.cs | 36 +++++-------------- src/components/Blazor/Stepper.cs | 18 +++------- src/components/Blazor/TileManager.cs | 18 +++------- src/components/Blazor/TreeItem.cs | 18 +++------- .../Blazor/TreeSelectionEventArgsDetail.cs | 6 ++-- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/DropdownTests.cs | 4 +-- tests/IgniteUI.Blazor.Tests/SelectTests.cs | 4 +-- tests/IgniteUI.Blazor.Tests/StepperTests.cs | 2 +- .../IgniteUI.Blazor.Tests/TileManagerTests.cs | 2 +- tests/IgniteUI.Blazor.Tests/TreeTests.cs | 8 ++--- 13 files changed, 44 insertions(+), 114 deletions(-) diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index d487374f..d5fe9af2 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -449,7 +449,7 @@ public T[] GetCurrentValue() /// Returns the current selection of the combo. /// /// The selected items as provided in the source. - public async Task GetSelectionAsync() + public async Task GetSelectionAsync() { var iv = await InvokeMethod("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); @@ -459,7 +459,7 @@ public T[] GetCurrentValue() /// Returns the current selection of the combo. /// /// The selected items as provided in the source. - public object[]? GetSelection() + public object[] GetSelection() { var iv = InvokeMethodSync("p:Selection", new object?[] { }, new string[] { }); return ReturnToObjectArray(iv); diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 32c538cf..723b8a96 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -152,18 +152,13 @@ public bool SameWidth /// /// Returns the items of the dropdown. /// - public async Task GetItemsAsync() + public async Task GetItemsAsync() { var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbDropdownItem[]); + return Array.Empty(); } return retVal; @@ -172,18 +167,13 @@ public bool SameWidth /// /// Returns the items of the dropdown. /// - public IgbDropdownItem[]? GetItems() + public IgbDropdownItem[] GetItems() { var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbDropdownItem[]); + return Array.Empty(); } return retVal; @@ -192,18 +182,13 @@ public bool SameWidth /// /// Returns the group items of the dropdown. /// - public async Task GetGroupsAsync() + public async Task GetGroupsAsync() { var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownGroup[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbDropdownGroup[]); + return Array.Empty(); } return retVal; @@ -212,18 +197,13 @@ public bool SameWidth /// /// Returns the group items of the dropdown. /// - public IgbDropdownGroup[]? GetGroups() + public IgbDropdownGroup[] GetGroups() { var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownGroup[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbDropdownGroup[]); + return Array.Empty(); } return retVal; diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index cfc151c0..c523d79f 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -226,18 +226,13 @@ public PopoverScrollStrategy ScrollStrategy /// /// Returns the items of the component. /// - public async Task GetItemsAsync() + public async Task GetItemsAsync() { var iv = await InvokeMethod("p:Items", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbSelectItem[]); + return Array.Empty(); } return retVal; @@ -246,18 +241,13 @@ public PopoverScrollStrategy ScrollStrategy /// /// Returns the items of the component. /// - public IgbSelectItem[]? GetItems() + public IgbSelectItem[] GetItems() { var iv = InvokeMethodSync("p:Items", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbSelectItem[]); + return Array.Empty(); } return retVal; @@ -266,18 +256,13 @@ public PopoverScrollStrategy ScrollStrategy /// /// Returns the groups of the component. /// - public async Task GetGroupsAsync() + public async Task GetGroupsAsync() { var iv = await InvokeMethod("p:Groups", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectGroup[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbSelectGroup[]); + return Array.Empty(); } return retVal; @@ -286,18 +271,13 @@ public PopoverScrollStrategy ScrollStrategy /// /// Returns the groups of the component. /// - public IgbSelectGroup[]? GetGroups() + public IgbSelectGroup[] GetGroups() { var iv = InvokeMethodSync("p:Groups", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectGroup[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbSelectGroup[]); + return Array.Empty(); } return retVal; diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index 859fe15a..38a69b5c 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -61,18 +61,13 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// Returns all of the stepper's steps. /// - public async Task GetStepsAsync() + public async Task GetStepsAsync() { var iv = await InvokeMethod("p:Steps", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbStep[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbStep[]); + return Array.Empty(); } return retVal; @@ -81,18 +76,13 @@ protected override ControlEventBehavior DefaultEventBehavior /// /// Returns all of the stepper's steps. /// - public IgbStep[]? GetSteps() + public IgbStep[] GetSteps() { var iv = InvokeMethodSync("p:Steps", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbStep[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbStep[]); + return Array.Empty(); } return retVal; diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index a954a03f..aad848ae 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -177,18 +177,13 @@ public string? Gap /// /// Gets the tiles sorted by their position in the layout. /// - public async Task GetTilesAsync() + public async Task GetTilesAsync() { var iv = await InvokeMethod("p:Tiles", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTile[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbTile[]); + return Array.Empty(); } return retVal; @@ -197,18 +192,13 @@ public string? Gap /// /// Gets the tiles sorted by their position in the layout. /// - public IgbTile[]? GetTiles() + public IgbTile[] GetTiles() { var iv = InvokeMethodSync("p:Tiles", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTile[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbTile[]); + return Array.Empty(); } return retVal; diff --git a/src/components/Blazor/TreeItem.cs b/src/components/Blazor/TreeItem.cs index f133c0f1..3b26e8d1 100644 --- a/src/components/Blazor/TreeItem.cs +++ b/src/components/Blazor/TreeItem.cs @@ -233,18 +233,13 @@ public object? Value /// /// Returns the full path to the tree item, starting from the top-most ancestor. /// - public async Task GetPathAsync() + public async Task GetPathAsync() { var iv = await InvokeMethod("p:Path", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTreeItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbTreeItem[]); + return Array.Empty(); } return retVal; @@ -253,18 +248,13 @@ public object? Value /// /// Returns the full path to the tree item, starting from the top-most ancestor. /// - public IgbTreeItem[]? GetPath() + public IgbTreeItem[] GetPath() { var iv = InvokeMethodSync("p:Path", new object?[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTreeItem[]); - } var retVal = ReturnToObjectArray(iv); if (retVal == null) { - return default(IgbTreeItem[]); + return Array.Empty(); } return retVal; diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index 53037c7a..d0a741c2 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -13,13 +13,13 @@ public partial class IgbTreeSelectionEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; - private IgbTreeItem[]? _newSelection; + private IgbTreeItem[] _newSelection = Array.Empty(); /// /// The tree items that will make up the new selection. /// [Parameter] - public IgbTreeItem[]? NewSelection + public IgbTreeItem[] NewSelection { get { return this._newSelection; } set @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("newSelection")) - { this.NewSelection = ReturnToObjectArray(args["newSelection"]); } + { this.NewSelection = ReturnToObjectArray(args["newSelection"]) ?? Array.Empty(); } this.SuppressParentNotify = false; } diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 3cf0e004..30528983 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -54,7 +54,7 @@ internal static string ChangeDetail(string newValues, string items, string type arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), returns: FromRender.Of((interop, cut) => InteropReturn.Array( $$"""[{"refType": "uuid", "id": "{{DataItemId(interop, cut, 1)}}"}]""")), - assert: (cut, result) => Assert.Same(_valueItem2, Assert.Single(result!))) + assert: (cut, result) => Assert.Same(_valueItem2, Assert.Single(result))) // The payload carries uuid refs, which only exist once the data has transferred. .Bind(c => c.Value, c => c.ValueChanged, via: c => c.Change, arrange: ps => ps.Add(c => c.Data, new[] { _valueItem1, _valueItem2 }), diff --git a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs index 0ed9bf22..4bd35efd 100644 --- a/tests/IgniteUI.Blazor.Tests/DropdownTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DropdownTests.cs @@ -99,7 +99,7 @@ sealed class Anchor returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-item:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) @@ -108,7 +108,7 @@ sealed class Anchor returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-group:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-dropdown-group:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); // TODO: unlike IgbDropdownItem (registers via the "DropdownParent" CascadingParameter, // resolved through IgbDropdown.ContentItems), IgbDropdownGroup carries no CascadingParameter // and there's no FindByNameDropdownGroup impl., so the refs currently resolve to null elements; diff --git a/tests/IgniteUI.Blazor.Tests/SelectTests.cs b/tests/IgniteUI.Blazor.Tests/SelectTests.cs index e4bcc83b..4a3b87bf 100644 --- a/tests/IgniteUI.Blazor.Tests/SelectTests.cs +++ b/tests/IgniteUI.Blazor.Tests/SelectTests.cs @@ -36,7 +36,7 @@ public class SelectTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-item:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-item:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) @@ -45,7 +45,7 @@ public class SelectTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-select-group:nth-of-type(1)")}}}"}]""")), assert: (cut, result) => { - Assert.Single(result!); + Assert.Single(result); // TODO: IgbSelectGroup never registers with Select's FindByName (no cascading-value // partial the way SelectItem has one), so the ref currently resolves to a null // Assert.Same(cut.FindComponents()[0].Instance, result[0]); diff --git a/tests/IgniteUI.Blazor.Tests/StepperTests.cs b/tests/IgniteUI.Blazor.Tests/StepperTests.cs index 2e6f5122..3d0ceb79 100644 --- a/tests/IgniteUI.Blazor.Tests/StepperTests.cs +++ b/tests/IgniteUI.Blazor.Tests/StepperTests.cs @@ -28,7 +28,7 @@ public class StepperTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-step:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-step:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); // TODO: IgbStep has no CascadingParameter registration and no FindByNameStepper impl // so the refs currently resolve to null elements }) diff --git a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs index 76831957..7130802f 100644 --- a/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TileManagerTests.cs @@ -27,7 +27,7 @@ public class TileManagerTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(1)")}}}"}, {"refType": "name", "id": "{{{interop.ContainerIdOf(cut, "igc-tile:nth-of-type(2)")}}}"}]""")), assert: (cut, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); Assert.Same(cut.FindComponents()[0].Instance, result[0]); Assert.Same(cut.FindComponents()[1].Instance, result[1]); }) diff --git a/tests/IgniteUI.Blazor.Tests/TreeTests.cs b/tests/IgniteUI.Blazor.Tests/TreeTests.cs index 44f6d070..79418d81 100644 --- a/tests/IgniteUI.Blazor.Tests/TreeTests.cs +++ b/tests/IgniteUI.Blazor.Tests/TreeTests.cs @@ -43,7 +43,7 @@ public class TreeTests : ComponentWithContractTestBase .Event(c => c.SelectionChanged, arrange, argsJson: FromRender.Of((interop, cut) => $$$$$"""{"detail": {"retType": "object", "type": "", "value": {"newSelection": {"retType": "Array", "type": "", "value": [{"refType": "name", "id": "{{{{{interop.ContainerIdOf(cut, "igc-tree-item:nth-of-type(2)")}}}}}"}]}}}}"""), - assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail.NewSelection![0])); + assert: (cut, args) => Assert.Same(cut.Instance.ContentItems[1], args.Detail.NewSelection[0])); [Fact] public Task Methods_FollowContract() => VerifyMethodContract(); @@ -228,8 +228,8 @@ public class TreeItemTests : ComponentWithContractTestBase returns: FromRender.Of((interop, cut) => InteropReturn.Array("""[{"refType": "name", "id": "mainControl"}]""")), assert: (cut, result) => { - Assert.Single(result!); - Assert.Same(cut.Instance, result![0]); + Assert.Single(result); + Assert.Same(cut.Instance, result[0]); }) .Getter(c => c.GetPathAsync(), c => c.GetPath(), "Path", host: treeHost, @@ -237,7 +237,7 @@ public class TreeItemTests : ComponentWithContractTestBase returns: FromRender.Of((interop, h) => InteropReturn.Array($$$"""[{"refType": "name", "id": "{{{interop.ContainerIdOf(h, "igc-tree-item")}}}"}, {"refType": "name", "id": "mainControl"}]""")), assert: (h, result) => { - Assert.Equal(2, result!.Length); + Assert.Equal(2, result.Length); Assert.Same(h.FindComponents()[1].Instance, result[1]); // TODO: the ancestor ref only resolves through FindByName on the item // itself, which matches nothing but "mainControl" — the parent element From 611ac497fee1e8415c30bb32d9897059d04731b8 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 1 Sep 2026 16:27:54 +0300 Subject: [PATCH 47/64] Purge null forgiving operators in favor of fallbacks or actual null checks. --- src/components/Blazor/Input.cs | 2 +- src/components/Blazor/MaskInput.cs | 2 +- src/components/Blazor/RadioGroup.cs | 2 +- src/components/Blazor/SliderBase.cs | 2 +- src/components/Blazor/Textarea.cs | 2 +- src/componentsBase/BaseCollection.cs | 6 +- src/componentsBase/BaseRendererControl.cs | 126 +-- src/componentsBase/BaseRendererElement.cs | 8 +- src/componentsBase/CollectionAdapter.cs | 26 +- src/componentsBase/DynamicContentHolder.cs | 14 +- src/componentsBase/JsonDataSource.cs | 4 +- src/componentsBase/JsonDataSourceItem.cs | 19 +- src/componentsBase/JsonDataSourceSchema.cs | 102 ++- src/componentsBase/JsonSerializable.cs | 2 +- src/componentsBase/RendererSerializer.cs | 89 +- src/componentsBase/RuntimeHelper.cs | 4 +- src/componentsBase/UnmarshalledDataSource.cs | 777 +++++++++++------- src/componentsBase/WebInputs/Input.cs | 6 +- src/componentsBase/WebInputs/Rating.cs | 4 +- .../Components/Common/ReflectionUtils.cs | 5 +- .../Components/Common/TestUtil.cs | 2 +- tests/IgniteUI.Blazor.Tests/ComboTests.cs | 10 +- 22 files changed, 752 insertions(+), 462 deletions(-) diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index c2df36d4..d448c3f0 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -446,7 +446,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail!; + newValueValue = (string)(args.Detail ?? string.Empty); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index e29d206f..2e2efb2e 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -281,7 +281,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail!; + newValueValue = (string)(args.Detail ?? string.Empty); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index 64ef22cb..ea50a80f 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -214,7 +214,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail.Value!; + newValueValue = (string)(args.Detail.Value ?? string.Empty); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/components/Blazor/SliderBase.cs b/src/components/Blazor/SliderBase.cs index f7f476dc..07794d81 100644 --- a/src/components/Blazor/SliderBase.cs +++ b/src/components/Blazor/SliderBase.cs @@ -433,7 +433,7 @@ internal override void SerializeCore(RendererSerializer ser) if (IsPropDirty("TickLabelRotation")) { ser.AddEnumProp("tickLabelRotation", this._tickLabelRotation); } if (IsPropDirty("ValueFormatOptions")) - { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable)this._valueFormatOptions!); } + { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable?)this._valueFormatOptions); } } diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 9c5c9385..df5ea5ae 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -676,7 +676,7 @@ public EventCallback Change var newValueValue = default(string); { - newValueValue = (string)args.Detail!; + newValueValue = (string)(args.Detail ?? string.Empty); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 0db2b799..ee862850 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -142,16 +142,16 @@ protected override void ClearItems() NotifyParent(); } - public void Serialize(SerializationContext? context, string? propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { //var vals = new List(); if (propertyName != null) { - context!.Writer.WriteStartArray(propertyName); + context.Writer.WriteStartArray(propertyName); } else { - context!.Writer.WriteStartArray(); + context.Writer.WriteStartArray(); } for (var i = 0; i < Count; i++) { diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 75dc2ac9..0888cf8b 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -165,7 +165,7 @@ internal string ContainerId } private bool _ready = false; - private Dictionary> _handlers = new Dictionary>(); + private Dictionary> _handlers = new Dictionary>(); private bool _updateQueued = false; /// @@ -193,6 +193,7 @@ public BaseRendererControl() : base() //WebCallback.Instance.Register(this); //this._objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); //_webCallbackHelper.WebCallback = WebCallback.Instance; + _sequenceInfo = BuildSequenceInfo(3); } protected virtual string ResolveDisplay() @@ -200,11 +201,11 @@ protected virtual string ResolveDisplay() return "block"; } - protected string? ToSpinal(string? value) + protected string ToSpinal(string? value) { if (value == null) { - return null; + return String.Empty; } List output = new List(); @@ -293,8 +294,12 @@ private Dictionary GatherSimpleAttributes() var ser = Serialize(); var data = System.Text.Json.JsonSerializer.Deserialize>(ser); + if (data == null) + { + return new Dictionary(); + } Dictionary ret = new Dictionary(); - foreach (var key in data!.Keys) + foreach (var key in data.Keys) { var currKey = key; var currValue = data[key]; @@ -366,13 +371,13 @@ private object ArrayToSimpleAttributeValue(JsonElement currValue) protected virtual string TransformSimpleKey(string? key) { key = Camelize(key); - return _sequenceInfo!.TransformKey(key); + return _sequenceInfo.TransformKey(key); } protected virtual bool IsTransformedEnumValue(string? key) { key = Camelize(key); - if (_sequenceInfo!.IsTransformedEnum(key)) + if (_sequenceInfo.IsTransformedEnum(key)) { return true; } @@ -383,7 +388,7 @@ protected virtual object TransformPotentialEnumValue(string? key, object value) { key = Camelize(key); //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); - if (_sequenceInfo!.IsTransformedEnum(key)) + if (_sequenceInfo.IsTransformedEnum(key)) { //Console.WriteLine("transforming enum value...."); @@ -393,7 +398,7 @@ protected virtual object TransformPotentialEnumValue(string? key, object value) return value; } - private SequenceInfo? _sequenceInfo = null; + private SequenceInfo _sequenceInfo; protected virtual SequenceInfo BuildSequenceInfo(int startSequence) { @@ -444,7 +449,7 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) } var wc = (WCEnumNameAttribute)attr; var wcEnumName = Camelize(wc.Name); - wcEnumTransform.Add(f.Name.ToLower(), wcEnumName!); + wcEnumTransform.Add(f.Name.ToLower(), wcEnumName); } } } @@ -479,7 +484,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.AddAttribute(2, "data-ig-id", _containerId); EnsureSequenceInfo(); - foreach (var key in _sequenceInfo!.AttributeKeys) + foreach (var key in _sequenceInfo.AttributeKeys) { if (attributes.ContainsKey(key)) { @@ -501,7 +506,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) attributeVal = TransformPotentialEnumValue(key, attributeVal); } //Console.WriteLine("adding attribute: " + tKey + ", " + attributes[key]); - builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey))!, attributeVal); + builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey)), attributeVal); } } @@ -689,7 +694,7 @@ internal void AdjustDynamicContent(string? containerId, string? contentType, str dynamicContent.UpdateTemplate(template); } - Holder!.AddDynamicContent(dynamicContent); + Holder?.AddDynamicContent(dynamicContent); break; } case "Remove": @@ -702,7 +707,7 @@ internal void AdjustDynamicContent(string? containerId, string? contentType, str { DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; _dynamicContentInfos.Remove(contentId); - Holder!.RemoveDynamicContent(dynamicContent); + Holder?.RemoveDynamicContent(dynamicContent); } break; } @@ -929,7 +934,7 @@ public virtual string? Type } } - public void Serialize(SerializationContext? context, string? propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; @@ -1079,11 +1084,11 @@ private JsonSerializerOptions SerializerOptions if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { - var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str!, SerializerOptions); + var str = ((JsonElement)ret).GetString() ?? ""; + var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); ret = retDict; - if (retDict!.ContainsKey("retType") && + if (retDict != null && retDict.ContainsKey("retType") && retDict["retType"] is JsonElement && ((JsonElement)retDict["retType"]).GetString() == "promise") { @@ -1639,9 +1644,9 @@ private void Update() } //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); - while (_messageQueue != null && _messageQueue.Count > 0) + while (_messageQueue != null && _messageQueue.First != null && _messageQueue.Count > 0) { - RendererMessage m = _messageQueue.First!.Value; + RendererMessage m = _messageQueue.First.Value; _messageQueue.RemoveFirst(); ProcessMessage(m); } @@ -1656,9 +1661,9 @@ private void UpdateSync() return; } - while (_messageQueue.Count > 0) + while (_messageQueue.Count > 0 && _messageQueue.First != null) { - RendererMessage m = _messageQueue.First!.Value; + RendererMessage m = _messageQueue.First.Value; _messageQueue.RemoveFirst(); ProcessMessageSync(m); } @@ -2099,8 +2104,8 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f { return null!; } - var ret = obj["value"].ToString(); - returnValue = JsonSerializer.Deserialize>(ret!, SerializerOptions); + var ret = obj["value"].ToString() ?? ""; + returnValue = JsonSerializer.Deserialize>(ret, SerializerOptions); } } else @@ -2133,11 +2138,14 @@ public void OnInvokeReturn(long invokeId, Object returnValue) // } //} - object? result = returnValue; + object result = returnValue; if (returnValue is JsonElement && ((JsonElement)returnValue).ValueKind == JsonValueKind.String) { var str = ((JsonElement)returnValue).GetString(); - result = JsonSerializer.Deserialize>(str!, SerializerOptions); + if (str != null) + { + result = JsonSerializer.Deserialize>(str, SerializerOptions) ?? returnValue; + } } InvokeAsync(() => @@ -2148,7 +2156,7 @@ public void OnInvokeReturn(long invokeId, Object returnValue) } else { - _methodReturns.Add(invokeId, result!); + _methodReturns.Add(invokeId, result); } }); } @@ -2508,7 +2516,7 @@ internal void ObjectToParam(SerializationContext c, string propertyName, object? w.WriteNull(propertyName); return; } - Guid id = _dataSourceManager!.FindItemId(val); + Guid id = _dataSourceManager?.FindItemId(val) ?? Guid.Empty; string typeName = ""; if (val is JsonSerializable) @@ -2631,11 +2639,11 @@ protected virtual bool UseCamelEnumValues } } - protected string? Camelize(string? value) + protected string Camelize(string? value) { if (value == null || value.Length == 0) { - return value; + return value ?? string.Empty; } return value.Substring(0, 1).ToLower() + value.Substring(1); } @@ -2788,7 +2796,7 @@ internal object[] ReturnToObjectArray(object? val) } try { - var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); + var arr = JsonSerializer.Deserialize(val.ToString() ?? "", SerializerOptions); if (arr == null) { return Array.Empty(); @@ -2931,8 +2939,12 @@ internal object[] ReturnToObjectArray(object? val) } try { - var arr = JsonSerializer.Deserialize(val.ToString()!, SerializerOptions); - int[] ret = new int[arr!.Length]; + var arr = JsonSerializer.Deserialize(val.ToString() ?? "[]", SerializerOptions); + if (arr == null) + { + return null; + } + int[] ret = new int[arr.Length]; for (int i = 0; i < arr.Length; i++) { int ele = arr[i] != null ? Convert.ToInt32(arr[i]) : int.MinValue; @@ -2987,12 +2999,20 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string _handlers.Remove(name + "/" + propertyName); return; } - Action inner = (sender, args) => + Action inner = (sender, args) => { + // Native void events (e.g. focus/blur) legitimately deliver null args, + // so only bail out when a non-null payload is not the expected dictionary. + if (args is not null and not Dictionary) + { + return; + } + var eventArgs = args as Dictionary; + T a = new T(); BaseRendererElement ele = (BaseRendererElement)a; ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); + ele.FromEventJson(this, eventArgs); //Console.WriteLine("invoking async"); if (onArgs != null) { @@ -3003,7 +3023,10 @@ protected internal void OnElementNameChanged(BaseRendererElement element, string { throw task.Exception; } - ele.ToEventJson(this, (Dictionary)args); + if (eventArgs != null) + { + ele.ToEventJson(this, eventArgs); + } ele.Parent = (null); }; @@ -3019,9 +3042,9 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac _handlers.Remove(name + "/" + propertyName); return; } - Action inner = (sender, args) => + Action inner = (sender, args) => { - T a = getReturn(args); + T a = getReturn(args!); //Console.WriteLine("invoking async"); if (onArgs != null) { @@ -3046,19 +3069,30 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac _handlers.Remove(name + "/" + propertyName); return; } - Action inner = (sender, args) => + Action inner = (sender, args) => { + // Native void events (e.g. focus/blur) legitimately deliver null args, + // so only bail out when a non-null payload is not the expected dictionary. + if (args is not null and not Dictionary) + { + return; + } + var eventArgs = args as Dictionary; + T a = new T(); BaseRendererElement ele = (BaseRendererElement)a; ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); + ele.FromEventJson(this, eventArgs); //Console.WriteLine("invoking async"); if (onArgs != null) { onArgs(a); } handler(a); - ele.ToEventJson(this, (Dictionary)args); + if (eventArgs != null) + { + ele.ToEventJson(this, eventArgs); + } ele.Parent = (null); }; @@ -3074,9 +3108,9 @@ internal void SetActionHandlerSimple(string name, string propertyName, Action _handlers.Remove(name + "/" + propertyName); return; } - Action inner = (sender, args) => + Action inner = (sender, args) => { - T a = getReturn(args); + T a = getReturn(args!); //Console.WriteLine("invoking async"); if (onArgs != null) @@ -3109,7 +3143,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) } //Console.WriteLine(args.ToString()); - object sender = obj["sender"]; + object? sender = obj["sender"]; if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) { var stringVal = ((JsonElement)sender).GetString(); @@ -3117,7 +3151,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) { return; } - sender = JsonSerializer.Deserialize>(stringVal, SerializerOptions)!; + sender = JsonSerializer.Deserialize>(stringVal, SerializerOptions); } senderObj = ConvertReturnValue(sender); @@ -3168,7 +3202,7 @@ internal void OnRaiseEvent(string name, string propertyName, string args) } } //Console.WriteLine("calling handler"); - _handlers[name + "/" + propertyName](senderObj, val!); + _handlers[name + "/" + propertyName](senderObj, val); } catch (Exception e) { @@ -3624,7 +3658,7 @@ public bool IsRuntimeValid(bool reevaluate = false) { if (reevaluate && _isRemoteRuntime) { - _isRuntimeValid = (bool)(_remoteRuntimeProp!.GetValue(JsRuntime) ?? false); + _isRuntimeValid = (bool)(_remoteRuntimeProp?.GetValue(JsRuntime) ?? false); } } return _isRuntimeValid; diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 6e788689..b712c624 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -224,10 +224,10 @@ internal object? TempParent private class RefChange { - public String propertyName = null!; + public String propertyName = string.Empty; public Object? oldValue; public Object? newValue; - public Action refChanged = null!; + public Action? refChanged = null; public bool isScript; public bool isElement; } @@ -253,7 +253,7 @@ private void FlushRefs() { RefChange? c = _queuedChanges.First?.Value; _queuedChanges.RemoveFirst(); - if (c != null) + if (c != null && c.refChanged != null) { OnRefChanged(c.propertyName, c.oldValue, c.newValue, c.isScript, c.isElement, c.refChanged); } @@ -530,7 +530,7 @@ public virtual string Type } } - public void Serialize(SerializationContext? context, string? propertyName = null) + public void Serialize(SerializationContext context, string? propertyName = null) { RendererSerializer ser = new RendererSerializer(context, this, Name); ser.Type = Type; diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index c55752a6..4825802e 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -85,21 +85,24 @@ private void OnManualChanged(object? sender, NotifyCollectionChangedEventArgs ar switch (args.Action) { case NotifyCollectionChangedAction.Add: - if (args.NewItems != null && args.NewItems.Count > 0) + if (args.NewItems is { Count: > 0 } && args.NewItems[0] is T addedItem) { - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]!); + this.InsertManualItem(args.NewStartingIndex, addedItem); } break; + case NotifyCollectionChangedAction.Remove: this.RemoveManualItemAt(args.OldStartingIndex); break; + case NotifyCollectionChangedAction.Replace: this.RemoveManualItemAt(args.OldStartingIndex); - if (args.NewItems != null && args.NewItems.Count > 0) + if (args.NewItems is { Count: > 0 } && args.NewItems[0] is T replacedItem) { - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]!); + this.InsertManualItem(args.NewStartingIndex, replacedItem); } break; + case NotifyCollectionChangedAction.Reset: this.ClearManualItems(); break; @@ -121,10 +124,7 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) var key = this.CollisionChecker(item); if (key != null) { - if (!manualSet.Contains(key)) - { - manualSet.Add(key); - } + manualSet.Add(key); } } } @@ -148,7 +148,7 @@ public void ShiftContentToManual(IList manualCollection, Action onMoving) } else { - var key = this.CollisionChecker!(item); + var key = this.CollisionChecker?.Invoke(item); if (key == null) { this._manualItems.Insert(i, item); @@ -293,9 +293,9 @@ private void SyncItems() } this._allList.Insert(ins, insItem); - if (this._target != null) + if (this._target != null && convertedItem != null) { - this._target.Insert(ins, convertedItem!); + this._target.Insert(ins, convertedItem); } this._onItemAdded?.Invoke(insItem); ind++; @@ -312,9 +312,9 @@ private void SyncItems() } this._allList.Add(insItem); - if (this._target != null) + if (this._target != null && convertedItem != null) { - this._target.Add(convertedItem!); + this._target.Add(convertedItem); } this._onItemAdded?.Invoke(insItem); ind++; diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 7f8e53ed..2289138f 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -184,7 +184,10 @@ protected override void OnComponentChanged(object? oldValue, object? component) foreach (var item in toSignal) { - item.SetResult(Component!); + if (Component != null) + { + item.SetResult(Component); + } } } @@ -208,11 +211,14 @@ public Task GetInstanceAsync() } } - if (component != null) + if (component != null && toSignal != null) { - foreach (var item in toSignal!) + foreach (var item in toSignal) { - item.SetResult(Component!); + if (Component != null) + { + item.SetResult(Component); + } } } diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 899118db..933de1f3 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -591,8 +591,8 @@ private void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer) for (int i = 0; i < _data.Count; i++) { item = (JsonDataSourceItem)_data[0]; - JsonDataSource ds = (JsonDataSource)item.Source!; - ds.GetDateCacheAsJson(writer); + JsonDataSource? ds = item.Source as JsonDataSource; + ds?.GetDateCacheAsJson(writer); } } else diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 4fbe596d..76630936 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -302,17 +302,17 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer) var propertyNames = _schema.PropertyNames; var jsonPropertyNames = _schema.JsonPropertyNames; - var len = propertyNames!.Length; + var len = propertyNames.Length; for (var i = 0; i < len; i++) { - ValueToJson(propertyNames[i], jsonPropertyNames![i], writer); + ValueToJson(propertyNames[i], jsonPropertyNames[i], writer); } var fieldNames = _schema.FieldNames; var jsonFieldNames = _schema.JsonFieldNames; - len = fieldNames!.Length; + len = fieldNames.Length; for (var i = 0; i < len; i++) { - ValueToJson(fieldNames[i], jsonFieldNames![i], writer); + ValueToJson(fieldNames[i], jsonFieldNames[i], writer); } writer.WriteString("___id", _parentId != null ? _parentId + "/" + _id.ToString() : _id.ToString()); @@ -335,12 +335,15 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.Json writer.WriteStartObject(propertyName); - var propertyNames = _schema!.PropertyNames; - var jsonPropertyNames = _schema.JsonPropertyNames; - var len = propertyNames!.Length; + var propertyNames = _schema?.PropertyNames; + var jsonPropertyNames = _schema?.JsonPropertyNames; + var len = propertyNames?.Length ?? 0; for (var i = 0; i < len; i++) { - ValueToJson(propertyNames[i], jsonPropertyNames![i], writer); + if (propertyNames?[i] != null && jsonPropertyNames?[i] != null) + { + ValueToJson(propertyNames[i], jsonPropertyNames[i], writer); + } } writer.WriteString("___id", _id); diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 96bc7146..5954907b 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -23,21 +23,21 @@ private bool HasDataIntents() //Console.WriteLine("has item schema"); return ItemSchema.HasDataIntents(); } - if (_subSchemas.ContainsKey("___self")) + if (_subSchemas.TryGetValue("___self", out var selfSchema)) { //Console.WriteLine("checking self intents"); - if (_subSchemas["___self"] != null) + if (selfSchema != null) { //Console.WriteLine("has item schema"); - return _subSchemas["___self"]!.HasDataIntents(); + return selfSchema.HasDataIntents(); } } } else { - for (var i = 0; i < PropertyDataIntents!.Length; i++) + for (var i = 0; i < PropertyDataIntents.Length; i++) { - var prop = PropertyNames![i]; + var prop = PropertyNames[i]; if (_subSchemas.ContainsKey(prop)) { var sub = _subSchemas[prop]; @@ -55,9 +55,9 @@ private bool HasDataIntents() return true; } } - for (var i = 0; i < FieldDataIntents!.Length; i++) + for (var i = 0; i < FieldDataIntents.Length; i++) { - var field = FieldNames![i]; + var field = FieldNames[i]; if (_subSchemas.ContainsKey(field)) { var sub = _subSchemas[field]; @@ -108,23 +108,23 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J { //Console.WriteLine("has item schema"); uw.WriteBoolean("subProps", true); - _subSchemas["___self"]!.WriteDataIntentsAsJson("subIntents", uw); + _subSchemas["___self"]?.WriteDataIntentsAsJson("subIntents", uw); } } } else { - for (var i = 0; i < PropertyNames!.Length; i++) + for (var i = 0; i < PropertyNames.Length; i++) { var currProp = PropertyNames[i]; - var intents = PropertyDataIntents![i]; + var intents = PropertyDataIntents[i]; if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas[currProp]!.HasDataIntents()) + var sub = _subSchemas[currProp]; + if (sub != null && sub.HasDataIntents()) { - var sub = _subSchemas[currProp]; - if (sub!.IsDataSource) + if (sub.IsDataSource) { uw.WriteStartObject(currProp); uw.WriteBoolean("subProps", true); @@ -151,17 +151,17 @@ private void WriteDataIntentsAsJson(string? propertyName, System.Text.Json.Utf8J } } - for (var i = 0; i < Fields!.Length; i++) + for (var i = 0; i < Fields.Length; i++) { - var currProp = FieldNames![i]; - var intents = FieldDataIntents![i]; + var currProp = FieldNames[i]; + var intents = FieldDataIntents[i]; if (_subSchemas.ContainsKey(currProp)) { - if (_subSchemas[currProp]!.HasDataIntents()) + var sub = _subSchemas[currProp]; + if (sub != null && sub.HasDataIntents()) { - var sub = _subSchemas[currProp]; - if (sub!.IsDataSource) + if (sub.IsDataSource) { uw.WriteStartObject(currProp); uw.WriteBoolean("subProps", true); @@ -283,12 +283,16 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) s.PropertyGetters = new Func[names.Count]; s.TypedPropertyGetters = new Delegate[names.Count]; - var itemProp = item.GetType().GetProperty("Item"); + var itemProp = item.GetType().GetProperty("Item") ?? throw new InvalidOperationException("The 'Item' property was not found on the dictionary type."); for (int i = 0; i < names.Count; i++) { var key = names[i]; - s.PropertyGetters[i] = (o) => ((IDictionary)o)[key]!; + s.PropertyGetters[i] = (o) => + { + var value = ((IDictionary)o)[key]; + return value is null ? new object() : value; + }; } for (int i = 0; i < names.Count; i++) { @@ -422,10 +426,9 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt var schema = JsonDataSourceItem.ExtractSchema(subObject); JSDataSourceSchema? itemSchema = null; - if (subObject is IEnumerable) + if (subObject is IEnumerable collection) { - var collection = subObject as IEnumerable; - foreach (var item in collection!) + foreach (var item in collection) { if (item != null) { @@ -434,9 +437,9 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt break; } } - if (itemSchema != null) + if (schema != null && itemSchema != null) { - schema!.SetSubSchema("Items", itemSchema); + schema.SetSubSchema("Items", itemSchema); } } else @@ -446,12 +449,16 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt if (itemSchema != null) { - for (int i = 0; i < itemSchema.PropertyTypes!.Length; i++) + var propertyGetters = itemSchema.PropertyGetters; + if (propertyGetters != null) { - if (itemSchema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) + for (int i = 0; i < itemSchema.PropertyTypes.Length; i++) { - var obj = itemSchema.PropertyGetters![i](subObject); - itemSchema.SetSubSchema(itemSchema.PropertyNames![i], BuildSubObjectSchema(obj)); + if (itemSchema.PropertyTypes[i] == JSDataSourceSchemaType.ObjectValue) + { + var obj = propertyGetters[i](subObject); + itemSchema.SetSubSchema(itemSchema.PropertyNames[i], BuildSubObjectSchema(obj)); + } } } } @@ -518,11 +525,11 @@ public bool IsNullable(string propertyName) //TODO: maybe true here. return false; } - for (int i = 0; i < PropertyNames!.Length; i++) + for (int i = 0; i < PropertyNames.Length; i++) { if (PropertyNames[i] == propertyName) { - return IsNullable(Properties![i].PropertyType); + return IsNullable(Properties[i].PropertyType); } } return false; @@ -551,6 +558,11 @@ public void SetSubSchema(string? propertyName, JSDataSourceSchema? schema) public JSDataSourceSchemaType ResolveSchemaType(Type? type) { + if (type == null) + { + return JSDataSourceSchemaType.ObjectValue; + } + if (type == typeof(double)) { return JSDataSourceSchemaType.DoubleValue; @@ -591,7 +603,7 @@ public JSDataSourceSchemaType ResolveSchemaType(Type? type) { return JSDataSourceSchemaType.DateTimeValue; } - if (type!.IsEnum) + if (type.IsEnum) { var underlyingType = Enum.GetUnderlyingType(type); return ResolveSchemaType(underlyingType); @@ -729,20 +741,20 @@ public void AddField(FieldInfo curr) _buildingFieldsTypes.Add(type); } - public PropertyInfo[]? Properties; + public PropertyInfo[] Properties = Array.Empty(); public Func[]? PropertyGetters; public Func[]? FieldGetters; public Delegate[]? TypedPropertyGetters; public Delegate[]? TypedFieldGetters; - public JSDataSourceSchemaType[]? PropertyTypes; - public IDataIntentAttribute[]?[]? PropertyDataIntents; - public System.Text.Json.JsonEncodedText[]? JsonPropertyNames; - public System.Text.Json.JsonEncodedText[]? JsonFieldNames; - public String[]? PropertyNames; - public String[]? FieldNames; - public FieldInfo[]? Fields; - public JSDataSourceSchemaType[]? FieldTypes; - public IDataIntentAttribute[]?[]? FieldDataIntents; + public JSDataSourceSchemaType[] PropertyTypes = Array.Empty(); + public IDataIntentAttribute[]?[] PropertyDataIntents = Array.Empty(); + public System.Text.Json.JsonEncodedText[] JsonPropertyNames = Array.Empty(); + public System.Text.Json.JsonEncodedText[] JsonFieldNames = Array.Empty(); + public String[] PropertyNames = Array.Empty(); + public String[] FieldNames = Array.Empty(); + public FieldInfo[] Fields = Array.Empty(); + public JSDataSourceSchemaType[] FieldTypes = Array.Empty(); + public IDataIntentAttribute[]?[] FieldDataIntents = Array.Empty(); private System.Linq.Expressions.UnaryExpression GetConversion(Type? type, System.Linq.Expressions.Expression expression) { @@ -799,7 +811,7 @@ private Delegate GetTypedPropertyValueGetter(Type? type, PropertyInfo propertyIn } } - private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, PropertyInfo? itemProp, string key) + private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, PropertyInfo itemProp, string key) { //var propertyInfo = type.GetProperty(propertyName); @@ -809,7 +821,7 @@ private Delegate GetTypedDictionaryValueGetter(Type dictType, Type valueType, Pr System.Linq.Expressions.UnaryExpression conversion = this.GetConversion(dictType, param); System.Linq.Expressions.Expression strIndex = System.Linq.Expressions.ConstantExpression.Constant(key); - System.Linq.Expressions.Expression prop = System.Linq.Expressions.Expression.Property(conversion, itemProp!, strIndex); + System.Linq.Expressions.Expression prop = System.Linq.Expressions.Expression.Property(conversion, itemProp, strIndex); System.Linq.Expressions.UnaryExpression retConversion = this.GetConversion(valueType, prop); if (valueType.IsEnum) { diff --git a/src/componentsBase/JsonSerializable.cs b/src/componentsBase/JsonSerializable.cs index d8ace0b3..aa61f550 100644 --- a/src/componentsBase/JsonSerializable.cs +++ b/src/componentsBase/JsonSerializable.cs @@ -16,7 +16,7 @@ public SerializationContext(System.Text.Json.Utf8JsonWriter writer, Serializatio public interface JsonSerializable { - void Serialize(SerializationContext? writer, string? propertyName = null); + void Serialize(SerializationContext writer, string? propertyName = null); } } diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index edaf0b1c..8aeb5455 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -8,7 +8,7 @@ namespace IgniteUI.Blazor.Controls internal partial class RendererSerializer { - public RendererSerializer(SerializationContext? context, ComponentBase component, string name) + public RendererSerializer(SerializationContext context, ComponentBase component, string name) { _name = name; _context = context; @@ -18,7 +18,7 @@ public RendererSerializer(SerializationContext? context, ComponentBase component private string? _name; private ComponentBase? _component; - private SerializationContext? _context; + private SerializationContext _context; //private List _properties = new List(); private string? _type = null; @@ -37,7 +37,7 @@ public string? Type public void AddBooleanProp(string propertyName, bool value) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -50,7 +50,7 @@ public void AddBooleanProp(string propertyName, bool value) public void AddStringProp(string propertyName, string? value) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (propertyName != "name" && propertyName != "type") { @@ -69,7 +69,7 @@ public void AddPrimitiveProp(object? val) if (val is Array) { var objArr = (IList)val; - _context!.Writer.WriteStartArray(); + _context.Writer.WriteStartArray(); for (var i = 0; i < objArr.Count; i++) { var subVal = objArr[i]; @@ -79,49 +79,49 @@ public void AddPrimitiveProp(object? val) } else if (val is double) { - _context!.Writer.WriteNumberValue((double)val); + _context.Writer.WriteNumberValue((double)val); } else if (val is int) { - _context!.Writer.WriteNumberValue((int)val); + _context.Writer.WriteNumberValue((int)val); } else if (val is long) { - _context!.Writer.WriteNumberValue((long)val); + _context.Writer.WriteNumberValue((long)val); } else if (val is short) { - _context!.Writer.WriteNumberValue((short)val); + _context.Writer.WriteNumberValue((short)val); } else if (val is bool) { - _context!.Writer.WriteBooleanValue((bool)val); + _context.Writer.WriteBooleanValue((bool)val); } else if (val is DateTime) { - _context!.Writer.WriteStringValue("@d:" + ((DateTime)val).ToString("o")); + _context.Writer.WriteStringValue("@d:" + ((DateTime)val).ToString("o")); } else if (val is string) { - _context!.Writer.WriteStringValue(val.ToString()); + _context.Writer.WriteStringValue(val.ToString()); } else { // ObjectToParam this thing if (_component is BaseRendererElement) { - (_component as BaseRendererElement)!.ObjectToParam(_context, val); + (_component as BaseRendererElement)?.ObjectToParam(_context, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl)!.ObjectToParam(_context, val); + (_component as BaseRendererControl)?.ObjectToParam(_context, val); } } } public void AddPrimitiveProp(string propertyName, object? val) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -173,11 +173,11 @@ public void AddPrimitiveProp(string propertyName, object? val) // ObjectToParam this thing if (_component is BaseRendererElement) { - (_component as BaseRendererElement)!.ObjectToParam(_context, propertyName, val); + (_component as BaseRendererElement)?.ObjectToParam(_context, propertyName, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl)!.ObjectToParam(_context, propertyName, val); + (_component as BaseRendererControl)?.ObjectToParam(_context, propertyName, val); } } } @@ -198,7 +198,7 @@ public void AddArrayProp(string propertyName, IEnumerable? values) } } var context = _context; - if (!containsSub && _context!.Filter != null) + if (!containsSub && _context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -212,11 +212,11 @@ public void AddArrayProp(string propertyName, IEnumerable? values) if (items == null) { //_properties.Add("\"" + propertyName + "\"" + ": null"); - context!.Writer.WriteNull(propertyName); + context.Writer.WriteNull(propertyName); return; } //string[] strValues = new string[values.Length]; - context!.Writer.WriteStartArray(propertyName); + context.Writer.WriteStartArray(propertyName); foreach (object? val in items) { if (val is String) @@ -262,11 +262,11 @@ public void AddArrayProp(string propertyName, IEnumerable? values) { if (_component is BaseRendererElement) { - (_component as BaseRendererElement)!.ObjectToParam(context, val); + (_component as BaseRendererElement)?.ObjectToParam(context, val); } else if (_component is BaseRendererControl) { - (_component as BaseRendererControl)!.ObjectToParam(context, val); + (_component as BaseRendererControl)?.ObjectToParam(context, val); } } } @@ -286,7 +286,7 @@ public void AddArrayProp(string propertyName, IEnumerable? values) public void AddEnumProp(string propertyName, Enum? value) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -319,7 +319,7 @@ public void AddEnumProp(string propertyName, Enum? value) public void AddNumberProp(String propertyName, Object? value) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -351,7 +351,7 @@ public void AddNumberProp(String propertyName, Object? value) public void AddDateTimeProp(String propertyName, DateTime value) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -366,17 +366,17 @@ public void Start(string? propertyName = null) { if (propertyName != null) { - _context!.Writer.WriteStartObject(propertyName); + _context.Writer.WriteStartObject(propertyName); } else { - _context!.Writer.WriteStartObject(); + _context.Writer.WriteStartObject(); } } public void End() { - _context!.Writer.WriteString("type", Type); + _context.Writer.WriteString("type", Type); _context.Writer.WriteEndObject(); } @@ -387,7 +387,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable? value) if (value == null) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -398,12 +398,12 @@ public void AddSerializableProp(String propertyName, JsonSerializable? value) context = new SerializationContext(_context.Writer, null); } } - context!.Writer.WriteNull(propertyName); + context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; } - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -419,7 +419,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable? value) public void AddStringArrayProp(String propertyName, string[]? values) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -461,7 +461,7 @@ public void AddStringArrayProp(String propertyName, string[]? values) public void AddDateArrayProp(String propertyName, DateTime[]? values) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -507,7 +507,7 @@ public void AddDateArrayProp(String propertyName, DateTime[]? values) private Regex _colorSplitRegex = new Regex("[\\s,]+(?![^(]*\\))"); public void AddStringArrayProp(String propertyName, string? values) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -549,7 +549,7 @@ public void AddStringArrayProp(String propertyName, string? values) public void AddEnumArrayProp(String propertyName, object? values) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -568,8 +568,11 @@ public void AddEnumArrayProp(String propertyName, object? values) _context.Writer.WriteStartArray(propertyName); for (int i = 0; i < vals.Count; i++) { - Enum val = (Enum)vals[i]!; - _context.Writer.WriteStringValue(Camelize(val.ToString())); + Enum? val = (Enum?)vals[i]; + if (val != null) + { + _context.Writer.WriteStringValue(Camelize(val.ToString())); + } //strValues[i] = "\"" + val.ToString() + "\""; } _context.Writer.WriteEndArray(); @@ -578,7 +581,7 @@ public void AddEnumArrayProp(String propertyName, object? values) public void AddIntArrayProp(String propertyName, int[]? values) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -606,7 +609,7 @@ public void AddIntArrayProp(String propertyName, int[]? values) public void AddDoubleArrayProp(string propertyName, double[]? numbers) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -637,7 +640,7 @@ public void AddSerializableArrayProp(string propertyName, T[]? array) where T { if (array == null) { - if (_context!.Filter != null) + if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) { @@ -651,7 +654,7 @@ public void AddSerializableArrayProp(string propertyName, T[]? array) where T } var context = _context; - if (_context!.Filter != null) + if (_context.Filter != null) { if (_context.Filter(_name, propertyName)) { @@ -659,7 +662,7 @@ public void AddSerializableArrayProp(string propertyName, T[]? array) where T } } //List items = new List(); - context!.Writer.WriteStartArray(propertyName); + context.Writer.WriteStartArray(propertyName); for (int i = 0; i < array.Length; i++) { //string c = numbers[i].ToString(CultureInfo.InvariantCulture); @@ -681,7 +684,7 @@ public void AddSerializableArrayProp(string propertyName, T[]? array) where T public void AddCollectionProp(string propertyName, BaseCollection coll) { var context = _context; - if (_context!.Filter != null) + if (_context.Filter != null) { if (_context.Filter(_name, propertyName)) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 89e5e6cd..9efc7012 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -38,13 +38,13 @@ public RuntimeHelper(IJSRuntime? runtime, IIgniteUIBlazor igBlazor) IsInproc = true; //Console.WriteLine("is inproc"); } - if (IsInproc) + if (IsInproc && inprocRuntime != null) { #if NET5_0 _unmarshalledRuntime = _inprocRuntime as IJSUnmarshalledRuntime; #else //Console.WriteLine("inproc type: " + _inprocRuntime.GetType().Name); - var unmarshalled = inprocRuntime!.GetType().GetMethods().Where(m => m.Name == "InvokeUnmarshalled").ToList(); + var unmarshalled = inprocRuntime.GetType().GetMethods().Where(m => m.Name == "InvokeUnmarshalled").ToList(); var name = inprocRuntime.GetType().Assembly.GetName(); if (unmarshalled.Count > 0) diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 97c7debe..57e78872 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -35,7 +35,7 @@ public UnmarshalledColumnData() public UnmarshalledColumnData?[]? SubColumns { get; set; } public JSDataSourceSchema? SubSchema { get; set; } public Action? Insert { get; internal set; } - public Action? Update { get; internal set; } + public Action? Update { get; internal set; } public Action? Remove { get; internal set; } public bool IsIDColumn { get; internal set; } public Action? Clear { get; internal set; } @@ -233,8 +233,9 @@ public UnmarshalledDataSource() }; if (columns[columns.Length - 1] == null) { - columns[columns.Length - 1] = CreateColumn(parentPath, "___id", schema, JSDataSourceSchemaType.StringValue, idGetter, untypedIdGetter, true); - columns[columns.Length - 1]!.IsIDColumn = true; + var idColumn = CreateColumn(parentPath, "___id", schema, JSDataSourceSchemaType.StringValue, idGetter, untypedIdGetter, true); + idColumn.IsIDColumn = true; + columns[columns.Length - 1] = idColumn; } columns[columns.Length - 1] = AdjustColumnCapacity(parentPath, columns[columns.Length - 1], schema, "___id", idGetter, untypedIdGetter, true, JSDataSourceSchemaType.StringValue, oldValue, newValue); } @@ -310,26 +311,26 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.SingleValue: singleGetter = (Func?)valueGetter; - floatingPointGetter = (o) => (double)singleGetter!(o); + floatingPointGetter = (o) => singleGetter == null ? double.NaN : (double)singleGetter(o); break; case JSDataSourceSchemaType.BooleanValue: boolGetter = (Func?)valueGetter; - integerGetter = (o) => boolGetter!(o) ? 1 : 0; + integerGetter = (o) => (boolGetter != null && boolGetter(o)) ? 1 : 0; break; case JSDataSourceSchemaType.ByteValue: byteGetter = (Func?)valueGetter; - integerGetter = (o) => (int)byteGetter!(o); + integerGetter = (o) => byteGetter == null ? 0 : (int)byteGetter(o); break; case JSDataSourceSchemaType.DecimalValue: decimalGetter = (Func?)valueGetter; - floatingPointGetter = (o) => (double)decimalGetter!(o); + floatingPointGetter = (o) => decimalGetter == null ? double.NaN : (double)decimalGetter(o); break; case JSDataSourceSchemaType.IntValue: integerGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.ShortValue: shortGetter = (Func?)valueGetter; - integerGetter = (o) => (int)shortGetter!(o); + integerGetter = (o) => shortGetter == null ? 0 : (int)shortGetter(o); break; case JSDataSourceSchemaType.LongValue: longGetter = (Func?)valueGetter; @@ -337,24 +338,24 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.StringValue: if (isIDColumn) { - idGetter = (Func)valueGetter!; - stringGetter = (o) => idGetter(o).ToString(); + idGetter = (Func?)valueGetter; + stringGetter = (o) => idGetter == null ? string.Empty : idGetter(o).ToString(); } else { - stringGetter = (Func)valueGetter!; + stringGetter = (Func?)valueGetter; } break; case JSDataSourceSchemaType.CalendarValue: case JSDataSourceSchemaType.DateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) + if (valueGetter != null && typeof(Func).IsAssignableFrom(valueGetter.GetType())) { dateTimeGetter = (Func)valueGetter; stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); } else { - dateTimeGetter = (o) => (DateTime)untypedGetter!(o); + dateTimeGetter = (o) => untypedGetter == null ? default : (DateTime)untypedGetter(o); stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); } break; @@ -381,13 +382,17 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN nullableFloatingPointGetter = nullableDoubleGetter; break; case JSDataSourceSchemaType.NullableSingleValue: - nullableSingleGetter = (Func)valueGetter!; - nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter(o); + nullableSingleGetter = (Func?)valueGetter; + nullableFloatingPointGetter = (o) => nullableSingleGetter == null ? null : (double?)nullableSingleGetter(o); break; case JSDataSourceSchemaType.NullableBooleanValue: - nullableBoolGetter = (Func)valueGetter!; + nullableBoolGetter = (Func?)valueGetter; nullableIntegerGetter = (o) => { + if (nullableBoolGetter == null) + { + return null; + } var val = nullableBoolGetter(o); int? t = 1; int? f = 0; @@ -395,26 +400,26 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN }; break; case JSDataSourceSchemaType.NullableByteValue: - nullableByteGetter = (Func)valueGetter!; - nullableIntegerGetter = (o) => (int?)nullableByteGetter(o); + nullableByteGetter = (Func?)valueGetter; + nullableIntegerGetter = (o) => nullableByteGetter == null ? null : (int?)nullableByteGetter(o); break; case JSDataSourceSchemaType.NullableDecimalValue: - nullableDecimalGetter = (Func)valueGetter!; - nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter(o); + nullableDecimalGetter = (Func?)valueGetter; + nullableFloatingPointGetter = (o) => nullableDecimalGetter == null ? null : (double?)nullableDecimalGetter(o); break; case JSDataSourceSchemaType.NullableIntValue: - nullableIntegerGetter = (Func)valueGetter!; + nullableIntegerGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.NullableShortValue: - nullableShortGetter = (Func)valueGetter!; - nullableIntegerGetter = (o) => (int?)nullableShortGetter(o); + nullableShortGetter = (Func?)valueGetter; + nullableIntegerGetter = (o) => nullableShortGetter == null ? null : (int?)nullableShortGetter(o); break; case JSDataSourceSchemaType.NullableLongValue: nullableLongGetter = (Func?)valueGetter; break; case JSDataSourceSchemaType.NullableCalendarValue: case JSDataSourceSchemaType.NullableDateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter!.GetType())) + if (valueGetter != null && typeof(Func).IsAssignableFrom(valueGetter.GetType())) { nullableDateTimeGetter = (Func)valueGetter; stringGetter = (o) => @@ -425,7 +430,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } else { - nullableDateTimeGetter = (o) => (DateTime)untypedGetter!(o); + nullableDateTimeGetter = (o) => untypedGetter == null ? default : (DateTime)untypedGetter(o); stringGetter = (o) => { var val = nullableDateTimeGetter(o); @@ -443,12 +448,19 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DecimalValue: insert = (size, column, index, item) => { + if (column.DoubleValues == null) + { + return; + } double floatVal = double.NaN; if (item != null) { if (!schema.IsPrimitive) { - floatVal = floatingPointGetter!(item); + if (floatingPointGetter != null) + { + floatVal = floatingPointGetter(item); + } } else { @@ -457,7 +469,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column.DoubleValues![index] = floatVal; + column.DoubleValues[index] = floatVal; } else { @@ -472,15 +484,22 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDecimalValue: insert = (size, column, index, item) => { + if (column.DoubleValues == null || column.NullValues == null) + { + return; + } double? floatVal = null; if (item != null) { - floatVal = nullableFloatingPointGetter!(item); + if (nullableFloatingPointGetter != null) + { + floatVal = nullableFloatingPointGetter(item); + } } if (index == size) { - column.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues![index] = floatVal == null; + column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues[index] = floatVal == null; } else { @@ -498,12 +517,19 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.ShortValue: insert = (size, column, index, item) => { + if (column.IntValues == null) + { + return; + } int intVal = int.MinValue; if (item != null) { if (!schema.IsPrimitive) { - intVal = integerGetter!(item); + if (integerGetter != null) + { + intVal = integerGetter(item); + } } else { @@ -512,7 +538,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column.IntValues![index] = intVal; + column.IntValues[index] = intVal; } else { @@ -528,15 +554,22 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableShortValue: insert = (size, column, index, item) => { + if (column.IntValues == null || column.NullValues == null) + { + return; + } int? intVal = null; if (item != null) { - intVal = nullableIntegerGetter!(item); + if (nullableIntegerGetter != null) + { + intVal = nullableIntegerGetter(item); + } } if (index == size) { - column.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues![index] = intVal == null; + column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues[index] = intVal == null; } else { @@ -551,12 +584,19 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.LongValue: insert = (size, column, index, item) => { + if (column.LongValues == null) + { + return; + } long longVal = long.MinValue; if (item != null) { if (!schema.IsPrimitive) { - longVal = longGetter!(item); + if (longGetter != null) + { + longVal = longGetter(item); + } } else { @@ -565,7 +605,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column.LongValues![index] = longVal; + column.LongValues[index] = longVal; } else { @@ -578,15 +618,22 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableLongValue: insert = (size, column, index, item) => { + if (column.LongValues == null || column.NullValues == null) + { + return; + } long? longVal = null; if (item != null) { - longVal = nullableLongGetter!(item); + if (nullableLongGetter != null) + { + longVal = nullableLongGetter(item); + } } if (index == size) { - column.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues![index] = longVal == null; + column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues[index] = longVal == null; } else { @@ -603,20 +650,27 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DateTimeValue: insert = (size, column, index, item) => { + if (column.StringValues == null) + { + return; + } string? stringVal = null; Guid idVal = Guid.Empty; if (item != null) { if (column.IsIDColumn) { - idVal = idGetter!(item); + if (idGetter != null) + { + idVal = idGetter(item); + } stringVal = _parentId != null ? _parentId + "/" + idVal.ToString() : idVal.ToString(); } else if (!schema.IsPrimitive) { try { - stringVal = stringGetter!(item); + stringVal = stringGetter != null ? stringGetter(item) : null; } catch { @@ -630,11 +684,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - if (column.StringValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.StringValues![index] = stringVal; + column.StringValues[index] = stringVal; } else { @@ -643,15 +693,11 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN column.StringValues[index] = stringVal; } - if (column.IsIDColumn) + if (column.IsIDColumn && column.IDValues != null) { if (index == size) { - if (column.IDValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.IDValues![index] = idVal; + column.IDValues[index] = idVal; } else { @@ -666,12 +712,16 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDateTimeValue: insert = (size, column, index, item) => { + if (column.StringValues == null) + { + return; + } string? stringVal = null; if (item != null) { try { - stringVal = stringGetter!(item); + stringVal = stringGetter != null ? stringGetter(item) : null; } catch { @@ -680,11 +730,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - if (column.StringValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.StringValues![index] = stringVal; + column.StringValues[index] = stringVal; } else { @@ -699,9 +745,9 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { //Console.WriteLine("shouldn't be here"); object? objVal = null; - if (item != null) + if (item != null && objectGetter != null) { - objVal = objectGetter!(item); + objVal = objectGetter(item); } if (objVal != null && column.SubColumns == null) { @@ -728,10 +774,14 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } UnmarshalledColumn[]? cols = null; if (objVal != null) { - var id = _idGetter!(item); + var id = _idGetter != null ? _idGetter(item) : Guid.Empty; var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); @@ -748,7 +798,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } if (index == size) { - column.SubDataSourceValues![index] = cols; + column.SubDataSourceValues[index] = cols; } else { @@ -764,7 +814,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Insert!(size, subColumn, index, objVal); + if (subColumn != null) + { + subColumn.Insert?.Invoke(size, subColumn, index, objVal); + } } } } @@ -784,9 +837,9 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN insert = (size, column, index, item) => { object? objVal = null; - if (item != null) + if (item != null && objectGetter != null) { - objVal = objectGetter!(item); + objVal = objectGetter(item); } if (objVal != null && column.SubColumns == null) { @@ -814,78 +867,85 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } UnmarshalledColumn[]? cols = null; if (objVal != null) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; - var subcols = sub.GetColumns(""); - - UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].ActualCount; - primcol.DataSourceID = subcols[0].DataSourceID; - primcol.PropertyPath = "___primitiveVal"; - primcol.Type = GetArrayType(newColumn.Type); - int i = 0; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.StringArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.StringValues[i] = (string)v; - i++; - } - break; - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.StringValues[i] = ((DateTime)v).ToString("o"); - i++; - } - break; - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - primcol.IntValues = new int[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.IntValues[i] = Convert.ToInt32(v); - i++; - } - break; - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - primcol.DoubleValues = new double[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.DoubleValues[i] = Convert.ToDouble(v); - i++; - } - break; - case JSDataSourceSchemaType.LongArrayValue: - primcol.LongValues = new long[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.LongValues[i] = Convert.ToInt64(v); - i++; - } - break; - } - - cols = new UnmarshalledColumn[subcols.Length + 1]; - for (i = 0; i < subcols.Length; i++) + var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); + if (sub != null) { - cols[i] = subcols[i]; + var subcols = sub.GetColumns(""); + + UnmarshalledColumn primcol = new UnmarshalledColumn(); + primcol.ActualCount = subcols[0].ActualCount; + primcol.DataSourceID = subcols[0].DataSourceID; + primcol.PropertyPath = "___primitiveVal"; + primcol.Type = GetArrayType(newColumn.Type); + int i = 0; + switch (newColumn.Type) + { + case JSDataSourceSchemaType.StringArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.StringValues[i] = (string)v; + i++; + } + break; + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.StringValues[i] = ((DateTime)v).ToString("o"); + i++; + } + break; + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + primcol.IntValues = new int[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.IntValues[i] = Convert.ToInt32(v); + i++; + } + break; + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + primcol.DoubleValues = new double[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.DoubleValues[i] = Convert.ToDouble(v); + i++; + } + break; + case JSDataSourceSchemaType.LongArrayValue: + primcol.LongValues = new long[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.LongValues[i] = Convert.ToInt64(v); + i++; + } + break; + } + + cols = new UnmarshalledColumn[subcols.Length + 1]; + for (i = 0; i < subcols.Length; i++) + { + cols[i] = subcols[i]; + } + cols[subcols.Length] = primcol; } - cols[subcols.Length] = primcol; } if (index == size) { - column.SubDataSourceValues![index] = cols; + column.SubDataSourceValues[index] = cols; } else { @@ -901,7 +961,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Insert!(size, subColumn, index, objVal); + if (subColumn != null) + { + subColumn.Insert?.Invoke(size, subColumn, index, objVal); + } } } } @@ -909,7 +972,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; } - Action? update = null; + Action? update = null; switch (newColumn.Type) { case JSDataSourceSchemaType.DoubleValue: @@ -917,12 +980,16 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DecimalValue: update = (size, column, index, oldItem, newItem) => { + if (column.DoubleValues == null) + { + return; + } double floatVal = double.NaN; - if (newItem != null) + if (newItem != null && floatingPointGetter != null) { - floatVal = floatingPointGetter!(newItem); + floatVal = floatingPointGetter(newItem); } - column.DoubleValues![index] = floatVal; + column.DoubleValues[index] = floatVal; }; break; case JSDataSourceSchemaType.NullableDoubleValue: @@ -930,13 +997,17 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDecimalValue: update = (size, column, index, oldItem, newItem) => { + if (column.DoubleValues == null || column.NullValues == null) + { + return; + } double? floatVal = null; - if (newItem != null) + if (newItem != null && nullableFloatingPointGetter != null) { - floatVal = nullableFloatingPointGetter!(newItem); + floatVal = nullableFloatingPointGetter(newItem); } - column.DoubleValues![index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues![index] = floatVal == null; + column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues[index] = floatVal == null; }; break; case JSDataSourceSchemaType.BooleanValue: @@ -945,12 +1016,16 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.ShortValue: update = (size, column, index, oldItem, newItem) => { + if (column.IntValues == null) + { + return; + } int intVal = int.MinValue; - if (newItem != null) + if (newItem != null && integerGetter != null) { - intVal = integerGetter!(newItem); + intVal = integerGetter(newItem); } - column.IntValues![index] = intVal; + column.IntValues[index] = intVal; }; break; case JSDataSourceSchemaType.NullableBooleanValue: @@ -959,36 +1034,48 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableShortValue: update = (size, column, index, oldItem, newItem) => { + if (column.IntValues == null || column.NullValues == null) + { + return; + } int? intVal = null; - if (newItem != null) + if (newItem != null && nullableIntegerGetter != null) { - intVal = nullableIntegerGetter!(newItem); + intVal = nullableIntegerGetter(newItem); } - column.IntValues![index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues![index] = intVal == null; + column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues[index] = intVal == null; }; break; case JSDataSourceSchemaType.LongValue: update = (size, column, index, oldItem, newItem) => { + if (column.LongValues == null) + { + return; + } long longVal = long.MinValue; - if (newItem != null) + if (newItem != null && longGetter != null) { - longVal = longGetter!(newItem); + longVal = longGetter(newItem); } - column.LongValues![index] = longVal; + column.LongValues[index] = longVal; }; break; case JSDataSourceSchemaType.NullableLongValue: update = (size, column, index, oldItem, newItem) => { + if (column.LongValues == null || column.NullValues == null) + { + return; + } long? longVal = null; - if (newItem != null) + if (newItem != null && nullableLongGetter != null) { - longVal = nullableLongGetter!(newItem); + longVal = nullableLongGetter(newItem); } - column.LongValues![index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues![index] = longVal == null; + column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues[index] = longVal == null; }; break; case JSDataSourceSchemaType.StringValue: @@ -996,30 +1083,37 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DateTimeValue: update = (size, column, index, oldItem, newItem) => { + if (column.StringValues == null) + { + return; + } string? stringVal = null; Guid idVal = Guid.Empty; - if (column.IsIDColumn && oldItem != newItem) + if (column.IsIDColumn && oldItem != newItem && column.IDValues != null) { - var oldId = column.IDValues![index]; + var oldId = column.IDValues[index]; OnRemoveId(oldId); } if (newItem != null) { if (column.IsIDColumn) { - idVal = idGetter!(newItem); + if (idGetter != null) + { + idVal = idGetter(newItem); + } stringVal = idVal.ToString(); } else { - stringVal = stringGetter!(newItem); + stringVal = stringGetter != null ? stringGetter(newItem) : null; } } - column.StringValues![index] = stringVal; - if (column.IsIDColumn) + column.StringValues[index] = stringVal; + if (column.IsIDColumn && column.IDValues != null) { - column.IDValues![index] = idVal; + column.IDValues[index] = idVal; } }; break; @@ -1027,27 +1121,31 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDateTimeValue: update = (size, column, index, oldItem, newItem) => { + if (column.StringValues == null) + { + return; + } string? stringVal = null; - if (newItem != null) + if (newItem != null && stringGetter != null) { - stringVal = stringGetter!(newItem); + stringVal = stringGetter(newItem); } - column.StringValues![index] = stringVal; + column.StringValues[index] = stringVal; }; break; case JSDataSourceSchemaType.ObjectValue: update = (size, column, index, oldItem, newItem) => { object? objVal = null; - if (newItem != null) + if (newItem != null && objectGetter != null) { - objVal = objectGetter!(newItem); + objVal = objectGetter(newItem); } object? oldObjVal = null; - if (oldItem != null) + if (oldItem != null && objectGetter != null) { - oldObjVal = objectGetter!(oldItem); + oldObjVal = objectGetter(oldItem); } if (objVal != null && column.SubColumns == null) @@ -1073,13 +1171,17 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } UnmarshalledColumn[]? cols = null; if (objVal != null) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper)!; - cols = sub.GetColumns(""); + var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); + cols = sub?.GetColumns(""); } - column.SubDataSourceValues![index] = cols; + column.SubDataSourceValues[index] = cols; } else { @@ -1088,7 +1190,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Update!(size, subColumn, index, oldObjVal, objVal); + if (subColumn != null) + { + subColumn.Update?.Invoke(size, subColumn, index, oldObjVal, objVal); + } } } } @@ -1108,90 +1213,97 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN update = (size, column, index, oldItem, newItem) => { object? objVal = null; - if (newItem != null) + if (newItem != null && objectGetter != null) { - objVal = objectGetter!(newItem); + objVal = objectGetter(newItem); } object? oldObjVal = null; - if (oldItem != null) + if (oldItem != null && objectGetter != null) { - oldObjVal = objectGetter!(oldItem); + oldObjVal = objectGetter(oldItem); } if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } UnmarshalledColumn[]? cols = null; if (objVal != null) { var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - var subcols = sub!.GetColumns(""); - - UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].ActualCount; - primcol.DataSourceID = subcols[0].DataSourceID; - primcol.PropertyPath = "___primitiveVal"; - primcol.Type = GetArrayType(newColumn.Type); - int i = 0; - switch (newColumn.Type) + if (sub != null) { - case JSDataSourceSchemaType.StringArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.StringValues[i] = (string)v; - i++; - } - break; - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.StringValues[i] = ((DateTime)v).ToString("o"); - i++; - } - break; - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - primcol.IntValues = new int[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.IntValues[i] = Convert.ToInt32(v); - i++; - } - break; - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - primcol.DoubleValues = new double[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.DoubleValues[i] = Convert.ToDouble(v); - i++; - } - break; - case JSDataSourceSchemaType.LongArrayValue: - primcol.LongValues = new long[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)!) - { - primcol.LongValues[i] = Convert.ToInt64(v); - i++; - } - break; + var subcols = sub.GetColumns(""); + + UnmarshalledColumn primcol = new UnmarshalledColumn(); + primcol.ActualCount = subcols[0].ActualCount; + primcol.DataSourceID = subcols[0].DataSourceID; + primcol.PropertyPath = "___primitiveVal"; + primcol.Type = GetArrayType(newColumn.Type); + int i = 0; + switch (newColumn.Type) + { + case JSDataSourceSchemaType.StringArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.StringValues[i] = (string)v; + i++; + } + break; + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.StringValues[i] = ((DateTime)v).ToString("o"); + i++; + } + break; + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + primcol.IntValues = new int[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.IntValues[i] = Convert.ToInt32(v); + i++; + } + break; + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + primcol.DoubleValues = new double[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.DoubleValues[i] = Convert.ToDouble(v); + i++; + } + break; + case JSDataSourceSchemaType.LongArrayValue: + primcol.LongValues = new long[primcol.ActualCount]; + foreach (var v in ((IEnumerable)objVal)) + { + primcol.LongValues[i] = Convert.ToInt64(v); + i++; + } + break; + } + + cols = new UnmarshalledColumn[subcols.Length + 1]; + for (i = 0; i < subcols.Length; i++) + { + cols[i] = subcols[i]; + } + cols[subcols.Length] = primcol; } - - cols = new UnmarshalledColumn[subcols.Length + 1]; - for (i = 0; i < subcols.Length; i++) - { - cols[i] = subcols[i]; - } - cols[subcols.Length] = primcol; } - column.SubDataSourceValues![index] = cols; + column.SubDataSourceValues[index] = cols; } else { @@ -1200,7 +1312,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Update!(size, subColumn, index, oldItem, newItem); + if (subColumn != null) + { + subColumn.Update?.Invoke(size, subColumn, index, oldItem, newItem); + } } } } @@ -1216,9 +1331,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DecimalValue: remove = (size, column, index) => { + if (column.DoubleValues == null) + { + return; + } if (index == (size - 1)) { - column.DoubleValues![index] = double.NaN; + column.DoubleValues[index] = double.NaN; } else { @@ -1232,10 +1351,14 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDecimalValue: remove = (size, column, index) => { + if (column.DoubleValues == null || column.NullValues == null) + { + return; + } if (index == (size - 1)) { - column.DoubleValues![index] = double.NaN; - column.NullValues![index] = false; + column.DoubleValues[index] = double.NaN; + column.NullValues[index] = false; } else { @@ -1252,9 +1375,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.ShortValue: remove = (size, column, index) => { + if (column.IntValues == null) + { + return; + } if (index == (size - 1)) { - column.IntValues![index] = 0; + column.IntValues[index] = 0; } else { @@ -1269,10 +1396,14 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableShortValue: remove = (size, column, index) => { + if (column.IntValues == null || column.NullValues == null) + { + return; + } if (index == (size - 1)) { - column.IntValues![index] = 0; - column.NullValues![index] = false; + column.IntValues[index] = 0; + column.NullValues[index] = false; } else { @@ -1286,9 +1417,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.LongValue: remove = (size, column, index) => { + if (column.LongValues == null) + { + return; + } if (index == (size - 1)) { - column.LongValues![index] = 0; + column.LongValues[index] = 0; } else { @@ -1300,10 +1435,14 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableLongValue: remove = (size, column, index) => { + if (column.LongValues == null || column.NullValues == null) + { + return; + } if (index == (size - 1)) { - column.LongValues![index] = 0; - column.NullValues![index] = false; + column.LongValues[index] = 0; + column.NullValues[index] = false; } else { @@ -1319,26 +1458,30 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DateTimeValue: remove = (size, column, index) => { - if (column.IsIDColumn) + if (column.StringValues == null) + { + return; + } + if (column.IsIDColumn && column.IDValues != null) { - var oldId = column.IDValues![index]; + var oldId = column.IDValues[index]; OnRemoveId(oldId); } if (index == (size - 1)) { - column.StringValues![index] = null; + column.StringValues[index] = null; } else { Array.Copy(column.StringValues, index + 1, column.StringValues, index, (size - 1) - index); column.StringValues[size - 1] = null; } - if (column.IsIDColumn) + if (column.IsIDColumn && column.IDValues != null) { if (index == (size - 1)) { - column.IDValues![index] = Guid.Empty; + column.IDValues[index] = Guid.Empty; } else { @@ -1352,9 +1495,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDateTimeValue: remove = (size, column, index) => { + if (column.StringValues == null) + { + return; + } if (index == (size - 1)) { - column.StringValues![index] = null; + column.StringValues[index] = null; } else { @@ -1379,9 +1526,13 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } if (index == (size - 1)) { - column.SubDataSourceValues![index] = null; + column.SubDataSourceValues[index] = null; } else { @@ -1396,7 +1547,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Remove!(size, subColumn, index); + if (subColumn != null) + { + subColumn.Remove?.Invoke(size, subColumn, index); + } } } } @@ -1412,6 +1566,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DecimalValue: clear = (size, column) => { + if (column.DoubleValues == null) + { + return; + } Array.Clear(column.DoubleValues, 0, size); }; break; @@ -1420,6 +1578,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDecimalValue: clear = (size, column) => { + if (column.DoubleValues == null || column.NullValues == null) + { + return; + } Array.Clear(column.DoubleValues, 0, size); Array.Clear(column.NullValues, 0, size); }; @@ -1430,6 +1592,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.ShortValue: clear = (size, column) => { + if (column.IntValues == null) + { + return; + } Array.Clear(column.IntValues, 0, size); }; break; @@ -1439,6 +1605,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableShortValue: clear = (size, column) => { + if (column.IntValues == null || column.NullValues == null) + { + return; + } Array.Clear(column.IntValues, 0, size); Array.Clear(column.NullValues, 0, size); }; @@ -1446,12 +1616,20 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.LongValue: clear = (size, column) => { + if (column.LongValues == null) + { + return; + } Array.Clear(column.LongValues, 0, size); }; break; case JSDataSourceSchemaType.NullableLongValue: clear = (size, column) => { + if (column.LongValues == null || column.NullValues == null) + { + return; + } Array.Clear(column.LongValues, 0, size); Array.Clear(column.NullValues, 0, size); }; @@ -1461,16 +1639,20 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.DateTimeValue: clear = (size, column) => { - if (column.IsIDColumn) + if (column.StringValues == null) + { + return; + } + if (column.IsIDColumn && column.IDValues != null) { for (var i = 0; i < size; i++) { - OnRemoveId(column.IDValues![i]); + OnRemoveId(column.IDValues[i]); } } Array.Clear(column.StringValues, 0, size); - if (column.IsIDColumn) + if (column.IsIDColumn && column.IDValues != null) { Array.Clear(column.IDValues, 0, size); } @@ -1480,6 +1662,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN case JSDataSourceSchemaType.NullableDateTimeValue: clear = (size, column) => { + if (column.StringValues == null) + { + return; + } Array.Clear(column.StringValues, 0, size); }; break; @@ -1499,6 +1685,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN { if (column.IsSubDataSource) { + if (column.SubDataSourceValues == null) + { + return; + } Array.Clear(column.SubDataSourceValues, 0, size); } else @@ -1508,7 +1698,10 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN for (var i = 0; i < column.SubColumns.Length; i++) { var subColumn = column.SubColumns[i]; - subColumn!.Clear!(size, subColumn); + if (subColumn != null) + { + subColumn.Clear?.Invoke(size, subColumn); + } } } } @@ -1601,32 +1794,52 @@ internal UnmarshalledColumn[] GetColumns(string refName) public void SendClear(string containerId, string refName) { - _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceClear", containerId + ":" + refName, -1, GetColumns(refName)); + if (_helper == null) + { + return; + } + _helper.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceClear", containerId + ":" + refName, -1, GetColumns(refName)); } public void SendRemove(string containerId, string refName, int index) { - _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceRemove", containerId + ":" + refName, index, GetColumns(refName)); + if (_helper == null) + { + return; + } + _helper.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceRemove", containerId + ":" + refName, index, GetColumns(refName)); } public void SendInsert(string containerId, string refName, int index) { - _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceInsert", containerId + ":" + refName, index, GetColumns(refName)); + if (_helper == null) + { + return; + } + _helper.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceInsert", containerId + ":" + refName, index, GetColumns(refName)); } public void SendUpdate(string containerId, string refName, int index, bool syncDataOnly) { - _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceUpdate", containerId + ":" + refName + ":" + (syncDataOnly ? "true" : "false"), index, GetColumns(refName)); + if (_helper == null) + { + return; + } + _helper.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceUpdate", containerId + ":" + refName + ":" + (syncDataOnly ? "true" : "false"), index, GetColumns(refName)); } public void SendCreate(string containerId, string refName, string? dataIntents) { + if (_helper == null) + { + return; + } if (dataIntents != null) { //Console.WriteLine("sending create data intents"); - _helper!.SendUnmarshalledColumnDataIntentsMessage("igUnmarshalledDataSourceCreateDataIntents", containerId + ":" + refName, dataIntents); + _helper.SendUnmarshalledColumnDataIntentsMessage("igUnmarshalledDataSourceCreateDataIntents", containerId + ":" + refName, dataIntents); } - _helper!.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceCreate", containerId + ":" + refName, -1, GetColumns(refName)); + _helper.SendUnmarshalledColumnMessage("igUnmarshalledDataSourceCreate", containerId + ":" + refName, -1, GetColumns(refName)); } private void OnRemoveId(Guid oldId) @@ -1942,6 +2155,11 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg return; } + if (_manager == null) + { + return; + } + switch (e.Action) { case NotifyCollectionChangedAction.Add: @@ -1951,7 +2169,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -1968,7 +2186,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -1985,7 +2203,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.OldItems.Count; i++) { var item = e.OldItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -1998,7 +2216,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg for (var i = 0; i < e.NewItems.Count; i++) { var item = e.NewItems[i]; - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -2010,7 +2228,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg } case NotifyCollectionChangedAction.Reset: { - var refName = _manager!.GetRefId(_originalData); + var refName = _manager.GetRefId(_originalData); if (refName == null) { return; @@ -2272,7 +2490,7 @@ private void InsertItemAt(object? item, int index, JSDataSourceSchema? schema, U continue; } //Console.WriteLine(column.PropertyName); - column.Insert!(_size, column, index, item); + column.Insert?.Invoke(_size, column, index, item); } _size++; @@ -2288,8 +2506,11 @@ private void UpdateItemAt(object? oldItem, object? newItem, int index, JSDataSou for (var i = 0; i < columns.Length; i++) { var column = columns[i]; - - column!.Update!(_size, column, index, oldItem!, newItem!); + if (column == null) + { + continue; + } + column.Update?.Invoke(_size, column, index, oldItem, newItem); } } @@ -2363,7 +2584,7 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; var isEmpty = item != null && ((IList)item).Count == 0; - if (isEmpty && GetIListTypeArg(item!.GetType()) != null) + if (isEmpty && item != null && GetIListTypeArg(item.GetType()) != null) { var eleType = GetIListTypeArg(item.GetType()); s.ItemSchema = ExtractSchemaFromType(eleType); @@ -2438,7 +2659,11 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) { - if (itemType!.IsArray) + if (itemType == null) + { + return JSDataSourceSchema.Create(typeof(object)); + } + if (itemType.IsArray) { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; diff --git a/src/componentsBase/WebInputs/Input.cs b/src/componentsBase/WebInputs/Input.cs index ba4037e6..ada831af 100644 --- a/src/componentsBase/WebInputs/Input.cs +++ b/src/componentsBase/WebInputs/Input.cs @@ -9,7 +9,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbInputBase : BaseRendererControl { [Inject] - internal ILogger Logger { get; set; } = default!; + internal ILogger? Logger { get; set; } private void EnsureInputOcurredHandled() { @@ -67,7 +67,7 @@ public override Task SetParametersAsync(ParameterView parameters) parameters.TryGetValue("Readonly", out object? result); if (result != null && result is string value) { - Logger.LogWarning("Readonly has been renamed, use ReadOnly instead"); + Logger?.LogWarning("Readonly has been renamed, use ReadOnly instead"); var updatedParams = parameters.ToDictionary().ToDictionary(kvp => kvp.Key, kvp => kvp.Value); bool.TryParse(value, out var coerced); updatedParams["Readonly"] = coerced; @@ -95,7 +95,7 @@ private ParameterView TryCoerceRenamedNumericProp(ParameterView parameters, stri parameters.TryGetValue(oldName, out object? result); if (result != null && result is string value) { - Logger.LogWarning($"{oldName} has been renamed, use {newName} instead"); + Logger?.LogWarning($"{oldName} has been renamed, use {newName} instead"); var updatedParams = parameters.ToDictionary().ToDictionary(kvp => kvp.Key, kvp => kvp.Value); if (double.TryParse(value, out var coerced)) { diff --git a/src/componentsBase/WebInputs/Rating.cs b/src/componentsBase/WebInputs/Rating.cs index a999ce2d..be110967 100644 --- a/src/componentsBase/WebInputs/Rating.cs +++ b/src/componentsBase/WebInputs/Rating.cs @@ -7,7 +7,7 @@ namespace IgniteUI.Blazor.Controls public partial class IgbRating { [Inject] - private ILogger Logger { get; set; } = default!; + private ILogger? Logger { get; set; } /// public override Task SetParametersAsync(ParameterView parameters) @@ -17,7 +17,7 @@ public override Task SetParametersAsync(ParameterView parameters) parameters.TryGetValue("Readonly", out object? result); if (result != null && result is string value) { - Logger.LogWarning("Readonly has been renamed, use ReadOnly instead"); + Logger?.LogWarning("Readonly has been renamed, use ReadOnly instead"); var updatedParams = parameters.ToDictionary().ToDictionary(kvp => kvp.Key, kvp => kvp.Value); bool.TryParse(value, out var coerced); updatedParams["Readonly"] = coerced; diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs index ce8eee09..baafc91e 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs @@ -1,4 +1,4 @@ -using System.Data; +using System.Data; using System.Reflection; using IgniteUI.Blazor.Controls; using Microsoft.AspNetCore.Components; @@ -185,7 +185,8 @@ public static object CreateRenderFragmentForType(Type propertyType, object value } // Invoke the generic method to create RenderFragment - return methodInfo.Invoke(null, new object[] { value })!; + var renderFragment = methodInfo.Invoke(null, new object[] { value }); + return renderFragment ?? throw new InvalidOperationException($"Cannot create RenderFragment for type '{propertyType.Name}'."); } private static RenderFragment CreateTypedRenderFragment(T value) diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs index 8e3bb6cd..cd17c8df 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using IgniteUI.Blazor.Controls; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 30528983..2db7bf7a 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -20,8 +20,14 @@ public class ComboTests : ComponentWithContractTestBase> // JsonDataSourceItem.ToJson's "___id" marker), assigned once item is added to DS. internal static string DataItemId(InteropHarness interop, IRenderedComponent cut, int index) { - var items = interop.FindPropertyUpdate(interop.ContainerIdOf(cut), "data")!.Value.EnumerateArray().ToArray(); - return items[index].GetProperty("___id").GetString()!; + var dataUpdate = interop.FindPropertyUpdate(interop.ContainerIdOf(cut), "data"); + if (dataUpdate is not { } data) + { + return string.Empty; + } + + var items = data.EnumerateArray().ToArray(); + return items[index].GetProperty("___id").GetString() ?? string.Empty; } internal static string UuidRef(InteropHarness interop, IRenderedComponent cut, int index) => From bc12dd80afcf4620fc22fc0cffdda4150e5ebdb0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Sep 2026 13:55:13 +0000 Subject: [PATCH 48/64] Initial plan From db82c38bf244b195e87e6e9ee22f54c454f6e397 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:11:41 +0000 Subject: [PATCH 49/64] Fix null component TCS race in dynamic content Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com> --- src/componentsBase/DynamicContentHolder.cs | 18 ++++++--- .../DynamicContentHolderTests.cs | 40 +++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 tests/IgniteUI.Blazor.Tests/DynamicContentHolderTests.cs diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 2289138f..720c8ec1 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -184,9 +184,13 @@ protected override void OnComponentChanged(object? oldValue, object? component) foreach (var item in toSignal) { - if (Component != null) + if (component != null) + { + item.SetResult(component); + } + else { - item.SetResult(Component); + item.SetException(new InvalidOperationException("Component is null.")); } } } @@ -211,13 +215,17 @@ public Task GetInstanceAsync() } } - if (component != null && toSignal != null) + if (toSignal != null) { foreach (var item in toSignal) { - if (Component != null) + if (component != null) + { + item.SetResult(component); + } + else { - item.SetResult(Component); + item.SetException(new InvalidOperationException("Component is null.")); } } } diff --git a/tests/IgniteUI.Blazor.Tests/DynamicContentHolderTests.cs b/tests/IgniteUI.Blazor.Tests/DynamicContentHolderTests.cs new file mode 100644 index 00000000..d3a96d0f --- /dev/null +++ b/tests/IgniteUI.Blazor.Tests/DynamicContentHolderTests.cs @@ -0,0 +1,40 @@ +using IgniteUI.Blazor.Controls; + +namespace IgniteUI.Blazor.Tests; + +public class DynamicContentHolderTests +{ + [Fact] + public async Task TypedDynamicContent_WhenComponentIsSetAfterGetInstanceAsync_ReturnsCurrentComponent() + { + var content = new TypedDynamicContent(typeof(TestComponent)) + { + ControlType = typeof(TestComponent) + }; + var task = content.GetInstanceAsync(); + + var component = new TestComponent(); + content.Component = component; + + Assert.Same(component, await task); + } + + [Fact] + public async Task TypedDynamicContent_WhenComponentChangesToNull_FaultsPendingTask() + { + var content = new TypedDynamicContent(typeof(TestComponent)) + { + ControlType = typeof(TestComponent) + }; + var task = content.GetInstanceAsync(); + + content.Component = null; + + var exception = await Assert.ThrowsAsync(() => task); + Assert.Equal("Component is null.", exception.Message); + } + + private sealed class TestComponent + { + } +} From 7e8e8edc82ea4abc8c736c920e5a38f6eb37eb0e Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Tue, 1 Sep 2026 18:23:12 +0300 Subject: [PATCH 50/64] Adjust to wc api. --- src/components/Blazor/Input.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index d448c3f0..309610b3 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -171,14 +171,14 @@ public string? Pattern } } - private double _minLength = 0; + private double? _minLength = 0; /// /// The minimum string length required by the control. /// [Parameter] [WCAttributeName("minlength")] - public double MinLength + public double? MinLength { get { return this._minLength; } set @@ -191,14 +191,14 @@ public double MinLength } } - private double _maxLength = 0; + private double? _maxLength = 0; /// /// The maximum string length of the control. /// [Parameter] [WCAttributeName("maxlength")] - public double MaxLength + public double? MaxLength { get { return this._maxLength; } set @@ -211,13 +211,13 @@ public double MaxLength } } - private double _min = 0; + private double? _min = 0; /// /// The min attribute of the control. /// [Parameter] - public double Min + public double? Min { get { return this._min; } set @@ -230,13 +230,13 @@ public double Min } } - private double _max = 0; + private double? _max = null; /// /// The max attribute of the control. /// [Parameter] - public double Max + public double? Max { get { return this._max; } set @@ -249,13 +249,13 @@ public double Max } } - private double _step = 0; + private double? _step = 0; /// /// The step attribute of the control. /// [Parameter] - public double Step + public double? Step { get { return this._step; } set From a473f1785f5db60d92e32a5041e4c02003bd6c90 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 2 Sep 2026 11:24:55 +0300 Subject: [PATCH 51/64] refactor: update DateRangePicker resource strings to support nullable types --- .../Blazor/DateRangePickerResourceStrings.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/Blazor/DateRangePickerResourceStrings.cs b/src/components/Blazor/DateRangePickerResourceStrings.cs index 5ba3f419..98de47b4 100644 --- a/src/components/Blazor/DateRangePickerResourceStrings.cs +++ b/src/components/Blazor/DateRangePickerResourceStrings.cs @@ -11,12 +11,12 @@ public partial class IgbDateRangePickerResourceStrings : IgbCalendarResourceStri /// public override string Type { get { return "WebDateRangePickerResourceStrings"; } } - private string _separator; + private string? _separator; /// /// The text shown between the start and end inputs when the date range picker is configured with separate inputs. /// [Parameter] - public string Separator + public string? Separator { get { return this._separator; } set @@ -30,13 +30,13 @@ public string Separator } } - private string _doneButton; + private string? _doneButton; /// /// Text for the button that commits the range selection when the picker is in dialog mode. /// [Parameter] [WCWidgetMemberName("done")] - public string DoneButton + public string? DoneButton { get { return this._doneButton; } set @@ -50,13 +50,13 @@ public string DoneButton } } - private string _cancelButton; + private string? _cancelButton; /// /// Text for the button that cancels the range selection when the picker is in dialog mode. /// [Parameter] [WCWidgetMemberName("cancel")] - public string CancelButton + public string? CancelButton { get { return this._cancelButton; } set @@ -70,12 +70,12 @@ public string CancelButton } } - private string _last7Days; + private string? _last7Days; /// /// Text for the preset range button that selects the last 7 days. /// [Parameter] - public string Last7Days + public string? Last7Days { get { return this._last7Days; } set @@ -89,12 +89,12 @@ public string Last7Days } } - private string _last30Days; + private string? _last30Days; /// /// Text for the preset range button that selects the last 30 days. /// [Parameter] - public string Last30Days + public string? Last30Days { get { return this._last30Days; } set @@ -108,12 +108,12 @@ public string Last30Days } } - private string _currentMonth; + private string? _currentMonth; /// /// Text for the preset range button that selects the current month. /// [Parameter] - public string CurrentMonth + public string? CurrentMonth { get { return this._currentMonth; } set @@ -127,12 +127,12 @@ public string CurrentMonth } } - private string _yearToDate; + private string? _yearToDate; /// /// Text for the preset range button that selects from the start of the current year to today. /// [Parameter] - public string YearToDate + public string? YearToDate { get { return this._yearToDate; } set From 276f875456525b7a5702422002f21df0853c18e0 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 2 Sep 2026 15:11:36 +0300 Subject: [PATCH 52/64] chore: update changelog with breaking changes for public API nullability --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de7eb98a..ba04e130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Breaking Changes + +#### Public API nullability + +The following public members changed from nullable to non-nullable. Value-type changes (e.g. `DateTime?` → `DateTime`, `double?` → `double`) are binary-breaking; reference-type changes tighten the nullability contract and may introduce nullable warnings for consumers. + +| Type | Member | Before | After | +|------|--------|--------|-------| +| `IgbDatePicker` | `Value` | `DateTime?` | `DateTime` | +| `IgbDatePicker` | `Min` | `DateTime?` | `DateTime` | +| `IgbDatePicker` | `Max` | `DateTime?` | `DateTime` | +| `IgbDatePicker` | `GetCurrentValue()` | `DateTime?` | `DateTime` | +| `IgbDatePicker` | `GetCurrentValueAsync()` | `Task` | `Task` | +| `IgbDatePicker` | `ValueChanged` | `EventCallback` | `EventCallback` | +| `IgbDateTimeInput` | `Value` | `DateTime?` | `DateTime` | +| `IgbDateTimeInput` | `GetCurrentValue()` | `DateTime?` | `DateTime` | +| `IgbDateTimeInput` | `GetCurrentValueAsync()` | `Task` | `Task` | +| `IgbDateTimeInput` | `ValueChanged` | `EventCallback` | `EventCallback` | +| `IgbDateTimeInputBase` | `Min` | `DateTime?` | `DateTime` | +| `IgbDateTimeInputBase` | `Max` | `DateTime?` | `DateTime` | +| `IgbDateRangePicker` | `Min` | `DateTime?` | `DateTime` | +| `IgbDateRangePicker` | `Max` | `DateTime?` | `DateTime` | +| `IgbTile` | `ColStart` | `double?` | `double` | +| `IgbTile` | `RowStart` | `double?` | `double` | +| `CalendarBase` (calendar-based components) | `SpecialDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | +| `CalendarBase` (calendar-based components) | `DisabledDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | +| `RendererSerializer` | `AddDateTimeProp(string, DateTime?)` | `DateTime?` (param) | `DateTime` (param) | + ## 0.1.0 - 2026-07-14 This release updates the Ignite UI for Blazor to the latest [igniteui-webcomponents@7.2.4 release](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/7.2.4) and matching related changes from `IgniteUI.Blazor` [25.2.77 (March 2026)](https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-changelog-dv-blazor#25277-march-2026), [25.2.102 (May 2026)](https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-changelog-dv-blazor#252102-may-2026) and [26.1.51 (June 2026)](https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-changelog-dv-blazor#26151-june-2026) with highlights noted below: From 1b9fe3a6c8ff772ec01acdc36503ce0b573e52c7 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 2 Sep 2026 15:40:50 +0300 Subject: [PATCH 53/64] Remove base classes and RenderSerializer. --- CHANGELOG.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba04e130..e31795ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,15 +25,14 @@ The following public members changed from nullable to non-nullable. Value-type c | `IgbDateTimeInput` | `GetCurrentValue()` | `DateTime?` | `DateTime` | | `IgbDateTimeInput` | `GetCurrentValueAsync()` | `Task` | `Task` | | `IgbDateTimeInput` | `ValueChanged` | `EventCallback` | `EventCallback` | -| `IgbDateTimeInputBase` | `Min` | `DateTime?` | `DateTime` | -| `IgbDateTimeInputBase` | `Max` | `DateTime?` | `DateTime` | +| `IgbDateTimeInput` | `Min` | `DateTime?` | `DateTime` | +| `IgbDateTimeInput` | `Max` | `DateTime?` | `DateTime` | | `IgbDateRangePicker` | `Min` | `DateTime?` | `DateTime` | | `IgbDateRangePicker` | `Max` | `DateTime?` | `DateTime` | | `IgbTile` | `ColStart` | `double?` | `double` | | `IgbTile` | `RowStart` | `double?` | `double` | -| `CalendarBase` (calendar-based components) | `SpecialDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | -| `CalendarBase` (calendar-based components) | `DisabledDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | -| `RendererSerializer` | `AddDateTimeProp(string, DateTime?)` | `DateTime?` (param) | `DateTime` (param) | +| `IgbCalendar` | `SpecialDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | +| `IgbCalendar` | `DisabledDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | ## 0.1.0 - 2026-07-14 From fc104bebd433699ec89946c70709d1b05a8d9858 Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Wed, 2 Sep 2026 15:52:57 +0300 Subject: [PATCH 54/64] chore: update changelog to clarify public API nullability changes --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e31795ac..2120e847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Public API nullability -The following public members changed from nullable to non-nullable. Value-type changes (e.g. `DateTime?` → `DateTime`, `double?` → `double`) are binary-breaking; reference-type changes tighten the nullability contract and may introduce nullable warnings for consumers. +> [!NOTE] +> As part of this release the public API was annotated for nullable reference types. Beyond the members listed below, many reference-type parameters, properties, and return values had their nullability contract tightened (`T?` → `T`). Consumers building with nullable reference types enabled may see new nullable warnings — or errors, if warnings are treated as errors — and may need to update their code accordingly. + +The following public members changed from nullable to non-nullable. Value-type changes (e.g. `DateTime?` → `DateTime`, `double?` → `double`) are binary-breaking. | Type | Member | Before | After | |------|--------|--------|-------| From 49c709f0e3ddbf5da03c6d49853ca203ef8dc08e Mon Sep 17 00:00:00 2001 From: Maya Kirova Date: Thu, 10 Sep 2026 09:47:05 +0300 Subject: [PATCH 55/64] Address comments. --- src/componentsBase/MarshalByValueFactory.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/componentsBase/MarshalByValueFactory.cs b/src/componentsBase/MarshalByValueFactory.cs index f19a08da..09bd91e4 100644 --- a/src/componentsBase/MarshalByValueFactory.cs +++ b/src/componentsBase/MarshalByValueFactory.cs @@ -154,10 +154,7 @@ internal static bool MustMarshalByValue(string? typeName) break; case "ActiveStepChangedEventArgs": case "WebActiveStepChangedEventArgs": - return new IgbActiveStepChangedEventArgs - { - Detail = new IgbActiveStepChangedEventArgsDetail() - }; + return new IgbActiveStepChangedEventArgs(); break; case "ActiveStepChangedEventArgsDetail": case "WebActiveStepChangedEventArgsDetail": From 2aab6c27fb2592052ad3f60a8fd93a22e73241b9 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Thu, 10 Sep 2026 19:28:50 +0300 Subject: [PATCH 56/64] Keep the date picker members nullable as in 0.1.0 The full product made IgbDatePicker and IgbDateTimeInput Value, Min and Max nullable in 25.1.63, the shipped item templates bind a DateTime? field, and null is the only way to clear the element from Blazor. Generic value binding and EditForm integration for the date components are a separate change. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 16 +---------- src/components/Blazor/DatePicker.cs | 28 ++++++++++---------- src/components/Blazor/DateRangePicker.cs | 8 +++--- src/components/Blazor/DateTimeInput.cs | 20 +++++++------- src/components/Blazor/DateTimeInputBase.cs | 8 +++--- src/componentsBase/RendererSerializer.cs | 4 +-- src/componentsBase/UnmarshalledDataSource.cs | 14 +++++----- 7 files changed, 42 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2120e847..f96ee48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,24 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > [!NOTE] > As part of this release the public API was annotated for nullable reference types. Beyond the members listed below, many reference-type parameters, properties, and return values had their nullability contract tightened (`T?` → `T`). Consumers building with nullable reference types enabled may see new nullable warnings — or errors, if warnings are treated as errors — and may need to update their code accordingly. -The following public members changed from nullable to non-nullable. Value-type changes (e.g. `DateTime?` → `DateTime`, `double?` → `double`) are binary-breaking. +The following public members changed from nullable to non-nullable. Value-type changes (`double?` → `double`) are binary-breaking. | Type | Member | Before | After | |------|--------|--------|-------| -| `IgbDatePicker` | `Value` | `DateTime?` | `DateTime` | -| `IgbDatePicker` | `Min` | `DateTime?` | `DateTime` | -| `IgbDatePicker` | `Max` | `DateTime?` | `DateTime` | -| `IgbDatePicker` | `GetCurrentValue()` | `DateTime?` | `DateTime` | -| `IgbDatePicker` | `GetCurrentValueAsync()` | `Task` | `Task` | -| `IgbDatePicker` | `ValueChanged` | `EventCallback` | `EventCallback` | -| `IgbDateTimeInput` | `Value` | `DateTime?` | `DateTime` | -| `IgbDateTimeInput` | `GetCurrentValue()` | `DateTime?` | `DateTime` | -| `IgbDateTimeInput` | `GetCurrentValueAsync()` | `Task` | `Task` | -| `IgbDateTimeInput` | `ValueChanged` | `EventCallback` | `EventCallback` | -| `IgbDateTimeInput` | `Min` | `DateTime?` | `DateTime` | -| `IgbDateTimeInput` | `Max` | `DateTime?` | `DateTime` | -| `IgbDateRangePicker` | `Min` | `DateTime?` | `DateTime` | -| `IgbDateRangePicker` | `Max` | `DateTime?` | `DateTime` | | `IgbTile` | `ColStart` | `double?` | `double` | | `IgbTile` | `RowStart` | `double?` | `double` | | `IgbCalendar` | `SpecialDates` | `IgbDateRangeDescriptor[]?` | `IgbDateRangeDescriptor[]` | diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 452c2eb6..c1dc60fe 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -112,13 +112,13 @@ public bool ReadOnly } } - private DateTime _value = DateTime.MinValue; + private DateTime? _value = DateTime.MinValue; /// /// The value of the picker. /// [Parameter] - public DateTime Value + public DateTime? Value { get { return this._value; } set @@ -135,7 +135,7 @@ public DateTime Value /// /// Gets the current value of the picker. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -144,7 +144,7 @@ public async Task GetCurrentValueAsync() /// /// Gets the current value of the picker. /// - public DateTime GetCurrentValue() + public DateTime? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -169,13 +169,13 @@ public DateTime ActiveDate } } - private DateTime _min = DateTime.MinValue; + private DateTime? _min = DateTime.MinValue; /// /// The minimum value required for the date picker to remain valid. /// [Parameter] - public DateTime Min + public DateTime? Min { get { return this._min; } set @@ -188,13 +188,13 @@ public DateTime Min } } - private DateTime _max = DateTime.MinValue; + private DateTime? _max = DateTime.MinValue; /// /// The maximum value required for the date picker to remain valid. /// [Parameter] - public DateTime Max + public DateTime? Max { get { return this._max; } set @@ -690,18 +690,18 @@ public void SetCustomValidity(String message) InvokeMethodSync("setCustomValidity", new object?[] { StringToString(message) }, new string[] { "String" }); } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -1062,10 +1062,10 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime); + var newValueValue = default(DateTime?); { - newValueValue = (DateTime)(args.Detail); + newValueValue = (DateTime?)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. @@ -1078,7 +1078,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Value"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 310fcbb2..82ba4ddc 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -448,13 +448,13 @@ public string? InputFormat } } - private DateTime _min = DateTime.MinValue; + private DateTime? _min = DateTime.MinValue; /// /// The minimum value required for the date range picker to remain valid. /// [Parameter] - public DateTime Min + public DateTime? Min { get { return this._min; } set @@ -467,13 +467,13 @@ public DateTime Min } } - private DateTime _max = DateTime.MinValue; + private DateTime? _max = DateTime.MinValue; /// /// The maximum value required for the date range picker to remain valid. /// [Parameter] - public DateTime Max + public DateTime? Max { get { return this._max; } set diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index 1c9416db..6ccefece 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -35,13 +35,13 @@ protected override bool SupportsVisualChildren } } - private DateTime _value = DateTime.MinValue; + private DateTime? _value = DateTime.MinValue; /// /// The value of the input. /// [Parameter] - public DateTime Value + public DateTime? Value { get { return this._value; } set @@ -58,7 +58,7 @@ public DateTime Value /// /// Returns the current value of the input. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -67,7 +67,7 @@ public async Task GetCurrentValueAsync() /// /// Returns the current value of the input. /// - public DateTime GetCurrentValue() + public DateTime? GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToDate(iv); @@ -120,18 +120,18 @@ public void Clear() InvokeMethodSync("clear", new object?[] { }, new string[] { }); } - private EventCallback? _valueChanged = null; + private EventCallback? _valueChanged = null; /// /// Emitted when the Value property changes. /// Enables two-way binding through @bind-Value. /// [Parameter] - public EventCallback ValueChanged + public EventCallback ValueChanged { get { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; } set { @@ -276,10 +276,10 @@ public EventCallback Change _change = value; this.SetHandler(this.Name, "Change", value, (args) => { - var newValueValue = default(DateTime); + var newValueValue = default(DateTime?); { - newValueValue = (DateTime)(args.Detail); + newValueValue = (DateTime?)(args.Detail); if (UseDirectRender) { //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. @@ -292,7 +292,7 @@ public EventCallback Change OnPropertyPropagatedOut(Name, "Value"); } - if (!EventCallback.Empty.Equals(ValueChanged)) + if (!EventCallback.Empty.Equals(ValueChanged)) { var task = ValueChanged.InvokeAsync(newValueValue); if (task.Exception != null) diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index 122f9bd3..6f67e68b 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -107,13 +107,13 @@ public string? InputFormat } } - private DateTime _min = DateTime.MinValue; + private DateTime? _min = DateTime.MinValue; /// /// The minimum value required for the input to remain valid. /// [Parameter] - public DateTime Min + public DateTime? Min { get { return this._min; } set @@ -126,13 +126,13 @@ public DateTime Min } } - private DateTime _max = DateTime.MinValue; + private DateTime? _max = DateTime.MinValue; /// /// The maximum value required for the input to remain valid. /// [Parameter] - public DateTime Max + public DateTime? Max { get { return this._max; } set diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 8aeb5455..ba0fcf42 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -349,7 +349,7 @@ public void AddNumberProp(String propertyName, Object? value) //_properties.Add("\"" + propertyName + "\"" + ": " + Convert.ToString(value, CultureInfo.InvariantCulture)); } - public void AddDateTimeProp(String propertyName, DateTime value) + public void AddDateTimeProp(String propertyName, DateTime? value) { if (_context.Filter != null) { @@ -358,7 +358,7 @@ public void AddDateTimeProp(String propertyName, DateTime value) return; } } - _context.Writer.WriteString(propertyName, value.ToString("o")); + _context.Writer.WriteString(propertyName, value != null ? value.Value.ToString("o") : null); //_properties.Add("\"" + propertyName + "\"" + ": \"" + value.ToString("o") + "\""); } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index 697f0df2..fc29e707 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -286,7 +286,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN Func? decimalGetter = null; Func? shortGetter = null; Func? longGetter = null; - Func? stringGetter = null; + Func? stringGetter = null; Func? dateTimeGetter = null; Func? objectGetter = null; @@ -301,7 +301,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN Func? nullableDecimalGetter = null; Func? nullableBoolGetter = null; Func? nullableByteGetter = null; - Func? nullableDateTimeGetter = null; + Func? nullableDateTimeGetter = null; Func? nullableFloatingPointGetter = null; switch (newColumn.Type) @@ -420,22 +420,22 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN break; case JSDataSourceSchemaType.NullableCalendarValue: case JSDataSourceSchemaType.NullableDateTimeValue: - if (valueGetter != null && typeof(Func).IsAssignableFrom(valueGetter.GetType())) + if (valueGetter != null && typeof(Func).IsAssignableFrom(valueGetter.GetType())) { - nullableDateTimeGetter = (Func)valueGetter; + nullableDateTimeGetter = (Func)valueGetter; stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val.ToString("o"); + return val == null ? null : val.Value.ToString("o"); }; } else { - nullableDateTimeGetter = (o) => untypedGetter == null ? default : (DateTime)untypedGetter(o); + nullableDateTimeGetter = (o) => untypedGetter == null ? default : (DateTime?)untypedGetter(o); stringGetter = (o) => { var val = nullableDateTimeGetter(o); - return val.ToString("o"); + return val == null ? null : val.Value.ToString("o"); }; } break; From 4e308711f42974d62788e8622552799e2db06ec8 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Thu, 10 Sep 2026 19:28:55 +0300 Subject: [PATCH 57/64] Align component nullability with the web component contracts ReturnToString never returns null, so the getters built on it return string. IgcChatMessage id, text and sender, IgcChatMessageAttachment id and IgcTileChangeStateEventArgs tile are required on the client. Co-Authored-By: Claude Fable 5.1 --- src/components/Blazor/ChatMessage.cs | 12 ++++++------ src/components/Blazor/ChatMessageAttachment.cs | 6 +++--- src/components/Blazor/Combo.cs | 4 ++-- src/components/Blazor/FormatSpecifier.cs | 4 ++-- src/components/Blazor/IconMeta.cs | 2 +- src/components/Blazor/Input.cs | 4 ++-- src/components/Blazor/RadioGroup.cs | 4 ++-- src/components/Blazor/Tabs.cs | 4 ++-- src/components/Blazor/Textarea.cs | 4 ++-- .../Blazor/TileChangeStateEventArgsDetail.cs | 6 +++--- src/components/Blazor/TileManager.cs | 4 ++-- stories/Components/Stories/Chat.stories.razor | 14 ++------------ 12 files changed, 29 insertions(+), 39 deletions(-) diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 8e799657..fac063e8 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -12,13 +12,13 @@ public partial class IgbChatMessage : BaseRendererElement private static bool _marshalByValue = true; - private string? _id; + private string _id = string.Empty; /// /// A unique identifier for the message. /// [Parameter] - public string? Id + public string Id { get { return this._id; } set @@ -31,13 +31,13 @@ public string? Id } } - private string? _text; + private string _text = string.Empty; /// /// The textual content of the message. /// [Parameter] - public string? Text + public string Text { get { return this._text; } set @@ -50,13 +50,13 @@ public string? Text } } - private string? _sender; + private string _sender = string.Empty; /// /// The identifier or name of the sender of the message. /// [Parameter] - public string? Sender + public string Sender { get { return this._sender; } set diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index 8904bc12..ee6d17bc 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -12,13 +12,13 @@ public partial class IgbChatMessageAttachment : BaseRendererElement private static bool _marshalByValue = true; - private string? _id; + private string _id = string.Empty; /// /// A unique identifier for the attachment. /// [Parameter] - public string? Id + public string Id { get { return this._id; } set @@ -142,7 +142,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict if (args != null && args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } if (args != null && args.ContainsKey("name")) - { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } + { this.Name = ReturnToString(args["name"]); } if (args != null && args.ContainsKey("url")) { this.Url = ReturnToString(args["url"]); } if (args != null && args.ContainsKey("attachmentType")) diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index d5fe9af2..156e4c4b 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -431,7 +431,7 @@ public T[] Value public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); - return (ReturnToObjectArray(iv) ?? Array.Empty()).Cast().ToArray(); + return ReturnToObjectArray(iv).Cast().ToArray(); } /// @@ -441,7 +441,7 @@ public async Task GetCurrentValueAsync() public T[] GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); - return (ReturnToObjectArray(iv) ?? Array.Empty()).Cast().ToArray(); + return ReturnToObjectArray(iv).Cast().ToArray(); } private string? _selectionRef; diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index d62f5605..1f7e1137 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -25,7 +25,7 @@ protected override void EnsureModulesLoaded() /// reports a bare language code. /// /// The resolved culture name. - public async Task GetLocalCultureAsync() + public async Task GetLocalCultureAsync() { var iv = await InvokeMethod("getLocalCulture", new object[] { }, new string[] { }); return ReturnToString(iv); @@ -35,7 +35,7 @@ protected override void EnsureModulesLoaded() /// reports a bare language code. /// /// The resolved culture name. - public String? GetLocalCulture() + public String GetLocalCulture() { var iv = InvokeMethodSync("getLocalCulture", new object[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 6a2924a4..0369e456 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("name")) - { this.Name = ReturnToString(args["name"]) ?? Guid.NewGuid().ToString(); } + { this.Name = ReturnToString(args["name"]); } if (args != null && args.ContainsKey("collection")) { this.Collection = ReturnToString(args["collection"]); } diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index 309610b3..6a2347e4 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -76,7 +76,7 @@ public string? Value /// /// Returns the current value of the control. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -85,7 +85,7 @@ public string? Value /// /// Returns the current value of the control. /// - public string? GetCurrentValue() + public string GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index ea50a80f..8ac61aa9 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -102,7 +102,7 @@ public string? Value /// Gets the current value of the group. /// /// The value of the checked . - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -112,7 +112,7 @@ public string? Value /// Gets the current value of the group. /// /// The value of the checked . - public string? GetCurrentValue() + public string GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index fa466c22..f3dc1c0d 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -195,7 +195,7 @@ public TabsActivation Activation /// Gets the currently selected tab. /// /// The label of the selected tab, or its ID if no label is set. - public async Task GetSelectedAsync() + public async Task GetSelectedAsync() { var iv = await InvokeMethod("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -205,7 +205,7 @@ public TabsActivation Activation /// Gets the currently selected tab. /// /// The label of the selected tab, or its ID if no label is set. - public string? GetSelected() + public string GetSelected() { var iv = InvokeMethodSync("p:Selected", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index df5ea5ae..2d02716e 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -308,7 +308,7 @@ public string? Value /// /// Returns the current value of the component. /// - public async Task GetCurrentValueAsync() + public async Task GetCurrentValueAsync() { var iv = await InvokeMethod("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -317,7 +317,7 @@ public string? Value /// /// Returns the current value of the component. /// - public string? GetCurrentValue() + public string GetCurrentValue() { var iv = InvokeMethodSync("p:Value", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index fbaf1317..853a97cf 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -12,13 +12,13 @@ public partial class IgbTileChangeStateEventArgsDetail : BaseRendererElement private static bool _marshalByValue = true; - private IgbTile? _tile; + private IgbTile _tile = new IgbTile(); /// /// The tile whose state is changing. /// [Parameter] - public IgbTile? Tile + public IgbTile Tile { get { return this._tile; } set @@ -91,7 +91,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict this.SuppressParentNotify = true; if (args != null && args.ContainsKey("tile")) - { this.Tile = (IgbTile?)ConvertReturnValue(args["tile"], "Tile", true); } + { this.Tile = (IgbTile)ConvertReturnValue(args["tile"], "Tile", true); } if (args != null && args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index aad848ae..afa5395c 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -234,7 +234,7 @@ public void SetNativeElement(Object element) /// /// Returns the properties of the current tile collections as a JSON payload. /// - public async Task SaveLayoutAsync() + public async Task SaveLayoutAsync() { var iv = await InvokeMethod("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); @@ -243,7 +243,7 @@ public void SetNativeElement(Object element) /// /// Returns the properties of the current tile collections as a JSON payload. /// - public String? SaveLayout() + public String SaveLayout() { var iv = InvokeMethodSync("saveLayout", new object?[] { }, new string[] { }); return ReturnToString(iv); diff --git a/stories/Components/Stories/Chat.stories.razor b/stories/Components/Stories/Chat.stories.razor index 61157500..4be12603 100644 --- a/stories/Components/Stories/Chat.stories.razor +++ b/stories/Components/Stories/Chat.stories.razor @@ -99,11 +99,6 @@ private async Task OnBasicMessageCreated(IgbChatMessageEventArgs args) { var userMessage = args.Detail; - if (userMessage is null) - { - return; - } - if (!_basicMessages.Any(x => x.Id == userMessage.Id)) { _basicMessages = [.. _basicMessages, userMessage]; @@ -115,17 +110,12 @@ await Task.Delay(700); _basicOptions.IsTyping = false; - _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage.Text ?? string.Empty)]; + _basicMessages = [.. _basicMessages, BuildAgentReply(userMessage.Text)]; } private async Task OnTemplateMessageCreated(IgbChatMessageEventArgs args) { var userMessage = args.Detail; - if (userMessage is null) - { - return; - } - if (!_templateMessages.Any(x => x.Id == userMessage.Id)) { _templateMessages = [.. _templateMessages, userMessage]; @@ -137,7 +127,7 @@ await Task.Delay(700); _templateOptions.IsTyping = false; - _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage.Text ?? string.Empty)]; + _templateMessages = [.. _templateMessages, BuildAgentReply(userMessage.Text)]; } private static IgbChatMessage BuildAgentReply(string prompt) From 7482cc3717948ab3c10279a2cce44a515807e5ec Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Thu, 10 Sep 2026 20:02:15 +0300 Subject: [PATCH 58/64] Restore master null handling in the base layer without null-forgiving operators ConvertReturnValue returns object?, so the ReturnTo* guards and the component-side null checks are live again instead of being hidden behind null!. Dictionary getters return the raw value, the method-wide CS8604 pragmas are replaced by per-site checks, BuildSequenceInfo runs lazily rather than from the constructor, and collection notifications pass null items through as before. IgBlazor keeps the throwing getter: a nullable property would need about 150 guards at the module registration sites. Co-Authored-By: Claude Fable 5.1 --- .../Blazor/ActiveStepChangedEventArgs.cs | 4 +- .../Blazor/ActiveStepChangingEventArgs.cs | 4 +- .../Blazor/ChatMessageAttachmentEventArgs.cs | 4 +- src/components/Blazor/ChatMessageEventArgs.cs | 4 +- src/components/Blazor/ChatMessageReaction.cs | 4 +- .../Blazor/ChatMessageReactionEventArgs.cs | 4 +- .../Blazor/CheckboxChangeEventArgs.cs | 4 +- src/components/Blazor/ComboChangeEventArgs.cs | 4 +- .../ComponentDataValueChangedEventArgs.cs | 4 +- src/components/Blazor/DateRangePicker.cs | 4 +- .../Blazor/DateRangeValueEventArgs.cs | 4 +- src/components/Blazor/Dropdown.cs | 12 +- .../Blazor/DropdownItemComponentEventArgs.cs | 4 +- .../ExpansionPanelComponentEventArgs.cs | 4 +- src/components/Blazor/RadioChangeEventArgs.cs | 4 +- .../Blazor/RangeSliderValueEventArgs.cs | 4 +- src/components/Blazor/Select.cs | 4 +- .../Blazor/SelectItemComponentEventArgs.cs | 4 +- .../Blazor/SplitterResizeEventArgs.cs | 4 +- .../Blazor/TabComponentEventArgs.cs | 4 +- .../Blazor/TileChangeStateEventArgs.cs | 4 +- .../Blazor/TileChangeStateEventArgsDetail.cs | 4 +- .../Blazor/TileComponentEventArgs.cs | 4 +- .../Blazor/TreeItemComponentEventArgs.cs | 4 +- .../Blazor/TreeSelectionEventArgs.cs | 4 +- src/componentsBase/BaseRendererControl.cs | 138 +++++++++++------- src/componentsBase/BaseRendererElement.cs | 8 +- src/componentsBase/CollectionAdapter.cs | 40 ++--- src/componentsBase/DataSourceManager.cs | 14 +- src/componentsBase/JsonDataSource.cs | 30 +--- src/componentsBase/JsonDataSourceItem.cs | 24 ++- src/componentsBase/JsonDataSourceSchema.cs | 20 +-- src/componentsBase/RendererSerializer.cs | 15 +- src/componentsBase/UnmarshalledDataSource.cs | 109 ++++++-------- src/componentsBase/WebInputs/Chat.cs | 10 +- tests/IgniteUI.Blazor.Tests/ChatTests.cs | 6 +- 36 files changed, 237 insertions(+), 285 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 75696f94..e7ef9b00 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -64,8 +64,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangedEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true) is IgbActiveStepChangedEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 48622020..27c6208a 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -64,8 +64,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbActiveStepChangingEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true) is IgbActiveStepChangingEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 83409895..32714a4d 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -63,8 +63,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageAttachment)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessageAttachment", true) is IgbChatMessageAttachment detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index 203821e2..41237efa 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -63,8 +63,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessage)ConvertReturnValue(args["detail"], "ChatMessage", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessage", true) is IgbChatMessage detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index a48cee85..bf4277eb 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -94,8 +94,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("message")) - { this.Message = (IgbChatMessage)ConvertReturnValue(args["message"], "ChatMessage", true); } + if (args != null && args.ContainsKey("message") && ConvertReturnValue(args["message"], "ChatMessage", true) is IgbChatMessage message) + { this.Message = message; } if (args != null && args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index 154c4d04..af9343d1 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -63,8 +63,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbChatMessageReaction)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessageReaction", true) is IgbChatMessageReaction detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index 4641c974..e9054204 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -63,8 +63,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbCheckboxChangeEventArgsDetail)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true) is IgbCheckboxChangeEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 91ff351b..9d02ab0b 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -61,8 +61,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbComboChangeEventArgsDetail)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true) is IgbComboChangeEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index e8c73ce9..c044e1e5 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -56,8 +56,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = ReturnToPrimitive(args["detail"]); } + if (args != null && args.ContainsKey("detail") && ReturnToPrimitive(args["detail"]) is object detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 82ba4ddc..c9008ef6 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -70,7 +70,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + var retVal = (IgbDateRangeValue?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDateRangeValue); @@ -90,7 +90,7 @@ public IgbDateRangeValue? Value { return default(IgbDateRangeValue); } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + var retVal = (IgbDateRangeValue?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDateRangeValue); diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 969d3cf6..662c8fa6 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -62,8 +62,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbDateRangeValueDetail)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "DateRangeValueDetail", true) is IgbDateRangeValueDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 723b8a96..342a87b0 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -220,7 +220,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -240,7 +240,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -280,7 +280,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -301,7 +301,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -321,7 +321,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); @@ -342,7 +342,7 @@ public IgbDropdownGroup[] GetGroups() { return default(IgbDropdownItem); } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + var retVal = (IgbDropdownItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbDropdownItem); diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index bc410c4b..1d1904f6 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -58,8 +58,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbDropdownItem)ConvertReturnValue(args["detail"], "DropdownItem", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "DropdownItem", true) is IgbDropdownItem detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 94caa571..381761fe 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -60,8 +60,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbExpansionPanel)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ExpansionPanel", true) is IgbExpansionPanel detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 490517b3..4ca8ac8c 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -63,8 +63,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbRadioChangeEventArgsDetail)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true) is IgbRadioChangeEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index 78752bc3..23fa2dee 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -61,8 +61,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbRangeSliderValue)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "RangeSliderValue", true) is IgbRangeSliderValue detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index c523d79f..0cf14329 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -294,7 +294,7 @@ public IgbSelectGroup[] GetGroups() { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); + var retVal = (IgbSelectItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbSelectItem); @@ -314,7 +314,7 @@ public IgbSelectGroup[] GetGroups() { return default(IgbSelectItem); } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); + var retVal = (IgbSelectItem?)ConvertReturnValue(iv); if (retVal == null) { return default(IgbSelectItem); diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 16f292d4..86cdaf4b 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -58,8 +58,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbSelectItem)ConvertReturnValue(args["detail"], "SelectItem", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "SelectItem", true) is IgbSelectItem detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index 85621265..f19f86fe 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -62,8 +62,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbSplitterResizeEventArgsDetail)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true) is IgbSplitterResizeEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index f0386b2d..b9c1d750 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -58,8 +58,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTab)ConvertReturnValue(args["detail"], "Tab", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "Tab", true) is IgbTab detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index 6ae53003..145bb9df 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -64,8 +64,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args?.ContainsKey("detail") == true) - { this.Detail = (IgbTileChangeStateEventArgsDetail)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } + if (args?.ContainsKey("detail") == true && ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true) is IgbTileChangeStateEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 853a97cf..4429b2d3 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -90,8 +90,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("tile")) - { this.Tile = (IgbTile)ConvertReturnValue(args["tile"], "Tile", true); } + if (args != null && args.ContainsKey("tile") && ConvertReturnValue(args["tile"], "Tile", true) is IgbTile tile) + { this.Tile = tile; } if (args != null && args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 5e8cf0bf..13a80ea8 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -59,8 +59,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTile)ConvertReturnValue(args["detail"], "Tile", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "Tile", true) is IgbTile detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 79b92bbb..c115486f 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -59,8 +59,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTreeItem)ConvertReturnValue(args["detail"], "TreeItem", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "TreeItem", true) is IgbTreeItem detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index 9ad2c502..636f6fad 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -62,8 +62,8 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail")) - { this.Detail = (IgbTreeSelectionEventArgsDetail)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } + if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true) is IgbTreeSelectionEventArgsDetail detail) + { this.Detail = detail; } this.SuppressParentNotify = false; } diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index 00af9af6..008671fe 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -35,8 +35,6 @@ public enum ControlEventBehavior [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] public partial class BaseRendererControl : ComponentBase, RefSink, JsonSerializable, IAsyncDisposable { - private static readonly SerializationFilter DefaultSerializationFilter = static (_, _) => true; - private IIgniteUIBlazor? _igBlazor; [Inject] protected IIgniteUIBlazor IgBlazor @@ -204,7 +202,6 @@ public BaseRendererControl() : base() //WebCallback.Instance.Register(this); //this._objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); //_webCallbackHelper.WebCallback = WebCallback.Instance; - _sequenceInfo = BuildSequenceInfo(3); } protected virtual string ResolveDisplay() @@ -291,18 +288,8 @@ protected virtual string DirectRenderElementName } } - private void EnsureSequenceInfo() - { - if (_sequenceInfo == null) - { - _sequenceInfo = BuildSequenceInfo(3); - } - } - private Dictionary GatherSimpleAttributes() { - EnsureSequenceInfo(); - var ser = Serialize(); var data = JsonSerializer.Deserialize(ser, SerializerContext.DictionaryStringObject); if (data == null) @@ -382,13 +369,13 @@ private object ArrayToSimpleAttributeValue(JsonElement currValue) protected virtual string TransformSimpleKey(string? key) { key = Camelize(key); - return _sequenceInfo.TransformKey(key); + return Sequence.TransformKey(key); } protected virtual bool IsTransformedEnumValue(string? key) { key = Camelize(key); - if (_sequenceInfo.IsTransformedEnum(key)) + if (Sequence.IsTransformedEnum(key)) { return true; } @@ -399,17 +386,21 @@ protected virtual object TransformPotentialEnumValue(string? key, object value) { key = Camelize(key); //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); - if (_sequenceInfo.IsTransformedEnum(key)) + if (Sequence.IsTransformedEnum(key)) { //Console.WriteLine("transforming enum value...."); key = Camelize(key); - return _sequenceInfo.TransformEnumValue(key, value.ToString()); + return Sequence.TransformEnumValue(key, value.ToString()); } return value; } - private SequenceInfo _sequenceInfo; + private SequenceInfo? _sequenceInfo = null; + + // Built on first use: BuildSequenceInfo is virtual and walks this instance's properties by + // reflection, so it must not run from the constructor. + private SequenceInfo Sequence => _sequenceInfo ??= BuildSequenceInfo(3); protected virtual SequenceInfo BuildSequenceInfo(int startSequence) { @@ -458,9 +449,9 @@ protected virtual SequenceInfo BuildSequenceInfo(int startSequence) // enumType intentionally unannotated: PropertyInfo.PropertyType cannot satisfy annotations, so one here would only move the warning to the caller. [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "The trimmer preserves all fields of enum types that are kept, and enum parameter property types are kept with their declaring component.")] - private Dictionary GetWCEnumTransform(Type enumType) + private Dictionary? GetWCEnumTransform(Type enumType) { - Dictionary wcEnumTransform = new Dictionary(); + Dictionary? wcEnumTransform = null; foreach (var f in enumType.GetFields()) { if (f.IsPublic && !f.IsSpecialName) @@ -498,12 +489,11 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) var attributes = GatherSimpleAttributes(); builder.AddAttribute(2, "data-ig-id", _containerId); - EnsureSequenceInfo(); - foreach (var key in _sequenceInfo.AttributeKeys) + foreach (var key in Sequence.AttributeKeys) { if (attributes.ContainsKey(key)) { - var sequence = _sequenceInfo.GetSequence(key); + var sequence = Sequence.GetSequence(key); var tKey = TransformSimpleKey(key); var val = attributes[key]; @@ -525,25 +515,25 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) } } - builder.AddMultipleAttributes(4 + _sequenceInfo.MaxSequence, AdditionalAttributes); + builder.AddMultipleAttributes(4 + Sequence.MaxSequence, AdditionalAttributes); - builder.AddElementReferenceCapture(5 + 15 + _sequenceInfo.MaxSequence, delegate (ElementReference value) + builder.AddElementReferenceCapture(5 + 15 + Sequence.MaxSequence, delegate (ElementReference value) { contEle = value; }); - //builder.AddMarkupContent(6 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + //builder.AddMarkupContent(6 + 15 + Sequence.MaxSequence, "\r\n "); builder.OpenComponent>(6); // TODO: This '6' here might be a bug because it doesn't seem to match the other line sequence numbers - builder.AddAttribute(7 + 15 + _sequenceInfo.MaxSequence, "Value", this); - builder.AddAttribute(8 + 15 + _sequenceInfo.MaxSequence, "Name", ParentTypeName); - builder.AddAttribute(9 + 15 + _sequenceInfo.MaxSequence, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) + builder.AddAttribute(7 + 15 + Sequence.MaxSequence, "Value", this); + builder.AddAttribute(8 + 15 + Sequence.MaxSequence, "Name", ParentTypeName); + builder.AddAttribute(9 + 15 + Sequence.MaxSequence, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) { - //builder2.AddMarkupContent(10 + 15 + _sequenceInfo.MaxSequence, "\r\n "); - builder2.AddContent(11 + 15 + _sequenceInfo.MaxSequence, ChildContent); - //builder2.AddMarkupContent(12 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + //builder2.AddMarkupContent(10 + 15 + Sequence.MaxSequence, "\r\n "); + builder2.AddContent(11 + 15 + Sequence.MaxSequence, ChildContent); + //builder2.AddMarkupContent(12 + 15 + Sequence.MaxSequence, "\r\n "); }); builder.CloseComponent(); - //builder.AddMarkupContent(13 + 15 + _sequenceInfo.MaxSequence, "\r\n"); + //builder.AddMarkupContent(13 + 15 + Sequence.MaxSequence, "\r\n"); builder.CloseElement(); return; @@ -824,17 +814,20 @@ public async Task EnsureReady() return; } + var jsRuntime = JsRuntime; + if (jsRuntime == null) + { + return; + } + //Console.WriteLine("ensuring ready: " + this.GetType().Name); while (!this._ready) { - bool ready = JsRuntime != null ? await JsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }) : false; + bool ready = await jsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }); //Console.WriteLine(ready + " -> " + this.GetType().Name); if (ready) { - if (JsRuntime != null) - { - await JsRuntime.InvokeVoidAsync("igWaitForLoaded"); - } + await jsRuntime.InvokeVoidAsync("igWaitForLoaded"); OnReady(); break; } @@ -966,7 +959,7 @@ public string Serialize() { using (Utf8JsonWriter uw = new Utf8JsonWriter(stream)) { - SerializationContext c = new SerializationContext(uw, DefaultSerializationFilter); + SerializationContext c = new SerializationContext(uw, null); //RendererSerializer ser = new RendererSerializer(uw); Serialize(c); @@ -1260,7 +1253,7 @@ internal void OnRefChanged(string propertyName, object? oldValue, object? newVal using (var stream = new System.IO.MemoryStream()) using (var writer = new System.Text.Json.Utf8JsonWriter(stream)) { - var context = new SerializationContext(writer, DefaultSerializationFilter); + var context = new SerializationContext(writer, null); ((JsonSerializable)newValue).Serialize(context); writer.Flush(); var json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); @@ -1777,7 +1770,7 @@ private void ProcessMessageSync(RendererMessage m) private async Task SendJsonImmediate(RendererMessage m) { - if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) + if (_igBlazor == null || !_igBlazor.IsRuntimeValid(_shouldReevaluateRuntime) || JsRuntime == null) { return null; } @@ -1930,7 +1923,7 @@ private object SendJsonSync(string json, ElementReference[]? nativeElements) } } - internal object ReturnToPrimitive(object? returnValue) + internal object? ReturnToPrimitive(object? returnValue) { return ConvertReturnValue(returnValue, true); } @@ -1957,7 +1950,7 @@ internal T[] DowncastArray(object val) return (T[])val; } - internal object ConvertReturnValue(object? returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object? ConvertReturnValue(object? returnValue, bool transformArrays = false, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { try { @@ -2073,7 +2066,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f } else if ("undefined".Equals(retType)) { - return null!; + return null; } else if ("Array".Equals(retType)) { @@ -2113,7 +2106,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f if (obj["value"] == null || ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) { - return null!; + return null; } object? o = null; @@ -2156,7 +2149,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f { if (acceptsNullIfMarshalDoesNotExist) { - return null!; + return null; } var ret = obj["value"].ToString() ?? ""; returnValue = JsonSerializer.Deserialize(ret, SerializerContext.DictionaryStringObject); @@ -2175,7 +2168,7 @@ internal object ConvertReturnValue(object? returnValue, bool transformArrays = f Console.WriteLine(e.ToString()); } - return returnValue!; + return returnValue; } public void OnInvokeReturn(long invokeId, Object returnValue) @@ -2249,7 +2242,15 @@ public void OnInvokeReturn(long invokeId, Object returnValue) internal int ReturnToInt(object? val) { + if (val == null) + { + return 0; + } val = ConvertReturnValue(val); + if (val == null) + { + return 0; + } if (val is String) { return int.Parse((String)val); @@ -2297,8 +2298,16 @@ internal double ReturnToDouble(object? val) internal long ReturnToLong(object? val) { + if (val == null) + { + return 0; + } //Console.WriteLine("converting return"); val = ConvertReturnValue(val); + if (val == null) + { + return Int64.MinValue; + } //Console.WriteLine(val); if (val is String) { @@ -2319,7 +2328,15 @@ internal long ReturnToLong(object? val) internal DateTime[] ReturnToDateArray(object? val) { + if (val == null) + { + return Array.Empty(); + } val = ConvertReturnValue(val); + if (val == null) + { + return Array.Empty(); + } try { var stringVal = val.ToString(); @@ -2403,7 +2420,15 @@ internal DateTime ReturnToDate(object? val, bool tryConvertValue = true) internal bool ReturnToBoolean(object? val) { + if (val == null) + { + return false; + } val = ConvertReturnValue(val); + if (val == null) + { + return false; + } if (val is bool) { return (bool)val; @@ -2456,7 +2481,7 @@ internal string ObjectToParam(object? val) { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); + SerializationContext c = new SerializationContext(w, null); ObjectToParam(c, val); w.Flush(); return System.Text.Encoding.UTF8.GetString(ms.ToArray()); @@ -2470,7 +2495,7 @@ internal string ObjectToParam(object? val, Type type) { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); + SerializationContext c = new SerializationContext(w, null); ObjectToParam(c, type, val); w.Flush(); return System.Text.Encoding.UTF8.GetString(ms.ToArray()); @@ -2747,7 +2772,7 @@ internal T StringToEnum(Object? val) where T : struct { using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) { - SerializationContext c = new SerializationContext(w, DefaultSerializationFilter); + SerializationContext c = new SerializationContext(w, null); w.WriteStartArray(); for (int i = 0; i < arr.Length; i++) { @@ -2940,8 +2965,8 @@ internal object[] ReturnToObjectArray(object? val) string[] ret = new string[arr.Length]; for (int i = 0; i < arr.Length; i++) { - string ele = arr[i].ToString(); - ret[i] = ele; + // Elements can be JSON nulls; keep them in place. + ret[i] = arr[i]; } return ret; } @@ -3312,7 +3337,7 @@ private async Task TrySendCleanupAsync() { try { - if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + if (_igBlazor == null || !_igBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { return; } @@ -3351,6 +3376,13 @@ private async Task TrySendCleanupAsync() // (double-dispose race or host-driven teardown). Nothing left to release. Debug.WriteLine($"[IgniteUI.Blazor] TrySendCleanupAsync: target already disposed; cleanup skipped. {ex.Message}"); } + catch (InvalidOperationException ex) + { + // Ordered after ObjectDisposedException, which derives from this type. Reached when + // the component is disposed before dependency injection assigned IgBlazor: there is + // no runtime to send a cleanup message to. + Debug.WriteLine($"[IgniteUI.Blazor] TrySendCleanupAsync: component never received IgBlazor; cleanup skipped. {ex.Message}"); + } catch (JSException ex) { // The JS side rejected or errored during cleanup. There is no meaningful diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index b712c624..d535b66c 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -893,7 +893,7 @@ internal bool ReturnToBoolean(object? val) return default; } - internal object ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + internal object? ConvertReturnValue(object? val, string? typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -904,10 +904,10 @@ internal object ConvertReturnValue(object? val, string? typeGuess = null, bool a { return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } - return new object(); + return null; } - internal object ReturnToPrimitive(object? val) + internal object? ReturnToPrimitive(object? val) { EnsureValid(); if (CurrParent is BaseRendererElement) @@ -918,7 +918,7 @@ internal object ReturnToPrimitive(object? val) { return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); } - return new object(); + return null; } internal T[]? DowncastArray(object val) diff --git a/src/componentsBase/CollectionAdapter.cs b/src/componentsBase/CollectionAdapter.cs index 4825802e..d83646e4 100644 --- a/src/componentsBase/CollectionAdapter.cs +++ b/src/componentsBase/CollectionAdapter.cs @@ -10,11 +10,11 @@ internal class CollectionAdapter private IList _manualItems = new List(); private IList? _allList; - private IList? _target; + private IList _target; private IList? _query; - private Func? _toTarget; - private Action? _onItemAdded; - private Action? _onItemRemoved; + private Func _toTarget; + private Action _onItemAdded; + private Action _onItemRemoved; private bool _hasShiftedOnceAlready; @@ -252,8 +252,8 @@ private void SyncItems() if (!queryMap.ContainsKey(item) && !manualMap.ContainsKey(item)) { this._allList.RemoveAt(i); - this._target?.RemoveAt(i); - this._onItemRemoved?.Invoke(item); + this._target.RemoveAt(i); + this._onItemRemoved(item); } } @@ -285,38 +285,18 @@ private void SyncItems() } else { - var convertedItem = this._toTarget?.Invoke(insItem); - if (this._target != null && convertedItem == null) - { - ind++; - continue; - } - this._allList.Insert(ins, insItem); - if (this._target != null && convertedItem != null) - { - this._target.Insert(ins, convertedItem); - } - this._onItemAdded?.Invoke(insItem); + this._target.Insert(ins, this._toTarget(insItem)); + this._onItemAdded(insItem); ind++; ins++; } } else { - var convertedItem = this._toTarget?.Invoke(insItem); - if (this._target != null && convertedItem == null) - { - ind++; - continue; - } - this._allList.Add(insItem); - if (this._target != null && convertedItem != null) - { - this._target.Add(convertedItem); - } - this._onItemAdded?.Invoke(insItem); + this._target.Add(this._toTarget(insItem)); + this._onItemAdded(insItem); ind++; ins++; } diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index 303959fb..ab3203f9 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -177,10 +177,6 @@ public void NotifyInsertItem(string refName, int index, object? refItem) } //Console.WriteLine("notifying insert item"); - if (refItem == null) - { - return; - } if (_refsById.ContainsKey(refName)) { //Console.WriteLine("found by id"); @@ -202,10 +198,6 @@ public void NotifyRemoveItem(String refName, int index, Object? oldItem) return; } - if (oldItem == null) - { - return; - } if (_refsById.ContainsKey(refName)) { Object data = _refsById[refName]; @@ -288,12 +280,8 @@ public bool HasRefId(object dataSource) return false; } - public string GetRefId(object? dataSource) + public string GetRefId(object dataSource) { - if (dataSource == null) - { - return string.Empty; - } if (_idLookup.ContainsKey(dataSource)) { return _idLookup[dataSource]; diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 933de1f3..f2a44e5b 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -21,8 +21,8 @@ internal interface IJSDataSource object? LookupOriginal(string id); bool HasOriginal(object item); Guid IdFromOriginal(object item); - IJSDataSourceItem? NotifyInsertItem(object data, int index, Object item); - IJSDataSourceItem? NotifyRemoveItem(object data, int index, object oldItem); + IJSDataSourceItem? NotifyInsertItem(object data, int index, Object? item); + IJSDataSourceItem? NotifyRemoveItem(object data, int index, object? oldItem); void NotifyClearItems(Object data); IJSDataSourceItem? NotifySetItem(Object data, int index, Object oldItem, Object newItem); IJSDataSourceItem? NotifyUpdateItem(object data, int index, object item); @@ -111,7 +111,7 @@ private void Listen(object data) private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { - if (SuppressModifications || _manager == null) + if (SuppressModifications || _manager == null || _originalData == null) { return; } @@ -126,10 +126,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); } } @@ -143,10 +139,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); } } @@ -160,10 +152,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); } } @@ -173,10 +161,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); } } @@ -185,10 +169,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg case NotifyCollectionChangedAction.Reset: { var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyClearItems(refName); break; } @@ -450,7 +430,7 @@ private void EnsureSchema(object? item) } } - public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) + public IJSDataSourceItem NotifyInsertItem(object data, int index, Object? item) { EnsureSchema(item); IJSDataSourceItem itemJson = JsonDataSourceItem.Create(item, _schema, _manager); @@ -459,7 +439,7 @@ public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) return itemJson; } - public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem) + public IJSDataSourceItem NotifyRemoveItem(object data, int index, object? oldItem) { EnsureSchema(oldItem); IJSDataSourceItem itemJson = _data[index]; diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 76630936..ae959af4 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -160,17 +160,14 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m _values["value"] = item; _valueTypes["value"] = schema.PrimitiveType; } - var propertyNames = schema.PropertyNames; var propertyGetters = schema.PropertyGetters; - var propertyTypes = schema.PropertyTypes; - if (propertyNames != null && propertyGetters != null && propertyTypes != null) + if (propertyGetters != null) { - var propertyLength = Math.Min(propertyNames.Length, Math.Min(propertyGetters.Length, propertyTypes.Length)); - for (var i = 0; i < propertyLength; i++) + for (int i = 0; i < schema.PropertyNames.Length; i++) { - string name = propertyNames[i]; - Func propGetter = propertyGetters[i]; - JSDataSourceSchemaType type = propertyTypes[i]; + String name = schema.PropertyNames[i]; + Func propGetter = propertyGetters[i]; + JSDataSourceSchemaType type = schema.PropertyTypes[i]; object? val = schema.ResolveValue(name, item, propGetter, this, type, manager); _values[name] = val; @@ -178,17 +175,14 @@ private void Read(Object? item, JSDataSourceSchema? schema, DataSourceManager? m } } - var fields = schema.Fields; var fieldGetters = schema.FieldGetters; - var fieldTypes = schema.FieldTypes; - if (fields != null && fieldGetters != null && fieldTypes != null) + if (fieldGetters != null) { - var fieldLength = Math.Min(fields.Length, Math.Min(fieldGetters.Length, fieldTypes.Length)); - for (var i = 0; i < fieldLength; i++) + for (int i = 0; i < schema.Fields.Length; i++) { - string name = fields[i].Name; + String name = schema.Fields[i].Name; Func fieldGetter = fieldGetters[i]; - JSDataSourceSchemaType type = fieldTypes[i]; + JSDataSourceSchemaType type = schema.FieldTypes[i]; object? val = schema.ResolveFieldValue(name, item, fieldGetter, this, type, manager); _values[name] = val; diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index aee148cc..8c1d9c1a 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -284,7 +284,7 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) s.PropertyTypes = s._buildingPropertiesTypes.ToArray(); s.PropertyDataIntents = s._buildingPropertiesDataIntents.ToArray(); s.PropertyNames = names.ToArray(); - s.PropertyGetters = new Func[names.Count]; + s.PropertyGetters = new Func[names.Count]; s.TypedPropertyGetters = new Delegate[names.Count]; var itemProp = item.GetType().GetProperty("Item") ?? throw new InvalidOperationException("The 'Item' property was not found on the dictionary type."); @@ -292,11 +292,7 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) for (int i = 0; i < names.Count; i++) { var key = names[i]; - s.PropertyGetters[i] = (o) => - { - var value = ((IDictionary)o)[key]; - return value is null ? new object() : value; - }; + s.PropertyGetters[i] = (o) => ((IDictionary)o)[key]; } for (int i = 0; i < names.Count; i++) { @@ -366,7 +362,7 @@ public static JSDataSourceSchema Create(Type c) return s; } - public object? ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager? manager) + public object? ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager? manager) { if (item == null) { @@ -375,7 +371,7 @@ public static JSDataSourceSchema Create(Type c) try { - object value = propGetter(item); + object? value = propGetter(item); if (type == JSDataSourceSchemaType.ObjectValue) { return GetSubObject(name, value, jsonItem, manager); @@ -388,7 +384,7 @@ public static JSDataSourceSchema Create(Type c) } } - private object GetSubObject(String name, Object value, JsonDataSourceItem rootItem, DataSourceManager? manager) + private object GetSubObject(String name, Object? value, JsonDataSourceItem rootItem, DataSourceManager? manager) { bool checkedArray = _checkedArray.ContainsKey(name); if (!checkedArray && value != null) @@ -421,7 +417,7 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt return JsonDataSourceItem.Create(value, subSchema, manager, rootItem); } - public JSDataSourceSchema? BuildSubObjectSchema(object subObject) + public JSDataSourceSchema? BuildSubObjectSchema(object? subObject) { if (subObject == null) { @@ -746,7 +742,7 @@ public void AddField(FieldInfo curr) } public PropertyInfo[] Properties = Array.Empty(); - public Func[]? PropertyGetters; + public Func[]? PropertyGetters; public Func[]? FieldGetters; public Delegate[]? TypedPropertyGetters; public Delegate[]? TypedFieldGetters; @@ -882,7 +878,7 @@ public void Commit() PropertyTypes = _buildingPropertiesTypes.ToArray(); PropertyDataIntents = _buildingPropertiesDataIntents.ToArray(); PropertyNames = new String[_buildingProperties.Count]; - PropertyGetters = new Func[_buildingProperties.Count]; + PropertyGetters = new Func[_buildingProperties.Count]; TypedPropertyGetters = new Delegate[_buildingProperties.Count]; for (int i = 0; i < _buildingProperties.Count; i++) { diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index ba0fcf42..40018510 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -284,7 +284,7 @@ public void AddArrayProp(string propertyName, IEnumerable? values) return value.Substring(0, 1).ToLower() + value.Substring(1); } - public void AddEnumProp(string propertyName, Enum? value) + public void AddEnumProp(string propertyName, Enum value) { if (_context.Filter != null) { @@ -294,12 +294,6 @@ public void AddEnumProp(string propertyName, Enum? value) } } - if (value == null) - { - _context.Writer.WriteNull(propertyName); - return; - } - if (Utils.TryGetWCEnumName(value.GetType(), value.ToString(), out var wcName)) { _context.Writer.WriteString(propertyName, wcName); @@ -569,7 +563,12 @@ public void AddEnumArrayProp(String propertyName, object? values) for (int i = 0; i < vals.Count; i++) { Enum? val = (Enum?)vals[i]; - if (val != null) + if (val == null) + { + // Keep the element positions aligned with the source collection. + _context.Writer.WriteNullValue(); + } + else { _context.Writer.WriteStringValue(Camelize(val.ToString())); } diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index fc29e707..f4c70312 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -165,7 +165,7 @@ public UnmarshalledDataSource() { var propertyNames = schema.PropertyNames ?? Array.Empty(); var fieldNames = schema.FieldNames ?? Array.Empty(); - var propertyGetters = schema.PropertyGetters ?? Array.Empty>(); + var propertyGetters = schema.PropertyGetters ?? Array.Empty>(); var fieldGetters = schema.FieldGetters ?? Array.Empty>(); var typedPropertyGetters = schema.TypedPropertyGetters ?? Array.Empty(); var typedFieldGetters = schema.TypedFieldGetters ?? Array.Empty(); @@ -186,20 +186,15 @@ public UnmarshalledDataSource() } } - var propertyCount = Math.Min(propertyNames.Length, Math.Min(propertyGetters.Length, propertyTypes.Length)); - var fieldCount = Math.Min(fieldNames.Length, Math.Min(fieldGetters.Length, fieldTypes.Length)); - int i = 0; - for (; i < propertyCount; i++) + + for (i = 0; i < propertyNames.Length; i++) { - var typedPropertyGetter = i < typedPropertyGetters.Length ? typedPropertyGetters[i] : null; - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, propertyNames[i], typedPropertyGetter, propertyGetters[i], false, propertyTypes[i], oldValue, newValue); + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, propertyNames[i], typedPropertyGetters[i], propertyGetters[i], false, propertyTypes[i], oldValue, newValue); } - - for (int j = 0; j < fieldCount; i++, j++) + for (int j = 0; j < fieldNames.Length; i++, j++) { - var typedFieldGetter = j < typedFieldGetters.Length ? typedFieldGetters[j] : null; - columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, fieldNames[j], typedFieldGetter, fieldGetters[j], false, fieldTypes[j], oldValue, newValue); + columns[i] = AdjustColumnCapacity(parentPath, columns[i], schema, fieldNames[j], typedFieldGetters[j], fieldGetters[j], false, fieldTypes[j], oldValue, newValue); } } if (schema.IsPrimitive) @@ -245,9 +240,8 @@ public UnmarshalledDataSource() return columns; } - private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate? valueGetter, Func? untypedGetter, bool isIDColumn) + private UnmarshalledColumnData CreateColumn(string? parentPath, string? propertyName, JSDataSourceSchema schema, JSDataSourceSchemaType type, Delegate? valueGetter, Func? untypedGetter, bool isIDColumn) { -#pragma warning disable CS8604 // internal invariant: column arrays are allocated before element access if (parentPath != null && parentPath.Length > 0) { parentPath += "."; @@ -288,7 +282,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN Func? longGetter = null; Func? stringGetter = null; Func? dateTimeGetter = null; - Func? objectGetter = null; + Func? objectGetter = null; Func? floatingPointGetter = null; Func? integerGetter = null; @@ -356,8 +350,11 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } else { - dateTimeGetter = (o) => untypedGetter == null ? default : (DateTime)untypedGetter(o); - stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + stringGetter = (o) => + { + var val = (DateTime?)untypedGetter?.Invoke(o); + return val == null ? null : val.Value.ToString("o"); + }; } break; case JSDataSourceSchemaType.ObjectValue: @@ -431,10 +428,9 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN } else { - nullableDateTimeGetter = (o) => untypedGetter == null ? default : (DateTime?)untypedGetter(o); stringGetter = (o) => { - var val = nullableDateTimeGetter(o); + var val = (DateTime?)untypedGetter?.Invoke(o); return val == null ? null : val.Value.ToString("o"); }; } @@ -782,7 +778,7 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN UnmarshalledColumn[]? cols = null; if (objVal != null) { - var id = _idGetter != null ? _idGetter(item) : Guid.Empty; + var id = _idGetter != null && item != null ? _idGetter(item) : Guid.Empty; var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); var sub = (UnmarshalledDataSource?)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); @@ -1716,7 +1712,6 @@ private UnmarshalledColumnData CreateColumn(string? parentPath, string propertyN newColumn.Clear = clear; return newColumn; -#pragma warning restore CS8604 } private JSDataSourceSchemaType GetArrayType(JSDataSourceSchemaType arrayType) @@ -1861,9 +1856,8 @@ private void OnRemoveId(Guid oldId) } } - private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) + private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, UnmarshalledColumnData? column, JSDataSourceSchema schema, string? propertyName, Delegate? getter, Func? untypedGetter, bool isIdColumn, JSDataSourceSchemaType type, int oldValue, int newValue) { -#pragma warning disable CS8604 // internal invariant: paired column arrays (NullValues) are allocated together if (column == null) { column = CreateColumn(parentPath, propertyName, schema, type, getter, untypedGetter, isIdColumn); @@ -1932,7 +1926,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha { var floatColumn = new double[newValue]; var nullColumn = new bool[newValue]; - if (existingColumn != null) + if (existingColumn != null && column.NullValues != null) { Array.Copy(existingColumn, floatColumn, _size); Array.Copy(column.NullValues, nullColumn, _size); @@ -1976,7 +1970,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha { var intColumn = new int[newValue]; var nullColumn = new bool[newValue]; - if (existingColumn != null) + if (existingColumn != null && column.NullValues != null) { Array.Copy(existingColumn, intColumn, _size); Array.Copy(column.NullValues, nullColumn, _size); @@ -2014,7 +2008,7 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha { var longColumn = new long[newValue]; var nullColumn = new bool[newValue]; - if (existingColumn != null) + if (existingColumn != null && column.NullValues != null) { Array.Copy(existingColumn, longColumn, _size); Array.Copy(column.NullValues, nullColumn, _size); @@ -2082,7 +2076,6 @@ private UnmarshalledColumnData AdjustColumnCapacity(string? parentPath, Unmarsha } return column; -#pragma warning restore CS8604 } private void EnsureCapacity(int required) @@ -2156,7 +2149,7 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg return; } - if (_manager == null) + if (_manager == null || _originalData == null) { return; } @@ -2171,10 +2164,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); } } @@ -2188,10 +2177,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); } } @@ -2205,10 +2190,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); } } @@ -2218,10 +2199,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg { var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); } } @@ -2230,10 +2207,6 @@ private void OnCollectionChanged(object? sender, NotifyCollectionChangedEventArg case NotifyCollectionChangedAction.Reset: { var refName = _manager.GetRefId(_originalData); - if (refName == null) - { - return; - } _manager.NotifyClearItems(refName); break; } @@ -2576,7 +2549,10 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu if (isEmpty) { var eleType = c.GetElementType(); - s.ItemSchema = ExtractSchemaFromType(eleType); + if (eleType != null) + { + s.ItemSchema = ExtractSchemaFromType(eleType); + } } s.Commit(); return s; @@ -2586,10 +2562,13 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; var isEmpty = item != null && ((IList)item).Count == 0; - if (isEmpty && item != null && GetIListTypeArg(item.GetType()) != null) + if (isEmpty && item != null) { var eleType = GetIListTypeArg(item.GetType()); - s.ItemSchema = ExtractSchemaFromType(eleType); + if (eleType != null) + { + s.ItemSchema = ExtractSchemaFromType(eleType); + } } s.Commit(); return s; @@ -2607,10 +2586,13 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu { isEmpty = false; } - if (isEmpty && GetIEnumerableTypeArg(item.GetType()) != null) + if (isEmpty) { var eleType = GetIEnumerableTypeArg(item.GetType()); - s.ItemSchema = ExtractSchemaFromType(eleType); + if (eleType != null) + { + s.ItemSchema = ExtractSchemaFromType(eleType); + } } s.Commit(); return s; @@ -2660,12 +2642,8 @@ private void RemoveItemAt(int index, JSDataSourceSchema schema, UnmarshalledColu } [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "Data item types are supplied by the application at runtime; trimmed apps must preserve their data item types — see docs/TRIMMING.md.")] - public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) + public static JSDataSourceSchema ExtractSchemaFromType(Type itemType) { - if (itemType == null) - { - return JSDataSourceSchema.Create(typeof(object)); - } if (itemType.IsArray) { JSDataSourceSchema s = new JSDataSourceSchema(); @@ -2673,7 +2651,10 @@ public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) //if (isEmpty) { var eleType = itemType.GetElementType(); - s.ItemSchema = ExtractSchemaFromType(eleType); + if (eleType != null) + { + s.ItemSchema = ExtractSchemaFromType(eleType); + } } s.Commit(); return s; @@ -2682,9 +2663,9 @@ public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; - if (GetIListTypeArg(itemType) != null) + var eleType = GetIListTypeArg(itemType); + if (eleType != null) { - var eleType = GetIListTypeArg(itemType); s.ItemSchema = ExtractSchemaFromType(eleType); } s.Commit(); @@ -2695,9 +2676,9 @@ public static JSDataSourceSchema ExtractSchemaFromType(Type? itemType) { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; - if (GetIEnumerableTypeArg(itemType) != null) + var eleType = GetIEnumerableTypeArg(itemType); + if (eleType != null) { - var eleType = GetIEnumerableTypeArg(itemType); s.ItemSchema = ExtractSchemaFromType(eleType); } s.Commit(); @@ -2760,7 +2741,7 @@ private void EnsureSchema(object? item) } } - public IJSDataSourceItem? NotifyInsertItem(object data, int index, Object item) + public IJSDataSourceItem? NotifyInsertItem(object data, int index, Object? item) { EnsureSchema(item); if (_schema == null && item == null) @@ -2777,7 +2758,7 @@ private void EnsureSchema(object? item) return null; } - public IJSDataSourceItem? NotifyRemoveItem(object data, int index, object oldItem) + public IJSDataSourceItem? NotifyRemoveItem(object data, int index, object? oldItem) { EnsureSchema(oldItem); if (_schema == null) diff --git a/src/componentsBase/WebInputs/Chat.cs b/src/componentsBase/WebInputs/Chat.cs index 70907a99..c7a47d4c 100644 --- a/src/componentsBase/WebInputs/Chat.cs +++ b/src/componentsBase/WebInputs/Chat.cs @@ -6,18 +6,16 @@ namespace IgniteUI.Blazor.Controls /// public partial class IgbChat { - public IgbChatDraftMessage GetCurrentDraftMessage() + public IgbChatDraftMessage? GetCurrentDraftMessage() { var iv = InvokeMethodSync("p:DraftMessage", new object?[] { }, new string[] { }); - var result = ReturnToObject(iv, "ChatDraftMessage"); - return result ?? new IgbChatDraftMessage(); + return ReturnToObject(iv, "ChatDraftMessage"); } - public async Task GetCurrentDraftMessageAsync() + public async Task GetCurrentDraftMessageAsync() { var iv = await InvokeMethod("p:DraftMessage", new object?[] { }, new string[] { }); - var result = ReturnToObject(iv, "ChatDraftMessage"); - return result ?? new IgbChatDraftMessage(); + return ReturnToObject(iv, "ChatDraftMessage"); } } } diff --git a/tests/IgniteUI.Blazor.Tests/ChatTests.cs b/tests/IgniteUI.Blazor.Tests/ChatTests.cs index 2c9312b7..8d345022 100644 --- a/tests/IgniteUI.Blazor.Tests/ChatTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ChatTests.cs @@ -12,7 +12,11 @@ public class ChatTests : ComponentWithContractTestBase .Getter(c => c.GetCurrentDraftMessageAsync(), c => c.GetCurrentDraftMessage(), "DraftMessage", arrange: _ => { }, returns: FromRender.Of((interop, cut) => InteropReturn.Object("", """{"text": "wip draft"}""")), - assert: (cut, result) => Assert.Equal("wip draft", result.Text)) + assert: (cut, result) => + { + Assert.NotNull(result); + Assert.Equal("wip draft", result.Text); + }) .Event(c => c.TypingChange, argsJson: """{"detail": true}""", assert: args => Assert.True(args.Detail)) From 2b8b7e951d3af310afd2411851b3ee95dc428f92 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Thu, 10 Sep 2026 20:02:18 +0300 Subject: [PATCH 59/64] Describe the reference-type nullability changes as clarified, not tightened Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f96ee48a..5750f18e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Public API nullability > [!NOTE] -> As part of this release the public API was annotated for nullable reference types. Beyond the members listed below, many reference-type parameters, properties, and return values had their nullability contract tightened (`T?` → `T`). Consumers building with nullable reference types enabled may see new nullable warnings — or errors, if warnings are treated as errors — and may need to update their code accordingly. +> As part of this release the public API was annotated for nullable reference types. Beyond the members listed below, reference-type parameters, properties, and return values now declare whether they accept or produce `null`. Consumers building with nullable reference types enabled may see new nullable warnings — or errors, if warnings are treated as errors — and may need to update their code accordingly. The following public members changed from nullable to non-nullable. Value-type changes (`double?` → `double`) are binary-breaking. From b304ed657053297d26ec9e7b6dab428f100299cc Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 11 Sep 2026 10:23:12 +0300 Subject: [PATCH 60/64] Look up event payloads with TryGetValue Co-Authored-By: Claude Fable 5.1 --- src/components/Blazor/ActiveStepChangedEventArgs.cs | 2 +- src/components/Blazor/ActiveStepChangingEventArgs.cs | 2 +- src/components/Blazor/ChatMessageAttachmentEventArgs.cs | 2 +- src/components/Blazor/ChatMessageEventArgs.cs | 2 +- src/components/Blazor/ChatMessageReaction.cs | 2 +- src/components/Blazor/ChatMessageReactionEventArgs.cs | 2 +- src/components/Blazor/CheckboxChangeEventArgs.cs | 2 +- src/components/Blazor/ComboChangeEventArgs.cs | 2 +- src/components/Blazor/ComponentDataValueChangedEventArgs.cs | 2 +- src/components/Blazor/DateRangeValueEventArgs.cs | 2 +- src/components/Blazor/DropdownItemComponentEventArgs.cs | 2 +- src/components/Blazor/ExpansionPanelComponentEventArgs.cs | 2 +- src/components/Blazor/RadioChangeEventArgs.cs | 2 +- src/components/Blazor/RangeSliderValueEventArgs.cs | 2 +- src/components/Blazor/SelectItemComponentEventArgs.cs | 2 +- src/components/Blazor/SplitterResizeEventArgs.cs | 2 +- src/components/Blazor/TabComponentEventArgs.cs | 2 +- src/components/Blazor/TileChangeStateEventArgsDetail.cs | 2 +- src/components/Blazor/TileComponentEventArgs.cs | 2 +- src/components/Blazor/TreeItemComponentEventArgs.cs | 2 +- src/components/Blazor/TreeSelectionEventArgs.cs | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index e7ef9b00..cd9364c5 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true) is IgbActiveStepChangedEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ActiveStepChangedEventArgsDetail", true) is IgbActiveStepChangedEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index 27c6208a..66bde4f3 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -64,7 +64,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true) is IgbActiveStepChangingEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ActiveStepChangingEventArgsDetail", true) is IgbActiveStepChangingEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 32714a4d..91b06dad 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessageAttachment", true) is IgbChatMessageAttachment detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ChatMessageAttachment", true) is IgbChatMessageAttachment detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index 41237efa..e19da866 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessage", true) is IgbChatMessage detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ChatMessage", true) is IgbChatMessage detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index bf4277eb..d61805c0 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -94,7 +94,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("message") && ConvertReturnValue(args["message"], "ChatMessage", true) is IgbChatMessage message) + if (args != null && args.TryGetValue("message", out var messageObj) && ConvertReturnValue(messageObj, "ChatMessage", true) is IgbChatMessage message) { this.Message = message; } if (args != null && args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index af9343d1..aef0703b 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ChatMessageReaction", true) is IgbChatMessageReaction detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ChatMessageReaction", true) is IgbChatMessageReaction detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index e9054204..312f9d84 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true) is IgbCheckboxChangeEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "CheckboxChangeEventArgsDetail", true) is IgbCheckboxChangeEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 9d02ab0b..b48e69d3 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -61,7 +61,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true) is IgbComboChangeEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ComboChangeEventArgsDetail", true) is IgbComboChangeEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index c044e1e5..9fd240ab 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -56,7 +56,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ReturnToPrimitive(args["detail"]) is object detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ReturnToPrimitive(detailObj) is object detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 662c8fa6..a929d116 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "DateRangeValueDetail", true) is IgbDateRangeValueDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "DateRangeValueDetail", true) is IgbDateRangeValueDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index 1d1904f6..caa2f94a 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "DropdownItem", true) is IgbDropdownItem detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "DropdownItem", true) is IgbDropdownItem detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 381761fe..cffa1567 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -60,7 +60,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "ExpansionPanel", true) is IgbExpansionPanel detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "ExpansionPanel", true) is IgbExpansionPanel detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index 4ca8ac8c..37aaa585 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -63,7 +63,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true) is IgbRadioChangeEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "RadioChangeEventArgsDetail", true) is IgbRadioChangeEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index 23fa2dee..1cf84774 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -61,7 +61,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "RangeSliderValue", true) is IgbRangeSliderValue detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "RangeSliderValue", true) is IgbRangeSliderValue detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 86cdaf4b..e298dbf2 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "SelectItem", true) is IgbSelectItem detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "SelectItem", true) is IgbSelectItem detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index f19f86fe..2c20abb7 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true) is IgbSplitterResizeEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "SplitterResizeEventArgsDetail", true) is IgbSplitterResizeEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index b9c1d750..8f6f823d 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -58,7 +58,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "Tab", true) is IgbTab detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "Tab", true) is IgbTab detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 4429b2d3..4c7a0f4a 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -90,7 +90,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("tile") && ConvertReturnValue(args["tile"], "Tile", true) is IgbTile tile) + if (args != null && args.TryGetValue("tile", out var tileObj) && ConvertReturnValue(tileObj, "Tile", true) is IgbTile tile) { this.Tile = tile; } if (args != null && args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 13a80ea8..3546482b 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "Tile", true) is IgbTile detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "Tile", true) is IgbTile detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index c115486f..481244f8 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -59,7 +59,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "TreeItem", true) is IgbTreeItem detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "TreeItem", true) is IgbTreeItem detail) { this.Detail = detail; } this.SuppressParentNotify = false; diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index 636f6fad..25e29ae7 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -62,7 +62,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict base.FromEventJson(control, args); this.SuppressParentNotify = true; - if (args != null && args.ContainsKey("detail") && ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true) is IgbTreeSelectionEventArgsDetail detail) + if (args != null && args.TryGetValue("detail", out var detailObj) && ConvertReturnValue(detailObj, "TreeSelectionEventArgsDetail", true) is IgbTreeSelectionEventArgsDetail detail) { this.Detail = detail; } this.SuppressParentNotify = false; From 0d3344a18058a3ead74c05daf2c9280d42384451 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 11 Sep 2026 16:25:29 +0300 Subject: [PATCH 61/64] Make required web component members non-nullable on render contexts, CustomDateRange and IconMeta The web component declares instance, message, attachment and value on its render contexts, label and dateRange on CustomDateRange, and collection on IconMeta as required. CustomDateRange is only constructed by user code, so its members are `required`; the others get the same defaults the event payload types use. The render contexts are not wired yet (#393). Co-Authored-By: Claude Fable 5.1 --- src/components/Blazor/ChatAttachmentRenderContext.cs | 6 +++--- src/components/Blazor/ChatInputRenderContext.cs | 4 ++-- src/components/Blazor/ChatMessageRenderContext.cs | 6 +++--- src/components/Blazor/ChatRenderContext.cs | 4 ++-- src/components/Blazor/CustomDateRange.cs | 6 +++--- src/components/Blazor/IconMeta.cs | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/Blazor/ChatAttachmentRenderContext.cs b/src/components/Blazor/ChatAttachmentRenderContext.cs index f923d237..871da4fb 100644 --- a/src/components/Blazor/ChatAttachmentRenderContext.cs +++ b/src/components/Blazor/ChatAttachmentRenderContext.cs @@ -10,13 +10,13 @@ public partial class IgbChatAttachmentRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatAttachmentRenderContext"; } } - private IgbChatMessageAttachment? _attachment; + private IgbChatMessageAttachment _attachment = new IgbChatMessageAttachment(); /// /// The specific attachment being rendered. /// [Parameter] - public IgbChatMessageAttachment? Attachment + public IgbChatMessageAttachment Attachment { get { return this._attachment; } set @@ -26,11 +26,11 @@ public IgbChatMessageAttachment? Attachment { this.DetachChild(this._attachment); } + this._attachment = value; if (value != null) { this.AttachChild(value); } - this._attachment = value; } } diff --git a/src/components/Blazor/ChatInputRenderContext.cs b/src/components/Blazor/ChatInputRenderContext.cs index b7175675..4942fd0d 100644 --- a/src/components/Blazor/ChatInputRenderContext.cs +++ b/src/components/Blazor/ChatInputRenderContext.cs @@ -10,13 +10,13 @@ public partial class IgbChatInputRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatInputRenderContext"; } } - private string? _value; + private string _value = string.Empty; /// /// The current value of the input field. /// [Parameter] - public string? Value + public string Value { get { return this._value; } set diff --git a/src/components/Blazor/ChatMessageRenderContext.cs b/src/components/Blazor/ChatMessageRenderContext.cs index 7c8c4ca0..1045ea0b 100644 --- a/src/components/Blazor/ChatMessageRenderContext.cs +++ b/src/components/Blazor/ChatMessageRenderContext.cs @@ -10,13 +10,13 @@ public partial class IgbChatMessageRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatMessageRenderContext"; } } - private IgbChatMessage? _message; + private IgbChatMessage _message = new IgbChatMessage(); /// /// The specific chat message being rendered. /// [Parameter] - public IgbChatMessage? Message + public IgbChatMessage Message { get { return this._message; } set @@ -26,11 +26,11 @@ public IgbChatMessage? Message { this.DetachChild(this._message); } + this._message = value; if (value != null) { this.AttachChild(value); } - this._message = value; } } diff --git a/src/components/Blazor/ChatRenderContext.cs b/src/components/Blazor/ChatRenderContext.cs index 93075531..7d493c61 100644 --- a/src/components/Blazor/ChatRenderContext.cs +++ b/src/components/Blazor/ChatRenderContext.cs @@ -11,13 +11,13 @@ public partial class IgbChatRenderContext : BaseRendererElement /// public override string Type { get { return "WebChatRenderContext"; } } - private IgbChat? _instance; + private IgbChat _instance = new IgbChat(); /// /// The instance of the component. /// [Parameter] - public IgbChat? Instance + public IgbChat Instance { get { return this._instance; } set diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index d094f93b..f9fbb633 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -10,13 +10,13 @@ public partial class IgbCustomDateRange : BaseRendererElement /// public override string Type { get { return "WebCustomDateRange"; } } - private string? _label; + private string _label = string.Empty; /// /// The text rendered in the chip for this range. /// [Parameter] - public string? Label + public required string Label { get { return this._label; } set @@ -35,7 +35,7 @@ public string? Label /// The date range applied when the chip is selected. /// [Parameter] - public IgbDateRangeValue DateRange + public required IgbDateRangeValue DateRange { get { return this._dateRange; } set diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index 0369e456..5de29349 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -12,13 +12,13 @@ public partial class IgbIconMeta : BaseRendererElement private static bool _marshalByValue = true; - private string? _collection; + private string _collection = string.Empty; /// /// The name of the collection the icon is registered in. /// [Parameter] - public string? Collection + public string Collection { get { return this._collection; } set From 92bb7cb7d5cafc4ca3b2e61f8c1675899b0bd112 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 11 Sep 2026 17:17:51 +0300 Subject: [PATCH 62/64] Make chat message attachments, reactions and suggestions non-nullable arrays The web component coalesces a missing array to empty everywhere it reads these (`attachments ?? []`, `reactions?.includes`, `suggestions ?? []`), so null carried no meaning. Co-Authored-By: Claude Fable 5.1 --- src/components/Blazor/ChatDraftMessage.cs | 6 +++--- src/components/Blazor/ChatMessage.cs | 12 ++++++------ src/components/Blazor/ChatOptions.cs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index 72994774..851bdfad 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -28,13 +28,13 @@ public string Text } } - private IgbChatMessageAttachment[]? _attachments; + private IgbChatMessageAttachment[] _attachments = Array.Empty(); /// /// An array of attachments associated with the draft message. /// [Parameter] - public IgbChatMessageAttachment[]? Attachments + public IgbChatMessageAttachment[] Attachments { get { return this._attachments; } set @@ -81,7 +81,7 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict if (args != null && args.ContainsKey("text")) { this.Text = ReturnToString(args["text"]); } if (args != null && args.ContainsKey("attachments")) - { this.Attachments = ReturnToObjectArray(args["attachments"]); } + { this.Attachments = ReturnToObjectArray(args["attachments"]) ?? Array.Empty(); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index c31856a3..36a24a76 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -88,14 +88,14 @@ public string? Timestamp } } - private IgbChatMessageAttachment[]? _attachments; + private IgbChatMessageAttachment[] _attachments = Array.Empty(); /// /// Optional list of attachments associated with the message, /// such as images, files, or links. /// [Parameter] - public IgbChatMessageAttachment[]? Attachments + public IgbChatMessageAttachment[] Attachments { get { return this._attachments; } set @@ -108,13 +108,13 @@ public IgbChatMessageAttachment[]? Attachments } } - private string[]? _reactions; + private string[] _reactions = Array.Empty(); /// /// Optional list of reactions associated with the message. /// [Parameter] - public string[]? Reactions + public string[] Reactions { get { return this._reactions; } set @@ -183,9 +183,9 @@ protected internal override void FromEventJson(BaseRendererControl control, Dict if (args != null && args.ContainsKey("timestamp")) { this.Timestamp = ReturnToString(args["timestamp"]); } if (args != null && args.ContainsKey("attachments")) - { this.Attachments = ReturnToObjectArray(args["attachments"]); } + { this.Attachments = ReturnToObjectArray(args["attachments"]) ?? Array.Empty(); } if (args != null && args.ContainsKey("reactions")) - { this.Reactions = ReturnToStringArray(args["reactions"]); } + { this.Reactions = ReturnToStringArray(args["reactions"]) ?? Array.Empty(); } this.SuppressParentNotify = false; } diff --git a/src/components/Blazor/ChatOptions.cs b/src/components/Blazor/ChatOptions.cs index c6793c95..341ec5a4 100644 --- a/src/components/Blazor/ChatOptions.cs +++ b/src/components/Blazor/ChatOptions.cs @@ -126,13 +126,13 @@ public string? InputPlaceholder } } - private string[]? _suggestions; + private string[] _suggestions = Array.Empty(); /// /// Suggested text snippets or quick replies that can be shown as user-selectable options. /// [Parameter] - public string[]? Suggestions + public string[] Suggestions { get { return this._suggestions; } set From d797519a7663131fe2110726a6f0f303caf7d444 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 11 Sep 2026 17:17:56 +0300 Subject: [PATCH 63/64] Document nullability conventions for C# Co-Authored-By: Claude Fable 5.1 --- .github/copilot-instructions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 1bc38e94..f2084ac7 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -85,6 +85,9 @@ This repository is the **source code for the Ignite UI for Blazor component libr - Use the latest C# version supported by the target frameworks; prefer modern features (pattern matching, file-scoped namespaces) when they compile on all TFMs - Use strict nullability (`#nullable enable`) in new files +- Annotate honestly: a member is `T?` only when `null` is a meaningful state; never use `!`, `null!` or `default!` to satisfy the analyzer, and keep runtime null checks at public entry points, since annotations are not enforced at runtime +- Prefer non-nullable collections: array and collection properties, parameters and return values are non-nullable and default to an empty collection, unless the web component treats a missing collection differently from an empty one +- Mirror the web component contract on data and option types: a field the `.d.ts` declares required is non-nullable (`required` when only user code constructs the type); a field declared optional or `| null` is `T?` - All public types live in `namespace IgniteUI.Blazor.Controls` - Use PascalCase for public members; camelCase for private fields - Prefix interfaces with `I` (e.g., `IIgniteUIBlazor`) From b2c20fa55611d9f3016fe90c4072d47a8ba9f726 Mon Sep 17 00:00:00 2001 From: damyanpetev Date: Fri, 11 Sep 2026 19:29:50 +0300 Subject: [PATCH 64/64] Keep IgbInput InputMode and Autocomplete unset by default The web component declares both as definite-assignment strings but renders them with ifDefined, so omitted is the normal state and an empty string would emit an invalid attribute value. The conventions note how to read that declaration shape. Co-Authored-By: Claude Fable 5.1 --- .github/copilot-instructions.md | 2 +- src/components/Blazor/Input.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f2084ac7..0a53a4cb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -87,7 +87,7 @@ This repository is the **source code for the Ignite UI for Blazor component libr - Use strict nullability (`#nullable enable`) in new files - Annotate honestly: a member is `T?` only when `null` is a meaningful state; never use `!`, `null!` or `default!` to satisfy the analyzer, and keep runtime null checks at public entry points, since annotations are not enforced at runtime - Prefer non-nullable collections: array and collection properties, parameters and return values are non-nullable and default to an empty collection, unless the web component treats a missing collection differently from an empty one -- Mirror the web component contract on data and option types: a field the `.d.ts` declares required is non-nullable (`required` when only user code constructs the type); a field declared optional or `| null` is `T?` +- Mirror the web component contract on data and option types: a field the `.d.ts` declares required is non-nullable (`required` when only user code constructs the type); a field declared optional or `| null` is `T?`; a definite-assignment attribute (`name!: string`) that the template renders with `ifDefined` is optional too, so check the render when the `.d.ts` shows a bare attribute string - All public types live in `namespace IgniteUI.Blazor.Controls` - Use PascalCase for public members; camelCase for private fields - Prefix interfaces with `I` (e.g., `IIgniteUIBlazor`) diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index 6a2347e4..9ca412e2 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -130,7 +130,7 @@ public bool ReadOnly } } - private string _inputMode = string.Empty; + private string? _inputMode; /// /// The input mode attribute of the control. @@ -139,7 +139,7 @@ public bool ReadOnly /// [Parameter] [WCAttributeName("inputmode")] - public string InputMode + public string? InputMode { get { return this._inputMode; } set @@ -287,13 +287,13 @@ public bool Autofocus } } - private string _autocomplete = string.Empty; + private string? _autocomplete; /// /// The autocomplete attribute of the control. /// [Parameter] - public string Autocomplete + public string? Autocomplete { get { return this._autocomplete; } set