ParameterSubsegment.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 / ParameterSubsegment.cs / 1305376 / ParameterSubsegment.cs

                            namespace System.Web.Routing { 

    // Represents a parameter subsegment of a ContentPathSegment
    internal sealed class ParameterSubsegment : PathSubsegment {
        public ParameterSubsegment(string parameterName) { 
            if (parameterName.StartsWith("*", StringComparison.Ordinal)) {
                ParameterName = parameterName.Substring(1); 
                IsCatchAll = true; 
            }
            else { 
                ParameterName = parameterName;
            }
        }
 
        public bool IsCatchAll {
            get; 
            private set; 
        }
 
        public string ParameterName {
            get;
            private set;
        } 

#if ROUTE_DEBUGGING 
        public override string LiteralText { 
            get {
                return "{" + (IsCatchAll ? "*" : String.Empty) + ParameterName + "}"; 
            }
        }

        public override string ToString() { 
            return "{" + (IsCatchAll ? "*" : String.Empty) + ParameterName + "}";
        } 
#endif 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Web.Routing { 

    // Represents a parameter subsegment of a ContentPathSegment
    internal sealed class ParameterSubsegment : PathSubsegment {
        public ParameterSubsegment(string parameterName) { 
            if (parameterName.StartsWith("*", StringComparison.Ordinal)) {
                ParameterName = parameterName.Substring(1); 
                IsCatchAll = true; 
            }
            else { 
                ParameterName = parameterName;
            }
        }
 
        public bool IsCatchAll {
            get; 
            private set; 
        }
 
        public string ParameterName {
            get;
            private set;
        } 

#if ROUTE_DEBUGGING 
        public override string LiteralText { 
            get {
                return "{" + (IsCatchAll ? "*" : String.Empty) + ParameterName + "}"; 
            }
        }

        public override string ToString() { 
            return "{" + (IsCatchAll ? "*" : String.Empty) + ParameterName + "}";
        } 
#endif 
    }
} 

// 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