Exemple #1
0
        /// <summary>
        /// Initializes the channel.
        /// </summary>
        /// <param name="pi">The pi.</param>
        public virtual void Initialize(CategoryPropertyItem pi)
        {
            DoDisposeCheck();
            if (pi == null)
            {
                ThrowHelper.ThrowArgumentNullException("pi");
            }

            if (!mInitialized)
            {
                {
                    this.mConnectionData = null;
                    CategoryPropertyItem item = ConfigurationAccessHelper.GetCategoryPropertyByPath(pi.PropertyItems, "RemoteAddress");
                    if (item != null)
                    {
                        this.mConnectionData = AddressEndPoint.Parse(item.EntryValue);
                    }
                    if (item != null)
                    {
                        ConfigurationAccessHelper.ParseLongValue(pi.PropertyItems, "DefaultErrorResponseTimeout", Timeout.Infinite, long.MaxValue, ref mDefaultErrorResponseTimeout);
                    }
                }
                {
                    mServerEndpoints.Clear();
                    CategoryPropertyItem baseAddressesItems = ConfigurationAccessHelper.GetCategoryPropertyByPath(pi.PropertyItems, "BaseAddresses");
                    if (baseAddressesItems != null)
                    {
                        IEnumerator <CategoryPropertyItem> iterator = baseAddressesItems.GetEnumerator();
                        while (iterator.MoveNext())
                        {
                            mServerEndpoints.Add(AddressEndPoint.Parse(iterator.Current.EntryValue));
                        }
                    }
                }
                {
                    mSessionReusable = true;
                    ConfigurationAccessHelper.ParseBooleanValue(pi.PropertyItems, "SessionReusable", ref mSessionReusable);
                }
            }
        }