Exemplo n.º 1
0
		public void Defaults ()
		{
			ClientTargetSection c = new ClientTargetSection ();

			Assert.IsNotNull (c.ClientTargets, "A1");
			Assert.AreEqual (typeof (ClientTargetCollection), c.ClientTargets.GetType(), "A2");
		}
Exemplo n.º 2
0
        internal static string GetUserAgentFromClientTarget(VirtualPath configPath, string clientTarget)
        {
            ClientTargetSection section = RuntimeConfig.GetConfig(configPath).ClientTarget;
            string userAgent            = null;

            if (section.ClientTargets[clientTarget] != null)
            {
                userAgent = section.ClientTargets[clientTarget].UserAgent;
            }
            if (userAgent == null)
            {
                throw new HttpException(System.Web.SR.GetString("Invalid_client_target", new object[] { clientTarget }));
            }
            return(userAgent);
        }
Exemplo n.º 3
0
        internal static string GetUserAgentFromClientTarget(VirtualPath configPath, string clientTarget)
        {
            // Lookup ClientTarget section in config.
            ClientTargetSection clientTargetConfig = RuntimeConfig.GetConfig(configPath).ClientTarget;

            string userAgent = null;

            if (clientTargetConfig.ClientTargets[clientTarget] != null)
            {
                userAgent = clientTargetConfig.ClientTargets[clientTarget].UserAgent;
            }

            if (userAgent == null)
            {
                throw new HttpException(SR.GetString(SR.Invalid_client_target, clientTarget));
            }

            return(userAgent);
        }