Archived
forked from RDTKEditor/RDTKEditor
添加属性组件
This commit is contained in:
@@ -136,6 +136,30 @@ namespace RDTKEditor
|
|||||||
Value = property.GetValue(obj)?.ToString() ?? "null",
|
Value = property.GetValue(obj)?.ToString() ?? "null",
|
||||||
Type = RDPropertyType.String,
|
Type = RDPropertyType.String,
|
||||||
};
|
};
|
||||||
|
case "Int32":
|
||||||
|
return new()
|
||||||
|
{
|
||||||
|
Verifier = new RDTKPropertyVerifierDefault(),
|
||||||
|
Name = property.Name,
|
||||||
|
Value = property.GetValue(obj)?.ToString() ?? "null",
|
||||||
|
Type = RDPropertyType.Integer,
|
||||||
|
};
|
||||||
|
case "Single":
|
||||||
|
return new()
|
||||||
|
{
|
||||||
|
Verifier = new RDTKPropertyVerifierDefault(),
|
||||||
|
Name = property.Name,
|
||||||
|
Value = property.GetValue(obj)?.ToString() ?? "null",
|
||||||
|
Type = RDPropertyType.Float,
|
||||||
|
};
|
||||||
|
case "RDColor":
|
||||||
|
return new()
|
||||||
|
{
|
||||||
|
Verifier = new RDTKPropertyVerifierDefault(),
|
||||||
|
Name = property.Name,
|
||||||
|
Value = property.GetValue(obj)?.ToString() ?? "null",
|
||||||
|
Type = RDPropertyType.Color,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return new()
|
return new()
|
||||||
{
|
{
|
||||||
@@ -196,6 +220,39 @@ namespace RDTKEditor
|
|||||||
new TextBox() { Text = property.Value, }
|
new TextBox() { Text = property.Value, }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
RDPropertyType.Integer => new()
|
||||||
|
{
|
||||||
|
AllowDrop = true,
|
||||||
|
Orientation = Orientation.Horizontal,
|
||||||
|
FlowDirection = FlowDirection.LeftToRight,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new Label(){Content = property.Name},
|
||||||
|
new TextBox() { Text = property.Value, }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
RDPropertyType.Float => new()
|
||||||
|
{
|
||||||
|
AllowDrop = true,
|
||||||
|
Orientation = Orientation.Horizontal,
|
||||||
|
FlowDirection = FlowDirection.LeftToRight,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new Label(){Content = property.Name},
|
||||||
|
new TextBox() { Text = property.Value, }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
RDPropertyType.Color => new()
|
||||||
|
{
|
||||||
|
AllowDrop = true,
|
||||||
|
Orientation = Orientation.Horizontal,
|
||||||
|
FlowDirection = FlowDirection.LeftToRight,
|
||||||
|
Children =
|
||||||
|
{
|
||||||
|
new Label(){Content = property.Name},
|
||||||
|
new TextBox() { Text = property.Value, }
|
||||||
|
},
|
||||||
|
},
|
||||||
_ => new()
|
_ => new()
|
||||||
{
|
{
|
||||||
Orientation = Orientation.Horizontal,
|
Orientation = Orientation.Horizontal,
|
||||||
|
|||||||
Reference in New Issue
Block a user