/// <summary>
        /// Instantiate the adapter.
        /// </summary>
        /// <returns></returns>
        protected override BindingElement CreateBindingElement()
        {
            GenericAdapter adapter = new GenericAdapter();

            this.ApplyConfiguration(adapter);
            return(adapter);
        }
 /// <summary>
 /// Initializes a new instance of the CustomAdapterConnectionFactory class
 /// </summary>
 public GenericAdapterConnectionFactory(ConnectionUri connectionUri
                                        , ClientCredentials clientCredentials
                                        , GenericAdapter adapter)
 {
     this.clientCredentials = clientCredentials;
     this.adapter           = adapter;
 }
        /// <summary>
        /// Apply the configuration properties to the adapter.
        /// </summary>
        /// <param name="bindingElement"></param>
        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
            GenericAdapter adapterBinding = ((GenericAdapter)(bindingElement));

            adapterBinding.EnableEventLog = (System.Boolean) this["EnableEventLog"];
            adapterBinding.ChannelName    = (System.String) this["ChannelName"];
        }
        /// <summary>
        /// Initialize the binding properties from the adapter.
        /// </summary>
        /// <param name="bindingElement"></param>
        protected override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            GenericAdapter adapterBinding = ((GenericAdapter)(bindingElement));

            this["EnableEventLog"] = adapterBinding.EnableEventLog;
            this["ChannelName"]    = adapterBinding.ChannelName;
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the CustomAdapter class with a binding
 /// </summary>
 public GenericAdapter(GenericAdapter binding)
     : base(binding)
 {
     this.EnableEventLog = binding.EnableEventLog;
     this.ChannelName    = binding.ChannelName;
 }