本文整理汇总了C#中PropertyValue.ice_isA方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue.ice_isA方法的具体用法?C# PropertyValue.ice_isA怎么用?C# PropertyValue.ice_isA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyValue
的用法示例。
在下文中一共展示了PropertyValue.ice_isA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setProperty
/// <summary>
/// Method setProperty
/// </summary>
/// <param name="propertyName">A string</param>
/// <param name="value">A Ferda.Modules.PropertyValue</param>
/// <param name="__current">An Ice.Current</param>
public override void setProperty(String propertyName, PropertyValue value, Current __current)
{
if (! (propertyName == "value"))
{
throw new Ferda.Modules.NameNotExistError();
}
if (value!=null && !value.ice_isA(this.propertyClassIceId))
{
throw new Ferda.Modules.BadTypeError();
}
if(propertyValuePrx != null && propertySetByValue)
adapter.remove(propertyValuePrx.ice_getIdentity());
this.propertySetByValue = true;
propertyValue = value;
propertyValuePrx = this.adapter.addWithUUID(value);
}
示例2: setProperty
/// <summary>
/// Sets the specified property (<c>propertyName</c>) by
/// specified <c>propertyValue</c>.
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="propertyValue">The property value.</param>
/// <param name="__current">The Ice.Current.</param>
/// <exception cref="T:Ferda.Modules.NameNotExistError">
/// Thrown iff there is no property of specified <c>propertyName</c>.
/// </exception>
/// <exception cref="T:Ferda.Modules.BadTypeError">
/// Thrown iff specified <c>propertyValue</c> is not of the
/// specified property data type. See <see cref="T:Ferda.Modules.Serialier.BoxSerializer.Property.TypeClassIceId"/>.
/// </exception>
/// <exception cref="T:Ferda.Modules.ReadOnlyError">
/// Thrown iff specified property is read only.
/// </exception>
public override void setProperty(string propertyName, PropertyValue propertyValue, Ice.Current __current)
{
if (!this.boxInfo.TestPropertyNameExistence(propertyName))
{
// there is no property of the specified propertyName
throw Ferda.Modules.Exceptions.NameNotExistError(null, null, "BMI25", propertyName);
}
if (propertyValue != null && !propertyValue.ice_isA(this.boxInfo.GetPropertyDataType(propertyName)))
{
// bad type of the specified propertyValue
Debug.WriteLine("BMI26");
throw new Ferda.Modules.BadTypeError();
}
if (this.boxInfo.IsPropertyReadOnly(propertyName))
{
// the specified property is readonly
Debug.WriteLine("BMI27");
throw new Ferda.Modules.ReadOnlyError();
}
// switch data type of the property
// check if new propertyValue satisfy restrictions of the property
// destroy old propetyValue object`s proxy
// add new propertyValue object to the adapter
// and save the proxy of added object
lock (this)
{
switch (boxInfo.GetPropertyDataType(propertyName))
{
case "::Ferda::Modules::ShortT":
PropertyValueRestrictionsHelper.TryIsIntegralPropertyCorrect(
this.boxInfo,
propertyName,
((ShortT)propertyValue).getShortValue());
break;
case "::Ferda::Modules::IntT":
PropertyValueRestrictionsHelper.TryIsIntegralPropertyCorrect(
this.boxInfo,
propertyName,
((IntT)propertyValue).getIntValue());
break;
case "::Ferda::Modules::LongT":
PropertyValueRestrictionsHelper.TryIsIntegralPropertyCorrect(
this.boxInfo,
propertyName,
((LongT)propertyValue).getLongValue());
break;
case "::Ferda::Modules::FloatT":
PropertyValueRestrictionsHelper.TryIsFloatingPropertyCorrect(
this.boxInfo,
propertyName,
((FloatT)propertyValue).getFloatValue());
break;
case "::Ferda::Modules::DoubleT":
PropertyValueRestrictionsHelper.TryIsFloatingPropertyCorrect(
this.boxInfo,
propertyName,
((DoubleT)propertyValue).getDoubleValue());
break;
case "::Ferda::Modules::StringT":
PropertyValueRestrictionsHelper.TryIsStringPropertyCorrect(
this.boxInfo,
propertyName,
((StringT)propertyValue).getStringValue());
break;
case "::Ferda::Modules::DateTimeT":
PropertyValueRestrictionsHelper.TryIsDateTimePropertyCorrect(
this.boxInfo, propertyName, (DateTimeT)propertyValue);
break;
case "::Ferda::Modules::DateT":
DateT date = new DateTI();
((DateT)propertyValue).getDateValue(out date.year, out date.month, out date.day);
PropertyValueRestrictionsHelper.TryIsDatePropertyCorrect(
this.boxInfo, propertyName, date);
break;
case "::Ferda::Modules::TimeT":
TimeT time = new TimeTI();
((TimeT)propertyValue).getTimeValue(out time.hour, out time.minute, out time.second);
PropertyValueRestrictionsHelper.TryIsTimePropertyCorrect(
this.boxInfo, propertyName, time);
break;
}
// proxy of new propertyValue is already saved
// save the propertyValue
//.........这里部分代码省略.........