本文整理汇总了C#中IControlFactory.CreateLookupComboBoxDefaultMapperStrategy方法的典型用法代码示例。如果您正苦于以下问题:C# IControlFactory.CreateLookupComboBoxDefaultMapperStrategy方法的具体用法?C# IControlFactory.CreateLookupComboBoxDefaultMapperStrategy怎么用?C# IControlFactory.CreateLookupComboBoxDefaultMapperStrategy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IControlFactory
的用法示例。
在下文中一共展示了IControlFactory.CreateLookupComboBoxDefaultMapperStrategy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnumComboBoxMapper
/// <summary>
/// Instantiates a new mapper
/// </summary>
/// <param name="comboBox">The ComboBox to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">The control factory to be used when creating the controlMapperStrategy</param>
public EnumComboBoxMapper(IComboBox comboBox, string propName, bool isReadOnly, IControlFactory factory)
: base(comboBox, propName, isReadOnly, factory)
{
_mapperStrategy = factory.CreateLookupComboBoxDefaultMapperStrategy();
if (_mapperStrategy == null) return;
_mapperStrategy.AddHandlers(this);
}
示例2: CollectionComboBoxMapper
/// <summary>
/// Constructor to initialise the mapper
/// </summary>
/// <param name="cbx">The ComboBox to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">The control factory to be used when creating the controlMapperStrategy</param>
public CollectionComboBoxMapper(IComboBox cbx, string propName, bool isReadOnly, IControlFactory factory)
: base(cbx, propName, isReadOnly, factory)
{
_comboBox = cbx;
_mapperStrategy = factory.CreateLookupComboBoxDefaultMapperStrategy();
_mapperStrategy.AddHandlers(this);
_comboBoxCollectionSelector = new ComboBoxCollectionSelector(cbx, factory, false);
_comboBoxCollectionSelector.PreserveSelectedItem = true;
}
示例3: LookupComboBoxMapper
/// <summary>
/// Constructor to initialise the mapper
/// </summary>
/// <param name="cbx">The ComboBox to map</param>
/// <param name="propName">The property name</param>
/// <param name="isReadOnly">Whether this control is read only</param>
/// <param name="factory">The control factory to be used when creating the controlMapperStrategy</param>
public LookupComboBoxMapper(IComboBox cbx, string propName, bool isReadOnly, IControlFactory factory)
: base(cbx, propName, isReadOnly, factory)
{
_comboBox = cbx;
_mapperStrategy = factory.CreateLookupComboBoxDefaultMapperStrategy();
if (_mapperStrategy == null) return;
_mapperStrategy.AddHandlers(this);
_collection = new Dictionary<string, string>();
}
示例4: BORelationshipMapper
/// <summary>
/// Constructs a <see cref="RelationshipComboBoxMapper"/> with the <paramref name="comboBox"/>
/// <paramref name="relationshipName"/>
/// </summary>
/// <param name="comboBox">The combo box that is being mapped to</param>
/// <param name="relationshipName">The name of the relation that is being mapped to</param>
/// <param name="isReadOnly">Whether the Combo box can be used to edit from or whether it is only viewable</param>
/// <param name="controlFactory">A control factory that is used to create control mappers etc</param>
public RelationshipComboBoxMapper
(IComboBox comboBox, string relationshipName, bool isReadOnly, IControlFactory controlFactory)
{
if (comboBox == null) throw new ArgumentNullException("comboBox");
if (relationshipName == null) throw new ArgumentNullException("relationshipName");
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
IsReadOnly = isReadOnly;
ControlFactory = controlFactory;
Control = comboBox;
RelationshipName = relationshipName;
_boRelationshipMapper = new BORelationshipMapper(relationshipName);
_boRelationshipMapper.RelationshipChanged += (sender, e) => OnMappedRelationshipChanged();
_mapperStrategy = ControlFactory.CreateLookupComboBoxDefaultMapperStrategy();
_mapperStrategy.AddHandlers(this);
UpdateIsEditable();
_comboBoxCollectionSelector = new ComboBoxCollectionSelector(comboBox, controlFactory, false)
{PreserveSelectedItem = true};
this.IncludeBlankItem = true;
}