RouteData.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Routing / RouteData.cs / 1305376 / RouteData.cs

                            namespace System.Web.Routing { 
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Runtime.CompilerServices; 

    [TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] 
    public class RouteData { 
        private IRouteHandler _routeHandler;
        private RouteValueDictionary _values = new RouteValueDictionary(); 
        private RouteValueDictionary _dataTokens = new RouteValueDictionary();

        public RouteData() {
        } 

        public RouteData(RouteBase route, IRouteHandler routeHandler) { 
            Route = route; 
            RouteHandler = routeHandler;
        } 

        public RouteValueDictionary DataTokens {
            get {
                return _dataTokens; 
            }
        } 
 
        public RouteBase Route {
            get; 
            set;
        }

        public IRouteHandler RouteHandler { 
            get {
                return _routeHandler; 
            } 
            set {
                _routeHandler = value; 
            }
        }

        public RouteValueDictionary Values { 
            get {
                return _values; 
            } 
        }
 
        public string GetRequiredString(string valueName) {
            object value;
            if (Values.TryGetValue(valueName, out value)) {
                string valueString = value as string; 
                if (!String.IsNullOrEmpty(valueString)) {
                    return valueString; 
                } 
            }
            throw new InvalidOperationException( 
                String.Format(
                    CultureInfo.CurrentUICulture,
                    SR.GetString(SR.RouteData_RequiredValue),
                    valueName)); 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
´╗┐namespace System.Web.Routing { 
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Runtime.CompilerServices; 

    [TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] 
    public class RouteData { 
        private IRouteHandler _routeHandler;
        private RouteValueDictionary _values = new RouteValueDictionary(); 
        private RouteValueDictionary _dataTokens = new RouteValueDictionary();

        public RouteData() {
        } 

        public RouteData(RouteBase route, IRouteHandler routeHandler) { 
            Route = route; 
            RouteHandler = routeHandler;
        } 

        public RouteValueDictionary DataTokens {
            get {
                return _dataTokens; 
            }
        } 
 
        public RouteBase Route {
            get; 
            set;
        }

        public IRouteHandler RouteHandler { 
            get {
                return _routeHandler; 
            } 
            set {
                _routeHandler = value; 
            }
        }

        public RouteValueDictionary Values { 
            get {
                return _values; 
            } 
        }
 
        public string GetRequiredString(string valueName) {
            object value;
            if (Values.TryGetValue(valueName, out value)) {
                string valueString = value as string; 
                if (!String.IsNullOrEmpty(valueString)) {
                    return valueString; 
                } 
            }
            throw new InvalidOperationException( 
                String.Format(
                    CultureInfo.CurrentUICulture,
                    SR.GetString(SR.RouteData_RequiredValue),
                    valueName)); 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.

                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK