/// <summary> /// Loads configuration properties for the component /// </summary> /// <param name="pb">Configuration property bag</param> /// <param name="errlog">Error status</param> public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog) { object val = null; try { pb.Read("Enabled", out val, 0); } catch (System.ArgumentException) { } catch (Exception ex) { throw new ApplicationException("Error reading propertybag: " + ex.Message); } if (val != null) { Enabled = (bool)val; } else { Enabled = true; } }
/// <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> private static T ReadPropertyBag <T>(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName) { try { object val = null; pb.Read(propName, out val, 0); return(val == null ? default(T) : (T)val); } catch (ArgumentException) { return(default(T)); } }
private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName) { object val = null; try { pb.Read(propName, out val, 0); } catch (System.ArgumentException ) { return val; } catch (System.Exception e) { throw new System.ApplicationException(e.Message); } return val; }
/// <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> private static object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName) { object val = null; try { pb.Read(propName, out val, 0); } catch (ArgumentException) { return(val); } catch (Exception ex) { throw new ApplicationException(ex.Message); } return(val); }