1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System;
- using System.Drawing;
- namespace InABox.Core
- {
- public class DFLayoutLabel : DFLayoutControl, IDFLayoutTextControl
- {
- [EditorSequence(0)]
- [MemoEditor]
- public string Caption { get; set; } = "";
- [EditorSequence("Style", 0)]
- public DFLayoutTextStyle Style { get; set; }
- protected override string GetDescription()
- {
- return Caption;
- }
- protected override void LoadProperties()
- {
- base.LoadProperties();
- Caption = GetProperty("Caption", "");
- Style.LoadProperties(this);
- }
- protected override void SaveProperties()
- {
- base.SaveProperties();
- SetProperty("Caption", Caption);
- Style.SaveProperties(this);
- }
- public T GetStyleProperty<T>(string name, T defaultValue)
- {
- return GetProperty($"Style.{name}", defaultValue);
- }
- public void SetStyleProperty(string name, object? value)
- {
- SetProperty($"Style.{name}", value);
- }
- }
- }
|