Skip to content

Commit dee2a3a

Browse files
committed
- cleanup
1 parent fb7ba0e commit dee2a3a

File tree

7 files changed

+3
-45
lines changed

7 files changed

+3
-45
lines changed

src/Compatibility/Core/src/AppHostBuilderExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public void Configure(HostBuilderContext context, IServiceProvider services)
105105
return;
106106
}
107107

108-
System.Diagnostics.Debug.WriteLine($"controlType: {controlType}");
109108
_handlers?.TryAddHandler(controlType, typeof(RendererToHandlerShim));
110109
});
111110
}

src/Compatibility/Core/src/Compatibility-net6.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
</ItemGroup>
7979

8080
<ItemGroup>
81+
<Compile Include="AppHostBuilderExtensions.Controls.cs" />
8182
<Compile Include="RendererToHandlerShim.cs" />
8283
<Compile Include="AppHostBuilderExtensions.cs" />
8384
<Compile Include="MauiHandlersCollectionExtensions.cs" />

src/Compatibility/Core/src/Compatibility.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@
6060
</ItemGroup>
6161

6262
<ItemGroup>
63-
<Compile Include="AppHostBuilderExtensions.Controls.cs">
64-
<SubType>Code</SubType>
65-
<Generator>MSBuild:Compile</Generator>
66-
</Compile>
63+
<Compile Include="AppHostBuilderExtensions.Controls.cs" />
6764
<Compile Include="AppHostBuilderExtensions.cs" />
6865
<Compile Include="MauiHandlersCollectionExtensions.cs" />
6966
<Compile Include="Forms.cs" />

src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,6 @@ public static IMauiHandlersCollection TryAddCompatibilityRenderer(this IMauiHand
1818
return handlersCollection;
1919
}
2020

21-
public static IMauiHandlersCollection TryAddCompatibilityRenderer<TControlType, TMauiType, TRenderer>(this IMauiHandlersCollection handlersCollection)
22-
where TMauiType : IFrameworkElement
23-
{
24-
FormsCompatBuilder.AddRenderer(typeof(TControlType), typeof(TRenderer));
25-
26-
#if __ANDROID__ || __IOS__ || WINDOWS || MACCATALYST
27-
handlersCollection.TryAddHandler<TMauiType, RendererToHandlerShim>();
28-
#endif
29-
return handlersCollection;
30-
}
31-
32-
public static IMauiHandlersCollection TryAddCompatibilityRenderer<TControlType, TRenderer>(this IMauiHandlersCollection handlersCollection)
33-
where TControlType : IFrameworkElement
34-
{
35-
handlersCollection.TryAddCompatibilityRenderer<TControlType, TControlType, TRenderer>();
36-
37-
return handlersCollection;
38-
}
39-
4021
public static IMauiHandlersCollection AddCompatibilityRenderer(this IMauiHandlersCollection handlersCollection, Type controlType, Type rendererType)
4122
{
4223
FormsCompatBuilder.AddRenderer(controlType, rendererType);

src/Controls/samples/Controls.Sample/Startup.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ enum PageType { Xaml, Semantics, Main, Blazor, NavigationPage, Shell }
3636

3737
public readonly static bool UseXamlApp = true;
3838
public readonly static bool UseFullDI = false;
39-
public void Configurej(IAppHostBuilder appBuilder)
40-
{
41-
appBuilder
42-
.UseMauiControlsApp<XamlApp>()
43-
.ConfigureServices(services =>
44-
{
45-
services.AddSingleton<ITextService, TextService>();
46-
})
47-
.UseMauiServiceProviderFactory(constructorInjection: true);
48-
}
4939

5040
public void Configure(IAppHostBuilder appBuilder)
5141
{

src/Controls/src/Core/AppHostBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static class AppHostBuilderExtensions
3434
{ typeof(Page), typeof(PageHandler) }
3535
};
3636

37-
public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlersCollection handlersCollection)
37+
internal static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlersCollection handlersCollection)
3838
=> handlersCollection.AddHandlers(DefaultMauiControlHandlers);
3939
}
4040
}

src/Controls/src/Core/Registrar.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.ComponentModel;
44
using System.Linq;
55
using System.Reflection;
6-
using System.Text;
76
using Microsoft.Maui.Controls.StyleSheets;
87

98
namespace Microsoft.Maui.Controls
@@ -391,9 +390,6 @@ public static void RegisterAll(
391390

392391
var length = attributes.Length;
393392

394-
StringBuilder namespaces = new StringBuilder();
395-
StringBuilder renderers = new StringBuilder();
396-
397393
for (var i = 0; i < length; i++)
398394
{
399395
var a = attributes[i];
@@ -406,17 +402,11 @@ public static void RegisterAll(
406402
{
407403
if (attribute.ShouldRegister())
408404
{
409-
namespaces.AppendLine($"using {attribute.TargetType.Name} = {attribute.TargetType.FullName};");
410-
renderers.AppendLine($"handlers.TryAddCompatibilityRenderer(typeof({attribute.HandlerType.Name}), typeof({attribute.TargetType.Name}));");
411-
412405
Registered.Register(attribute.HandlerType, attribute.TargetType, attribute.SupportedVisuals, attribute.Priority);
413406
viewRegistered?.Invoke(attribute.HandlerType);
414407
}
415408
}
416409
}
417-
418-
System.Diagnostics.Debug.WriteLine(namespaces.ToString());
419-
System.Diagnostics.Debug.WriteLine(renderers.ToString());
420410
}
421411

422412
object[] effectAttributes = assembly.GetCustomAttributesSafe(typeof(ExportEffectAttribute));

0 commit comments

Comments
 (0)