Merge branch 'master' of https://gitee.com/csharpui/CPF into my
This commit is contained in:
commit
095e414085
37
CPF.Razor/CPF.Razor.csproj
Normal file
37
CPF.Razor/CPF.Razor.csproj
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<LangVersion>9.0</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Core\ElementHandlerFactory.cs" />
|
||||||
|
<Compile Remove="Core\ElementHandlerFactoryContext.cs" />
|
||||||
|
<Compile Remove="Core\ElementHandlerRegistry.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!--<ItemGroup>
|
||||||
|
<Compile Remove="Core\**" />
|
||||||
|
<EmbeddedResource Remove="Core\**" />
|
||||||
|
<None Remove="Core\**" />
|
||||||
|
</ItemGroup>-->
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="0.4.1">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\CPF\CPF.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
14
CPF.Razor/Controls/Button.cs
Normal file
14
CPF.Razor/Controls/Button.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class Button
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
14
CPF.Razor/Controls/CheckBox.cs
Normal file
14
CPF.Razor/Controls/CheckBox.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class CheckBox
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
14
CPF.Razor/Controls/DockPanel.cs
Normal file
14
CPF.Razor/Controls/DockPanel.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class DockPanel
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
115
CPF.Razor/Controls/Element.cs
Normal file
115
CPF.Razor/Controls/Element.cs
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
using CPF.Input;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public abstract partial class Element<T> : NativeControlComponentBase<T> where T : UIElement, new()
|
||||||
|
{
|
||||||
|
protected override void RenderAttributes(AttributesBuilder builder)
|
||||||
|
{
|
||||||
|
base.RenderAttributes(builder);
|
||||||
|
|
||||||
|
var type = GetType();
|
||||||
|
var ps = type.GetProperties();
|
||||||
|
foreach (var item in ps)
|
||||||
|
{
|
||||||
|
var attr = item.GetCustomAttributes(typeof(ParameterAttribute), true);
|
||||||
|
if (attr != null && attr.Length > 0 && item.PropertyType != typeof(RenderFragment))
|
||||||
|
{
|
||||||
|
var v = item.GetValue(this);
|
||||||
|
if (v != null)
|
||||||
|
{
|
||||||
|
if (item.PropertyType == typeof(EventCallback) || (item.PropertyType.IsGenericType && item.PropertyType.GetGenericTypeDefinition() == typeof(EventCallback<>)))
|
||||||
|
{//事件注册还必须加小写的on
|
||||||
|
builder.AddAttribute("on" + item.Name, v);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
builder.AddAttribute(item.Name, v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (MarginLeft != null)
|
||||||
|
//{
|
||||||
|
// builder.AddAttribute(nameof(MarginLeft), MarginLeft);
|
||||||
|
//}
|
||||||
|
//if (MarginTop != null)
|
||||||
|
//{
|
||||||
|
// builder.AddAttribute(nameof(MarginTop), MarginTop);
|
||||||
|
//}
|
||||||
|
//if (Height != null)
|
||||||
|
//{
|
||||||
|
// builder.AddAttribute(nameof(Height), Height);
|
||||||
|
//}
|
||||||
|
//if (Width != null)
|
||||||
|
//{
|
||||||
|
// builder.AddAttribute(nameof(Width), Width);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
|
||||||
|
{
|
||||||
|
var p = Element.GetPropertyMetadata(attributeName);
|
||||||
|
if (p != null)
|
||||||
|
{
|
||||||
|
Element.SetValue(attributeValue.ConvertTo(p.PropertyType), attributeName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (events.Contains(attributeName))
|
||||||
|
{
|
||||||
|
handlerIds[attributeName] = attributeEventHandlerId;
|
||||||
|
Renderer.RegisterEvent(attributeEventHandlerId, id => { if (id == attributeEventHandlerId) { handlerIds.Remove(attributeName); } });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<string, ulong> handlerIds = new Dictionary<string, ulong>();
|
||||||
|
HashSet<string> events = new HashSet<string>();
|
||||||
|
|
||||||
|
protected override T CreateElement()
|
||||||
|
{
|
||||||
|
var r = base.CreateElement();
|
||||||
|
var type = typeof(T);
|
||||||
|
var ps = type.GetEvents();
|
||||||
|
foreach (var item in ps)
|
||||||
|
{
|
||||||
|
var name = "on" + item.Name;
|
||||||
|
events.Add(name);
|
||||||
|
r.Commands.Add(item.Name, (s, e) =>
|
||||||
|
{
|
||||||
|
if (handlerIds.TryGetValue(name, out var id))
|
||||||
|
{
|
||||||
|
Renderer.Dispatcher.InvokeAsync(() => Renderer.DispatchEventAsync(id, null, e as EventArgs));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HandleText(int index, string text)
|
||||||
|
{
|
||||||
|
if (Element is CPF.Controls.ContentControl control)
|
||||||
|
{
|
||||||
|
control.Content = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////只要属性和事件自动生成就行
|
||||||
|
//[Parameter] public string Name { get; set; }
|
||||||
|
//[Parameter] public FloatField? MarginLeft { get; set; }
|
||||||
|
//[Parameter] public FloatField? MarginTop { get; set; }
|
||||||
|
//[Parameter] public FloatField? MarginBottom { get; set; }
|
||||||
|
//[Parameter] public FloatField? MarginRight { get; set; }
|
||||||
|
//[Parameter] public CPF.FloatField? Width { get; set; }
|
||||||
|
//[Parameter] public CPF.FloatField? Height { get; set; }
|
||||||
|
//[Parameter] public EventCallback<MouseButtonEventArgs> MouseDown { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
13
CPF.Razor/Controls/Grid.cs
Normal file
13
CPF.Razor/Controls/Grid.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class Grid
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
16
CPF.Razor/Controls/Panel.cs
Normal file
16
CPF.Razor/Controls/Panel.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class Panel : Element<CPF.Controls.Panel>
|
||||||
|
{
|
||||||
|
//[Parameter] public string Background { get; set; }
|
||||||
|
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
13
CPF.Razor/Controls/ResponsivePanel.cs
Normal file
13
CPF.Razor/Controls/ResponsivePanel.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class ResponsivePanel
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
13
CPF.Razor/Controls/StackPanel.cs
Normal file
13
CPF.Razor/Controls/StackPanel.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class StackPanel
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
153
CPF.Razor/Controls/TestElement.cs
Normal file
153
CPF.Razor/Controls/TestElement.cs
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public class TestElement : Microsoft.AspNetCore.Components.IComponent, IHandleEvent, IHandleAfterRender, ICustomTypeDescriptor
|
||||||
|
{
|
||||||
|
[Parameter]
|
||||||
|
public string Test { get; set; }
|
||||||
|
|
||||||
|
public void Attach(RenderHandle renderHandle)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AttributeCollection GetAttributes()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetClassName()
|
||||||
|
{
|
||||||
|
return "TestElement";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetComponentName()
|
||||||
|
{
|
||||||
|
return "GetComponentName";
|
||||||
|
}
|
||||||
|
|
||||||
|
public TypeConverter GetConverter()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EventDescriptor GetDefaultEvent()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyDescriptor GetDefaultProperty()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object GetEditor(Type editorBaseType)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EventDescriptorCollection GetEvents()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EventDescriptorCollection GetEvents(Attribute[] attributes)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyDescriptorCollection GetProperties()
|
||||||
|
{
|
||||||
|
return new PropertyDescriptorCollection(new CpfPropertyDescriptor[] { new CpfPropertyDescriptor("Pro1", false, typeof(string), null) });
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object GetPropertyOwner(PropertyDescriptor pd)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task HandleEventAsync(EventCallbackWorkItem item, object arg)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task OnAfterRenderAsync()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task SetParametersAsync(ParameterView parameters)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class CpfPropertyDescriptor : PropertyDescriptor
|
||||||
|
{
|
||||||
|
public CpfPropertyDescriptor(string name, bool readOnly, Type type, Attribute[] attributes) : base(name, attributes)
|
||||||
|
{
|
||||||
|
isreadonly = readOnly;
|
||||||
|
pType = type;
|
||||||
|
}
|
||||||
|
public string FileTypes { get; set; }
|
||||||
|
public bool IsAttached { get; set; }
|
||||||
|
public bool IsDependency { get; set; }
|
||||||
|
|
||||||
|
bool isreadonly;
|
||||||
|
Type pType;
|
||||||
|
public override Type ComponentType => typeof(TestElement);
|
||||||
|
|
||||||
|
public override bool IsReadOnly => isreadonly;
|
||||||
|
|
||||||
|
public override Type PropertyType => pType;
|
||||||
|
|
||||||
|
public override bool CanResetValue(object component)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override object GetValue(object component)
|
||||||
|
{
|
||||||
|
if (component is UIElement element)
|
||||||
|
{
|
||||||
|
return element.GetPropretyValue(Name);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ResetValue(object component)
|
||||||
|
{
|
||||||
|
//if (component is UIElement element)
|
||||||
|
//{
|
||||||
|
// element.ResetValue(Name);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetValue(object component, object value)
|
||||||
|
{
|
||||||
|
if (component is UIElement element)
|
||||||
|
{
|
||||||
|
element.SetPropretyValue(Name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool ShouldSerializeValue(object component)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return this.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
CPF.Razor/Controls/WindowFrame.cs
Normal file
13
CPF.Razor/Controls/WindowFrame.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class WindowFrame
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
14
CPF.Razor/Controls/WrapPanel.cs
Normal file
14
CPF.Razor/Controls/WrapPanel.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
public partial class WrapPanel
|
||||||
|
{
|
||||||
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||||
|
protected override RenderFragment GetChild() => ChildContent;
|
||||||
|
}
|
||||||
|
}
|
60
CPF.Razor/Controls/generated/Border.generated.cs
Normal file
60
CPF.Razor/Controls/generated/Border.generated.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 在另一个元素四周绘制边框和背景
|
||||||
|
/// </summary>
|
||||||
|
public partial class Border : Element<CPF.Controls.Border>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public UIElement Child { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模糊宽度
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public byte? ShadowBlur { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阴影颜色
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string ShadowColor { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阴影水平偏移
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public sbyte? ShadowHorizontal { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阴影垂直偏移
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public sbyte? ShadowVertical { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
77
CPF.Razor/Controls/generated/Button.generated.cs
Normal file
77
CPF.Razor/Controls/generated/Button.generated.cs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示 Windows 按钮控件,该按钮对 Click 事件做出反应。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Button : Element<CPF.Controls.Button> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
75
CPF.Razor/Controls/generated/Calendar.generated.cs
Normal file
75
CPF.Razor/Controls/generated/Calendar.generated.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 代表一个控件,此控件允许用户使用可视的日历显示来选择日期
|
||||||
|
/// </summary>
|
||||||
|
public partial class Calendar : Element<CPF.Controls.Calendar>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public DateTime? DisplayDate { get; set; }
|
||||||
|
[Parameter] public CalendarMode? DisplayMode { get; set; }
|
||||||
|
[Parameter] public DayOfWeek? FirstDayOfWeek { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public Nullable<DateTime> SelectedDate { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
139
CPF.Razor/Controls/generated/Chart.generated.cs
Normal file
139
CPF.Razor/Controls/generated/Chart.generated.cs
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Charts;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 提供折线图,曲线图,柱状图
|
||||||
|
/// </summary>
|
||||||
|
public partial class Chart : Element<CPF.Charts.Chart>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可以缩放滚动
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? CanScroll { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图表区域填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string ChartFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public IList<IChartData> Data { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 网格填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string GridFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 网格显示模式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public GridShowMode? GridShowMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 水平缩放值 大于等于1
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? HorizontalScaling { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标移入选中的线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string HoverSelectLineFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标移入选中的坐标轴提示背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string HoverSelectTipBackFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标移入选中的坐标轴提示文字填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string HoverSelectTipFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Y轴最大值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Nullable<double> MaxValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Y轴最小值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Nullable<double> MinValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标移入图表的时候显示信息
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? MouseHoverShowTip { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示滚动缩放值的线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string ScrollLineFill { get; set; }
|
||||||
|
[Parameter] public float? ScrollValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// X轴文字
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string XAxis { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// X轴颜色
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string XAxisFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Y轴颜色
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string YAxisFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Y轴刻度分割数量,大于等于1
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? YAxisScaleCount { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
83
CPF.Razor/Controls/generated/CheckBox.generated.cs
Normal file
83
CPF.Razor/Controls/generated/CheckBox.generated.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示用户可以选择和清除的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class CheckBox : Element<CPF.Controls.CheckBox> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public Nullable<bool> IsChecked { get; set; }
|
||||||
|
[Parameter] public bool? IsThreeState { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Checked { get; set; }
|
||||||
|
[Parameter] public EventCallback Indeterminate { get; set; }
|
||||||
|
[Parameter] public EventCallback Unchecked { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
116
CPF.Razor/Controls/generated/CodeTextBox.generated.cs
Normal file
116
CPF.Razor/Controls/generated/CodeTextBox.generated.cs
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支持可视化设计的控件基类
|
||||||
|
/// </summary>
|
||||||
|
public partial class CodeTextBox : Element<CPF.Controls.CodeTextBox>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 如果按 Tab 键会在当前光标位置插入一个制表符,则为 true;如果按 Tab 键会将焦点移动到标记为制表位的下一个控件且不插入制表符,则为 false
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? AcceptsTab { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用于绘制文本框的插入符号的画笔
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string CaretFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否应显示水平 ScrollBar
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public ScrollBarVisibility? HScrollBarVisibility { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用输入法,主要描述的是中文这类输入法
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsInputMethodEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示文本编辑控件对于与该控件交互的用户是否是只读的
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsReadOnly { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示文本编辑控件是否支持撤消功能
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsUndoEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置会突出显示选定文本的画笔。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectionFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,此值定义用于所选文本的画笔。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectionTextFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,是否显示行号
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? ShowLineNumber { get; set; }
|
||||||
|
[Parameter] public string Text { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置存储在撤消队列中的操作的数目。 默认值为-1, 表示撤消队列限制为可用的内存。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? UndoLimit { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否应显示垂直 ScrollBar。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public ScrollBarVisibility? VScrollBarVisibility { get; set; }
|
||||||
|
[Parameter] public EventCallback TextChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
118
CPF.Razor/Controls/generated/ComboBox.generated.cs
Normal file
118
CPF.Razor/Controls/generated/ComboBox.generated.cs
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示带有下拉列表的选择控件,通过单击控件上的箭头可显示或隐藏下拉列表
|
||||||
|
/// </summary>
|
||||||
|
public partial class ComboBox : Element<CPF.Controls.ComboBox>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ItemsControl 中的交替项容器的数目,该控件可使交替容器具有唯一外观,通过附加数据AttachedExtenstions.AlternationIndex 读取循环的ID
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? AlternationCount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示的数据字段或属性
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string DisplayMemberPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public bool? IsDropDownOpen { get; set; }
|
||||||
|
[Parameter] public bool? IsEditable { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否虚拟化UI,只支持StackPanel的虚拟化数据显示。初始化之前设置
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsVirtualizing { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 返回CPF.Controls.ItemCollection类型,可以直接将数据源设置过来
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public IList Items { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或者设置当前选定的项的第一个索引
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? SelectedIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置通过使用 SelectedItem 而获取的 SelectedValuePath 的值。如果数据量大不建议用这个来设置,如果是多选的时候,类型是IEnumerable数据,可以遍历获取
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object SelectedValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用于从 SelectedValue 获取 SelectedItem 的路径。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectedValuePath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标选中方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public SelectionMethod? SelectionMethod { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 选择行为,单选,多选方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public SelectionMode? SelectionMode { get; set; }
|
||||||
|
[Parameter] public bool? ShowClear { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 虚拟模式下元素使用方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public VirtualizationMode? VirtualizationMode { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemMouseEventArgs> ItemMouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemMouseEventArgs> ItemMouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemEventArgs> ItemDoubleClick { get; set; }
|
||||||
|
[Parameter] public EventCallback SelectionChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
75
CPF.Razor/Controls/generated/ContentControl.generated.cs
Normal file
75
CPF.Razor/Controls/generated/ContentControl.generated.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示包含一段任意类型内容的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class ContentControl : Element<CPF.Controls.ContentControl>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
70
CPF.Razor/Controls/generated/Control.generated.cs
Normal file
70
CPF.Razor/Controls/generated/Control.generated.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 支持可视化设计的控件基类
|
||||||
|
/// </summary>
|
||||||
|
public partial class Control : Element<CPF.Controls.Control>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
113
CPF.Razor/Controls/generated/DataGrid.generated.cs
Normal file
113
CPF.Razor/Controls/generated/DataGrid.generated.cs
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示用于在可自定义的网格中显示数据的控件。DataGrid只有虚拟模式,自定义DataGridRow模板需要注意DataGrid的VirtualizationMode属性
|
||||||
|
/// </summary>
|
||||||
|
public partial class DataGrid : Element<CPF.Controls.DataGrid>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ItemsControl 中的交替项容器的数目,该控件可使交替容器具有唯一外观,通过附加数据AttachedExtenstions.AlternationIndex 读取循环的ID
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? AlternationCount { get; set; }
|
||||||
|
[Parameter] public bool? AutoGenerateColumns { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public Collection<DataGridColumn> Columns { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public CustomScrollData CustomScrollData { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示的数据字段或属性
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string DisplayMemberPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否虚拟化UI,只支持StackPanel的虚拟化数据显示。初始化之前设置
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsVirtualizing { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 返回CPF.Controls.ItemCollection类型,可以直接将数据源设置过来
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public IList Items { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或者设置当前选定的项的第一个索引
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? SelectedIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置通过使用 SelectedItem 而获取的 SelectedValuePath 的值。如果数据量大不建议用这个来设置,如果是多选的时候,类型是IEnumerable数据,可以遍历获取
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object SelectedValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用于从 SelectedValue 获取 SelectedItem 的路径。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectedValuePath { get; set; }
|
||||||
|
[Parameter] public DataGridSelectionMode? SelectionMode { get; set; }
|
||||||
|
[Parameter] public DataGridSelectionUnit? SelectionUnit { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public VirtualizationMode? VirtualizationMode { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridCellMouseEventArgs> CellMouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridCellMouseEventArgs> CellMouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridCellEventArgs> CellDoubleClick { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridCellEventArgs> CellClick { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridBeginningEditEventArgs> BeginningEdit { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridCellEditEndingEventArgs> CellEditEnding { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DataGridAutoGeneratingColumnEventArgs> AutoGeneratingColumn { get; set; }
|
||||||
|
[Parameter] public EventCallback SelectionChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
79
CPF.Razor/Controls/generated/DatePicker.generated.cs
Normal file
79
CPF.Razor/Controls/generated/DatePicker.generated.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个允许用户选择日期的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class DatePicker : Element<CPF.Controls.DatePicker>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public bool? AutoClose { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public DateTime? DisplayDate { get; set; }
|
||||||
|
[Parameter] public CalendarMode? DisplayMode { get; set; }
|
||||||
|
[Parameter] public DayOfWeek? FirstDayOfWeek { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public bool? IsDropDownOpen { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public Nullable<DateTime> SelectedDate { get; set; }
|
||||||
|
[Parameter] public string SelectedDateFormat { get; set; }
|
||||||
|
[Parameter] public bool? ShowClearButton { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
71
CPF.Razor/Controls/generated/Decorator.generated.cs
Normal file
71
CPF.Razor/Controls/generated/Decorator.generated.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 提供在单个子元素
|
||||||
|
/// </summary>
|
||||||
|
public partial class Decorator : Element<CPF.Controls.Decorator>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public UIElement Child { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
55
CPF.Razor/Controls/generated/DockPanel.generated.cs
Normal file
55
CPF.Razor/Controls/generated/DockPanel.generated.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个区域,从中可以按相对位置水平或垂直排列各个子元素。
|
||||||
|
/// </summary>
|
||||||
|
public partial class DockPanel : Element<CPF.Controls.DockPanel>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示 DockPanel 中的最后一个子元素是否拉伸以填充剩余的可用空间
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? LastChildFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
28
CPF.Razor/Controls/generated/DocumentBlock.generated.cs
Normal file
28
CPF.Razor/Controls/generated/DocumentBlock.generated.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 简单的文档控件,支持图片字符控件等元素布局,支持每个字符设置样式
|
||||||
|
/// </summary>
|
||||||
|
public partial class DocumentBlock : Element<CPF.Controls.DocumentBlock>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public string Text { get; set; }
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
28
CPF.Razor/Controls/generated/Ellipse.generated.cs
Normal file
28
CPF.Razor/Controls/generated/Ellipse.generated.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 绘制椭圆形
|
||||||
|
/// </summary>
|
||||||
|
public partial class Ellipse : Element<CPF.Shapes.Ellipse>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
77
CPF.Razor/Controls/generated/Expander.generated.cs
Normal file
77
CPF.Razor/Controls/generated/Expander.generated.cs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一种控件,该控件显示具有可折叠内容显示窗口的标题。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Expander : Element<CPF.Controls.Expander> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public object Header { get; set; }
|
||||||
|
[Parameter] public bool? IsExpanded { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
59
CPF.Razor/Controls/generated/Grid.generated.cs
Normal file
59
CPF.Razor/Controls/generated/Grid.generated.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 网格布局
|
||||||
|
/// </summary>
|
||||||
|
public partial class Grid : Element<CPF.Controls.Grid>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string LineFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? LineStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
80
CPF.Razor/Controls/generated/GridSplitter.generated.cs
Normal file
80
CPF.Razor/Controls/generated/GridSplitter.generated.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示重新分布 Grid 控件的列间距或行间距的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class GridSplitter : Element<CPF.Controls.GridSplitter>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public UIElement Child { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public float? DragIncrement { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public float? KeyboardIncrement { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public string PreviewColor { get; set; }
|
||||||
|
[Parameter] public GridResizeBehavior? ResizeBehavior { get; set; }
|
||||||
|
[Parameter] public GridResizeDirection? ResizeDirection { get; set; }
|
||||||
|
[Parameter] public bool? ShowsPreview { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragStartedEventArgs> DragStarted { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragDeltaEventArgs> DragDelta { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragCompletedEventArgs> DragCompleted { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
71
CPF.Razor/Controls/generated/Label.generated.cs
Normal file
71
CPF.Razor/Controls/generated/Label.generated.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示控件的文本标签。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Label : Element<CPF.Controls.Label>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public string Text { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
30
CPF.Razor/Controls/generated/Line.generated.cs
Normal file
30
CPF.Razor/Controls/generated/Line.generated.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 在两个点之间绘制直线。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Line : Element<CPF.Shapes.Line>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public Point? EndPoint { get; set; }
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
[Parameter] public Point? StartPoint { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
115
CPF.Razor/Controls/generated/ListBox.generated.cs
Normal file
115
CPF.Razor/Controls/generated/ListBox.generated.cs
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 包含可选项列表
|
||||||
|
/// </summary>
|
||||||
|
public partial class ListBox : Element<CPF.Controls.ListBox>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ItemsControl 中的交替项容器的数目,该控件可使交替容器具有唯一外观,通过附加数据AttachedExtenstions.AlternationIndex 读取循环的ID
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? AlternationCount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示的数据字段或属性
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string DisplayMemberPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否虚拟化UI,只支持StackPanel的虚拟化数据显示。初始化之前设置
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsVirtualizing { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 返回CPF.Controls.ItemCollection类型,可以直接将数据源设置过来
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public IList Items { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或者设置当前选定的项的第一个索引
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? SelectedIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置通过使用 SelectedItem 而获取的 SelectedValuePath 的值。如果数据量大不建议用这个来设置,如果是多选的时候,类型是IEnumerable数据,可以遍历获取
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object SelectedValue { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用于从 SelectedValue 获取 SelectedItem 的路径。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectedValuePath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 鼠标选中方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public SelectionMethod? SelectionMethod { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 选择行为,单选,多选方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public SelectionMode? SelectionMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 虚拟模式下元素使用方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public VirtualizationMode? VirtualizationMode { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemMouseEventArgs> ItemMouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemMouseEventArgs> ItemMouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.ListBoxItemEventArgs> ItemDoubleClick { get; set; }
|
||||||
|
[Parameter] public EventCallback SelectionChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
29
CPF.Razor/Controls/generated/NativeElement.generated.cs
Normal file
29
CPF.Razor/Controls/generated/NativeElement.generated.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用于内嵌原生控件,一般来说原生控件无法使用渲染变换,无法调整ZIndex,只能在最前端,可能无法透明。一般尽可能少用该控件
|
||||||
|
/// </summary>
|
||||||
|
public partial class NativeElement : Element<CPF.Controls.NativeElement>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景色,有些平台可能无法透明
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BackColor { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 设置对应平台的控件句柄
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
89
CPF.Razor/Controls/generated/NumericUpDown.generated.cs
Normal file
89
CPF.Razor/Controls/generated/NumericUpDown.generated.cs
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示显示数值的 Windows 数字显示框(也称作 up-down 控件)。
|
||||||
|
/// </summary>
|
||||||
|
public partial class NumericUpDown : Element<CPF.Controls.NumericUpDown>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public double? Increment { get; set; }
|
||||||
|
[Parameter] public double? LargeChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最大值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Maximum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最小值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Minimum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public double? SmallChange { get; set; }
|
||||||
|
[Parameter] public Func<string, double> StringToValueConvert { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当前值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Value { get; set; }
|
||||||
|
[Parameter] public Func<double, string> ValueToStringConvert { get; set; }
|
||||||
|
[Parameter] public EventCallback ValueChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
71
CPF.Razor/Controls/generated/PageManger.generated.cs
Normal file
71
CPF.Razor/Controls/generated/PageManger.generated.cs
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 页面管理,Pages里加多个页面,切换显示
|
||||||
|
/// </summary>
|
||||||
|
public partial class PageManger : Element<CPF.Controls.PageManger>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public int? PageIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
51
CPF.Razor/Controls/generated/Panel.generated.cs
Normal file
51
CPF.Razor/Controls/generated/Panel.generated.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 为所有 Panel 元素提供基类。 使用 Panel 元素放置和排列UIElement,对于Panel的继承者的子对象的如果尺寸超过Panel对齐方式是左上角而不是居中
|
||||||
|
/// </summary>
|
||||||
|
public partial class Panel : Element<CPF.Controls.Panel>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
33
CPF.Razor/Controls/generated/Path.generated.cs
Normal file
33
CPF.Razor/Controls/generated/Path.generated.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 绘制一系列相互连接的直线和曲线。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Path : Element<CPF.Shapes.Path>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public PathGeometry Data { get; set; }
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 Stretch 模式,该模式确定内容适应可用空间的方式。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stretch? Stretch { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
34
CPF.Razor/Controls/generated/Picture.generated.cs
Normal file
34
CPF.Razor/Controls/generated/Picture.generated.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 显示图像,支持路径、Url、Image、Bitmap、Stream、byte[]、支持GIF播放
|
||||||
|
/// </summary>
|
||||||
|
public partial class Picture : Element<CPF.Controls.Picture>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片源,可以是路径、Url、Drawing.Image对象、Stream、byte[]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Source { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片缩放模式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stretch? Stretch { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 描述如何对内容应用缩放,并限制对已命名像素类型的缩放。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public StretchDirection? StretchDirection { get; set; }
|
||||||
|
[Parameter] public EventCallback ImageFailed { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
78
CPF.Razor/Controls/generated/PieChart.generated.cs
Normal file
78
CPF.Razor/Controls/generated/PieChart.generated.cs
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Charts;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 饼图
|
||||||
|
/// </summary>
|
||||||
|
public partial class PieChart : Element<CPF.Charts.PieChart>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public IList<PieChartData> Data { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 圆环宽度
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FloatField? RingWidth { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public string TipLineFill { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
28
CPF.Razor/Controls/generated/Polygon.generated.cs
Normal file
28
CPF.Razor/Controls/generated/Polygon.generated.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 多边形
|
||||||
|
/// </summary>
|
||||||
|
public partial class Polygon : Element<CPF.Shapes.Polygon>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
28
CPF.Razor/Controls/generated/Polyline.generated.cs
Normal file
28
CPF.Razor/Controls/generated/Polyline.generated.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 折线
|
||||||
|
/// </summary>
|
||||||
|
public partial class Polyline : Element<CPF.Shapes.Polyline>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
90
CPF.Razor/Controls/generated/ProgressBar.generated.cs
Normal file
90
CPF.Razor/Controls/generated/ProgressBar.generated.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 指示操作进度。
|
||||||
|
/// </summary>
|
||||||
|
public partial class ProgressBar : Element<CPF.Controls.ProgressBar>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ProgressBar 是显示实际值,还是显示一般的连续进度反馈。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsIndeterminate { get; set; }
|
||||||
|
[Parameter] public double? LargeChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最大值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Maximum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最小值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Minimum { get; set; }
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public double? SmallChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当前值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Value { get; set; }
|
||||||
|
[Parameter] public EventCallback ValueChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
87
CPF.Razor/Controls/generated/RadioButton.generated.cs
Normal file
87
CPF.Razor/Controls/generated/RadioButton.generated.cs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示可由用户选择但不能清除的按钮。 可以通过单击来设置 IsChecked 的 RadioButton 属性,但只能以编程方式清除该属性。
|
||||||
|
/// </summary>
|
||||||
|
public partial class RadioButton : Element<CPF.Controls.RadioButton> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 通过该属性对RadioButton分组,通过Root.GetRadioButtonValue()获取分组的选中值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string GroupName { get; set; }
|
||||||
|
[Parameter] public Nullable<bool> IsChecked { get; set; }
|
||||||
|
[Parameter] public bool? IsThreeState { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Checked { get; set; }
|
||||||
|
[Parameter] public EventCallback Indeterminate { get; set; }
|
||||||
|
[Parameter] public EventCallback Unchecked { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
28
CPF.Razor/Controls/generated/Rectangle.generated.cs
Normal file
28
CPF.Razor/Controls/generated/Rectangle.generated.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 矩形
|
||||||
|
/// </summary>
|
||||||
|
public partial class Rectangle : Element<CPF.Shapes.Rectangle>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 事件响应范围是路径的线条上还是路径围成的范围内,true就是在线条上
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestOnPath { get; set; }
|
||||||
|
[Parameter] public string StrokeFill { get; set; }
|
||||||
|
[Parameter] public Stroke? StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
79
CPF.Razor/Controls/generated/RepeatButton.generated.cs
Normal file
79
CPF.Razor/Controls/generated/RepeatButton.generated.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示从按下按钮到释放按钮的时间内重复引发其 Click 事件的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class RepeatButton : Element<CPF.Controls.RepeatButton> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public int? Delay { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public int? Interval { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
63
CPF.Razor/Controls/generated/ResponsivePanel.generated.cs
Normal file
63
CPF.Razor/Controls/generated/ResponsivePanel.generated.cs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 响应式布局容器,模仿bootstrap
|
||||||
|
/// </summary>
|
||||||
|
public partial class ResponsivePanel : Element<CPF.Controls.ResponsivePanel>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义响应布局的尺寸
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BreakPoints? BreakPoints { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义列数
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? MaxDivision { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示分割列线条
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? ShowGridLines { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
34
CPF.Razor/Controls/generated/SVG.generated.cs
Normal file
34
CPF.Razor/Controls/generated/SVG.generated.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public partial class SVG : Element<CPF.Svg.SVG>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Fill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// SVG源,可以是路径、Url、或者svg文档字符串
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Source { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片缩放模式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stretch? Stretch { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 描述如何对内容应用缩放,并限制对已命名像素类型的缩放。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public StretchDirection? StretchDirection { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
87
CPF.Razor/Controls/generated/ScrollBar.generated.cs
Normal file
87
CPF.Razor/Controls/generated/ScrollBar.generated.cs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 滚动条
|
||||||
|
/// </summary>
|
||||||
|
public partial class ScrollBar : Element<CPF.Controls.ScrollBar>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public double? LargeChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最大值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Maximum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最小值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Minimum { get; set; }
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public double? SmallChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当前值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Value { get; set; }
|
||||||
|
[Parameter] public float? ViewportSize { get; set; }
|
||||||
|
[Parameter] public EventCallback ValueChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
79
CPF.Razor/Controls/generated/ScrollViewer.generated.cs
Normal file
79
CPF.Razor/Controls/generated/ScrollViewer.generated.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示可包含其他可视元素的可滚动区域
|
||||||
|
/// </summary>
|
||||||
|
public partial class ScrollViewer : Element<CPF.Controls.ScrollViewer> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public float? HorizontalOffset { get; set; }
|
||||||
|
[Parameter] public ScrollBarVisibility? HorizontalScrollBarVisibility { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public float? VerticalOffset { get; set; }
|
||||||
|
[Parameter] public ScrollBarVisibility? VerticalScrollBarVisibility { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
70
CPF.Razor/Controls/generated/Separator.generated.cs
Normal file
70
CPF.Razor/Controls/generated/Separator.generated.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 分割线
|
||||||
|
/// </summary>
|
||||||
|
public partial class Separator : Element<CPF.Controls.Separator>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
121
CPF.Razor/Controls/generated/Slider.generated.cs
Normal file
121
CPF.Razor/Controls/generated/Slider.generated.cs
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个控件,该控件可让用户通过沿 Thumb 移动 Track 控件从一个值范围中进行选择。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Slider : Element<CPF.Controls.Slider>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置在按下 RepeatButton 之后等待执行用于移动 Thumb 的命令(如 DecreaseLarge 命令)的时间(以毫秒为单位)。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? Delay { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置当用户单击 RepeatButton 的 Slider 时增加或减少命令之间的时间量(以毫秒为单位)
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? Interval { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 如果增加值的方向向左(对于水平滑块)或向下(对于垂直滑块),则为 true;否则为 false。 默认值为 false。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsDirectionReversed { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否立即将 Slider 的 Thumb 移动到在鼠标指针悬停在 Slider 轨道的上方时鼠标单击的位置。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsMoveToPointEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示 Slider 是否自动将 Thumb 移动到最近的刻度线
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsSnapToTickEnabled { get; set; }
|
||||||
|
[Parameter] public double? LargeChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最大值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Maximum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最小值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Minimum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 布局方向
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public double? SmallChange { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 刻度线之间的距离。 默认值为 (1.0)。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? TickFrequency { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置与 Track 的 Slider 相关的刻度线的位置。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TickPlacement? TickPlacement { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置刻度线的位置。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Collection<float> Ticks { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当前值
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public double? Value { get; set; }
|
||||||
|
[Parameter] public EventCallback ValueChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
55
CPF.Razor/Controls/generated/StackPanel.generated.cs
Normal file
55
CPF.Razor/Controls/generated/StackPanel.generated.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 将子元素排列成水平或垂直的一行
|
||||||
|
/// </summary>
|
||||||
|
public partial class StackPanel : Element<CPF.Controls.StackPanel>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 布局方向
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
91
CPF.Razor/Controls/generated/Switch.generated.cs
Normal file
91
CPF.Razor/Controls/generated/Switch.generated.cs
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 左右切换的按钮
|
||||||
|
/// </summary>
|
||||||
|
public partial class Switch : Element<CPF.Controls.Switch> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public Nullable<bool> IsChecked { get; set; }
|
||||||
|
[Parameter] public bool? IsThreeState { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 关闭时候显示的背景色
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string OffColor { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 打开时候显示的背景色
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string OnColor { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Checked { get; set; }
|
||||||
|
[Parameter] public EventCallback Indeterminate { get; set; }
|
||||||
|
[Parameter] public EventCallback Unchecked { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
78
CPF.Razor/Controls/generated/TabControl.generated.cs
Normal file
78
CPF.Razor/Controls/generated/TabControl.generated.cs
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示包含多个项的控件,这些项共享屏幕上的同一空间。
|
||||||
|
/// </summary>
|
||||||
|
public partial class TabControl : Element<CPF.Controls.TabControl>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置当前选择中第一项的索引,如果选择为空,则返回负一(-1)
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? SelectedIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 选项卡标题相对于选项卡内容的对齐方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Dock? TabStripPlacement { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
45
CPF.Razor/Controls/generated/TextBlock.generated.cs
Normal file
45
CPF.Razor/Controls/generated/TextBlock.generated.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文本显示
|
||||||
|
/// </summary>
|
||||||
|
public partial class TextBlock : Element<CPF.Controls.TextBlock>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public string Text { get; set; }
|
||||||
|
[Parameter] public TextAlignment? TextAlignment { get; set; }
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文字描边
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? TextStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文字描边
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string TextStrokeFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本裁剪
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextTrimming? TextTrimming { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本在垂直方向的对齐方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public VerticalAlignment? VerticalAlignment { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
136
CPF.Razor/Controls/generated/TextBox.generated.cs
Normal file
136
CPF.Razor/Controls/generated/TextBox.generated.cs
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个控件,该控件可用于显示或编辑无格式文本。
|
||||||
|
/// </summary>
|
||||||
|
public partial class TextBox : Element<CPF.Controls.TextBox>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示在用户按 ENTER 键时文本编辑控件如何响应。如果按 Enter 键会在当前光标位置插入一个新行,则为 true;否则将忽略 Enter 键
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? AcceptsReturn { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 如果按 Tab 键会在当前光标位置插入一个制表符,则为 true;如果按 Tab 键会将焦点移动到标记为制表位的下一个控件且不插入制表符,则为 false
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? AcceptsTab { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用于绘制文本框的插入符号的画笔
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string CaretFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否应显示水平 ScrollBar
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public ScrollBarVisibility? HScrollBarVisibility { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许粘贴图片
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsAllowPasteImage { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用输入法,主要描述的是中文这类输入法
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsInputMethodEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示文本编辑控件对于与该控件交互的用户是否是只读的
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsReadOnly { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示文本编辑控件是否支持撤消功能
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsUndoEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 最大长度,为0的时候不限
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? MaxLength { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 密码模式的代替字符
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public char? PasswordChar { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置会突出显示选定文本的画笔。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectionFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,此值定义用于所选文本的画笔。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string SelectionTextFill { get; set; }
|
||||||
|
[Parameter] public string Text { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本对齐方式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextAlignment? TextAlignment { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置存储在撤消队列中的操作的数目。 默认值为-1, 表示撤消队列限制为可用的内存。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? UndoLimit { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否应显示垂直 ScrollBar。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public ScrollBarVisibility? VScrollBarVisibility { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 自动换行
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? WordWarp { get; set; }
|
||||||
|
[Parameter] public EventCallback TextChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
74
CPF.Razor/Controls/generated/Thumb.generated.cs
Normal file
74
CPF.Razor/Controls/generated/Thumb.generated.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示可由用户拖动的控件
|
||||||
|
/// </summary>
|
||||||
|
public partial class Thumb : Element<CPF.Controls.Thumb>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public UIElement Child { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragStartedEventArgs> DragStarted { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragDeltaEventArgs> DragDelta { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.DragCompletedEventArgs> DragCompleted { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
74
CPF.Razor/Controls/generated/TimePicker.generated.cs
Normal file
74
CPF.Razor/Controls/generated/TimePicker.generated.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个允许用户选择时间的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class TimePicker : Element<CPF.Controls.TimePicker>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public TimeSpan? MaxTime { get; set; }
|
||||||
|
[Parameter] public TimeSpan? MinTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
[Parameter] public TimeSpan? SelectedTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
83
CPF.Razor/Controls/generated/ToggleButton.generated.cs
Normal file
83
CPF.Razor/Controls/generated/ToggleButton.generated.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 可切换状态的控件基类
|
||||||
|
/// </summary>
|
||||||
|
public partial class ToggleButton : Element<CPF.Controls.ToggleButton> ,IHandleChildContentText
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public ClickMode? ClickMode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容可以是字符串,UI元素等等
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Content { get; set; }
|
||||||
|
[Parameter] public string ContentStringFormat { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public Nullable<bool> IsChecked { get; set; }
|
||||||
|
[Parameter] public bool? IsThreeState { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Checked { get; set; }
|
||||||
|
[Parameter] public EventCallback Indeterminate { get; set; }
|
||||||
|
[Parameter] public EventCallback Unchecked { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> Click { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
76
CPF.Razor/Controls/generated/Track.generated.cs
Normal file
76
CPF.Razor/Controls/generated/Track.generated.cs
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个处理 Thumb 控件的定位和大小调整的控件基元
|
||||||
|
/// </summary>
|
||||||
|
public partial class Track : Element<CPF.Controls.Track>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public bool? IsDirectionReversed { get; set; }
|
||||||
|
[Parameter] public float? Maximum { get; set; }
|
||||||
|
[Parameter] public float? Minimum { get; set; }
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public float? Value { get; set; }
|
||||||
|
[Parameter] public float? ViewportSize { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
88
CPF.Razor/Controls/generated/TreeView.generated.cs
Normal file
88
CPF.Razor/Controls/generated/TreeView.generated.cs
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个控件,该控件在树结构(其中的项可以展开和折叠)中显示分层数据。
|
||||||
|
/// </summary>
|
||||||
|
public partial class TreeView : Element<CPF.Controls.TreeView>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ItemsControl 中的交替项容器的数目,该控件可使交替容器具有唯一外观,通过附加数据AttachedExtenstions.AlternationIndex 读取循环的ID
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public uint? AlternationCount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示的数据字段或属性
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string DisplayMemberPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 返回CPF.Controls.ItemCollection类型,可以直接将数据源设置过来
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public IList Items { get; set; }
|
||||||
|
[Parameter] public string ItemsMemberPath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback SelectionChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.TreeViewItemMouseEventArgs> ItemMouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.TreeViewItemMouseEventArgs> ItemMouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Controls.TreeViewItemEventArgs> ItemDoubleClick { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
156
CPF.Razor/Controls/generated/UIElement.generated.cs
Normal file
156
CPF.Razor/Controls/generated/UIElement.generated.cs
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Effects;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public partial class Element<T>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示此元素能否用作拖放操作的目标。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? AllowDrop { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否剪切此元素的内容(或来自此元素的子元素的内容)使其适合包含元素的大小。这是一个依赖项属性。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? ClipToBounds { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定的命令上下文
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object CommandContext { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 右键菜单
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public ContextMenu ContextMenu { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 光标
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Cursor Cursor { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定的数据上下文
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object DataContext { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 位图特效
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Effect Effect { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可以获取焦点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? Focusable { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 按tab键切换焦点显示的聚焦框填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FocusFrameFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 聚焦框到元素边缘距离
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? FocusFramePadding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 按tab键切换焦点显示的聚焦框
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? FocusFrameStroke { get; set; }
|
||||||
|
[Parameter] public FloatField? Height { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图形抗锯齿
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsAntiAlias { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsEnabled { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可以通过鼠标点击到
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsHitTestVisible { get; set; }
|
||||||
|
[Parameter] public FloatField? MarginBottom { get; set; }
|
||||||
|
[Parameter] public FloatField? MarginLeft { get; set; }
|
||||||
|
[Parameter] public FloatField? MarginRight { get; set; }
|
||||||
|
[Parameter] public FloatField? MarginTop { get; set; }
|
||||||
|
[Parameter] public FloatField? MaxHeight { get; set; }
|
||||||
|
[Parameter] public FloatField? MaxWidth { get; set; }
|
||||||
|
[Parameter] public FloatField? MinHeight { get; set; }
|
||||||
|
[Parameter] public FloatField? MinWidth { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 元素名称
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 当添加触发器时并且触发器有设置动画,如果满足条件是否播放动画
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? PlayAnimationOnAddTrigger { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 渲染变换
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Transform RenderTransform { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 渲染原点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public PointField? RenderTransformOrigin { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// tab键切换元素焦点时候的顺序
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? TabIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 与控件关联的用户自定义数据
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object Tag { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置在用户界面 (UI) 中为此元素显示的工具提示对象
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public object ToolTip { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值指示是否应向此元素的大小和位置布局应用布局舍入。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? UseLayoutRounding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// UI元素可见性
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Visibility? Visibility { get; set; }
|
||||||
|
[Parameter] public FloatField? Width { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Z轴
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public int? ZIndex { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.UIElementAddedEventArgs> UIElementAdded { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.UIElementRemovedEventArgs> UIElementRemoved { get; set; }
|
||||||
|
[Parameter] public EventCallback DesiredSizeChanged { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseButtonEventArgs> PreviewMouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseButtonEventArgs> PreviewMouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseButtonEventArgs> MouseDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseButtonEventArgs> MouseUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> DoubleClick { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseEventArgs> MouseMove { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseEventArgs> MouseEnter { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseEventArgs> MouseLeave { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.TouchEventArgs> TouchUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.TouchEventArgs> TouchDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.TouchEventArgs> TouchMove { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.MouseWheelEventArgs> MouseWheel { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.KeyEventArgs> KeyDown { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.KeyEventArgs> KeyUp { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.TextInputEventArgs> TextInput { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.GotFocusEventArgs> GotFocus { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> LostFocus { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> LayoutUpdated { get; set; }
|
||||||
|
[Parameter] public EventCallback Disposed { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.RoutedEventArgs> ToolTipOpening { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.DragEventArgs> DragEnter { get; set; }
|
||||||
|
[Parameter] public EventCallback DragLeave { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.DragEventArgs> DragOver { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.Input.DragEventArgs> Drop { get; set; }
|
||||||
|
[Parameter] public EventCallback<CPF.CPFPropertyChangedEventArgs> PropertyChanged { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
79
CPF.Razor/Controls/generated/Viewbox.generated.cs
Normal file
79
CPF.Razor/Controls/generated/Viewbox.generated.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个内容修饰器,以便拉伸或缩放单一子项使其填满可用的控件。
|
||||||
|
/// </summary>
|
||||||
|
public partial class Viewbox : Element<CPF.Controls.Viewbox>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
[Parameter] public UIElement Child { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 ViewboxStretch 模式,该模式确定内容适应可用空间的方式。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stretch? Stretch { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 StretchDirection,它确定缩放如何应用 Viewbox 的内容。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public StretchDirection? StretchDirection { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
80
CPF.Razor/Controls/generated/WindowFrame.generated.cs
Normal file
80
CPF.Razor/Controls/generated/WindowFrame.generated.cs
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 通用窗体框架,包含窗体边框,系统按钮,阴影这些元素
|
||||||
|
/// </summary>
|
||||||
|
public partial class WindowFrame : Element<CPF.Controls.WindowFrame>
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框类型,BorderStroke和BorderThickness
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。格式 一个数字或者四个数字 比如10或者 10,10,10,10 topLeft,topRight,bottomRight,bottomLeft
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体名
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体尺寸,点
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 字体样式
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 控件文字的填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
[Parameter] public bool? MaximizeBox { get; set; }
|
||||||
|
[Parameter] public bool? MinimizeBox { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置描述 Thickness 及其子元素之间的空间量的 Border 值。格式:all或者left,top,right,bottom
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? Padding { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阴影宽度
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public byte? ShadowBlur { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 显示标题栏图标
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? ShowIcon { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
[Parameter] public EventCallback Initialized { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
54
CPF.Razor/Controls/generated/WrapPanel.generated.cs
Normal file
54
CPF.Razor/Controls/generated/WrapPanel.generated.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// CPF自动生成.
|
||||||
|
|
||||||
|
using CPF;
|
||||||
|
using CPF.Controls;
|
||||||
|
using CPF.Drawing;
|
||||||
|
using CPF.Input;
|
||||||
|
using CPF.Razor;
|
||||||
|
using CPF.Shapes;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace CPF.Razor.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 按从左到右的顺序位置定位子元素,在包含框的边缘处将内容切换到下一行。 后续排序按照从上至下或从右至左的顺序进行,具体取决于 Orientation 属性的值。
|
||||||
|
/// </summary>
|
||||||
|
public partial class WrapPanel : Element<CPF.Controls.WrapPanel>
|
||||||
|
{
|
||||||
|
|
||||||
|
[Parameter] public string Background { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 边框线条填充
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public string BorderFill { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置线条类型
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Stroke? BorderStroke { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 四周边框粗细
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public Thickness? BorderThickness { get; set; }
|
||||||
|
[Parameter] public BorderType? BorderType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置一个值,该值表示将 Border 的角倒圆的程度。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public CornerRadius? CornerRadius { get; set; }
|
||||||
|
[Parameter] public string FontFamily { get; set; }
|
||||||
|
[Parameter] public float? FontSize { get; set; }
|
||||||
|
[Parameter] public FontStyles? FontStyle { get; set; }
|
||||||
|
[Parameter] public string Foreground { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 定义一个控件组,一般由多个元素组成,在设计器中,子元素和该控件为一个控件组,点击子元素拖动时,将作为整体拖动整个控件组。如果该控件被子元素盖住,按Alt+Ctrl键加鼠标左键可以选中该控件。按住Alt键可以移动子元素。
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public bool? IsGroup { get; set; }
|
||||||
|
[Parameter] public float? ItemHeight { get; set; }
|
||||||
|
[Parameter] public float? ItemWidth { get; set; }
|
||||||
|
[Parameter] public Orientation? Orientation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 表示一个文本修饰,它是可添加到文本的视觉装饰(如下划线)。字符串格式: overline/Underline/Strikethrough/none [width[,Solid/Dash/Dot/DashDot/DashDotDot]] [color]
|
||||||
|
/// <summary>
|
||||||
|
[Parameter] public TextDecoration? TextDecoration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
44
CPF.Razor/Core/AttributesBuilder.cs
Normal file
44
CPF.Razor/Core/AttributesBuilder.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Components.Rendering;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
// This wraps a RenderTreeBuilder in such a way that consumers
|
||||||
|
// can only call the desired AddAttribute method, can't supply
|
||||||
|
// sequence numbers, and can't leak the instance outside their
|
||||||
|
// position in the call stack.
|
||||||
|
|
||||||
|
#pragma warning disable CA1815 // Override equals and operator equals on value types; these instances are never compared
|
||||||
|
public readonly ref struct AttributesBuilder
|
||||||
|
#pragma warning restore CA1815 // Override equals and operator equals on value types
|
||||||
|
{
|
||||||
|
private readonly RenderTreeBuilder _underlyingBuilder;
|
||||||
|
|
||||||
|
public AttributesBuilder(RenderTreeBuilder underlyingBuilder)
|
||||||
|
{
|
||||||
|
_underlyingBuilder = underlyingBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddAttribute(string name, object value)
|
||||||
|
{
|
||||||
|
// Using a fixed sequence number is allowed for attribute frames,
|
||||||
|
// and causes the diff algorithm to use a dictionary to match old
|
||||||
|
// and new values.
|
||||||
|
_underlyingBuilder.AddAttribute(0, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddAttribute(string name, bool value)
|
||||||
|
{
|
||||||
|
// Using a fixed sequence number is allowed for attribute frames,
|
||||||
|
// and causes the diff algorithm to use a dictionary to match old
|
||||||
|
// and new values.
|
||||||
|
|
||||||
|
// bool values are converted to ints (which later become strings) to ensure that
|
||||||
|
// all values are always rendered, not only 'true' values. This ensures that the
|
||||||
|
// element handlers will see all property changes and can handle them as needed.
|
||||||
|
_underlyingBuilder.AddAttribute(0, name, value ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
CPF.Razor/Core/ElementHandlerFactory.cs
Normal file
22
CPF.Razor/Core/ElementHandlerFactory.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.BlazorBindings
|
||||||
|
{
|
||||||
|
internal class ElementHandlerFactory
|
||||||
|
{
|
||||||
|
private readonly Func<NativeComponentRenderer, IElementHandler, IElementHandler> _callback;
|
||||||
|
|
||||||
|
public ElementHandlerFactory(Func<NativeComponentRenderer, IElementHandler, IElementHandler> callback)
|
||||||
|
{
|
||||||
|
_callback = callback ?? throw new ArgumentNullException(nameof(callback));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IElementHandler CreateElementHandler(ElementHandlerFactoryContext context)
|
||||||
|
{
|
||||||
|
return _callback(context.Renderer, context.ParentHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
CPF.Razor/Core/ElementHandlerFactoryContext.cs
Normal file
20
CPF.Razor/Core/ElementHandlerFactoryContext.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.BlazorBindings
|
||||||
|
{
|
||||||
|
internal class ElementHandlerFactoryContext
|
||||||
|
{
|
||||||
|
public ElementHandlerFactoryContext(NativeComponentRenderer renderer, IElementHandler parentHandler)
|
||||||
|
{
|
||||||
|
Renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));
|
||||||
|
ParentHandler = parentHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IElementHandler ParentHandler { get; }
|
||||||
|
|
||||||
|
public NativeComponentRenderer Renderer { get; }
|
||||||
|
}
|
||||||
|
}
|
31
CPF.Razor/Core/ElementHandlerRegistry.cs
Normal file
31
CPF.Razor/Core/ElementHandlerRegistry.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace CPF.BlazorBindings
|
||||||
|
{
|
||||||
|
public static class ElementHandlerRegistry
|
||||||
|
{
|
||||||
|
//internal static Dictionary<string, ElementHandlerFactory> ElementHandlers { get; }
|
||||||
|
// = new Dictionary<string, ElementHandlerFactory>();
|
||||||
|
|
||||||
|
//public static void RegisterElementHandler<TComponent>(
|
||||||
|
// Func<NativeComponentRenderer, IElementHandler, IElementHandler> factory) where TComponent : NativeControlComponentBase
|
||||||
|
//{
|
||||||
|
// ElementHandlers.Add(typeof(TComponent).FullName, new ElementHandlerFactory(factory));
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public static void RegisterElementHandler<TComponent>(
|
||||||
|
// Func<NativeComponentRenderer, IElementHandler> factory) where TComponent : NativeControlComponentBase
|
||||||
|
//{
|
||||||
|
// ElementHandlers.Add(typeof(TComponent).FullName, new ElementHandlerFactory((renderer, _) => factory(renderer)));
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public static void RegisterElementHandler<TComponent, TControlHandler>() where TComponent : NativeControlComponentBase where TControlHandler : class, IElementHandler, new()
|
||||||
|
//{
|
||||||
|
// RegisterElementHandler<TComponent>((_, __) => new TControlHandler());
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
20
CPF.Razor/Core/ElementManager.cs
Normal file
20
CPF.Razor/Core/ElementManager.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utilities needed by the system to manage native controls. Implementations
|
||||||
|
/// of native rendering systems have their own quirks in terms of dealing with
|
||||||
|
/// parent/child relationships, so each must implement this given the constraints
|
||||||
|
/// and requirements of their systems.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class ElementManager
|
||||||
|
{
|
||||||
|
public abstract void AddChildElement(IElementHandler parentHandler, IElementHandler childHandler, int physicalSiblingIndex);
|
||||||
|
public abstract int GetPhysicalSiblingIndex(IElementHandler handler);
|
||||||
|
public abstract bool IsParented(IElementHandler handler);
|
||||||
|
public abstract bool IsParentOfChild(IElementHandler parentHandler, IElementHandler childHandler);
|
||||||
|
public abstract void RemoveElement(IElementHandler handler);
|
||||||
|
}
|
||||||
|
}
|
54
CPF.Razor/Core/ElementManagerOfElementType.cs
Normal file
54
CPF.Razor/Core/ElementManagerOfElementType.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utility intermediate class to make it easier to strongly-type a derived <see cref="ElementManager"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TElementType"></typeparam>
|
||||||
|
public abstract class ElementManager<TElementType> : ElementManager
|
||||||
|
{
|
||||||
|
private static TElementType ConvertToType(IElementHandler elementHandler, string parameterName)
|
||||||
|
{
|
||||||
|
if (!(elementHandler is TElementType))
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"Expected parameter value of type '{elementHandler.GetType().FullName}' to be convertible to type '{typeof(TElementType).FullName}'.", parameterName);
|
||||||
|
}
|
||||||
|
return (TElementType)elementHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed override void AddChildElement(IElementHandler parentHandler, IElementHandler childHandler, int physicalSiblingIndex)
|
||||||
|
{
|
||||||
|
AddChildElement(ConvertToType(parentHandler, nameof(parentHandler)), ConvertToType(childHandler, nameof(childHandler)), physicalSiblingIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed override int GetPhysicalSiblingIndex(IElementHandler handler)
|
||||||
|
{
|
||||||
|
return GetPhysicalSiblingIndex(ConvertToType(handler, nameof(handler)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed override bool IsParented(IElementHandler handler)
|
||||||
|
{
|
||||||
|
return IsParented(ConvertToType(handler, nameof(handler)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed override bool IsParentOfChild(IElementHandler parentHandler, IElementHandler childHandler)
|
||||||
|
{
|
||||||
|
return IsParentOfChild(ConvertToType(parentHandler, nameof(parentHandler)), ConvertToType(childHandler, nameof(childHandler)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed override void RemoveElement(IElementHandler handler)
|
||||||
|
{
|
||||||
|
RemoveElement(ConvertToType(handler, nameof(handler)));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void AddChildElement(TElementType elementType1, TElementType elementType2, int physicalSiblingIndex);
|
||||||
|
protected abstract int GetPhysicalSiblingIndex(TElementType elementType);
|
||||||
|
protected abstract bool IsParented(TElementType elementType);
|
||||||
|
protected abstract bool IsParentOfChild(TElementType elementType1, TElementType elementType2);
|
||||||
|
protected abstract void RemoveElement(TElementType elementType);
|
||||||
|
}
|
||||||
|
}
|
27
CPF.Razor/Core/IElementHandler.cs
Normal file
27
CPF.Razor/Core/IElementHandler.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a container for native element.
|
||||||
|
/// </summary>
|
||||||
|
public interface IElementHandler
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Sets an attribute named <paramref name="attributeName"/> on the <see cref="TargetElement"/> represented by
|
||||||
|
/// this handler to value <paramref name="attributeValue"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="attributeEventHandlerId"></param>
|
||||||
|
/// <param name="attributeName"></param>
|
||||||
|
/// <param name="attributeValue"></param>
|
||||||
|
/// <param name="attributeEventUpdatesAttributeName"></param>
|
||||||
|
void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The native element represented by this handler. This is often a native UI component, but can be any type
|
||||||
|
/// of component used by the native system.
|
||||||
|
/// </summary>
|
||||||
|
object TargetElement { get; }
|
||||||
|
}
|
||||||
|
}
|
18
CPF.Razor/Core/IHandleChildContentText.cs
Normal file
18
CPF.Razor/Core/IHandleChildContentText.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a mechanism for an <see cref="IElementHandler"/> to accept inline text.
|
||||||
|
/// </summary>
|
||||||
|
public interface IHandleChildContentText
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method is called to process inline text found in a component.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">the index of the string within a group of text strings.</param>
|
||||||
|
/// <param name="text">The text to handle. This text may contain whitespace at the start and end of the string.</param>
|
||||||
|
void HandleText(int index, string text);
|
||||||
|
}
|
||||||
|
}
|
16
CPF.Razor/Core/INonChildContainerElement.cs
Normal file
16
CPF.Razor/Core/INonChildContainerElement.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Marker interface to indicate that this element is a container of elements that are not
|
||||||
|
/// true children of their parent. For example, a host for elements that go in a modal dialog
|
||||||
|
/// are not true children of their parent.
|
||||||
|
/// </summary>
|
||||||
|
#pragma warning disable CA1040 // Avoid empty interfaces
|
||||||
|
public interface INonChildContainerElement
|
||||||
|
#pragma warning restore CA1040 // Avoid empty interfaces
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
469
CPF.Razor/Core/NativeComponentAdapter.cs
Normal file
469
CPF.Razor/Core/NativeComponentAdapter.cs
Normal file
@ -0,0 +1,469 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.Components.RenderTree;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a "shadow" item that Blazor uses to map changes into the live native UI tree.
|
||||||
|
/// </summary>
|
||||||
|
[DebuggerDisplay("{DebugName}")]
|
||||||
|
internal sealed class NativeComponentAdapter : IDisposable
|
||||||
|
{
|
||||||
|
private static volatile int DebugInstanceCounter;
|
||||||
|
|
||||||
|
public NativeComponentAdapter(NativeComponentRenderer renderer, IElementHandler closestPhysicalParent, IElementHandler knownTargetElement = null)
|
||||||
|
{
|
||||||
|
Renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));
|
||||||
|
_closestPhysicalParent = closestPhysicalParent;
|
||||||
|
_targetElement = knownTargetElement;
|
||||||
|
|
||||||
|
// Assign unique counter value. This *should* all be done on one thread, but just in case, make it thread-safe.
|
||||||
|
_debugInstanceCounterValue = Interlocked.Increment(ref DebugInstanceCounter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly int _debugInstanceCounterValue;
|
||||||
|
|
||||||
|
private string DebugName => $"[#{_debugInstanceCounterValue}] {Name}";
|
||||||
|
|
||||||
|
public NativeComponentAdapter Parent { get; private set; }
|
||||||
|
public List<NativeComponentAdapter> Children { get; } = new List<NativeComponentAdapter>();
|
||||||
|
|
||||||
|
private readonly IElementHandler _closestPhysicalParent;
|
||||||
|
private IElementHandler _targetElement;
|
||||||
|
private IComponent _targetComponent;
|
||||||
|
|
||||||
|
public NativeComponentRenderer Renderer { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for debugging purposes.
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; internal set; }
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"{nameof(NativeComponentAdapter)}: Name={Name ?? "<?>"}, Target={_targetElement?.GetType().Name ?? "<None>"}, #Children={Children.Count}";
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ApplyEdits(int componentId, ArrayBuilderSegment<RenderTreeEdit> edits, ArrayRange<RenderTreeFrame> referenceFrames, RenderBatch batch)
|
||||||
|
{
|
||||||
|
Renderer.Dispatcher.AssertAccess();
|
||||||
|
|
||||||
|
if (edits.Count == 0)
|
||||||
|
{
|
||||||
|
// TODO: Without this check there's a NullRef in ArrayBuilderSegment? Possibly a Blazor bug?
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var edit in edits)
|
||||||
|
{
|
||||||
|
switch (edit.Type)
|
||||||
|
{
|
||||||
|
case RenderTreeEditType.PrependFrame:
|
||||||
|
ApplyPrependFrame(batch, componentId, edit.SiblingIndex, referenceFrames.Array, edit.ReferenceFrameIndex);
|
||||||
|
break;
|
||||||
|
case RenderTreeEditType.RemoveFrame:
|
||||||
|
ApplyRemoveFrame(edit.SiblingIndex);
|
||||||
|
break;
|
||||||
|
case RenderTreeEditType.SetAttribute:
|
||||||
|
ApplySetAttribute(ref referenceFrames.Array[edit.ReferenceFrameIndex]);
|
||||||
|
break;
|
||||||
|
case RenderTreeEditType.RemoveAttribute:
|
||||||
|
// TODO: See whether siblingIndex is needed here
|
||||||
|
ApplyRemoveAttribute(edit.RemovedAttributeName);
|
||||||
|
break;
|
||||||
|
case RenderTreeEditType.UpdateText:
|
||||||
|
{
|
||||||
|
var frame = batch.ReferenceFrames.Array[edit.ReferenceFrameIndex];
|
||||||
|
if (_targetElement is IHandleChildContentText handleChildContentText)
|
||||||
|
{
|
||||||
|
handleChildContentText.HandleText(edit.SiblingIndex, frame.TextContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("Cannot set text content on child that doesn't handle inner text content.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RenderTreeEditType.StepIn:
|
||||||
|
{
|
||||||
|
// TODO: Need to implement this. For now it seems safe to ignore.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RenderTreeEditType.StepOut:
|
||||||
|
{
|
||||||
|
// TODO: Need to implement this. For now it seems safe to ignore.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RenderTreeEditType.UpdateMarkup:
|
||||||
|
{
|
||||||
|
var frame = batch.ReferenceFrames.Array[edit.ReferenceFrameIndex];
|
||||||
|
if (_targetElement is IHandleChildContentText handleChildContentText)
|
||||||
|
{
|
||||||
|
handleChildContentText.HandleText(edit.SiblingIndex, frame.MarkupContent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("Cannot set markup content on child that doesn't handle inner text content.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RenderTreeEditType.PermutationListEntry:
|
||||||
|
throw new NotImplementedException($"Not supported edit type: {edit.Type}");
|
||||||
|
case RenderTreeEditType.PermutationListEnd:
|
||||||
|
throw new NotImplementedException($"Not supported edit type: {edit.Type}");
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException($"Invalid edit type: {edit.Type}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyRemoveFrame(int siblingIndex)
|
||||||
|
{
|
||||||
|
var childToRemove = Children[siblingIndex];
|
||||||
|
Children.RemoveAt(siblingIndex);
|
||||||
|
childToRemove.RemoveSelfAndDescendants();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveSelfAndDescendants()
|
||||||
|
{
|
||||||
|
if (_targetElement != null)
|
||||||
|
{
|
||||||
|
// This adapter represents a physical element, so by removing it, we implicitly
|
||||||
|
// remove all descendants.
|
||||||
|
Renderer.ElementManager.RemoveElement(_targetElement);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This adapter is just a container for other adapters
|
||||||
|
foreach (var child in Children)
|
||||||
|
{
|
||||||
|
child.RemoveSelfAndDescendants();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplySetAttribute(ref RenderTreeFrame attributeFrame)
|
||||||
|
{
|
||||||
|
if (_targetElement == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"Trying to apply attribute {attributeFrame.AttributeName} to an adapter that isn't for an element");
|
||||||
|
}
|
||||||
|
|
||||||
|
_targetElement.ApplyAttribute(
|
||||||
|
attributeFrame.AttributeEventHandlerId,
|
||||||
|
attributeFrame.AttributeName,
|
||||||
|
attributeFrame.AttributeValue,
|
||||||
|
attributeFrame.AttributeEventUpdatesAttributeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyRemoveAttribute(string removedAttributeName)
|
||||||
|
{
|
||||||
|
if (_targetElement == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"Trying to remove attribute {removedAttributeName} to an adapter that isn't for an element");
|
||||||
|
}
|
||||||
|
|
||||||
|
_targetElement.ApplyAttribute(
|
||||||
|
attributeEventHandlerId: 0,
|
||||||
|
attributeName: removedAttributeName,
|
||||||
|
attributeValue: null,
|
||||||
|
attributeEventUpdatesAttributeName: null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int ApplyPrependFrame(RenderBatch batch, int componentId, int siblingIndex, RenderTreeFrame[] frames, int frameIndex)
|
||||||
|
{
|
||||||
|
ref var frame = ref frames[frameIndex];
|
||||||
|
switch (frame.FrameType)
|
||||||
|
{
|
||||||
|
case RenderTreeFrameType.Element:
|
||||||
|
{
|
||||||
|
InsertElement(siblingIndex, frames, frameIndex, componentId, batch);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case RenderTreeFrameType.Component:
|
||||||
|
{
|
||||||
|
// Components are represented by NativeComponentAdapter
|
||||||
|
var childAdapter = Renderer.CreateAdapterForChildComponent(_targetElement ?? _closestPhysicalParent, frame.ComponentId);
|
||||||
|
childAdapter.Name = $"For: '{frame.Component.GetType().FullName}'";
|
||||||
|
childAdapter._targetComponent = frame.Component;
|
||||||
|
AddChildAdapter(siblingIndex, childAdapter);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case RenderTreeFrameType.Region:
|
||||||
|
{
|
||||||
|
return InsertFrameRange(batch, componentId, siblingIndex, frames, frameIndex + 1, frameIndex + frame.RegionSubtreeLength);
|
||||||
|
}
|
||||||
|
case RenderTreeFrameType.Markup:
|
||||||
|
{
|
||||||
|
if (_targetElement is IHandleChildContentText handleChildContentText)
|
||||||
|
{
|
||||||
|
handleChildContentText.HandleText(siblingIndex, frame.MarkupContent);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrWhiteSpace(frame.MarkupContent))
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("Nonempty markup: " + frame.MarkupContent);
|
||||||
|
}
|
||||||
|
#pragma warning disable CA2000 // Dispose objects before losing scope; adapters are disposed when they are removed from the adapter tree
|
||||||
|
var childAdapter = CreateAdapter(_targetElement ?? _closestPhysicalParent);
|
||||||
|
#pragma warning restore CA2000 // Dispose objects before losing scope
|
||||||
|
childAdapter.Name = $"Markup, sib#={siblingIndex}";
|
||||||
|
AddChildAdapter(siblingIndex, childAdapter);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
case RenderTreeFrameType.Text:
|
||||||
|
{
|
||||||
|
if (_targetElement is IHandleChildContentText handleChildContentText)
|
||||||
|
{
|
||||||
|
handleChildContentText.HandleText(siblingIndex, frame.TextContent);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrWhiteSpace(frame.TextContent))
|
||||||
|
{
|
||||||
|
throw new NotImplementedException("Nonempty text: " + frame.TextContent);
|
||||||
|
}
|
||||||
|
#pragma warning disable CA2000 // Dispose objects before losing scope; adapters are disposed when they are removed from the adapter tree
|
||||||
|
var childAdapter = CreateAdapter(_targetElement ?? _closestPhysicalParent);
|
||||||
|
#pragma warning restore CA2000 // Dispose objects before losing scope
|
||||||
|
childAdapter.Name = $"Text, sib#={siblingIndex}";
|
||||||
|
AddChildAdapter(siblingIndex, childAdapter);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException($"Not supported frame type: {frame.FrameType}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private NativeComponentAdapter CreateAdapter(IElementHandler physicalParent)
|
||||||
|
{
|
||||||
|
return new NativeComponentAdapter(Renderer, physicalParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InsertElement(int siblingIndex, RenderTreeFrame[] frames, int frameIndex, int componentId, RenderBatch batch)
|
||||||
|
{
|
||||||
|
// Elements represent native elements
|
||||||
|
ref var frame = ref frames[frameIndex];
|
||||||
|
//var elementName = frame.ElementName;
|
||||||
|
//var elementHandlerFactory = ElementHandlerRegistry.ElementHandlers[elementName];
|
||||||
|
|
||||||
|
var elementHandler = _targetComponent as IElementHandler;
|
||||||
|
//var elementHandler = elementHandlerFactory.CreateElementHandler(new ElementHandlerFactoryContext(Renderer, _closestPhysicalParent));
|
||||||
|
|
||||||
|
//if (_targetComponent is NativeControlComponentBase componentInstance)
|
||||||
|
//{
|
||||||
|
// componentInstance.SetElementReference(elementHandler);
|
||||||
|
//}
|
||||||
|
if (elementHandler is ICpfElementHandler handler)
|
||||||
|
{
|
||||||
|
handler.Renderer = Renderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (siblingIndex != 0)
|
||||||
|
{
|
||||||
|
// With the current design, we should be able to ignore sibling indices for elements,
|
||||||
|
// so bail out if that's not the case
|
||||||
|
throw new NotSupportedException($"Currently we assume all adapter elements render exactly zero or one elements. Found an element with sibling index {siblingIndex}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Consider in the future calling a new API to check if the elementHandler represents a native UI component:
|
||||||
|
// if (Renderer.ElementManager.IsNativeElement(elementHandler)) { add to UI tree }
|
||||||
|
// else { do something with non-native element, e.g. notify parent to handle it }
|
||||||
|
|
||||||
|
// For the location in the physical UI tree, find the last preceding-sibling adapter that has
|
||||||
|
// a physical descendant (if any). If there is one, we physically insert after that one. If not,
|
||||||
|
// we'll insert as the first child of the closest physical parent.
|
||||||
|
if (!Renderer.ElementManager.IsParented(elementHandler))
|
||||||
|
{
|
||||||
|
var elementIndex = GetIndexForElement();
|
||||||
|
Renderer.ElementManager.AddChildElement(_closestPhysicalParent, elementHandler, elementIndex);
|
||||||
|
}
|
||||||
|
_targetElement = elementHandler;
|
||||||
|
|
||||||
|
var endIndexExcl = frameIndex + frames[frameIndex].ElementSubtreeLength;
|
||||||
|
for (var descendantIndex = frameIndex + 1; descendantIndex < endIndexExcl; descendantIndex++)
|
||||||
|
{
|
||||||
|
var candidateFrame = frames[descendantIndex];
|
||||||
|
if (candidateFrame.FrameType == RenderTreeFrameType.Attribute)
|
||||||
|
{
|
||||||
|
ApplySetAttribute(ref candidateFrame);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// As soon as we see a non-attribute child, all the subsequent child frames are
|
||||||
|
// not attributes, so bail out and insert the remnants recursively
|
||||||
|
InsertFrameRange(batch, componentId, childIndex: 0, frames, descendantIndex, endIndexExcl);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the sibling index to insert this adapter's element into. It walks up Parent adapters to find
|
||||||
|
/// an earlier sibling that has a native element, and uses that native element's physical index to determine
|
||||||
|
/// the location of the new element.
|
||||||
|
/// <code>
|
||||||
|
/// * Adapter0
|
||||||
|
/// * Adapter1
|
||||||
|
/// * Adapter2
|
||||||
|
/// * Adapter3 (native)
|
||||||
|
/// * Adapter3.0 (searchOrder=2)
|
||||||
|
/// * Adapter3.0.0 (searchOrder=3)
|
||||||
|
/// * Adapter3.0.1 (native) (searchOrder=4) <-- This is the nearest earlier sibling that has a physical element)
|
||||||
|
/// * Adapter3.0.2
|
||||||
|
/// * Adapter3.1 (searchOrder=1)
|
||||||
|
/// * Adapter3.1.0 (searchOrder=0)
|
||||||
|
/// * Adapter3.1.1 (native) <-- Current adapter
|
||||||
|
/// * Adapter3.1.2
|
||||||
|
/// * Adapter3.2
|
||||||
|
/// * Adapter4
|
||||||
|
/// </code>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The index at which the native element should be inserted into within the parent. It returns -1 as a failure mode.</returns>
|
||||||
|
private int GetIndexForElement()
|
||||||
|
{
|
||||||
|
var childAdapter = this;
|
||||||
|
var parentAdapter = Parent;
|
||||||
|
while (parentAdapter != null)
|
||||||
|
{
|
||||||
|
// Walk previous siblings of this level and deep-scan them for native elements
|
||||||
|
var matchedEarlierSibling = GetEarlierSiblingMatch(parentAdapter, childAdapter);
|
||||||
|
if (matchedEarlierSibling != null)
|
||||||
|
{
|
||||||
|
if (!Renderer.ElementManager.IsParentOfChild(_closestPhysicalParent, matchedEarlierSibling._targetElement))
|
||||||
|
{
|
||||||
|
Debug.Fail($"Expected that the item found ({matchedEarlierSibling.DebugName}) with target element ({matchedEarlierSibling._targetElement.GetType().FullName}) should necessarily be an immediate child of the closest native parent ({_closestPhysicalParent.GetType().FullName}), but it wasn't...");
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a native element was found somewhere within this sibling, the index for the new element
|
||||||
|
// will be 1 greater than its native index.
|
||||||
|
return Renderer.ElementManager.GetPhysicalSiblingIndex(matchedEarlierSibling._targetElement) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If this level has a native element and all its relevant children have been scanned, then there's
|
||||||
|
// no previous sibling, so the new element to be added will be its earliest child (index=0). (There
|
||||||
|
// might be *later* siblings, but they are not relevant to this search.)
|
||||||
|
if (parentAdapter._targetElement != null)
|
||||||
|
{
|
||||||
|
Debug.Assert(parentAdapter._targetElement == _closestPhysicalParent, $"Expected that nearest parent ({parentAdapter.DebugName}) with native element ({parentAdapter._targetElement.GetType().FullName}) would have the closest physical parent ({_closestPhysicalParent.GetType().FullName}).");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we haven't found a previous sibling with a native element or reached a native container, keep
|
||||||
|
// walking up the parent tree...
|
||||||
|
childAdapter = parentAdapter;
|
||||||
|
parentAdapter = parentAdapter.Parent;
|
||||||
|
}
|
||||||
|
Debug.Fail($"Expected to find a parent with a native element but found none.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static NativeComponentAdapter GetEarlierSiblingMatch(NativeComponentAdapter parentAdapter, NativeComponentAdapter childAdapter)
|
||||||
|
{
|
||||||
|
var indexOfParentsChildAdapter = parentAdapter.Children.IndexOf(childAdapter);
|
||||||
|
|
||||||
|
for (var i = indexOfParentsChildAdapter - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var sibling = parentAdapter.Children[i];
|
||||||
|
if (sibling._targetElement is INonChildContainerElement)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deep scan this sibling adapter to find its latest and highest native element
|
||||||
|
var siblingWithNativeElement = sibling.GetLastDescendantWithPhysicalElement();
|
||||||
|
if (siblingWithNativeElement != null)
|
||||||
|
{
|
||||||
|
return siblingWithNativeElement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// No preceding sibling has any native elements
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private NativeComponentAdapter GetLastDescendantWithPhysicalElement()
|
||||||
|
{
|
||||||
|
if (_targetElement is INonChildContainerElement)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (_targetElement != null)
|
||||||
|
{
|
||||||
|
// If this adapter has a target element, then this is the droid we're looking for. It can't be
|
||||||
|
// any children of this target element because they can't be children of this element's parent.
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = Children.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
var child = Children[i];
|
||||||
|
var physicalDescendant = child.GetLastDescendantWithPhysicalElement();
|
||||||
|
if (physicalDescendant != null)
|
||||||
|
{
|
||||||
|
return physicalDescendant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int InsertFrameRange(RenderBatch batch, int componentId, int childIndex, RenderTreeFrame[] frames, int startIndex, int endIndexExcl)
|
||||||
|
{
|
||||||
|
var origChildIndex = childIndex;
|
||||||
|
for (var index = startIndex; index < endIndexExcl; index++)
|
||||||
|
{
|
||||||
|
ref var frame = ref batch.ReferenceFrames.Array[index];
|
||||||
|
var numChildrenInserted = ApplyPrependFrame(batch, componentId, childIndex, frames, index);
|
||||||
|
childIndex += numChildrenInserted;
|
||||||
|
|
||||||
|
// Skip over any descendants, since they are already dealt with recursively
|
||||||
|
index += CountDescendantFrames(frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (childIndex - origChildIndex); // Total number of children inserted
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int CountDescendantFrames(RenderTreeFrame frame)
|
||||||
|
{
|
||||||
|
return frame.FrameType switch
|
||||||
|
{
|
||||||
|
// The following frame types have a subtree length. Other frames may use that memory slot
|
||||||
|
// to mean something else, so we must not read it. We should consider having nominal subtypes
|
||||||
|
// of RenderTreeFramePointer that prevent access to non-applicable fields.
|
||||||
|
RenderTreeFrameType.Component => frame.ComponentSubtreeLength - 1,
|
||||||
|
RenderTreeFrameType.Element => frame.ElementSubtreeLength - 1,
|
||||||
|
RenderTreeFrameType.Region => frame.RegionSubtreeLength - 1,
|
||||||
|
_ => 0,
|
||||||
|
};
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddChildAdapter(int siblingIndex, NativeComponentAdapter childAdapter)
|
||||||
|
{
|
||||||
|
childAdapter.Parent = this;
|
||||||
|
|
||||||
|
if (siblingIndex <= Children.Count)
|
||||||
|
{
|
||||||
|
Children.Insert(siblingIndex, childAdapter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"WARNING: {nameof(AddChildAdapter)} called with {nameof(siblingIndex)}={siblingIndex}, but Children.Count={Children.Count}");
|
||||||
|
Children.Add(childAdapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (_targetElement is IDisposable disposableTargetElement)
|
||||||
|
{
|
||||||
|
disposableTargetElement.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
134
CPF.Razor/Core/NativeComponentRenderer.cs
Normal file
134
CPF.Razor/Core/NativeComponentRenderer.cs
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.Components.RenderTree;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public abstract class NativeComponentRenderer : Renderer
|
||||||
|
{
|
||||||
|
private readonly Dictionary<int, NativeComponentAdapter> _componentIdToAdapter = new Dictionary<int, NativeComponentAdapter>();
|
||||||
|
private ElementManager _elementManager;
|
||||||
|
private readonly Dictionary<ulong, Action<ulong>> _eventRegistrations = new Dictionary<ulong, Action<ulong>>();
|
||||||
|
|
||||||
|
|
||||||
|
public NativeComponentRenderer(IServiceProvider serviceProvider, ILoggerFactory loggerFactory)
|
||||||
|
: base(serviceProvider, loggerFactory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract ElementManager CreateNativeControlManager();
|
||||||
|
|
||||||
|
internal ElementManager ElementManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _elementManager ?? (_elementManager = CreateNativeControlManager());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Dispatcher Dispatcher { get; }
|
||||||
|
= Dispatcher.CreateDefault();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a component of type <typeparamref name="TComponent"/> and adds it as a child of <paramref name="parent"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TComponent"></typeparam>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task AddComponent<TComponent>(IElementHandler parent) where TComponent : IComponent
|
||||||
|
{
|
||||||
|
await AddComponent(typeof(TComponent), parent).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a component of type <paramref name="componentType"/> and adds it as a child of <paramref name="parent"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="componentType"></param>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task AddComponent(Type componentType, IElementHandler parent)
|
||||||
|
{
|
||||||
|
await Dispatcher.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
var component = InstantiateComponent(componentType);
|
||||||
|
var componentId = AssignRootComponentId(component);
|
||||||
|
|
||||||
|
var rootAdapter = new NativeComponentAdapter(this, closestPhysicalParent: parent, knownTargetElement: parent)
|
||||||
|
{
|
||||||
|
Name = $"RootAdapter attached to {parent.GetType().FullName}",
|
||||||
|
};
|
||||||
|
|
||||||
|
_componentIdToAdapter[componentId] = rootAdapter;
|
||||||
|
|
||||||
|
await RenderRootComponentAsync(componentId).ConfigureAwait(false);
|
||||||
|
}).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
|
||||||
|
{
|
||||||
|
foreach (var updatedComponent in renderBatch.UpdatedComponents.Array.Take(renderBatch.UpdatedComponents.Count))
|
||||||
|
{
|
||||||
|
var adapter = _componentIdToAdapter[updatedComponent.ComponentId];
|
||||||
|
adapter.ApplyEdits(updatedComponent.ComponentId, updatedComponent.Edits, renderBatch.ReferenceFrames, renderBatch);
|
||||||
|
}
|
||||||
|
|
||||||
|
var numDisposedComponents = renderBatch.DisposedComponentIDs.Count;
|
||||||
|
for (var i = 0; i < numDisposedComponents; i++)
|
||||||
|
{
|
||||||
|
var disposedComponentId = renderBatch.DisposedComponentIDs.Array[i];
|
||||||
|
if (_componentIdToAdapter.TryGetValue(disposedComponentId, out var adapter))
|
||||||
|
{
|
||||||
|
_componentIdToAdapter.Remove(disposedComponentId);
|
||||||
|
(adapter as IDisposable)?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var numDisposeEventHandlers = renderBatch.DisposedEventHandlerIDs.Count;
|
||||||
|
if (numDisposeEventHandlers != 0)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < numDisposeEventHandlers; i++)
|
||||||
|
{
|
||||||
|
DisposeEvent(renderBatch.DisposedEventHandlerIDs.Array[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterEvent(ulong eventHandlerId, Action<ulong> unregisterCallback)
|
||||||
|
{
|
||||||
|
if (eventHandlerId == 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(eventHandlerId), "Event handler ID must not be 0.");
|
||||||
|
}
|
||||||
|
if (unregisterCallback == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(unregisterCallback));
|
||||||
|
}
|
||||||
|
_eventRegistrations.Add(eventHandlerId, unregisterCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisposeEvent(ulong eventHandlerId)
|
||||||
|
{
|
||||||
|
if (!_eventRegistrations.TryGetValue(eventHandlerId, out var unregisterCallback))
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"Attempting to dispose unknown event handler id '{eventHandlerId}'.");
|
||||||
|
}
|
||||||
|
unregisterCallback(eventHandlerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal NativeComponentAdapter CreateAdapterForChildComponent(IElementHandler physicalParent, int componentId)
|
||||||
|
{
|
||||||
|
var result = new NativeComponentAdapter(this, physicalParent);
|
||||||
|
_componentIdToAdapter[componentId] = result;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
75
CPF.Razor/Core/NativeControlComponentBase.cs
Normal file
75
CPF.Razor/Core/NativeControlComponentBase.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.Components.Rendering;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public abstract class NativeControlComponentBase<T> : ComponentBase, ICpfElementHandler where T : UIElement, new()
|
||||||
|
{
|
||||||
|
//public IElementHandler ElementHandler { get; private set; }
|
||||||
|
|
||||||
|
UIElement ICpfElementHandler.Element => Element;
|
||||||
|
|
||||||
|
T element;
|
||||||
|
public T Element
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
element = CreateElement();
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object TargetElement => Element;
|
||||||
|
|
||||||
|
NativeComponentRenderer _Renderer;
|
||||||
|
public NativeComponentRenderer Renderer
|
||||||
|
{
|
||||||
|
get => _Renderer;
|
||||||
|
set => _Renderer = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
//public void SetElementReference(IElementHandler elementHandler)
|
||||||
|
//{
|
||||||
|
// ElementHandler = elementHandler ?? throw new ArgumentNullException(nameof(elementHandler));
|
||||||
|
//}
|
||||||
|
|
||||||
|
protected override void BuildRenderTree(RenderTreeBuilder builder)
|
||||||
|
{
|
||||||
|
if (builder is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(builder));
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.OpenElement(0, GetType().FullName);
|
||||||
|
RenderAttributes(new AttributesBuilder(builder));
|
||||||
|
|
||||||
|
var childContent = GetChild();
|
||||||
|
if (childContent != null)
|
||||||
|
{
|
||||||
|
builder.AddContent(2, childContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.CloseElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void RenderAttributes(AttributesBuilder builder)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual RenderFragment GetChild() => null;
|
||||||
|
|
||||||
|
public abstract void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName);
|
||||||
|
|
||||||
|
protected virtual T CreateElement()
|
||||||
|
{
|
||||||
|
return new T();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Microsoft.Extensions.DependencyInjection
|
||||||
|
{
|
||||||
|
public static class ServiceCollectionAdditionalServicesExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Copies service descriptors from one service collection to another.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="services">The destination service collection to which the additional services will be added.</param>
|
||||||
|
/// <param name="additionalServices">The list of additional services to add.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static IServiceCollection AddAdditionalServices(this IServiceCollection services, IServiceCollection additionalServices)
|
||||||
|
{
|
||||||
|
if (services is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(services));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (additionalServices is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(additionalServices));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var additionalService in additionalServices)
|
||||||
|
{
|
||||||
|
services.Add(additionalService);
|
||||||
|
}
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
51
CPF.Razor/Core/TextSpanContainer.cs
Normal file
51
CPF.Razor/Core/TextSpanContainer.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Helper class for types that accept inline text spans. This type collects text spans
|
||||||
|
/// and returns the string represented by the contained text spans.
|
||||||
|
/// </summary>
|
||||||
|
public class TextSpanContainer
|
||||||
|
{
|
||||||
|
private readonly List<string> _textSpans = new List<string>();
|
||||||
|
|
||||||
|
public TextSpanContainer(bool trimWhitespace = true)
|
||||||
|
{
|
||||||
|
TrimWhitespace = trimWhitespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TrimWhitespace { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the text spans with the new text at the new index and returns the new
|
||||||
|
/// string represented by the contained text spans.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index"></param>
|
||||||
|
/// <param name="text"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetUpdatedText(int index, string text)
|
||||||
|
{
|
||||||
|
if (index < 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(index));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index >= _textSpans.Count)
|
||||||
|
{
|
||||||
|
// Expand the list to allow for the new text's index to exist
|
||||||
|
_textSpans.AddRange(new string[index - _textSpans.Count + 1]);
|
||||||
|
}
|
||||||
|
_textSpans[index] = text;
|
||||||
|
|
||||||
|
var allText = string.Join(string.Empty, _textSpans);
|
||||||
|
return TrimWhitespace
|
||||||
|
? allText?.Trim()
|
||||||
|
: allText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
54
CPF.Razor/CpfDispatcher.cs
Normal file
54
CPF.Razor/CpfDispatcher.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public class CpfDispatcher : Dispatcher
|
||||||
|
{
|
||||||
|
public override bool CheckAccess()
|
||||||
|
{
|
||||||
|
return CPF.Threading.Dispatcher.MainThread.CheckAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task InvokeAsync(Action workItem)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
CPF.Threading.Dispatcher.MainThread.Invoke(workItem);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task InvokeAsync(Func<Task> workItem)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
var task = Task.CompletedTask;
|
||||||
|
CPF.Threading.Dispatcher.MainThread.Invoke(() => { task = workItem(); });
|
||||||
|
return task;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<TResult> InvokeAsync<TResult>(Func<TResult> workItem)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
TResult result = default;
|
||||||
|
CPF.Threading.Dispatcher.MainThread.Invoke(() => { result = workItem(); });
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> workItem)
|
||||||
|
{
|
||||||
|
return Task.Run(() =>
|
||||||
|
{
|
||||||
|
TResult result = default;
|
||||||
|
CPF.Threading.Dispatcher.MainThread.Invoke(async () => { result = await workItem(); });
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
86
CPF.Razor/CpfElementManager.cs
Normal file
86
CPF.Razor/CpfElementManager.cs
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
internal class CpfElementManager : ElementManager<ICpfElementHandler>
|
||||||
|
{
|
||||||
|
protected override bool IsParented(ICpfElementHandler handler)
|
||||||
|
{
|
||||||
|
return handler.Element.Parent != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void AddChildElement(
|
||||||
|
ICpfElementHandler parentHandler,
|
||||||
|
ICpfElementHandler childHandler,
|
||||||
|
int physicalSiblingIndex)
|
||||||
|
{
|
||||||
|
if (parentHandler.Element is CPF.Controls.Panel panel)
|
||||||
|
{
|
||||||
|
if (physicalSiblingIndex <= panel.Children.Count)
|
||||||
|
{
|
||||||
|
panel.Children.Insert(physicalSiblingIndex, childHandler.Element);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Debug.WriteLine($"WARNING: {nameof(AddChildElement)} called with {nameof(physicalSiblingIndex)}={physicalSiblingIndex}, but parentControl.Controls.Count={parentHandler.Control.Controls.Count}");
|
||||||
|
panel.Children.Add(childHandler.Element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (parentHandler.Element is CPF.Controls.View win)
|
||||||
|
{
|
||||||
|
if (physicalSiblingIndex <= win.Children.Count)
|
||||||
|
{
|
||||||
|
win.Children.Insert(physicalSiblingIndex, childHandler.Element);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
win.Children.Add(childHandler.Element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (parentHandler.Element is CPF.Controls.ContentControl contentControl)
|
||||||
|
{
|
||||||
|
contentControl.Content = childHandler.Element;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Fail("未实现添加控件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override int GetPhysicalSiblingIndex(
|
||||||
|
ICpfElementHandler handler)
|
||||||
|
{
|
||||||
|
return (handler.Element.Parent as CPF.Controls.Panel).Children.IndexOf(handler.Element);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RemoveElement(ICpfElementHandler handler)
|
||||||
|
{
|
||||||
|
if (handler.Element.Parent is CPF.Controls.Panel panel)
|
||||||
|
{
|
||||||
|
panel.Children.Remove(handler.Element);
|
||||||
|
}
|
||||||
|
else if (handler.Element.Parent is CPF.Controls.View win)
|
||||||
|
{
|
||||||
|
win.Children.Remove(handler.Element);
|
||||||
|
}
|
||||||
|
else if (handler.Element.Parent is CPF.Controls.ContentControl contentControl)
|
||||||
|
{
|
||||||
|
contentControl.Content = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Fail("未实现移除控件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool IsParentOfChild(ICpfElementHandler parentHandler, ICpfElementHandler childHandler)
|
||||||
|
{
|
||||||
|
return childHandler.Element.Parent == parentHandler.Element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
41
CPF.Razor/CpfExtensions.cs
Normal file
41
CPF.Razor/CpfExtensions.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public static class CpfExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 创建视图 <typeparamref name="TComponent"/> 添加到 <paramref name="parent"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TComponent"></typeparam>
|
||||||
|
/// <param name="host"></param>
|
||||||
|
/// <param name="parent"></param>
|
||||||
|
public static void AddComponent<TComponent>(this IHost host, CPF.UIElement parent) where TComponent : IComponent
|
||||||
|
{
|
||||||
|
if (host is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(host));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parent is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(parent));
|
||||||
|
}
|
||||||
|
|
||||||
|
var services = host.Services;
|
||||||
|
var renderer = new CpfRenderer(services, services.GetRequiredService<ILoggerFactory>());
|
||||||
|
|
||||||
|
//// TODO: This call is an async call, but is called as "fire-and-forget," which is not ideal.
|
||||||
|
//// We need to figure out how to get Xamarin.Forms to run this startup code asynchronously, which
|
||||||
|
//// is how this method should be called.
|
||||||
|
renderer.AddComponent<TComponent>(new ElementHandler(renderer, parent)).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
38
CPF.Razor/CpfHost.cs
Normal file
38
CPF.Razor/CpfHost.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public static class CpfHost
|
||||||
|
{
|
||||||
|
public static IHostBuilder CreateDefaultBuilder()
|
||||||
|
{
|
||||||
|
// Inspired by Microsoft.Extensions.Hosting.Host, which can be seen here:
|
||||||
|
// https://github.com/dotnet/extensions/blob/master/src/Hosting/Hosting/src/Host.cs
|
||||||
|
// But slightly modified to work on all of Android, iOS, and UWP.
|
||||||
|
|
||||||
|
var builder = new HostBuilder();
|
||||||
|
|
||||||
|
builder.UseContentRoot(Directory.GetCurrentDirectory());
|
||||||
|
|
||||||
|
builder.ConfigureLogging((hostingContext, logging) =>
|
||||||
|
{
|
||||||
|
logging.AddConsole(configure => configure.DisableColors = true);
|
||||||
|
logging.AddDebug();
|
||||||
|
logging.AddEventSourceLogger();
|
||||||
|
})
|
||||||
|
.UseDefaultServiceProvider((context, options) =>
|
||||||
|
{
|
||||||
|
var isDevelopment = context.HostingEnvironment.IsDevelopment();
|
||||||
|
options.ValidateScopes = isDevelopment;
|
||||||
|
options.ValidateOnBuild = isDevelopment;
|
||||||
|
});
|
||||||
|
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
29
CPF.Razor/CpfRenderer.cs
Normal file
29
CPF.Razor/CpfRenderer.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Diagnostics;
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public class CpfRenderer : NativeComponentRenderer
|
||||||
|
{
|
||||||
|
public CpfRenderer(IServiceProvider serviceProvider, ILoggerFactory loggerFactory)
|
||||||
|
: base(serviceProvider, loggerFactory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void HandleException(Exception exception)
|
||||||
|
{
|
||||||
|
//MessageBox.Show(exception?.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
Debug.WriteLine(exception?.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override ElementManager CreateNativeControlManager()
|
||||||
|
{
|
||||||
|
return new CpfElementManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Dispatcher Dispatcher => new CpfDispatcher();
|
||||||
|
}
|
||||||
|
}
|
66
CPF.Razor/ElementHandler.cs
Normal file
66
CPF.Razor/ElementHandler.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public class ElementHandler : ICpfElementHandler
|
||||||
|
{
|
||||||
|
public ElementHandler(NativeComponentRenderer renderer, CPF.UIElement elementControl)
|
||||||
|
{
|
||||||
|
Renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));
|
||||||
|
Element = elementControl ?? throw new ArgumentNullException(nameof(elementControl));
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected void RegisterEvent(string eventName, Action<ulong> setId, Action<ulong> clearId)
|
||||||
|
//{
|
||||||
|
// RegisteredEvents[eventName] = new EventRegistration(eventName, setId, clearId);
|
||||||
|
//}
|
||||||
|
//private Dictionary<string, EventRegistration> RegisteredEvents { get; } = new Dictionary<string, EventRegistration>();
|
||||||
|
|
||||||
|
public NativeComponentRenderer Renderer { get; }
|
||||||
|
public CPF.UIElement Element { get; }
|
||||||
|
public object TargetElement => Element;
|
||||||
|
|
||||||
|
NativeComponentRenderer ICpfElementHandler.Renderer { get; set; }
|
||||||
|
|
||||||
|
public virtual void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
|
||||||
|
{
|
||||||
|
//switch (attributeName)
|
||||||
|
//{
|
||||||
|
// case nameof(XF.Element.AutomationId):
|
||||||
|
// ElementControl.AutomationId = (string)attributeValue;
|
||||||
|
// break;
|
||||||
|
// case nameof(XF.Element.ClassId):
|
||||||
|
// ElementControl.ClassId = (string)attributeValue;
|
||||||
|
// break;
|
||||||
|
// case nameof(XF.Element.StyleId):
|
||||||
|
// ElementControl.StyleId = (string)attributeValue;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// if (!TryRegisterEvent(attributeName, attributeEventHandlerId))
|
||||||
|
// {
|
||||||
|
// throw new NotImplementedException($"{GetType().FullName} doesn't recognize attribute '{attributeName}'");
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
var p = Element.GetPropertyMetadata(attributeName);
|
||||||
|
if (p != null)
|
||||||
|
{
|
||||||
|
Element.SetValue(attributeValue.ConvertTo(p.PropertyType), attributeName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//private bool TryRegisterEvent(string eventName, ulong eventHandlerId)
|
||||||
|
//{
|
||||||
|
// if (RegisteredEvents.TryGetValue(eventName, out var eventRegistration))
|
||||||
|
// {
|
||||||
|
// Renderer.RegisterEvent(eventHandlerId, eventRegistration.ClearId);
|
||||||
|
// eventRegistration.SetId(eventHandlerId);
|
||||||
|
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
13
CPF.Razor/ICpfElementHandler.cs
Normal file
13
CPF.Razor/ICpfElementHandler.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
//using Microsoft.MobileBlazorBindings.Core;
|
||||||
|
|
||||||
|
namespace CPF.Razor
|
||||||
|
{
|
||||||
|
public interface ICpfElementHandler : IElementHandler
|
||||||
|
{
|
||||||
|
UIElement Element { get; }
|
||||||
|
NativeComponentRenderer Renderer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1490,8 +1490,10 @@ BLENDFUNCTION blendFunction // alpha-blending function
|
|||||||
//[DllImport("shell32.dll", CharSet = CharSet.Auto)]
|
//[DllImport("shell32.dll", CharSet = CharSet.Auto)]
|
||||||
//public static extern int DragQueryFile(HandleRef hDrop, int iFile, StringBuilder lpszFile, int cch);
|
//public static extern int DragQueryFile(HandleRef hDrop, int iFile, StringBuilder lpszFile, int cch);
|
||||||
|
|
||||||
[DllImport("dwmapi.dll", PreserveSig = false)]
|
//[DllImport("dwmapi.dll", PreserveSig = false)]
|
||||||
public static extern bool DwmIsCompositionEnabled();
|
//public static extern bool DwmIsCompositionEnabled();
|
||||||
|
[DllImport("dwmapi.dll", BestFitMapping = false)]
|
||||||
|
public static extern int DwmIsCompositionEnabled(out Int32 enabled);
|
||||||
|
|
||||||
[DllImport("dwmapi.dll")]
|
[DllImport("dwmapi.dll")]
|
||||||
public static extern int DwmEnableBlurBehindWindow(IntPtr hWnd, ref DWM_BLURBEHIND pBlurBehind);
|
public static extern int DwmEnableBlurBehindWindow(IntPtr hWnd, ref DWM_BLURBEHIND pBlurBehind);
|
||||||
|
@ -83,7 +83,7 @@ namespace CPF.Windows
|
|||||||
}
|
}
|
||||||
posttime = Application.Elapsed;
|
posttime = Application.Elapsed;
|
||||||
var v = System.Environment.OSVersion.Version;
|
var v = System.Environment.OSVersion.Version;
|
||||||
if (v.Major >= 6 && DwmIsCompositionEnabled() && !Application.DesignMode)
|
if (v.Major >= 6 && DwmIsCompositionEnabled(out var e) == 0 && e == 1 && !Application.DesignMode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -92,7 +92,7 @@ namespace CPF.Windows
|
|||||||
}
|
}
|
||||||
if ((v.Major == 6 && v.Minor < 2))
|
if ((v.Major == 6 && v.Minor < 2))
|
||||||
{
|
{
|
||||||
touchMsg = RegisterTouchWindow(handle, RegisterTouchFlags.TWF_NONE);
|
touchMsg = RegisterTouchWindow(handle, RegisterTouchFlags.TWF_NONE);
|
||||||
}
|
}
|
||||||
_className = "CPFWindow-" + Guid.NewGuid();
|
_className = "CPFWindow-" + Guid.NewGuid();
|
||||||
// 初始化窗口类结构
|
// 初始化窗口类结构
|
||||||
|
@ -620,7 +620,7 @@ namespace CPF
|
|||||||
throw new Exception($"错误:{ex}");
|
throw new Exception($"错误:{ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CpfObject SourceProperty = null;
|
//CpfObject SourceProperty = null;
|
||||||
private void Target_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
private void Target_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
//重新绑定
|
//重新绑定
|
||||||
|
@ -17,7 +17,7 @@ namespace CPF.Controls
|
|||||||
/// 通用窗体框架,包含窗体边框,系统按钮,阴影这些元素
|
/// 通用窗体框架,包含窗体边框,系统按钮,阴影这些元素
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("通用窗体框架,包含窗体边框,系统按钮,阴影这些元素")]
|
[Description("通用窗体框架,包含窗体边框,系统按钮,阴影这些元素")]
|
||||||
public class WindowFrame : Control
|
public class WindowFrame : ContentControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通用窗体框架,包含窗体边框,系统按钮,阴影这些元素
|
/// 通用窗体框架,包含窗体边框,系统按钮,阴影这些元素
|
||||||
@ -28,11 +28,11 @@ namespace CPF.Controls
|
|||||||
public WindowFrame(IWindow window, UIElement content, params UIElement[] systemButtons)
|
public WindowFrame(IWindow window, UIElement content, params UIElement[] systemButtons)
|
||||||
{
|
{
|
||||||
this.window = window;
|
this.window = window;
|
||||||
this.content = content;
|
this.Content = content;
|
||||||
this.systemButtons = systemButtons;
|
this.systemButtons = systemButtons;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected WindowFrame() { }
|
public WindowFrame() { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否显示最大化还原按钮
|
/// 是否显示最大化还原按钮
|
||||||
@ -54,15 +54,15 @@ namespace CPF.Controls
|
|||||||
get { return window; }
|
get { return window; }
|
||||||
}
|
}
|
||||||
|
|
||||||
UIElement content;
|
//UIElement content;
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 窗体的内容
|
///// 窗体的内容
|
||||||
/// </summary>
|
///// </summary>
|
||||||
[NotCpfProperty]
|
//[NotCpfProperty]
|
||||||
public UIElement Content
|
//public UIElement Content
|
||||||
{
|
//{
|
||||||
get { return content; }
|
// get { return content; }
|
||||||
}
|
//}
|
||||||
|
|
||||||
IEnumerable<UIElement> systemButtons;
|
IEnumerable<UIElement> systemButtons;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -96,7 +96,7 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
protected override void InitializeComponent()
|
protected override void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
|
||||||
ViewFill color = "#fff";
|
ViewFill color = "#fff";
|
||||||
ViewFill hoverColor = "255,255,255,40";
|
ViewFill hoverColor = "255,255,255,40";
|
||||||
Width = "100%";
|
Width = "100%";
|
||||||
@ -142,6 +142,8 @@ namespace CPF.Controls
|
|||||||
{
|
{
|
||||||
Width = "100%",
|
Width = "100%",
|
||||||
Height = "100%",
|
Height = "100%",
|
||||||
|
Name = "contentGrid",
|
||||||
|
PresenterFor = this,
|
||||||
ColumnDefinitions =
|
ColumnDefinitions =
|
||||||
{
|
{
|
||||||
new ColumnDefinition()
|
new ColumnDefinition()
|
||||||
@ -157,6 +159,19 @@ namespace CPF.Controls
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new Border
|
||||||
|
{
|
||||||
|
Name = "contentPresenter",
|
||||||
|
Height = "100%",
|
||||||
|
Width = "100%",
|
||||||
|
BorderFill = null,
|
||||||
|
BorderStroke="0",
|
||||||
|
PresenterFor = this,
|
||||||
|
[Grid.RowIndex]=1,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//标题栏和按钮
|
//标题栏和按钮
|
||||||
grid.Children.Add(
|
grid.Children.Add(
|
||||||
@ -237,6 +252,7 @@ namespace CPF.Controls
|
|||||||
new StackPanel
|
new StackPanel
|
||||||
{
|
{
|
||||||
Name="controlBox",
|
Name="controlBox",
|
||||||
|
PresenterFor=this,
|
||||||
MarginRight=0,
|
MarginRight=0,
|
||||||
Height = "100%",
|
Height = "100%",
|
||||||
Orientation= Orientation.Horizontal,
|
Orientation= Orientation.Horizontal,
|
||||||
@ -495,10 +511,10 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (Content != null)
|
//if (Content != null)
|
||||||
{
|
//{
|
||||||
grid.Children.Add(Content, 0, 1);
|
// grid.Children.Add(Content, 0, 1);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void DoubleClickTitle()
|
protected void DoubleClickTitle()
|
||||||
@ -515,6 +531,25 @@ namespace CPF.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnAttachedToVisualTree()
|
||||||
|
{
|
||||||
|
var parent = Parent;
|
||||||
|
while (parent != null)
|
||||||
|
{
|
||||||
|
if (parent is IWindow window)
|
||||||
|
{
|
||||||
|
this.window = window;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
parent = parent.Parent;
|
||||||
|
}
|
||||||
|
if (window == null)
|
||||||
|
{
|
||||||
|
window = (IWindow)Root;
|
||||||
|
}
|
||||||
|
base.OnAttachedToVisualTree();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通用窗体接口
|
/// 通用窗体接口
|
||||||
|
719
CPF/Json/Reflection.cs
Normal file
719
CPF/Json/Reflection.cs
Normal file
@ -0,0 +1,719 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection.Emit;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Text;
|
||||||
|
using CPF.Reflection;
|
||||||
|
#if !SILVERLIGHT
|
||||||
|
using System.Data;
|
||||||
|
#endif
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
|
namespace CPF.Json
|
||||||
|
{
|
||||||
|
internal struct Getters
|
||||||
|
{
|
||||||
|
public string Name;
|
||||||
|
public string lcName;
|
||||||
|
public Reflection.GenericGetter Getter;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal enum myPropInfoType
|
||||||
|
{
|
||||||
|
Int,
|
||||||
|
Long,
|
||||||
|
String,
|
||||||
|
Bool,
|
||||||
|
DateTime,
|
||||||
|
Enum,
|
||||||
|
Guid,
|
||||||
|
|
||||||
|
Array,
|
||||||
|
ByteArray,
|
||||||
|
Dictionary,
|
||||||
|
StringKeyDictionary,
|
||||||
|
NameValue,
|
||||||
|
StringDictionary,
|
||||||
|
#if !SILVERLIGHT
|
||||||
|
Hashtable,
|
||||||
|
DataSet,
|
||||||
|
DataTable,
|
||||||
|
#endif
|
||||||
|
Custom,
|
||||||
|
Unknown,
|
||||||
|
}
|
||||||
|
|
||||||
|
internal struct myPropInfo
|
||||||
|
{
|
||||||
|
public Type pt;
|
||||||
|
public Type bt;
|
||||||
|
public Type changeType;
|
||||||
|
public Reflection.GenericSetter setter;
|
||||||
|
public Reflection.GenericGetter getter;
|
||||||
|
public Type[] GenericTypes;
|
||||||
|
public string Name;
|
||||||
|
public myPropInfoType Type;
|
||||||
|
public bool CanWrite;
|
||||||
|
|
||||||
|
public bool IsClass;
|
||||||
|
public bool IsValueType;
|
||||||
|
public bool IsGenericType;
|
||||||
|
public bool IsStruct;
|
||||||
|
public bool IsInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal sealed class Reflection
|
||||||
|
{
|
||||||
|
// Sinlgeton pattern 4 from : http://csharpindepth.com/articles/general/singleton.aspx
|
||||||
|
private static readonly Reflection instance = new Reflection();
|
||||||
|
// Explicit static constructor to tell C# compiler
|
||||||
|
// not to mark type as beforefieldinit
|
||||||
|
static Reflection()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
private Reflection()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public static Reflection Instance { get { return instance; } }
|
||||||
|
|
||||||
|
internal delegate object GenericSetter(object target, object value);
|
||||||
|
internal delegate object GenericGetter(object obj);
|
||||||
|
private delegate object CreateObject();
|
||||||
|
|
||||||
|
private SafeDictionary<Type, string> _tyname = new SafeDictionary<Type, string>();
|
||||||
|
private SafeDictionary<string, Type> _typecache = new SafeDictionary<string, Type>();
|
||||||
|
private SafeDictionary<Type, CreateObject> _constrcache = new SafeDictionary<Type, CreateObject>();
|
||||||
|
private SafeDictionary<Type, Getters[]> _getterscache = new SafeDictionary<Type, Getters[]>();
|
||||||
|
private SafeDictionary<string, Dictionary<string, myPropInfo>> _propertycache = new SafeDictionary<string, Dictionary<string, myPropInfo>>();
|
||||||
|
private SafeDictionary<Type, Type[]> _genericTypes = new SafeDictionary<Type, Type[]>();
|
||||||
|
private SafeDictionary<Type, Type> _genericTypeDef = new SafeDictionary<Type, Type>();
|
||||||
|
|
||||||
|
#region bjson custom types
|
||||||
|
internal UnicodeEncoding unicode = new UnicodeEncoding();
|
||||||
|
internal UTF8Encoding utf8 = new UTF8Encoding();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region json custom types
|
||||||
|
// JSON custom
|
||||||
|
internal SafeDictionary<Type, Serialize> _customSerializer = new SafeDictionary<Type, Serialize>();
|
||||||
|
internal SafeDictionary<Type, Deserialize> _customDeserializer = new SafeDictionary<Type, Deserialize>();
|
||||||
|
|
||||||
|
internal object CreateCustom(string v, Type type)
|
||||||
|
{
|
||||||
|
Deserialize d;
|
||||||
|
_customDeserializer.TryGetValue(type, out d);
|
||||||
|
return d(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void RegisterCustomType(Type type, Serialize serializer, Deserialize deserializer)
|
||||||
|
{
|
||||||
|
if (type != null && serializer != null && deserializer != null)
|
||||||
|
{
|
||||||
|
_customSerializer.Add(type, serializer);
|
||||||
|
_customDeserializer.Add(type, deserializer);
|
||||||
|
// reset property cache
|
||||||
|
Instance.ResetPropertyCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal bool IsTypeRegistered(Type t)
|
||||||
|
{
|
||||||
|
if (_customSerializer.Count == 0)
|
||||||
|
return false;
|
||||||
|
Serialize s;
|
||||||
|
return _customSerializer.TryGetValue(t, out s);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Type GetGenericTypeDefinition(Type t)
|
||||||
|
{
|
||||||
|
Type tt = null;
|
||||||
|
if (_genericTypeDef.TryGetValue(t, out tt))
|
||||||
|
return tt;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tt = t.GetGenericTypeDefinition();
|
||||||
|
_genericTypeDef.Add(t, tt);
|
||||||
|
return tt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type[] GetGenericArguments(Type t)
|
||||||
|
{
|
||||||
|
Type[] tt = null;
|
||||||
|
if (_genericTypes.TryGetValue(t, out tt))
|
||||||
|
return tt;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tt = t.GetGenericArguments();
|
||||||
|
_genericTypes.Add(t, tt);
|
||||||
|
return tt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, myPropInfo> Getproperties(Type type, string typename)
|
||||||
|
{
|
||||||
|
Dictionary<string, myPropInfo> sd = null;
|
||||||
|
if (_propertycache.TryGetValue(typename, out sd))
|
||||||
|
{
|
||||||
|
return sd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sd = new Dictionary<string, myPropInfo>();
|
||||||
|
var bf = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static;
|
||||||
|
if (type.Name == "Nullable`1")
|
||||||
|
{
|
||||||
|
type = type.GetGenericArguments()[0];
|
||||||
|
}
|
||||||
|
PropertyInfo[] pr = type.GetProperties(bf);
|
||||||
|
foreach (PropertyInfo p in pr)
|
||||||
|
{
|
||||||
|
if (p.GetIndexParameters().Length > 0)// Property is an indexer
|
||||||
|
continue;
|
||||||
|
|
||||||
|
myPropInfo d = CreateMyProp(p.PropertyType, p.Name);
|
||||||
|
d.setter = Reflection.CreateSetMethod(type, p);
|
||||||
|
if (d.setter != null)
|
||||||
|
d.CanWrite = true;
|
||||||
|
d.getter = Reflection.CreateGetMethod(type, p);
|
||||||
|
sd.Add(p.Name.ToLower(), d);
|
||||||
|
}
|
||||||
|
FieldInfo[] fi = type.GetFields(bf);
|
||||||
|
foreach (FieldInfo f in fi)
|
||||||
|
{
|
||||||
|
myPropInfo d = CreateMyProp(f.FieldType, f.Name);
|
||||||
|
if (f.IsLiteral == false)
|
||||||
|
{
|
||||||
|
d.setter = Reflection.CreateSetField(type, f);
|
||||||
|
if (d.setter != null)
|
||||||
|
d.CanWrite = true;
|
||||||
|
d.getter = Reflection.CreateGetField(type, f);
|
||||||
|
sd.Add(f.Name.ToLower(), d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_propertycache.Add(typename, sd);
|
||||||
|
return sd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private myPropInfo CreateMyProp(Type t, string name)
|
||||||
|
{
|
||||||
|
myPropInfo d = new myPropInfo();
|
||||||
|
myPropInfoType d_type = myPropInfoType.Unknown;
|
||||||
|
|
||||||
|
if (t == typeof(int) || t == typeof(int?)) d_type = myPropInfoType.Int;
|
||||||
|
else if (t == typeof(long) || t == typeof(long?)) d_type = myPropInfoType.Long;
|
||||||
|
else if (t == typeof(string)) d_type = myPropInfoType.String;
|
||||||
|
else if (t == typeof(bool) || t == typeof(bool?)) d_type = myPropInfoType.Bool;
|
||||||
|
else if (t == typeof(DateTime) || t == typeof(DateTime?)) d_type = myPropInfoType.DateTime;
|
||||||
|
else if (t.IsEnum) d_type = myPropInfoType.Enum;
|
||||||
|
else if (t == typeof(Guid) || t == typeof(Guid?)) d_type = myPropInfoType.Guid;
|
||||||
|
else if (t == typeof(StringDictionary)) d_type = myPropInfoType.StringDictionary;
|
||||||
|
else if (t == typeof(NameValueCollection)) d_type = myPropInfoType.NameValue;
|
||||||
|
else if (t.IsArray)
|
||||||
|
{
|
||||||
|
d.bt = t.GetElementType();
|
||||||
|
if (t == typeof(byte[]))
|
||||||
|
d_type = myPropInfoType.ByteArray;
|
||||||
|
else
|
||||||
|
d_type = myPropInfoType.Array;
|
||||||
|
}
|
||||||
|
else if (t.Name.Contains("Dictionary"))
|
||||||
|
{
|
||||||
|
d.GenericTypes = Reflection.Instance.GetGenericArguments(t);
|
||||||
|
if (d.GenericTypes.Length > 0 && d.GenericTypes[0] == typeof(string))
|
||||||
|
d_type = myPropInfoType.StringKeyDictionary;
|
||||||
|
else
|
||||||
|
d_type = myPropInfoType.Dictionary;
|
||||||
|
}
|
||||||
|
#if !SILVERLIGHT
|
||||||
|
else if (t == typeof(Hashtable)) d_type = myPropInfoType.Hashtable;
|
||||||
|
else if (t == typeof(DataSet)) d_type = myPropInfoType.DataSet;
|
||||||
|
else if (t == typeof(DataTable)) d_type = myPropInfoType.DataTable;
|
||||||
|
#endif
|
||||||
|
else if (IsTypeRegistered(t))
|
||||||
|
d_type = myPropInfoType.Custom;
|
||||||
|
|
||||||
|
if (t.IsValueType && !t.IsPrimitive && !t.IsEnum && t != typeof(decimal))
|
||||||
|
d.IsStruct = true;
|
||||||
|
|
||||||
|
d.IsInterface = t.IsInterface;
|
||||||
|
d.IsClass = t.IsClass;
|
||||||
|
d.IsValueType = t.IsValueType;
|
||||||
|
if (t.IsGenericType)
|
||||||
|
{
|
||||||
|
d.IsGenericType = true;
|
||||||
|
d.bt = t.GetGenericArguments()[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
d.pt = t;
|
||||||
|
d.Name = name;
|
||||||
|
d.changeType = GetChangeType(t);
|
||||||
|
d.Type = d_type;
|
||||||
|
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Type GetChangeType(Type conversionType)
|
||||||
|
{
|
||||||
|
if (conversionType.IsGenericType && conversionType.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
|
||||||
|
return Reflection.Instance.GetGenericArguments(conversionType)[0];
|
||||||
|
|
||||||
|
return conversionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region [ PROPERTY GET SET ]
|
||||||
|
|
||||||
|
internal string GetTypeAssemblyName(Type t)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
if (_tyname.TryGetValue(t, out val))
|
||||||
|
return val;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string s = t.AssemblyQualifiedName;
|
||||||
|
_tyname.Add(t, s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Type GetTypeFromCache(string typename)
|
||||||
|
{
|
||||||
|
Type val = null;
|
||||||
|
if (_typecache.TryGetValue(typename, out val))
|
||||||
|
return val;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Type t = Type.GetType(typename);
|
||||||
|
//if (t == null) // RaptorDB : loading runtime assemblies
|
||||||
|
//{
|
||||||
|
// t = Type.GetType(typename, (name) => {
|
||||||
|
// return AppDomain.CurrentDomain.GetAssemblies().Where(z => z.FullName == name.FullName).FirstOrDefault();
|
||||||
|
// }, null, true);
|
||||||
|
//}
|
||||||
|
_typecache.Add(typename, t);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal object FastCreateInstance(Type objtype)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CreateObject c = null;
|
||||||
|
if (_constrcache.TryGetValue(objtype, out c))
|
||||||
|
{
|
||||||
|
return c();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objtype.IsClass)
|
||||||
|
{
|
||||||
|
DynamicMethod dynMethod = new DynamicMethod("_", objtype, null);
|
||||||
|
ILGenerator ilGen = dynMethod.GetILGenerator();
|
||||||
|
ilGen.Emit(OpCodes.Newobj, objtype.GetConstructor(Type.EmptyTypes));
|
||||||
|
ilGen.Emit(OpCodes.Ret);
|
||||||
|
c = (CreateObject)dynMethod.CreateDelegate(typeof(CreateObject));
|
||||||
|
_constrcache.Add(objtype, c);
|
||||||
|
}
|
||||||
|
else // structs
|
||||||
|
{
|
||||||
|
if (objtype.Name == "Nullable`1")
|
||||||
|
{
|
||||||
|
var sType = objtype.GetGenericArguments()[0];
|
||||||
|
var create = objtype.GetConstructor(new Type[] { sType });
|
||||||
|
c = () => create.Invoke(new object[] { null });
|
||||||
|
_constrcache.Add(objtype, c);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DynamicMethod dynMethod = new DynamicMethod("_", typeof(object), null);
|
||||||
|
ILGenerator ilGen = dynMethod.GetILGenerator();
|
||||||
|
var lv = ilGen.DeclareLocal(objtype);
|
||||||
|
ilGen.Emit(OpCodes.Ldloca_S, lv);
|
||||||
|
ilGen.Emit(OpCodes.Initobj, objtype);
|
||||||
|
ilGen.Emit(OpCodes.Ldloc_0);
|
||||||
|
ilGen.Emit(OpCodes.Box, objtype);
|
||||||
|
ilGen.Emit(OpCodes.Ret);
|
||||||
|
c = (CreateObject)dynMethod.CreateDelegate(typeof(CreateObject));
|
||||||
|
_constrcache.Add(objtype, c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return c();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
throw new Exception(string.Format("Failed to fast create instance for type '{0}' from assembly '{1}'",
|
||||||
|
objtype.FullName, objtype.AssemblyQualifiedName), exc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static GenericSetter CreateSetField(Type type, FieldInfo fieldInfo)
|
||||||
|
{
|
||||||
|
Type[] arguments = new Type[2];
|
||||||
|
arguments[0] = arguments[1] = typeof(object);
|
||||||
|
|
||||||
|
DynamicMethod dynamicSet = new DynamicMethod("_", typeof(object), arguments, type);
|
||||||
|
|
||||||
|
ILGenerator il = dynamicSet.GetILGenerator();
|
||||||
|
|
||||||
|
if (!type.IsClass) // structs
|
||||||
|
{
|
||||||
|
var lv = il.DeclareLocal(type);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Unbox_Any, type);
|
||||||
|
il.Emit(OpCodes.Stloc_0);
|
||||||
|
il.Emit(OpCodes.Ldloca_S, lv);
|
||||||
|
il.Emit(OpCodes.Ldarg_1);
|
||||||
|
if (fieldInfo.FieldType.IsClass)
|
||||||
|
il.Emit(OpCodes.Castclass, fieldInfo.FieldType);
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Unbox_Any, fieldInfo.FieldType);
|
||||||
|
il.Emit(OpCodes.Stfld, fieldInfo);
|
||||||
|
il.Emit(OpCodes.Ldloc_0);
|
||||||
|
il.Emit(OpCodes.Box, type);
|
||||||
|
il.Emit(OpCodes.Ret);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Ldarg_1);
|
||||||
|
if (fieldInfo.FieldType.IsValueType)
|
||||||
|
il.Emit(OpCodes.Unbox_Any, fieldInfo.FieldType);
|
||||||
|
il.Emit(OpCodes.Stfld, fieldInfo);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Ret);
|
||||||
|
}
|
||||||
|
return (GenericSetter)dynamicSet.CreateDelegate(typeof(GenericSetter));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static GenericSetter CreateSetMethod(Type type, PropertyInfo propertyInfo)
|
||||||
|
{
|
||||||
|
MethodInfo setMethod = propertyInfo.GetSetMethod();
|
||||||
|
if (setMethod == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
Type[] arguments = new Type[2];
|
||||||
|
arguments[0] = arguments[1] = typeof(object);
|
||||||
|
|
||||||
|
DynamicMethod setter = new DynamicMethod("_", typeof(object), arguments);
|
||||||
|
ILGenerator il = setter.GetILGenerator();
|
||||||
|
|
||||||
|
if (!type.IsClass) // structs
|
||||||
|
{
|
||||||
|
var lv = il.DeclareLocal(type);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Unbox_Any, type);
|
||||||
|
il.Emit(OpCodes.Stloc_0);
|
||||||
|
il.Emit(OpCodes.Ldloca_S, lv);
|
||||||
|
il.Emit(OpCodes.Ldarg_1);
|
||||||
|
if (propertyInfo.PropertyType.IsClass)
|
||||||
|
il.Emit(OpCodes.Castclass, propertyInfo.PropertyType);
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Unbox_Any, propertyInfo.PropertyType);
|
||||||
|
il.EmitCall(OpCodes.Call, setMethod, null);
|
||||||
|
il.Emit(OpCodes.Ldloc_0);
|
||||||
|
il.Emit(OpCodes.Box, type);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!setMethod.IsStatic)
|
||||||
|
{
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Castclass, propertyInfo.DeclaringType);
|
||||||
|
il.Emit(OpCodes.Ldarg_1);
|
||||||
|
if (propertyInfo.PropertyType.IsClass)
|
||||||
|
il.Emit(OpCodes.Castclass, propertyInfo.PropertyType);
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Unbox_Any, propertyInfo.PropertyType);
|
||||||
|
il.EmitCall(OpCodes.Callvirt, setMethod, null);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Ldarg_1);
|
||||||
|
if (propertyInfo.PropertyType.IsClass)
|
||||||
|
il.Emit(OpCodes.Castclass, propertyInfo.PropertyType);
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Unbox_Any, propertyInfo.PropertyType);
|
||||||
|
il.Emit(OpCodes.Call, setMethod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
il.Emit(OpCodes.Ret);
|
||||||
|
|
||||||
|
return (GenericSetter)setter.CreateDelegate(typeof(GenericSetter));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static GenericGetter CreateGetField(Type type, FieldInfo fieldInfo)
|
||||||
|
{
|
||||||
|
DynamicMethod dynamicGet = new DynamicMethod("_", typeof(object), new Type[] { typeof(object) }, type);
|
||||||
|
|
||||||
|
ILGenerator il = dynamicGet.GetILGenerator();
|
||||||
|
|
||||||
|
if (!type.IsClass) // structs
|
||||||
|
{
|
||||||
|
var lv = il.DeclareLocal(type);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Unbox_Any, type);
|
||||||
|
il.Emit(OpCodes.Stloc_0);
|
||||||
|
il.Emit(OpCodes.Ldloca_S, lv);
|
||||||
|
il.Emit(OpCodes.Ldfld, fieldInfo);
|
||||||
|
if (fieldInfo.FieldType.IsValueType)
|
||||||
|
il.Emit(OpCodes.Box, fieldInfo.FieldType);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Ldfld, fieldInfo);
|
||||||
|
if (fieldInfo.FieldType.IsValueType)
|
||||||
|
il.Emit(OpCodes.Box, fieldInfo.FieldType);
|
||||||
|
}
|
||||||
|
|
||||||
|
il.Emit(OpCodes.Ret);
|
||||||
|
|
||||||
|
return (GenericGetter)dynamicGet.CreateDelegate(typeof(GenericGetter));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static GenericGetter CreateGetMethod(Type type, PropertyInfo propertyInfo)
|
||||||
|
{
|
||||||
|
MethodInfo getMethod = propertyInfo.GetGetMethod();
|
||||||
|
if (getMethod == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
DynamicMethod getter = new DynamicMethod("_", typeof(object), new Type[] { typeof(object) }, type);
|
||||||
|
|
||||||
|
ILGenerator il = getter.GetILGenerator();
|
||||||
|
|
||||||
|
if (!type.IsClass) // structs
|
||||||
|
{
|
||||||
|
var lv = il.DeclareLocal(type);
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Unbox_Any, type);
|
||||||
|
il.Emit(OpCodes.Stloc_0);
|
||||||
|
il.Emit(OpCodes.Ldloca_S, lv);
|
||||||
|
il.EmitCall(OpCodes.Call, getMethod, null);
|
||||||
|
if (propertyInfo.PropertyType.IsValueType)
|
||||||
|
il.Emit(OpCodes.Box, propertyInfo.PropertyType);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!getMethod.IsStatic)
|
||||||
|
{
|
||||||
|
il.Emit(OpCodes.Ldarg_0);
|
||||||
|
il.Emit(OpCodes.Castclass, propertyInfo.DeclaringType);
|
||||||
|
il.EmitCall(OpCodes.Callvirt, getMethod, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Call, getMethod);
|
||||||
|
|
||||||
|
if (propertyInfo.PropertyType.IsValueType)
|
||||||
|
il.Emit(OpCodes.Box, propertyInfo.PropertyType);
|
||||||
|
}
|
||||||
|
|
||||||
|
il.Emit(OpCodes.Ret);
|
||||||
|
|
||||||
|
return (GenericGetter)getter.CreateDelegate(typeof(GenericGetter));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Getters[] GetGetters(Type type, bool ShowReadOnlyProperties, List<Type> IgnoreAttributes)
|
||||||
|
{
|
||||||
|
Getters[] val = null;
|
||||||
|
if (_getterscache.TryGetValue(type, out val))
|
||||||
|
return val;
|
||||||
|
|
||||||
|
//bool isAnonymous = IsAnonymousType(type);
|
||||||
|
|
||||||
|
var bf = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static;
|
||||||
|
//if (ShowReadOnlyProperties)
|
||||||
|
// bf |= BindingFlags.NonPublic;
|
||||||
|
PropertyInfo[] props = type.GetProperties(bf);
|
||||||
|
List<Getters> getters = new List<Getters>();
|
||||||
|
foreach (PropertyInfo p in props)
|
||||||
|
{
|
||||||
|
if (p.GetIndexParameters().Length > 0)
|
||||||
|
{// Property is an indexer
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!p.CanWrite && (ShowReadOnlyProperties == false))//|| isAnonymous == false))
|
||||||
|
continue;
|
||||||
|
if (IgnoreAttributes != null)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
foreach (var ignoreAttr in IgnoreAttributes)
|
||||||
|
{
|
||||||
|
if (p.IsDefined(ignoreAttr, false))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
GenericGetter g = CreateGetMethod(type, p);
|
||||||
|
if (g != null)
|
||||||
|
getters.Add(new Getters { Getter = g, Name = p.Name, lcName = p.Name.ToLower() });
|
||||||
|
}
|
||||||
|
|
||||||
|
FieldInfo[] fi = type.GetFields(bf);
|
||||||
|
foreach (var f in fi)
|
||||||
|
{
|
||||||
|
if (IgnoreAttributes != null)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
foreach (var ignoreAttr in IgnoreAttributes)
|
||||||
|
{
|
||||||
|
if (f.IsDefined(ignoreAttr, false))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (f.IsLiteral == false)
|
||||||
|
{
|
||||||
|
GenericGetter g = CreateGetField(type, f);
|
||||||
|
if (g != null)
|
||||||
|
getters.Add(new Getters { Getter = g, Name = f.Name, lcName = f.Name.ToLower() });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val = getters.ToArray();
|
||||||
|
_getterscache.Add(type, val);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
//private static bool IsAnonymousType(Type type)
|
||||||
|
//{
|
||||||
|
// // may break in the future if compiler defined names change...
|
||||||
|
// const string CS_ANONYMOUS_PREFIX = "<>f__AnonymousType";
|
||||||
|
// const string VB_ANONYMOUS_PREFIX = "VB$AnonymousType";
|
||||||
|
|
||||||
|
// if (type == null)
|
||||||
|
// throw new ArgumentNullException("type");
|
||||||
|
|
||||||
|
// if (type.Name.StartsWith(CS_ANONYMOUS_PREFIX, StringComparison.Ordinal) || type.Name.StartsWith(VB_ANONYMOUS_PREFIX, StringComparison.Ordinal))
|
||||||
|
// {
|
||||||
|
// return type.IsDefined(typeof(CompilerGeneratedAttribute), false);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
internal void ResetPropertyCache()
|
||||||
|
{
|
||||||
|
_propertycache = new SafeDictionary<string, Dictionary<string, myPropInfo>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ClearReflectionCache()
|
||||||
|
{
|
||||||
|
_tyname = new SafeDictionary<Type, string>();
|
||||||
|
_typecache = new SafeDictionary<string, Type>();
|
||||||
|
_constrcache = new SafeDictionary<Type, CreateObject>();
|
||||||
|
_getterscache = new SafeDictionary<Type, Getters[]>();
|
||||||
|
_propertycache = new SafeDictionary<string, Dictionary<string, myPropInfo>>();
|
||||||
|
_genericTypes = new SafeDictionary<Type, Type[]>();
|
||||||
|
_genericTypeDef = new SafeDictionary<Type, Type>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !NET40
|
||||||
|
class DynamicMethod
|
||||||
|
{
|
||||||
|
static Type type = Type.GetType("System.Reflection.Emit.DynamicMethod");
|
||||||
|
static MethodInfo getILGenerator = type.GetMethod(nameof(GetILGenerator), new Type[] { });
|
||||||
|
static MethodInfo createDelegate = type.GetMethod(nameof(CreateDelegate), new Type[] { typeof(Type) });
|
||||||
|
|
||||||
|
public object Instance;
|
||||||
|
|
||||||
|
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner)
|
||||||
|
{
|
||||||
|
Instance = Activator.CreateInstance(type, name, returnType, parameterTypes, owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DynamicMethod(string name, Type returnType, Type[] parameterTypes)
|
||||||
|
{
|
||||||
|
Instance = Activator.CreateInstance(type, name, returnType, parameterTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ILGenerator GetILGenerator()
|
||||||
|
{
|
||||||
|
return new ILGenerator(getILGenerator.Invoke(Instance, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Delegate CreateDelegate(Type delegateType)
|
||||||
|
{
|
||||||
|
return (Delegate)createDelegate.Invoke(Instance, new object[] { delegateType });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ILGenerator
|
||||||
|
{
|
||||||
|
static Type type = Type.GetType("System.Reflection.Emit.ILGenerator");
|
||||||
|
static Type LocalBuilder = Type.GetType("System.Reflection.Emit.LocalBuilder");
|
||||||
|
static MethodInfo Emit_ = type.GetMethod("Emit", new Type[] { typeof(OpCode) });
|
||||||
|
static MethodInfo Emit_Type = type.GetMethod("Emit", new Type[] { typeof(OpCode), typeof(Type) });
|
||||||
|
static MethodInfo Emit_con = type.GetMethod("Emit", new Type[] { typeof(OpCode), typeof(ConstructorInfo) });
|
||||||
|
static MethodInfo Emit_Local = type.GetMethod("Emit", new Type[] { typeof(OpCode), LocalBuilder });
|
||||||
|
static MethodInfo Emit_FieldInfo = type.GetMethod("Emit", new Type[] { typeof(OpCode), typeof(FieldInfo) });
|
||||||
|
static MethodInfo Emit_MethodInfo = type.GetMethod("Emit", new Type[] { typeof(OpCode), typeof(MethodInfo) });
|
||||||
|
static MethodInfo Emit_MethodInfo_Type = type.GetMethod("EmitCall", new Type[] { typeof(OpCode), typeof(MethodInfo), typeof(Type[]) });
|
||||||
|
static MethodInfo declareLocal = type.GetMethod("DeclareLocal", new Type[] { typeof(Type) });
|
||||||
|
|
||||||
|
object Instance;
|
||||||
|
public ILGenerator(object instance)
|
||||||
|
{
|
||||||
|
Instance = instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual LocalVariableInfo DeclareLocal(Type localType)
|
||||||
|
{
|
||||||
|
return (LocalVariableInfo)declareLocal.Invoke(Instance, new object[] { localType });
|
||||||
|
}
|
||||||
|
public virtual void Emit(OpCode opcode)
|
||||||
|
{
|
||||||
|
Emit_.Invoke(Instance, new object[] { opcode });
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Emit(OpCode opcode, Type cls)
|
||||||
|
{
|
||||||
|
Emit_Type.Invoke(Instance, new object[] { opcode, cls });
|
||||||
|
}
|
||||||
|
public virtual void Emit(OpCode opcode, ConstructorInfo con)
|
||||||
|
{
|
||||||
|
Emit_con.Invoke(Instance, new object[] { opcode, con });
|
||||||
|
}
|
||||||
|
public virtual void Emit(OpCode opcode, LocalVariableInfo local)
|
||||||
|
{
|
||||||
|
Emit_Local.Invoke(Instance, new object[] { opcode, local });
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Emit(OpCode opcode, FieldInfo field)
|
||||||
|
{
|
||||||
|
Emit_FieldInfo.Invoke(Instance, new object[] { opcode, field });
|
||||||
|
}
|
||||||
|
public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
|
||||||
|
{
|
||||||
|
Emit_MethodInfo_Type.Invoke(Instance, new object[] { opcode, methodInfo, optionalParameterTypes });
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Emit(OpCode opcode, MethodInfo meth)
|
||||||
|
{
|
||||||
|
Emit_MethodInfo.Invoke(Instance, new object[] { opcode, meth });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//class LocalBuilder
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
#endif
|
||||||
|
}
|
@ -228,6 +228,11 @@ namespace CPF.Platform
|
|||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 某些平台下不能使用CPF的消息循环,需要将该属性改成false
|
||||||
|
/// </summary>
|
||||||
|
public static bool NeedRunLoop { get; set; } = true;
|
||||||
|
|
||||||
//#if NETSTANDARD
|
//#if NETSTANDARD
|
||||||
// /// <summary>
|
// /// <summary>
|
||||||
// /// 启用AOT功能,net5以及以上版本才能使用,其中包括,禁用弱引用事件功能,一般在Aot的release发布的时候设置。如果不用Aot,请勿设置,否则可能有内存泄露风险,而且会导致性能降低。 以及切换windows的com包装
|
// /// 启用AOT功能,net5以及以上版本才能使用,其中包括,禁用弱引用事件功能,一般在Aot的release发布的时候设置。如果不用Aot,请勿设置,否则可能有内存泄露风险,而且会导致性能降低。 以及切换windows的com包装
|
||||||
|
@ -46,7 +46,7 @@ namespace CPF.Threading
|
|||||||
if (timeThread == null)
|
if (timeThread == null)
|
||||||
{
|
{
|
||||||
timers = new List<DispatcherTimer>();
|
timers = new List<DispatcherTimer>();
|
||||||
tempTimers = new List<DispatcherTimer>();
|
tempTimers = new List<DispatcherTimer>();
|
||||||
timeThread = new Thread(SetTime) { IsBackground = true, Name = "定时器线程" };
|
timeThread = new Thread(SetTime) { IsBackground = true, Name = "定时器线程" };
|
||||||
timeThread.Start();
|
timeThread.Start();
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ namespace CPF.Threading
|
|||||||
}
|
}
|
||||||
if (tempTimers.Count > 0)
|
if (tempTimers.Count > 0)
|
||||||
{
|
{
|
||||||
if (CPF.Platform.Application.Main != null)
|
if ((CPF.Platform.Application.NeedRunLoop && CPF.Platform.Application.Main != null) || !CPF.Platform.Application.NeedRunLoop)
|
||||||
{
|
{
|
||||||
Dispatcher.MainThread.Invoke(() =>
|
Dispatcher.MainThread.Invoke(() =>
|
||||||
{
|
{
|
||||||
|
171
ConsoleApp1.sln
171
ConsoleApp1.sln
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 17.8.34309.116
|
VisualStudioVersion = 16.0.29324.140
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{ABE4ED47-CB9F-4183-9CE3-65E3E521BE2A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{ABE4ED47-CB9F-4183-9CE3-65E3E521BE2A}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -11,21 +11,64 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Windows", "CPF.Windows\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Skia", "CPF.Skia\CPF.Skia.csproj", "{E6495F31-7937-4A69-A915-834BFA1A031F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Skia", "CPF.Skia\CPF.Skia.csproj", "{E6495F31-7937-4A69-A915-834BFA1A031F}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{2C544909-EAB9-43F8-85B0-C04E2453289E}"
|
||||||
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Mac", "CPF.Mac\CPF.Mac.csproj", "{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Mac", "CPF.Mac\CPF.Mac.csproj", "{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFProjectTemplate", "CPFProjectTemplate\CPFProjectTemplate.csproj", "{BBAFD33E-1CF8-4AC4-9928-337E746947A6}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFItemTemplate", "CPFItemTemplate\CPFItemTemplate.csproj", "{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFWindowTemplate", "CPFWindowTemplate\CPFWindowTemplate.csproj", "{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}"
|
||||||
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Linux", "CPF.Linux\CPF.Linux.csproj", "{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Linux", "CPF.Linux\CPF.Linux.csproj", "{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Template", "Template", "{1D98D556-38A7-4ED6-ACAD-697B5E0625DE}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Template", "Template", "{1D98D556-38A7-4ED6-ACAD-697B5E0625DE}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFProjectNetCore3AndNet4", "CPFProjectNetCore3AndNet4\CPFProjectNetCore3AndNet4.csproj", "{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Cef", "CPF.Cef\CPF.Cef.csproj", "{A0703482-DAAD-43F6-A39F-4326157C1ADC}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Vlc", "CPF.Vlc\CPF.Vlc.csproj", "{B2A6696C-288D-44C2-A393-9DC3C7773C8F}"
|
||||||
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPF.Android", "CPF.Android\CPF.Android.csproj", "{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPF.Android", "CPF.Android\CPF.Android.csproj", "{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NESPlayer", "NESPlayer\NESPlayer.csproj", "{CC00B3A6-7F84-4BDA-B8C9-915723F51207}"
|
||||||
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidTest", "AndroidTest\AndroidTest.csproj", "{C7338F66-2EAF-4F0A-9306-53232DD20501}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidTest", "AndroidTest\AndroidTest.csproj", "{C7338F66-2EAF-4F0A-9306-53232DD20501}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFDesigner", "Private\CPFDesigner\CPFDesigner.csproj", "{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}"
|
||||||
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Private", "Private", "{2B729C46-7592-425A-87E9-D769A94881F7}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Private", "Private", "{2B729C46-7592-425A-87E9-D769A94881F7}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesignerShared", "Private\DesignerShared\DesignerShared.csproj", "{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesignerSurface", "Private\DesignerSurface\DesignerSurface.csproj", "{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeveloperTools", "Private\DeveloperTools\DeveloperTools.csproj", "{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeveloperUpdate", "Private\DeveloperUpdate\DeveloperUpdate.csproj", "{1278A1BC-327D-4D13-AD04-C6FF2B680530}"
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedVSIX", "Private\SharedVSIX\SharedVSIX.shproj", "{F34CFFEE-546F-490E-A76A-2792840B284D}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPFDesigner2022", "Private\CPFDesigner2022\CPFDesigner2022.csproj", "{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Demo", "CPF_Demo\CPF.Demo.csproj", "{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "蓝图重制版", "蓝图重制版\蓝图重制版.csproj", "{003E155A-8C40-41AF-A796-ED17E729E013}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CPF.Razor", "CPF.Razor\CPF.Razor.csproj", "{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CpfRazorSample", "CpfRazorSample\CpfRazorSample.csproj", "{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
|
Private\SharedVSIX\SharedVSIX.projitems*{db53e8d7-dfb6-48eb-a7b6-d1cf762acb9b}*SharedItemsImports = 4
|
||||||
|
Private\SharedVSIX\SharedVSIX.projitems*{df526631-d060-47f2-afd4-62c6cea2fe9a}*SharedItemsImports = 4
|
||||||
|
Private\SharedVSIX\SharedVSIX.projitems*{f34cffee-546f-490e-a76a-2792840b284d}*SharedItemsImports = 13
|
||||||
|
EndGlobalSection
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
@ -56,18 +99,60 @@ Global
|
|||||||
{E6495F31-7937-4A69-A915-834BFA1A031F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E6495F31-7937-4A69-A915-834BFA1A031F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E6495F31-7937-4A69-A915-834BFA1A031F}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
{E6495F31-7937-4A69-A915-834BFA1A031F}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E6495F31-7937-4A69-A915-834BFA1A031F}.类库d|Any CPU.Build.0 = Release|Any CPU
|
{E6495F31-7937-4A69-A915-834BFA1A031F}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2C544909-EAB9-43F8-85B0-C04E2453289E}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.类库d|Any CPU.Build.0 = Release|Any CPU
|
{C63692AB-1CA6-4416-AB5C-9D71D1E3FC66}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.类库d|Any CPU.Build.0 = Release|Any CPU
|
{A91093C9-BFE6-4536-ADA1-E35F91C8AB37}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A0703482-DAAD-43F6-A39F-4326157C1ADC}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B2A6696C-288D-44C2-A393-9DC3C7773C8F}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6255E6D7-7EE3-4CB9-AF6C-F75B52341294}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -80,6 +165,12 @@ Global
|
|||||||
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.类库d|Any CPU.Build.0 = Release|Any CPU
|
{D1DF2CDD-E6B1-4844-B3DE-0F414091E972}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{CC00B3A6-7F84-4BDA-B8C9-915723F51207}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||||
@ -89,8 +180,84 @@ Global
|
|||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.Build.0 = Release|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.Deploy.0 = Release|Any CPU
|
{C7338F66-2EAF-4F0A-9306-53232DD20501}.类库d|Any CPU.Deploy.0 = Release|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.类库d|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BBF891E9-1939-4EE9-A1C7-7654ED8601E1}.类库d|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.类库d|Any CPU.ActiveCfg = 类库d|Any CPU
|
||||||
|
{003E155A-8C40-41AF-A796-ED17E729E013}.类库d|Any CPU.Build.0 = 类库d|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.类库d|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{87E1ED0A-BFBF-4F5E-9FDF-5EAFE48DD719}.类库d|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.类库d|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{25A4EE47-F5BD-4F1E-B143-3E3B50C5AC2A}.类库d|Any CPU.Build.0 = Debug|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{BBAFD33E-1CF8-4AC4-9928-337E746947A6} = {1D98D556-38A7-4ED6-ACAD-697B5E0625DE}
|
||||||
|
{E0235FD9-93F9-44CC-A449-CB9E24E0D93B} = {1D98D556-38A7-4ED6-ACAD-697B5E0625DE}
|
||||||
|
{79F0E685-FD16-4AE7-8DC8-3655FAA63ED2} = {1D98D556-38A7-4ED6-ACAD-697B5E0625DE}
|
||||||
|
{F5E89FCC-BF21-4664-B7A8-0740C4D1191C} = {1D98D556-38A7-4ED6-ACAD-697B5E0625DE}
|
||||||
|
{DB53E8D7-DFB6-48EB-A7B6-D1CF762ACB9B} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{431F48E7-CB1B-4161-99A7-5DB4B0A975B5} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{71FBFC1A-8EC8-4FD7-ADEB-07C56E1C9286} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{ED65F5A2-0459-49C6-B895-A6ABFF32C8B9} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{1278A1BC-327D-4D13-AD04-C6FF2B680530} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{F34CFFEE-546F-490E-A76A-2792840B284D} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
{DF526631-D060-47F2-AFD4-62C6CEA2FE9A} = {2B729C46-7592-425A-87E9-D769A94881F7}
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {16FB883C-167C-4E1A-B311-6D74452A3CD6}
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
4
CpfRazorSample/Component1.razor
Normal file
4
CpfRazorSample/Component1.razor
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<Panel Width="500" Height="500" Background="#000"></Panel>
|
||||||
|
@code {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,636 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace ComponentWrapperGenerator
|
||||||
|
{
|
||||||
|
// TODO: XML Doc Comments
|
||||||
|
|
||||||
|
#pragma warning disable CA1724 // Type name conflicts with namespace name
|
||||||
|
public class CpfComponentWrapperGenerator
|
||||||
|
#pragma warning restore CA1724 // Type name conflicts with namespace name
|
||||||
|
{
|
||||||
|
public CpfComponentWrapperGenerator(GeneratorSettings settings)
|
||||||
|
{
|
||||||
|
Settings = settings ?? throw new ArgumentNullException(nameof(settings));
|
||||||
|
}
|
||||||
|
|
||||||
|
private GeneratorSettings Settings { get; }
|
||||||
|
|
||||||
|
public void GenerateComponentWrapper(Type typeToGenerate, string outputFolder)
|
||||||
|
{
|
||||||
|
typeToGenerate = typeToGenerate ?? throw new ArgumentNullException(nameof(typeToGenerate));
|
||||||
|
|
||||||
|
var propertiesToGenerate = GetPropertiesToGenerate(typeToGenerate);
|
||||||
|
|
||||||
|
GenerateComponentFile(typeToGenerate, propertiesToGenerate, outputFolder);
|
||||||
|
//GenerateHandlerFile(typeToGenerate, propertiesToGenerate, outputFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GenerateComponentFile(Type typeToGenerate, IEnumerable<PropertyInfo> propertiesToGenerate, string outputFolder)
|
||||||
|
{
|
||||||
|
var fileName = Path.Combine(outputFolder, $"{typeToGenerate.Name}.generated.cs");
|
||||||
|
var directoryName = Path.GetDirectoryName(fileName);
|
||||||
|
if (!string.IsNullOrEmpty(directoryName))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(directoryName);
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Generating component for type '{typeToGenerate.FullName}' into file '{fileName}'.");
|
||||||
|
|
||||||
|
var componentName = typeToGenerate.Name;
|
||||||
|
//var componentHandlerName = $"{componentName}Handler";
|
||||||
|
//var componentBaseName = GetBaseTypeOfInterest(typeToGenerate).Name;
|
||||||
|
var componentBaseName = $": Element<{typeToGenerate.FullName}>";
|
||||||
|
if (typeToGenerate.IsSubclassOf(typeof(CPF.Controls.ContentControl)))
|
||||||
|
{
|
||||||
|
componentBaseName += " ,IHandleChildContentText";
|
||||||
|
}
|
||||||
|
if (componentName == "UIElement")
|
||||||
|
{
|
||||||
|
componentName = "Element<T>";
|
||||||
|
componentBaseName = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// header
|
||||||
|
var headerText = Settings.FileHeader;
|
||||||
|
|
||||||
|
// usings
|
||||||
|
var usings = new List<UsingStatement>
|
||||||
|
{
|
||||||
|
new UsingStatement { Namespace = "Microsoft.AspNetCore.Components" },
|
||||||
|
new UsingStatement { Namespace = "CPF" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Input" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Shapes" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Razor" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Drawing" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Controls" },
|
||||||
|
new UsingStatement { Namespace = "CPF.Razor.Controls" }
|
||||||
|
};
|
||||||
|
|
||||||
|
// props
|
||||||
|
var propertyDeclarationBuilder = new StringBuilder();
|
||||||
|
if (propertiesToGenerate.Any())
|
||||||
|
{
|
||||||
|
propertyDeclarationBuilder.AppendLine();
|
||||||
|
}
|
||||||
|
foreach (var prop in propertiesToGenerate)
|
||||||
|
{
|
||||||
|
propertyDeclarationBuilder.Append(GetPropertyDeclaration(prop, usings));
|
||||||
|
}
|
||||||
|
|
||||||
|
var events = typeToGenerate.GetEvents(BindingFlags.Public | BindingFlags.Instance);
|
||||||
|
foreach (var prop in events)
|
||||||
|
{
|
||||||
|
if (typeToGenerate == typeof(CPF.UIElement) || (typeToGenerate != typeof(CPF.UIElement) && prop.DeclaringType != typeof(CPF.UIElement) && prop.DeclaringType != typeof(CPF.Visual) && prop.DeclaringType != typeof(CPF.CpfObject)))
|
||||||
|
{
|
||||||
|
propertyDeclarationBuilder.Append(GetEventDeclaration(prop, usings));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var propertyDeclarations = propertyDeclarationBuilder.ToString();
|
||||||
|
|
||||||
|
//var propertyAttributeBuilder = new StringBuilder();
|
||||||
|
//foreach (var prop in propertiesToGenerate)
|
||||||
|
//{
|
||||||
|
// propertyAttributeBuilder.Append(GetPropertyRenderAttribute(prop));
|
||||||
|
//}
|
||||||
|
//var propertyAttributes = propertyAttributeBuilder.ToString();
|
||||||
|
//var eventHandlerAttributes = "";
|
||||||
|
|
||||||
|
var usingsText = string.Join(
|
||||||
|
Environment.NewLine,
|
||||||
|
usings
|
||||||
|
.Distinct()
|
||||||
|
.Where(u => u.Namespace != Settings.RootNamespace)
|
||||||
|
.OrderBy(u => u.ComparableString)
|
||||||
|
.Select(u => u.UsingText));
|
||||||
|
|
||||||
|
var isComponentAbstract = typeToGenerate.IsAbstract;
|
||||||
|
var classModifiers = string.Empty;
|
||||||
|
if (isComponentAbstract)
|
||||||
|
{
|
||||||
|
classModifiers += "abstract ";
|
||||||
|
}
|
||||||
|
var componentHasPublicParameterlessConstructor =
|
||||||
|
typeToGenerate
|
||||||
|
.GetConstructors()
|
||||||
|
.Any(ctor => ctor.IsPublic && !ctor.GetParameters().Any());
|
||||||
|
|
||||||
|
var des = "";
|
||||||
|
var d = typeToGenerate.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>();
|
||||||
|
if (d != null)
|
||||||
|
{
|
||||||
|
des = d.Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
var outputBuilder = new StringBuilder();
|
||||||
|
outputBuilder.Append($@"{headerText}
|
||||||
|
{usingsText}
|
||||||
|
|
||||||
|
namespace {Settings.RootNamespace}
|
||||||
|
{{
|
||||||
|
/// <summary>
|
||||||
|
/// {des}
|
||||||
|
/// </summary>
|
||||||
|
public {classModifiers}partial class {componentName} {componentBaseName}
|
||||||
|
{{
|
||||||
|
{propertyDeclarations}
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
");
|
||||||
|
|
||||||
|
File.WriteAllText(fileName, outputBuilder.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//private static readonly List<Type> DisallowedComponentPropertyTypes = new List<Type>
|
||||||
|
//{
|
||||||
|
// typeof(XF.Button.ButtonContentLayout), // TODO: This is temporary; should be possible to add support later
|
||||||
|
// typeof(XF.ColumnDefinitionCollection),
|
||||||
|
// typeof(XF.ControlTemplate),
|
||||||
|
// typeof(XF.DataTemplate),
|
||||||
|
// typeof(XF.Element),
|
||||||
|
// typeof(XF.Font), // TODO: This is temporary; should be possible to add support later
|
||||||
|
// typeof(XF.FormattedString),
|
||||||
|
// typeof(ICommand),
|
||||||
|
// typeof(XF.Keyboard), // TODO: This is temporary; should be possible to add support later
|
||||||
|
// typeof(object),
|
||||||
|
// typeof(XF.Page),
|
||||||
|
// typeof(XF.ResourceDictionary),
|
||||||
|
// typeof(XF.RowDefinitionCollection),
|
||||||
|
// typeof(XF.ShellContent),
|
||||||
|
// typeof(XF.ShellItem),
|
||||||
|
// typeof(XF.ShellSection),
|
||||||
|
// typeof(XF.Style), // TODO: This is temporary; should be possible to add support later
|
||||||
|
// typeof(XF.IVisual),
|
||||||
|
// typeof(XF.View),
|
||||||
|
//};
|
||||||
|
|
||||||
|
private static string GetPropertyDeclaration(PropertyInfo prop, IList<UsingStatement> usings)
|
||||||
|
{
|
||||||
|
var propertyType = prop.PropertyType;
|
||||||
|
string propertyTypeName;
|
||||||
|
if (propertyType == typeof(IList<string>) || propertyType == typeof(CPF.ViewFill) || propertyType == typeof(CPF.Drawing.Color) || propertyType == typeof(CPF.Drawing.Brush))
|
||||||
|
{
|
||||||
|
// Lists of strings are special-cased because they are handled specially by the handlers as a comma-separated list
|
||||||
|
propertyTypeName = "string";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
propertyTypeName = GetTypeNameAndAddNamespace(propertyType, usings);
|
||||||
|
if (propertyType.IsValueType && (!propertyType.IsGenericType || propertyType.GetGenericTypeDefinition() == typeof(Nullable)))
|
||||||
|
{
|
||||||
|
propertyTypeName += "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var des = "";
|
||||||
|
var d = prop.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>();
|
||||||
|
if (d != null)
|
||||||
|
{
|
||||||
|
des = $" /// <summary>\r\n /// {d.Description}\r\n /// <summary>\r\n";
|
||||||
|
}
|
||||||
|
return $@"{des} [Parameter] public {propertyTypeName} {GetIdentifierName(prop.Name)} {{ get; set; }}
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetEventDeclaration(EventInfo prop, IList<UsingStatement> usings)
|
||||||
|
{
|
||||||
|
var propertyType = prop.EventHandlerType;
|
||||||
|
string propertyTypeName;
|
||||||
|
if (propertyType == typeof(EventHandler))
|
||||||
|
{
|
||||||
|
// Lists of strings are special-cased because they are handled specially by the handlers as a comma-separated list
|
||||||
|
propertyTypeName = "EventCallback";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//propertyTypeName = GetTypeNameAndAddNamespace(propertyType, usings);
|
||||||
|
//if (propertyType.IsValueType)
|
||||||
|
//{
|
||||||
|
// propertyTypeName += "?";
|
||||||
|
//}
|
||||||
|
propertyTypeName = $"EventCallback<{propertyType.GetGenericArguments()[0]}>";
|
||||||
|
}
|
||||||
|
var des = "";
|
||||||
|
var d = prop.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>();
|
||||||
|
if (d != null)
|
||||||
|
{
|
||||||
|
des = $" /// <summary>\r\n /// {d.Description}\r\n /// <summary>\r\n";
|
||||||
|
}
|
||||||
|
return $@"{des} [Parameter] public {propertyTypeName} {GetIdentifierName(prop.Name)} {{ get; set; }}
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetTypeNameAndAddNamespace(Type type, IList<UsingStatement> usings)
|
||||||
|
{
|
||||||
|
var typeName = GetCSharpType(type);
|
||||||
|
if (typeName != null)
|
||||||
|
{
|
||||||
|
return typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there's a 'using' already. If so, check if it has an alias. If not, add a new 'using'.
|
||||||
|
var namespaceAlias = string.Empty;
|
||||||
|
|
||||||
|
var existingUsing = usings.FirstOrDefault(u => u.Namespace == type.Namespace);
|
||||||
|
if (existingUsing == null)
|
||||||
|
{
|
||||||
|
usings.Add(new UsingStatement { Namespace = type.Namespace });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (existingUsing.Alias != null)
|
||||||
|
{
|
||||||
|
namespaceAlias = existingUsing.Alias + ".";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
typeName = namespaceAlias + FormatTypeName(type, usings);
|
||||||
|
return typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string FormatTypeName(Type type, IList<UsingStatement> usings)
|
||||||
|
{
|
||||||
|
if (!type.IsGenericType)
|
||||||
|
{
|
||||||
|
return type.Name;
|
||||||
|
}
|
||||||
|
var typeNameBuilder = new StringBuilder();
|
||||||
|
typeNameBuilder.Append(type.Name.Substring(0, type.Name.IndexOf('`', StringComparison.Ordinal)));
|
||||||
|
typeNameBuilder.Append("<");
|
||||||
|
var genericArgs = type.GetGenericArguments();
|
||||||
|
for (int i = 0; i < genericArgs.Length; i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
typeNameBuilder.Append(", ");
|
||||||
|
}
|
||||||
|
typeNameBuilder.Append(GetTypeNameAndAddNamespace(genericArgs[i], usings));
|
||||||
|
|
||||||
|
}
|
||||||
|
typeNameBuilder.Append(">");
|
||||||
|
return typeNameBuilder.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
//private static readonly Dictionary<Type, Func<string, string>> TypeToAttributeHelperGetter = new Dictionary<Type, Func<string, string>>
|
||||||
|
//{
|
||||||
|
// { typeof(XF.Color), propValue => $"AttributeHelper.ColorToString({propValue})" },
|
||||||
|
// { typeof(XF.CornerRadius), propValue => $"AttributeHelper.CornerRadiusToString({propValue})" },
|
||||||
|
// { typeof(XF.ImageSource), propValue => $"AttributeHelper.ImageSourceToString({propValue})" },
|
||||||
|
// { typeof(XF.LayoutOptions), propValue => $"AttributeHelper.LayoutOptionsToString({propValue})" },
|
||||||
|
// { typeof(XF.Thickness), propValue => $"AttributeHelper.ThicknessToString({propValue})" },
|
||||||
|
// { typeof(bool), propValue => $"{propValue}" },
|
||||||
|
// { typeof(double), propValue => $"AttributeHelper.DoubleToString({propValue})" },
|
||||||
|
// { typeof(float), propValue => $"AttributeHelper.SingleToString({propValue})" },
|
||||||
|
// { typeof(int), propValue => $"{propValue}" },
|
||||||
|
// { typeof(string), propValue => $"{propValue}" },
|
||||||
|
// { typeof(IList<string>), propValue => $"{propValue}" },
|
||||||
|
//};
|
||||||
|
|
||||||
|
// private static string GetPropertyRenderAttribute(PropertyInfo prop)
|
||||||
|
// {
|
||||||
|
// var propValue = prop.PropertyType.IsValueType ? $"{GetIdentifierName(prop.Name)}.Value" : GetIdentifierName(prop.Name);
|
||||||
|
// var formattedValue = propValue;
|
||||||
|
// if (TypeToAttributeHelperGetter.TryGetValue(prop.PropertyType, out var formattingFunc))
|
||||||
|
// {
|
||||||
|
// formattedValue = formattingFunc(propValue);
|
||||||
|
// }
|
||||||
|
// else if (prop.PropertyType.IsEnum)
|
||||||
|
// {
|
||||||
|
// formattedValue = $"(int){formattedValue}";
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // TODO: Error?
|
||||||
|
// Console.WriteLine($"WARNING: Couldn't generate attribute render for {prop.DeclaringType.Name}.{prop.Name}");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return $@" if ({GetIdentifierName(prop.Name)} != null)
|
||||||
|
// {{
|
||||||
|
// builder.AddAttribute(nameof({GetIdentifierName(prop.Name)}), {formattedValue});
|
||||||
|
// }}
|
||||||
|
//";
|
||||||
|
// }
|
||||||
|
|
||||||
|
private static readonly Dictionary<Type, string> TypeToCSharpName = new Dictionary<Type, string>
|
||||||
|
{
|
||||||
|
{ typeof(bool), "bool" },
|
||||||
|
{ typeof(byte), "byte" },
|
||||||
|
{ typeof(sbyte), "sbyte" },
|
||||||
|
{ typeof(char), "char" },
|
||||||
|
{ typeof(decimal), "decimal" },
|
||||||
|
{ typeof(double), "double" },
|
||||||
|
{ typeof(float), "float" },
|
||||||
|
{ typeof(int), "int" },
|
||||||
|
{ typeof(uint), "uint" },
|
||||||
|
{ typeof(long), "long" },
|
||||||
|
{ typeof(ulong), "ulong" },
|
||||||
|
{ typeof(object), "object" },
|
||||||
|
{ typeof(short), "short" },
|
||||||
|
{ typeof(ushort), "ushort" },
|
||||||
|
{ typeof(string), "string" },
|
||||||
|
};
|
||||||
|
|
||||||
|
private static string GetCSharpType(Type propertyType)
|
||||||
|
{
|
||||||
|
return TypeToCSharpName.TryGetValue(propertyType, out var typeName) ? typeName : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// Finds the next non-generic base type of the specified type. This matches the Mobile Blazor Bindings
|
||||||
|
///// model where there is no need to represent the intermediate generic base classes because they are
|
||||||
|
///// generally only containers and have no API functionality that needs to be generated.
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="type"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//private static Type GetBaseTypeOfInterest(Type type)
|
||||||
|
//{
|
||||||
|
// do
|
||||||
|
// {
|
||||||
|
// type = type.BaseType;
|
||||||
|
// if (!type.IsGenericType)
|
||||||
|
// {
|
||||||
|
// return type;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// while (type != null);
|
||||||
|
|
||||||
|
// return null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// private void GenerateHandlerFile(Type typeToGenerate, IEnumerable<PropertyInfo> propertiesToGenerate, string outputFolder)
|
||||||
|
// {
|
||||||
|
// var fileName = Path.Combine(outputFolder, "Handlers", $"{typeToGenerate.Name}Handler.generated.cs");
|
||||||
|
// var directoryName = Path.GetDirectoryName(fileName);
|
||||||
|
// if (!string.IsNullOrEmpty(directoryName))
|
||||||
|
// {
|
||||||
|
// Directory.CreateDirectory(directoryName);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Console.WriteLine($"Generating component handler for type '{typeToGenerate.FullName}' into file '{fileName}'.");
|
||||||
|
|
||||||
|
// var componentName = typeToGenerate.Name;
|
||||||
|
// var componentVarName = char.ToLowerInvariant(componentName[0]) + componentName.Substring(1);
|
||||||
|
// var componentHandlerName = $"{componentName}Handler";
|
||||||
|
// var componentBaseName = GetBaseTypeOfInterest(typeToGenerate).Name;
|
||||||
|
// var componentHandlerBaseName = $"{componentBaseName}Handler";
|
||||||
|
|
||||||
|
// // header
|
||||||
|
// var headerText = Settings.FileHeader;
|
||||||
|
|
||||||
|
// // usings
|
||||||
|
// var usings = new List<UsingStatement>
|
||||||
|
// {
|
||||||
|
// //new UsingStatement { Namespace = "Microsoft.AspNetCore.Components" }, // Typically needed only when there are event handlers for the EventArgs types
|
||||||
|
// new UsingStatement { Namespace = "Microsoft.MobileBlazorBindings.Core" },
|
||||||
|
// new UsingStatement { Namespace = "System" },
|
||||||
|
// new UsingStatement { Namespace = "Xamarin.Forms", Alias = "XF" }
|
||||||
|
// };
|
||||||
|
|
||||||
|
// //// props
|
||||||
|
// //var propertySettersBuilder = new StringBuilder();
|
||||||
|
// //foreach (var prop in propertiesToGenerate)
|
||||||
|
// //{
|
||||||
|
// // propertySettersBuilder.Append(GetPropertySetAttribute(prop, usings));
|
||||||
|
// //}
|
||||||
|
// //var propertySetters = propertySettersBuilder.ToString();
|
||||||
|
|
||||||
|
// var usingsText = string.Join(
|
||||||
|
// Environment.NewLine,
|
||||||
|
// usings
|
||||||
|
// .Distinct()
|
||||||
|
// .Where(u => u.Namespace != Settings.RootNamespace)
|
||||||
|
// .OrderBy(u => u.ComparableString)
|
||||||
|
// .Select(u => u.UsingText));
|
||||||
|
|
||||||
|
// var isComponentAbstract = typeToGenerate.IsAbstract;
|
||||||
|
// var classModifiers = string.Empty;
|
||||||
|
// if (isComponentAbstract)
|
||||||
|
// {
|
||||||
|
// classModifiers += "abstract ";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var applyAttributesMethod = string.Empty;
|
||||||
|
// // if (!string.IsNullOrEmpty(propertySetters))
|
||||||
|
// // {
|
||||||
|
// // applyAttributesMethod = $@"
|
||||||
|
// // public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
|
||||||
|
// // {{
|
||||||
|
// // switch (attributeName)
|
||||||
|
// // {{
|
||||||
|
// //{propertySetters} default:
|
||||||
|
// // base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
|
||||||
|
// // break;
|
||||||
|
// // }}
|
||||||
|
// // }}
|
||||||
|
// //";
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// var outputBuilder = new StringBuilder();
|
||||||
|
// outputBuilder.Append($@"{headerText}
|
||||||
|
//{usingsText}
|
||||||
|
|
||||||
|
//namespace {Settings.RootNamespace}.Handlers
|
||||||
|
//{{
|
||||||
|
// public {classModifiers}partial class {componentHandlerName} : {componentHandlerBaseName}
|
||||||
|
// {{
|
||||||
|
// public {componentName}Handler(NativeComponentRenderer renderer, XF.{componentName} {componentVarName}Control) : base(renderer, {componentVarName}Control)
|
||||||
|
// {{
|
||||||
|
// {componentName}Control = {componentVarName}Control ?? throw new ArgumentNullException(nameof({componentVarName}Control));
|
||||||
|
|
||||||
|
// Initialize(renderer);
|
||||||
|
// }}
|
||||||
|
|
||||||
|
// partial void Initialize(NativeComponentRenderer renderer);
|
||||||
|
|
||||||
|
// public XF.{componentName} {componentName}Control {{ get; }}
|
||||||
|
//{applyAttributesMethod} }}
|
||||||
|
//}}
|
||||||
|
//");
|
||||||
|
|
||||||
|
// File.WriteAllText(fileName, outputBuilder.ToString());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private static string GetPropertySetAttribute(PropertyInfo prop, List<UsingStatement> usings)
|
||||||
|
// {
|
||||||
|
// // Handle null values by resetting to default value
|
||||||
|
// var resetValueParameterExpression = string.Empty;
|
||||||
|
// var bindablePropertyForProp = GetBindablePropertyForProp(prop);
|
||||||
|
// if (bindablePropertyForProp != null)
|
||||||
|
// {
|
||||||
|
// var declaredDefaultValue = bindablePropertyForProp.DefaultValue;
|
||||||
|
// var defaultValueForType = GetDefaultValueForType(prop.PropertyType);
|
||||||
|
// var needsCustomResetValue = declaredDefaultValue == null ? false : !declaredDefaultValue.Equals(defaultValueForType);
|
||||||
|
|
||||||
|
// if (needsCustomResetValue)
|
||||||
|
// {
|
||||||
|
// var valueExpression = GetValueExpression(declaredDefaultValue, usings);
|
||||||
|
// if (string.IsNullOrEmpty(valueExpression))
|
||||||
|
// {
|
||||||
|
// Console.WriteLine($"WARNING: Couldn't get value expression for {prop.DeclaringType.Name}.{prop.Name} of type {prop.PropertyType.FullName}.");
|
||||||
|
// }
|
||||||
|
// resetValueParameterExpression = valueExpression;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var formattedValue = string.Empty;
|
||||||
|
// if (TypeToAttributeHelperSetter.TryGetValue(prop.PropertyType, out var propValueFormat))
|
||||||
|
// {
|
||||||
|
// var resetValueParameterExpressionAsExtraParameter = string.Empty;
|
||||||
|
// if (!string.IsNullOrEmpty(resetValueParameterExpression))
|
||||||
|
// {
|
||||||
|
// resetValueParameterExpressionAsExtraParameter = ", " + resetValueParameterExpression;
|
||||||
|
// }
|
||||||
|
// formattedValue = string.Format(CultureInfo.InvariantCulture, propValueFormat, resetValueParameterExpressionAsExtraParameter);
|
||||||
|
// }
|
||||||
|
// else if (prop.PropertyType.IsEnum)
|
||||||
|
// {
|
||||||
|
// var resetValueParameterExpressionAsExtraParameter = string.Empty;
|
||||||
|
// if (!string.IsNullOrEmpty(resetValueParameterExpression))
|
||||||
|
// {
|
||||||
|
// resetValueParameterExpressionAsExtraParameter = ", (int)" + resetValueParameterExpression;
|
||||||
|
// }
|
||||||
|
// var castTypeName = GetTypeNameAndAddNamespace(prop.PropertyType, usings);
|
||||||
|
// formattedValue = $"({castTypeName})AttributeHelper.GetInt(attributeValue{resetValueParameterExpressionAsExtraParameter})";
|
||||||
|
// }
|
||||||
|
// else if (prop.PropertyType == typeof(string))
|
||||||
|
// {
|
||||||
|
// formattedValue =
|
||||||
|
// string.IsNullOrEmpty(resetValueParameterExpression)
|
||||||
|
// ? "(string)attributeValue"
|
||||||
|
// : string.Format(CultureInfo.InvariantCulture, "(string)attributeValue ?? {0}", resetValueParameterExpression);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // TODO: Error?
|
||||||
|
// Console.WriteLine($"WARNING: Couldn't generate property set for {prop.DeclaringType.Name}.{prop.Name}");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return $@" case nameof(XF.{prop.DeclaringType.Name}.{GetIdentifierName(prop.Name)}):
|
||||||
|
// {prop.DeclaringType.Name}Control.{GetIdentifierName(prop.Name)} = {formattedValue};
|
||||||
|
// break;
|
||||||
|
//";
|
||||||
|
// }
|
||||||
|
|
||||||
|
//private static string GetValueExpression(object declaredDefaultValue, List<UsingStatement> usings)
|
||||||
|
//{
|
||||||
|
// if (declaredDefaultValue is null)
|
||||||
|
// {
|
||||||
|
// throw new ArgumentNullException(nameof(declaredDefaultValue));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return declaredDefaultValue switch
|
||||||
|
// {
|
||||||
|
// bool boolValue => boolValue ? "true" : "false",
|
||||||
|
// int intValue => GetIntValueExpression(intValue),
|
||||||
|
// float floatValue => floatValue.ToString("F", CultureInfo.InvariantCulture) + "f", // "Fixed-Point": https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-fixed-point-f-format-specifier
|
||||||
|
// double doubleValue => doubleValue.ToString("F", CultureInfo.InvariantCulture), // "Fixed-Point": https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-fixed-point-f-format-specifier
|
||||||
|
// Enum enumValue => GetTypeNameAndAddNamespace(enumValue.GetType(), usings) + "." + Enum.GetName(enumValue.GetType(), declaredDefaultValue),
|
||||||
|
// XF.LayoutOptions layoutOptionsValue => GetLayoutOptionsValueExpression(layoutOptionsValue),
|
||||||
|
// string stringValue => $@"""{stringValue}""",
|
||||||
|
// // TODO: More types here
|
||||||
|
// _ => null,
|
||||||
|
// };
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private static string GetLayoutOptionsValueExpression(XF.LayoutOptions layoutOptionsValue)
|
||||||
|
//{
|
||||||
|
// var expandSuffix = layoutOptionsValue.Expands ? "AndExpand" : string.Empty;
|
||||||
|
// return $"XF.LayoutOptions.{layoutOptionsValue.Alignment}{expandSuffix}";
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private static string GetIntValueExpression(int intValue)
|
||||||
|
//{
|
||||||
|
// return intValue switch
|
||||||
|
// {
|
||||||
|
// int.MinValue => "int.MinValue",
|
||||||
|
// int.MaxValue => "int.MaxValue",
|
||||||
|
// _ => intValue.ToString(CultureInfo.InvariantCulture),
|
||||||
|
// };
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private static object GetDefaultValueForType(Type propertyType)
|
||||||
|
//{
|
||||||
|
// if (propertyType.IsValueType)
|
||||||
|
// {
|
||||||
|
// return Activator.CreateInstance(propertyType);
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private static XF.BindableProperty GetBindablePropertyForProp(PropertyInfo prop)
|
||||||
|
//{
|
||||||
|
// var bindablePropertyField = prop.DeclaringType.GetField(prop.Name + "Property");
|
||||||
|
// if (bindablePropertyField == null)
|
||||||
|
// {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// return (XF.BindableProperty)bindablePropertyField.GetValue(null);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private static readonly Dictionary<Type, string> TypeToAttributeHelperSetter = new Dictionary<Type, string>
|
||||||
|
//{
|
||||||
|
// { typeof(XF.Color), "AttributeHelper.StringToColor((string)attributeValue{0})" },
|
||||||
|
// { typeof(XF.CornerRadius), "AttributeHelper.StringToCornerRadius(attributeValue{0})" },
|
||||||
|
// { typeof(XF.ImageSource), "AttributeHelper.StringToImageSource(attributeValue{0})" },
|
||||||
|
// { typeof(XF.LayoutOptions), "AttributeHelper.StringToLayoutOptions(attributeValue{0})" },
|
||||||
|
// { typeof(XF.Thickness), "AttributeHelper.StringToThickness(attributeValue{0})" },
|
||||||
|
// { typeof(bool), "AttributeHelper.GetBool(attributeValue{0})" },
|
||||||
|
// { typeof(double), "AttributeHelper.StringToDouble((string)attributeValue{0})" },
|
||||||
|
// { typeof(float), "AttributeHelper.StringToSingle((string)attributeValue{0})" },
|
||||||
|
// { typeof(int), "AttributeHelper.GetInt(attributeValue{0})" },
|
||||||
|
// { typeof(IList<string>), "AttributeHelper.GetStringList(attributeValue)" },
|
||||||
|
//};
|
||||||
|
|
||||||
|
static HashSet<string> DisallowedPropertyName = new HashSet<string>
|
||||||
|
{
|
||||||
|
"Site"
|
||||||
|
};
|
||||||
|
|
||||||
|
private static IEnumerable<PropertyInfo> GetPropertiesToGenerate(Type componentType)
|
||||||
|
{
|
||||||
|
var allPublicProperties = componentType.GetProperties();
|
||||||
|
|
||||||
|
return
|
||||||
|
allPublicProperties
|
||||||
|
.Where(HasPublicGetAndSet)
|
||||||
|
.Where(prop => componentType == typeof(CPF.UIElement) || (componentType != typeof(CPF.UIElement) && prop.DeclaringType != typeof(CPF.UIElement) && prop.DeclaringType != typeof(CPF.Visual) && prop.DeclaringType != typeof(CPF.CpfObject)))
|
||||||
|
//.Where(prop => !DisallowedComponentPropertyTypes.Contains(prop.PropertyType))
|
||||||
|
.Where(prop => !DisallowedPropertyName.Contains(prop.Name))
|
||||||
|
.Where(IsPropertyBrowsable)
|
||||||
|
.OrderBy(prop => prop.Name, StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool HasPublicGetAndSet(PropertyInfo propInfo)
|
||||||
|
{
|
||||||
|
if (propInfo.PropertyType == typeof(CPF.UIElementTemplate) || propInfo.PropertyType.IsGenericType && propInfo.PropertyType.GetGenericTypeDefinition() == typeof(CPF.UIElementTemplate<>))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return propInfo.GetGetMethod() != null && propInfo.GetSetMethod() != null && propInfo.GetCustomAttribute(typeof(CPF.NotCpfProperty)) == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsPropertyBrowsable(PropertyInfo propInfo)
|
||||||
|
{
|
||||||
|
// [EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
|
var attr = (EditorBrowsableAttribute)Attribute.GetCustomAttribute(propInfo, typeof(EditorBrowsableAttribute));
|
||||||
|
return (attr == null) || (attr.State != EditorBrowsableState.Never);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetIdentifierName(string possibleIdentifier)
|
||||||
|
{
|
||||||
|
return ReservedKeywords.Contains(possibleIdentifier, StringComparer.Ordinal)
|
||||||
|
? $"@{possibleIdentifier}"
|
||||||
|
: possibleIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly List<string> ReservedKeywords = new List<string>
|
||||||
|
{ "class", };
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
namespace ComponentWrapperGenerator
|
||||||
|
{
|
||||||
|
public class GeneratorSettings
|
||||||
|
{
|
||||||
|
public string FileHeader { get; set; }
|
||||||
|
public string RootNamespace { get; set; }
|
||||||
|
}
|
||||||
|
}
|
12
CpfRazorSample/ComponentWrapperGenerator/UsingStatement.cs
Normal file
12
CpfRazorSample/ComponentWrapperGenerator/UsingStatement.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
namespace ComponentWrapperGenerator
|
||||||
|
{
|
||||||
|
internal sealed class UsingStatement
|
||||||
|
{
|
||||||
|
public string Alias { get; set; }
|
||||||
|
public string Namespace { get; set; }
|
||||||
|
|
||||||
|
public string ComparableString => Alias?.ToUpperInvariant() ?? Namespace?.ToUpperInvariant();
|
||||||
|
|
||||||
|
public string UsingText => $"using {(Alias != null ? Alias + " = " : "")}{Namespace};";
|
||||||
|
}
|
||||||
|
}
|
35
CpfRazorSample/CpfRazorSample.csproj
Normal file
35
CpfRazorSample/CpfRazorSample.csproj
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
|
<ApplicationIcon />
|
||||||
|
<StartupObject />
|
||||||
|
<LangVersion>9.0</LangVersion>
|
||||||
|
<RazorLangVersion>3.0</RazorLangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DefineConstants />
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Stylesheet1.css" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Stylesheet1.css" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<!--<ProjectReference Include="..\CPF.Linux\CPF.Linux.csproj" />
|
||||||
|
<ProjectReference Include="..\CPF.Mac\CPF.Mac.csproj" />-->
|
||||||
|
<ProjectReference Include="..\CPF.Razor\CPF.Razor.csproj" />
|
||||||
|
<ProjectReference Include="..\CPF.Skia\CPF.Skia.csproj" />
|
||||||
|
<ProjectReference Include="..\CPF.Windows\CPF.Windows.csproj" />
|
||||||
|
<ProjectReference Include="..\CPF\CPF.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user