Example #1
0
        public UnbindCommand(IHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }
            this.host = host;

            this.configProvider = this.host.GetService <IConfigurationProvider>();
            configProvider.AssertLocalServiceIsNotNull();
        }
Example #2
0
        private BindingConfiguration SafeGetBindingConfig()
        {
            IConfigurationProvider configProvider = this.GetService <IConfigurationProvider>();

            configProvider.AssertLocalServiceIsNotNull();

            BindingConfiguration bindingConfig = null;

            try
            {
                bindingConfig = configProvider.GetConfiguration();
            }
            catch (Exception ex)
            {
                if (ErrorHandler.IsCriticalException(ex))
                {
                    throw;
                }

                Debug.Fail("Unexpected exception: " + ex.ToString());
            }

            return(bindingConfig);
        }