/// <summary> /// Map C# referance type instance to Js object with custom name. /// </summary> /// <param name="context">Component that contains the object, mostly 'this' keyword.</param> /// <param name="o">Reference type object</param> /// <param name="name">Js variable name</param> public static async Task MapAsync(BlazorComponent context, object o, string name, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0) { if (!(context is DevComponent)) { return; } //Add DevBoot Js code await DevUtils.DevBootAsync(); AddToOrUpdateObjectList(o, name); UpdateMappingLayer(); await DevUtils.DevWarnAsync($"Mapped {o.GetType().FullName} object in {filePath} at line {lineNumber}."); }
internal static async void AddToStorage(DevComponent o) { DevComponentStorage.Add(o); await DevUtils.DevWarnAsync($"{o.GetType().FullName} is now a dev component"); }