public void 字段关键字() { FieldKeyword fieldKeyword = FieldKeyword.StaticReadonly; var output = EnumCache.GetFieldKeyword(fieldKeyword); Assert.Equal("static readonly", output); output = EnumCache.GetValue(fieldKeyword); Assert.Equal("static readonly", output); }
/// <summary> /// 设置字段的关键字,如 static,readonly 等 /// </summary> /// <param name="keyword">字段修饰符</param> /// <returns></returns> public virtual TBuilder WithKeyword(FieldKeyword keyword = FieldKeyword.Default) { _variable.Keyword = EnumCache.GetValue(keyword); return(_TBuilder); }
public static string GetFieldKeyword(FieldKeyword value) { return(_FieldKeyword.Value[value]); }
/// <summary> /// 设置字段的关键字,如 static,readonly 等 /// </summary> /// <param name="keyword">字段修饰符</param> /// <returns></returns> public virtual TBuilder WithKeyword(FieldKeyword keyword = FieldKeyword.Default) { _variable.Keyword = RoslynHelper.GetName(keyword); return(_TBuilder); }