当前位置: 首页>>代码示例>>C#>>正文


C# IPropertyBag.Read方法代码示例

本文整理汇总了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;
 }
开发者ID:qwert789,项目名称:codegallery,代码行数:13,代码来源:PipelineComponentBase.cs

示例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;
        }
开发者ID:microServiceBus,项目名称:microservicebus.biztalk,代码行数:17,代码来源:ConfigProperties.cs

示例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;
 }
开发者ID:kakkerlakgly,项目名称:ManageMessageNamespace,代码行数:23,代码来源:PropertyBagHelper.cs

示例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;
 }
开发者ID:vimjock,项目名称:T4Pipeline,代码行数:25,代码来源:T4TemplaterPipelineComponent.cs

示例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; }
 }
开发者ID:instant-hrvoje,项目名称:dsl-compiler-client,代码行数:10,代码来源:DDDLanguagePackage.cs

示例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; }
 }
开发者ID:instant-hrvoje,项目名称:dsl-compiler-client,代码行数:12,代码来源:DDDLanguagePackage.cs


注:本文中的IPropertyBag.Read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。