/// <summary>
 /// Creates a new instance of <see cref="ConnectorConfiguration"/> based on the configuration.
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="configContext"></param>
 /// <param name="section"></param>
 /// <returns></returns>
 public object Create(object parent, object configContext, System.Xml.XmlNode section)
 {
     var conf = new ConnectorConfiguration();
     XPathNavigator nav = section.CreateNavigator();
     conf.User = GetValue(nav, "user");
     conf.Key = GetValue(nav, "key");
     conf.HostsRaw = GetValue(nav, "hosts");
     conf.MainHostsRaw = GetValue(nav, "mainHosts");
     conf.FastHostsRaw = GetValue(nav, "fastHosts");
     return conf;
 }
예제 #2
0
        /// <summary>
        /// Creates a new instance of <see cref="ConnectorConfiguration"/> based on the configuration.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="configContext"></param>
        /// <param name="section"></param>
        /// <returns></returns>
        public object Create(object parent, object configContext, System.Xml.XmlNode section)
        {
            var            conf = new ConnectorConfiguration();
            XPathNavigator nav  = section.CreateNavigator();

            conf.User         = GetValue(nav, "user");
            conf.Key          = GetValue(nav, "key");
            conf.HostsRaw     = GetValue(nav, "hosts");
            conf.MainHostsRaw = GetValue(nav, "mainHosts");
            conf.FastHostsRaw = GetValue(nav, "fastHosts");
            return(conf);
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="CritSendConnect"/>
        /// </summary>
        /// <param name="fast">If set to <c>true</c> use the fast web service.</param>
        /// <param name="user">The Critsent user to use instead of the configuration file.</param>
        /// <param name="key">The password to use instead of the configuration file.</param>
        public CritSendConnect(bool fast, string user, string key)
        {
            _fast          = fast;
            _configuration = ConnectorConfiguration.Instance;
            _user          = user ?? _configuration.User;
            _key           = key ?? _configuration.Key;

            // This line avoids the HTTP 417 errors.
            // Found at http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5023d48b-476a-47db-b108-1a4eca6a5316
            System.Net.ServicePointManager.Expect100Continue = false;

            WSDL01forMxMaster client = CreateClient(!_fast ? _configuration.Hosts : _configuration.FastHosts) ??
                                       GetFallbackHost(_configuration.Hosts);


            _client = client;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of <see cref="CritSendConnect"/>
        /// </summary>
        /// <param name="fast">If set to <c>true</c> use the fast web service.</param>
        /// <param name="user">The Critsent user to use instead of the configuration file.</param>
        /// <param name="key">The password to use instead of the configuration file.</param>
        public CritSendConnect(bool fast, string user, string key)
        {
            _fast = fast;
            _configuration = ConnectorConfiguration.Instance;
            _user = user ?? _configuration.User;
            _key = key ?? _configuration.Key;

            // This line avoids the HTTP 417 errors.
            // Found at http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5023d48b-476a-47db-b108-1a4eca6a5316
            System.Net.ServicePointManager.Expect100Continue = false;

            WSDL01forMxMaster client = CreateClient(!_fast ? _configuration.Hosts : _configuration.FastHosts) ??
                                       GetFallbackHost(_configuration.Hosts);

            _client = client;
        }