/// <summary> /// const readonly /// </summary> private static void DoKeyword2() { Console.WriteLine("========初始化字段================="); Console.WriteLine(Keyword2.Name_const); Console.WriteLine(Keyword2.Name_static); Console.WriteLine(Keyword2.Name_static_readonly); Console.WriteLine("========初始化构造函数================="); Keyword2 kw = new Keyword2(); Console.WriteLine(kw.Name_readonly); Console.WriteLine(Keyword2.Name_const); Console.WriteLine(Keyword2.Name_static); Console.WriteLine(Keyword2.Name_static_readonly); Console.WriteLine("========修改内容================="); //Keyword2.Name_const = Keyword2.Name_const+"_Edit"; //Keyword2.Name_static_readonly = Keyword2.Name_static_readonly + "_Edit"; //kw.Name_readonly = Keyword2.Name_readonly + "_Edit"; Keyword2.Name_static = Keyword2.Name_static + "_Edit"; Console.WriteLine(Keyword2.Name_static); }
/// <summary> /// シラバスのキーワードでタイプ2に一致する文字列を取得します。 /// </summary> /// <param name="input"> 一致する対象を検索する文字列。 </param> /// <returns> 一致する文字列。</returns> public static IEnumerable <SyllabusKeyword> MatchKeyword2(string input) { for (var match = Keyword2.Match(input); match.Success; match = match.NextMatch()) { ////if (string.IsNullOrEmpty(match.Groups["keyword"].Value)) if (match.Groups["keyword"].Success) { yield return(new SyllabusKeyword(match.Groups["keyword"].Value, match.Groups["keyword"].Value)); ////yield return Tuple.Create(match.Groups["keyword"].Value, match.Groups["keyword"].Value); ////jp.Add(match.Groups["keyword"].Value); ////en.Add(match.Groups["keyword"].Value); } else { yield return(new SyllabusKeyword(match.Groups["jpKeyword"].Value, match.Groups["enKeyword"].Value)); ////yield return Tuple.Create(match.Groups["jpKeyword"].Value, match.Groups["enKeyword"].Value); //// jp.Add(match.Groups["jpKeyword"].Value); //// en.Add(match.Groups["enKeyword"].Value); } } }