| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- namespace InABox.Core
- {
- public class DFLayoutEmbeddedImageProperties : DFLayoutFieldProperties<byte[]>
- {
- [CheckBoxEditor]
- public bool DisableLibrary { get; set; }
- public override string FormatValue(object value)
- {
- return value != null ? "Yes" : "";
- }
- public override object? ParseValue(object value)
- {
- if (value is byte[])
- return value;
- if (value is string)
- try
- {
- return Convert.FromBase64String(value as string);
- }
- catch (Exception e)
- {
- return null;
- }
- return null;
- }
- protected override void LoadProperties()
- {
- base.LoadProperties();
- DisableLibrary = GetProperty("DisableLibrary", false);
- }
- protected override void SaveProperties()
- {
- base.SaveProperties();
- SetProperty("DisableLibrary", DisableLibrary);
- }
- }
- }
|