You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Controls/Mesnac.Controls.Base/Common.cs

61 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace Mesnac.Controls.Base
{
/// <summary>
/// 开关状态枚举
/// </summary>
public enum OnOffStatuses
{
Off = 0, On = 1
}
public class StringListConverterParent : TypeConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true; // display drop
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true; // drop-down vs combo
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
List<string> list = new List<string>();
foreach (Component cmpnt in context.Container.Components)
{
list.Add(cmpnt.Site.Name);
}
return new TypeConverter.StandardValuesCollection(list);
}
}
/// <summary>
/// 设计时功能操作信息
/// </summary>
[Serializable]
public class DesignAction
{
/// <summary>
/// 保存的唯一值
/// </summary>
[DefaultValue("")]
public string GUID { get; set; }
/// <summary>
/// 显示的名称
/// </summary>
[DefaultValue("")]
public string Name { get; set; }
/// <summary>
/// 说明
/// </summary>
[DefaultValue("")]
public string Remark { get; set; }
}
}