RouteData

 public class RouteData
    {
        private RouteValueDictionary _dataTokens;
        private IRouteHandler _routeHandler;
        private RouteValueDictionary _values;
        public RouteData()
        {
            this._values = new RouteValueDictionary();
            this._dataTokens = new RouteValueDictionary();
        }

        public RouteData(RouteBase route, IRouteHandler routeHandler)
        {
            this._values = new RouteValueDictionary();
            this._dataTokens = new RouteValueDictionary();
            this.Route = route;
            this.RouteHandler = routeHandler;
        }

        public string GetRequiredString(string valueName)
        {
            object obj2;
            if (this.Values.TryGetValue(valueName, out obj2))
            {
                string str = obj2 as string;
                if (!string.IsNullOrEmpty(str))
                {
                    return str;
                }
            }
            throw new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, System.Web.SR.GetString("RouteData_RequiredValue"), new object[] { valueName }));
        }

        public RouteValueDictionary DataTokens
        {
            [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
            get
            {
                return this._dataTokens;
            }
        }

        public RouteBase Route
        {
            get
            {
                return this.<Route>k__BackingField;
            }
            set
            {
                this.<Route>k__BackingField = value;
            }
        }

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

        public RouteValueDictionary Values
        {
            get
            {
                return this._values;
            }
        }
    }
View Code

相关文章:

  • 2021-06-23
  • 2022-12-23
  • 2021-08-29
  • 2022-01-30
  • 2022-12-23
  • 2021-06-06
  • 2021-12-02
猜你喜欢
  • 2021-09-10
  • 2022-02-27
  • 2022-01-19
  • 2021-05-30
相关资源
相似解决方案