示例#1
0
 public static string ToString(CodeSelectionMode value)
 {
     if (value == CodeSelectionMode.Code)
     {
         return("code");
     }
     else if (value == CodeSelectionMode.Children)
     {
         return("children");
     }
     else if (value == CodeSelectionMode.Descendants)
     {
         return("descendants");
     }
     else if (value == CodeSelectionMode.All)
     {
         return("all");
     }
     else if (value == CodeSelectionMode.System)
     {
         return("system");
     }
     else
     {
         throw new ArgumentException("Unrecognized CodeSelectionMode value: " + value.ToString());
     }
 }
示例#2
0
            public static bool TryParse(string value, out CodeSelectionMode result)
            {
                result = default(CodeSelectionMode);

                if (value == "code")
                {
                    result = CodeSelectionMode.Code;
                }
                else if (value == "children")
                {
                    result = CodeSelectionMode.Children;
                }
                else if (value == "descendants")
                {
                    result = CodeSelectionMode.Descendants;
                }
                else if (value == "all")
                {
                    result = CodeSelectionMode.All;
                }
                else if (value == "system")
                {
                    result = CodeSelectionMode.System;
                }
                else
                {
                    return(false);
                }

                return(true);
            }
示例#3
0
            public static bool TryParse(string value, out CodeSelectionMode result)
            {
                result = default(CodeSelectionMode);

                if( value=="code")
                    result = CodeSelectionMode.Code;
                else if( value=="children")
                    result = CodeSelectionMode.Children;
                else if( value=="descendants")
                    result = CodeSelectionMode.Descendants;
                else if( value=="all")
                    result = CodeSelectionMode.All;
                else if( value=="system")
                    result = CodeSelectionMode.System;
                else
                    return false;

                return true;
            }
示例#4
0
 public static string ToString(CodeSelectionMode value)
 {
     if( value==CodeSelectionMode.Code )
         return "code";
     else if( value==CodeSelectionMode.Children )
         return "children";
     else if( value==CodeSelectionMode.Descendants )
         return "descendants";
     else if( value==CodeSelectionMode.All )
         return "all";
     else if( value==CodeSelectionMode.System )
         return "system";
     else
         throw new ArgumentException("Unrecognized CodeSelectionMode value: " + value.ToString());
 }