コード例 #1
0
ファイル: Router.cs プロジェクト: Earlz/EFramework
        /**Add a route to the list of routes.
         * @param id The RouteID
         * @param type The pattern type to use
         * @param pattern The route pattern to match to
         * @param handler A lambda(or similar) to invoke a new HttpHandler, such as ()=>{return new MyHandler;}
         */
        public void AddRoute(string id, PatternTypes type, string pattern, HandlerInvoker handler)
        {
            var r = new Route {
                Pattern = pattern, Handler = handler, PatternType = type, ID = id
            };

            Routes.Add(r);
        }
コード例 #2
0
ファイル: Routing.cs プロジェクト: Earlz/EFramework
 /**Add a route to the list of routes.
  * @param id The RouteID
  * @param type The pattern type to use
  * @param pattern The route pattern to match to
  * @param handler A lambda(or similar) to invoke a new HttpHandler, such as ()=>{return new MyHandler;}
  */
 static public void AddRoute(string id, PatternTypes type, string pattern, HandlerInvoker handler)
 {
     /**TODO: This needs to be smart enough so that routes can not be added while routes are being parsed, else get a
      * "collection modified" exception from .Net. **/
     if (router == null)
     {
         router = new Router();
     }
     router.AddRoute(id, type, pattern, handler);
 }
コード例 #3
0
 public Constant(PatternTypes type, dynamic value) : base(type)
 {
     Value = value;
 }
コード例 #4
0
 public Variable(PatternTypes type) : base(type)
 {
 }
コード例 #5
0
 protected PatternPart(PatternTypes type)
 {
     Type = type;
 }
コード例 #6
0
ファイル: Pattern.cs プロジェクト: zhongshuiyuan/mapwindowsix
 /// <summary>
 /// Creates a new pattern with the specified type
 /// </summary>
 /// <param name="type">The subclass of pattern to use as the internal pattern</param>
 public Pattern(PatternTypes type)
 {
     SetType(type);
 }
コード例 #7
0
ファイル: Pattern.cs プロジェクト: zhongshuiyuan/mapwindowsix
 private void SetType(PatternTypes type)
 {
     _patternType = type;
     IPattern result = null;
     switch (type)
     {
         case PatternTypes.Gradient:
             result = new GradientPattern();
             break;
         case PatternTypes.Line:
             break;
         case PatternTypes.Marker:
             break;
         case PatternTypes.Picture:
             result = new PicturePattern();
             break;
         case PatternTypes.Simple:
             result = new SimplePattern();
             break;
     }
     if (result != null) result.Outline = _innerPattern.Outline;
     _innerPattern = result;
 }