本文整理汇总了C#中IPropertyBag.Read方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyBag.Read方法的具体用法?C# IPropertyBag.Read怎么用?C# IPropertyBag.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyBag
的用法示例。
在下文中一共展示了IPropertyBag.Read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadPropertyBag
protected static object ReadPropertyBag(IPropertyBag propertyBag, string propName)
{
object val = null;
try
{
propertyBag.Read(propName, out val, 0);
}
catch (System.ArgumentException)
{
return val;
}
return val;
}
示例2: ExtractConfigDomImpl
// Various useful helper functions
public static XmlDocument ExtractConfigDomImpl(IPropertyBag pConfig, bool required)
{
object obj = null;
pConfig.Read("AdapterConfig", out obj, 0);
if (!required && null == obj)
return null;
if (null == obj)
throw new NoAdapterConfig();
XmlDocument configDom = new XmlDocument();
string adapterConfig = (string)obj;
configDom.LoadXml(adapterConfig);
return configDom;
}
示例3: ReadPropertyBag
/// <summary>
/// Reads property value from property bag
/// </summary>
/// <param name="pb">Property bag</param>
/// <param name="propName">Name of property</param>
/// <returns>Value of the property</returns>
public static object ReadPropertyBag(IPropertyBag pb, string propName)
{
object val = null;
try
{
pb.Read(propName, out val, 0);
}
catch (ArgumentException)
{
return val;
}
catch (Exception e)
{
throw new ApplicationException(e.Message);
}
return val;
}
示例4: ReadPropertyBag
/// <summary>
/// Reads property value from property bag.
/// </summary>
/// <param name="propertyBag">Property bag.</param>
/// <param name="propertyName">Name of property.</param>
/// <returns>Value of the property.</returns>
private object ReadPropertyBag(IPropertyBag propertyBag, string propertyName)
{
object val = null;
try
{
propertyBag.Read(propertyName, out val, 0);
}
catch (ArgumentException)
{
return val;
}
//catch (Exception ex)
//{
// ExceptionHelper.HandleException(Resources.T4TemplaterPipelineComponentName, ex);
// TraceHelper.WriteLineIf(traceEnabled, ex.Message, EventLogEntryType.Error);
// throw; ;
//}
return val;
}
示例5: TryReadString
private string TryReadString(string property, IPropertyBag pBag)
{
try
{
object cs;
pBag.Read(property, out cs, null, 0, null);
return cs.ToString();
}
catch { return null; }
}
示例6: TryReadBool
private bool TryReadBool(string property, IPropertyBag pBag, bool defaultValue = false)
{
try
{
object cs;
pBag.Read(property, out cs, null, 0, null);
bool val;
bool.TryParse(cs.ToString(), out val);
return val;
}
catch { return defaultValue; }
}