/// <summary> /// Initialize the binding properties from the adapter. /// </summary> /// <param name="bindingElement">The binding element containing the adapter configuration</param> protected override void InitializeFrom(BindingElement bindingElement) { base.InitializeFrom(bindingElement); MockAdapter adapterBinding = (MockAdapter)bindingElement; this["Encoding"] = adapterBinding.Encoding; this["PromotedProperties"] = adapterBinding.PromotedProperties; }
/// <summary> /// Instantiate the adapter. /// </summary> /// <returns>An instance of the binding element representing the adapter</returns> protected override BindingElement CreateBindingElement() { MockAdapter adapter = new MockAdapter(); this.ApplyConfiguration(adapter); return(adapter); }
/// <summary> /// Apply the configuration properties to the adapter. /// </summary> /// <param name="bindingElement">The binding element containing the adapter configuration</param> public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); MockAdapter adapterBinding = (MockAdapter)bindingElement; adapterBinding.Encoding = (string)this["Encoding"]; adapterBinding.PromotedProperties = (string)this["PromotedProperties"]; }
/// <summary> /// Initializes a new instance of the <see cref="MockAdapterConnectionFactory"/> class /// </summary> /// <param name="connectionUri">The connection Uri</param> /// <param name="clientCredentials">THe client credentials for the adapter connection</param> /// <param name="adapter">The adapter instance</param> public MockAdapterConnectionFactory( ConnectionUri connectionUri, ClientCredentials clientCredentials, MockAdapter adapter) { this.clientCredentials = clientCredentials; this.adapter = adapter; this.connectionUri = connectionUri as MockAdapterConnectionUri; }
/// <summary> /// Initializes a new instance of the MockAdapter class with a binding /// </summary> /// <param name="binding">The binding instance from which the adapter will be initialized</param> public MockAdapter(MockAdapter binding) : base(binding) { if (binding == null) { throw new ArgumentNullException("binding"); } this.Encoding = binding.Encoding; this.PromotedProperties = binding.PromotedProperties; }