/// <summary>
 /// Create a WoopsaObjectAdapter for a fixed object reference
 /// </summary>
 /// <param name="container">Can be null if it's the root object.</param>
 /// <param name="name"></param>
 /// <param name="targetObjectGetter"></param>
 /// <param name="declaredExposedType">
 /// Type to expose for the targetObject.
 /// Specify null to use targetObject.GetType().
 /// The specified type can be different than the targetObject.GetType()
 /// when an interface is published instead of the public methods of the type.
 /// Specifying null implies that the type is determined dynamically, as targetObjectGetter
 /// does not necesarily return always the same object.
 /// </param>
 /// <param name="options"></param>
 /// <param name="defaultVisibility"></param>
 public WoopsaObjectAdapter(WoopsaContainer container, string name, object targetObject,
                            Type declaredExposedType = null,
                            WoopsaConverters customValueTypeConverters = null,
                            WoopsaObjectAdapterOptions options         = WoopsaObjectAdapterOptions.None,
                            WoopsaVisibility defaultVisibility         = DefaultDefaultVisibility) :
     this(container, name, () => targetObject, declaredExposedType,
          new TypeDescriptions(customValueTypeConverters),
          options, defaultVisibility)
 {
 }
 /// <summary>
 /// Create a WoopsaObjectAdapter for a dynamic object reference, returned by a delegate
 /// </summary>
 /// <param name="container"></param>
 /// <param name="name"></param>
 /// <param name="targetObjectGetter"></param>
 /// <param name="declaredExposedType">
 /// Type to expose for the targetObject.
 /// Specify null to use targetObject.GetType().
 /// The specified type can be different than the targetObject.GetType()
 /// when an interface is published instead of the public methods of the type.
 /// Specifying null implies that the type is determined dynamically, as targetObjectGetter
 /// does not necesarily return always the same object.
 /// </param>
 /// <param name="options"></param>
 /// <param name="defaultVisibility"></param>
 protected WoopsaObjectAdapter(WoopsaContainer container, string name, Func <object> targetObjectGetter,
                               Type declaredExposedType,
                               TypeDescriptions typeDescriptions,
                               WoopsaObjectAdapterOptions options = WoopsaObjectAdapterOptions.None,
                               WoopsaVisibility defaultVisibility = DefaultDefaultVisibility)
     : base(container, name)
 {
     TargetObjectGetter  = targetObjectGetter;
     DeclaredExposedType = declaredExposedType;
     DefaultVisibility   = defaultVisibility;
     Options             = options;
     TypeDescriptions    = typeDescriptions;
     _lock = new object();
 }
 public WoopsaVisibilityAttribute(WoopsaVisibility visibility)
 {
     Visibility = visibility;
 }