public PropTempl CreatePropTempl(EntityTempl entityTempl, PropGroupTempl propertyParent, TextCode tcKey, TextCode tcValue) { // check the entity parent if (entityTempl == null) { return(null); } // transform the key PropKeyTemplTextCode propKeyTextCode = new PropKeyTemplTextCode(); propKeyTextCode.TextCodeId = tcKey.Id; // transform the value ValTextCodeId valTextCodeId = null; if (tcValue != null) { valTextCodeId = new ValTextCodeId(); // can be null (to set on instantiation) valTextCodeId.TextCodeId = tcValue.Id; } PropValueTempl propValue = PropValueTemplTool.CreatePropValueTemplFromValue(valTextCodeId); return(CreatePropTempl(entityTempl, propertyParent, propKeyTextCode, propValue)); }
public PropTempl CreatePropTempl(EntityTempl entityTempl, PropGroupTempl propertyParent, TextCode tcKey, string value) { // check the entity parent if (entityTempl == null) { return(null); } PropKeyTemplTextCode propKeyTextCode = new PropKeyTemplTextCode(); propKeyTextCode.TextCodeId = tcKey.Id; // create the property value template PropValueTempl propValue = PropValueTemplTool.CreatePropValueTemplFromValue(value); return(CreatePropTempl(entityTempl, propertyParent, propKeyTextCode, propValue)); }
/// <summary> /// Create a property template, under a property group parent. /// prop key is string, prop value is a bool. /// </summary> /// <param name="entityTempl"></param> /// <param name="tcKey"></param> /// <param name="tcValue"></param> /// <returns></returns> public PropTempl CreatePropTempl(EntityTempl entityTempl, PropGroupTempl propertyParent, string key, bool value) { // check the entity parent if (entityTempl == null) { return(null); } PropKeyTemplString propKeyString = new PropKeyTemplString(); propKeyString.Key = key; // create the property value template, can be null PropValueTempl propValue = PropValueTemplTool.CreatePropValueTemplFromValue(value); return(CreatePropTempl(entityTempl, propertyParent, propKeyString, propValue)); }