当前位置: 首页>>代码示例>>C#>>正文


C# MemberType类代码示例

本文整理汇总了C#中MemberType的典型用法代码示例。如果您正苦于以下问题:C# MemberType类的具体用法?C# MemberType怎么用?C# MemberType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MemberType类属于命名空间,在下文中一共展示了MemberType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Member

        public Member(StreamReader sr)
        {
            firstName = sr.ReadLine();
            lastName = sr.ReadLine();
            type = (MemberType)Convert.ToInt32(sr.ReadLine());
            uiStudentNumber = Convert.ToUInt32(sr.ReadLine());
            memberFaculty = (Faculty)Convert.ToInt32(sr.ReadLine());

            otherInstrument = sr.ReadLine();
            curInstrument = (Instrument)Convert.ToInt32(sr.ReadLine());

            this.bMultipleInstruments = Convert.ToBoolean(sr.ReadLine());

            // write if the member plays multiple instruments
            // write any other instruments that the member plays (or does not play)
            int numberOfInstruments = Enum.GetValues(typeof(Member.Instrument)).Length;
            if (this.bMultipleInstruments)
            {
                playsInstrument = new bool[Enum.GetValues(typeof(Member.Instrument)).Length];
                for (int j = 0; j < numberOfInstruments; j++)
                    playsInstrument[j] = Convert.ToBoolean(sr.ReadLine());
            }

            email = sr.ReadLine();
            comments = ClsStorage.ReverseCleanNewLine(sr.ReadLine());
            sID = Convert.ToInt16(sr.ReadLine());
            signupTime = new DateTime(Convert.ToInt64(sr.ReadLine()));
            size = (ShirtSize)Convert.ToInt32(sr.ReadLine());
        }
开发者ID:uwcbc,项目名称:uwcbc-marimba,代码行数:29,代码来源:member.cs

示例2: GetDefaultValueIfAny

        public static bool GetDefaultValueIfAny(MemberType memberType, MetadataReader reader, Handle constantHandle, Type declaredType, IEnumerable<CustomAttributeData> customAttributes, out Object defaultValue)
        {
            if (!(constantHandle.IsNull(reader)))
            {
                defaultValue = ParseMetadataConstant(reader, constantHandle);
                if (declaredType.GetTypeInfo().IsEnum)
                    defaultValue = Enum.ToObject(declaredType, defaultValue);
                return true;
            }

            if (memberType != MemberType.Property)  // the attributes in question cannot be applied to properties.
            {
                // Legacy: If there are multiple default value attribute, the desktop picks one at random (and so do we...)
                foreach (CustomAttributeData cad in customAttributes)
                {
                    Type attributeType = cad.AttributeType;
                    TypeInfo attributeTypeInfo = attributeType.GetTypeInfo();
                    if (attributeTypeInfo.IsSubclassOf(typeof(CustomConstantAttribute)))
                    {
                        CustomConstantAttribute customConstantAttribute = (CustomConstantAttribute)(cad.Instantiate());
                        defaultValue = customConstantAttribute.Value;
                        return true;
                    }
                    if (attributeType.Equals(typeof(DecimalConstantAttribute)))
                    {
                        DecimalConstantAttribute decimalConstantAttribute = (DecimalConstantAttribute)(cad.Instantiate());
                        defaultValue = decimalConstantAttribute.Value;
                        return true;
                    }
                }
            }

            defaultValue = null;
            return false;
        }
开发者ID:tijoytom,项目名称:corert,代码行数:35,代码来源:DefaultValueParser.cs

示例3: PermissionFilter

		public PermissionFilter(int memberId, MemberType memberType, string schemaId, string actionId, string filter) : base(memberId, memberType, schemaId, actionId, false)
		{
			if(string.IsNullOrWhiteSpace(filter))
				throw new ArgumentNullException("filter");

			_filter = filter.Trim();
		}
开发者ID:Flagwind,项目名称:Zongsoft.CoreLibrary,代码行数:7,代码来源:PermissionFilter.cs

示例4: MemberMetadata

        public MemberMetadata(MemberInfo memberInfo)
        {
            _type = MemberType.None;
            _memberType = null;
            _mi = null;
            _fp = null;

            memberInfo.ThrowIfNull("memberInfo", "Parameter cannot be null.");
            switch (memberInfo.MemberType)
            {
                case MemberTypes.Field:
                    _type = MemberType.Field;
                    _mi = memberInfo;
                    _memberType = (memberInfo as FieldInfo).FieldType;
                    break;
                case MemberTypes.Property:
                    _type = MemberType.Property;
                    _memberType = (memberInfo as PropertyInfo).PropertyType;
                    _fp = new FastReflection.FastProperty((memberInfo as PropertyInfo), true);
                    _mi = memberInfo;
                    break;
                default:
                    break;
            }
        }
开发者ID:OleksandrKulchytskyi,项目名称:Sharedeployed,代码行数:25,代码来源:MemberMetadata.cs

示例5: GenerateSyntax

 internal override void GenerateSyntax(MemberType type, ISymbol symbol, SyntaxDetail syntax, SymbolVisitorAdapter adapter)
 {
     foreach (var generator in _generators)
     {
         generator.GenerateSyntax(type, symbol, syntax, adapter);
     }
 }
开发者ID:yonglehou,项目名称:docfx,代码行数:7,代码来源:CompositeYamlModelGenerator.cs

示例6: LoadUc

        private void LoadUc(MemberType usertype)
        {
            Control con = null;

               //0 未设定 1 个人会员 2 家庭会员 3 学校会员 4 企业会员 :
            switch (usertype)
            {
                case MemberType.Initiation:
                    lblUserType.Text = "初始注册会员";
                    break;
                case MemberType.Company:
                    lblUserType.Text = "企业会员";
                    con = (Control)Page.LoadControl("~/uc/UCCompanyMemberInfo.ascx");
                    break;
                case MemberType.Famly:
                    lblUserType.Text = "家庭会员";
                    con = (Control)Page.LoadControl("~/uc/UCFamlyMemberInfo.ascx");
                    break;
                case MemberType.Personal:
                    lblUserType.Text = "个人会员";
                    con = (Control)Page.LoadControl("~/uc/UCPersonMemberInfo.ascx");
                    break;
                case MemberType.School:
                    lblUserType.Text = "学校会员";
                    con = (Control)Page.LoadControl("~/uc/UCSchoolMemberInfo.ascx");
                    break;
            }
            con.ID = "uccon";
            phExtentInfo.Controls.Add(con);
        }
开发者ID:ViniciusConsultor,项目名称:noname-netshop,代码行数:30,代码来源:MyProfile.aspx.cs

示例7: ConstantExpression

 private static string ConstantExpression(Expression exp, ref MemberType type, bool? isComparisonOperator)
 {
     type = MemberType.Value;
     ConstantExpression ce = ((ConstantExpression)exp);
     if (ce.Value == null)
         return "null";
     else if (ce.Value.ToString().IsIn("True", "False"))//是bool值
     {
         var ceType = ce.Value.GetType();
         var ceValue = ce.Value.ToString();
         if (isComparisonOperator==true)
         {
             var ceNewValue = ConstantBoolDictionary.Single(it => it.Type == ceType && it.OldValue.ToLower() == ceValue.ToLower());
             return ceNewValue.NewValue;
         }
         else
         {
             var ceNewValue = ConstantBoolDictionary.Single(it => it.Type == ceType && it.OldValue.ToLower() == ceValue.ToLower());
             return ceNewValue.Key.ToString();
         }
     }
     else
     {
         return ce.Value.ToString();
     }
 }
开发者ID:sunkaixuan,项目名称:SqlSugar,代码行数:26,代码来源:Expressions.cs

示例8: ReflectionException

 public ReflectionException(string memberName, MemberType type, object obj) 
     : this(string.Format("Fail to find {0} {1} in {2}."
         , memberName
         , Enum.GetName(typeof(MemberType), type)
         , obj.ToString()))
 {
 }
开发者ID:timonela,项目名称:mb-unit,代码行数:7,代码来源:ReflectionException.cs

示例9: Create

 public static TypeValueAccess Create(Type type, string name, MemberType memberType = MemberType.Instance | MemberType.Public | MemberType.Field | MemberType.Property)
 {
     //BindingFlags bindingFlags = BindingFlags.Instance;
     //if ((memberType & pb.Reflection.MemberType.Public) == pb.Reflection.MemberType.Public)
     //    bindingFlags |= BindingFlags.Public;
     //if ((memberType & pb.Reflection.MemberType.NonPublic) == pb.Reflection.MemberType.NonPublic)
     //    bindingFlags |= BindingFlags.NonPublic;
     //foreach (MemberInfo member in type.GetMember(name, bindingFlags))
     //{
     //    BindingFlags accessBindingFlag = 0;
     //    if (member.MemberType == MemberTypes.Field)
     //        accessBindingFlag = BindingFlags.GetField;
     //    else if (member.MemberType == MemberTypes.Property)
     //        accessBindingFlag = BindingFlags.GetProperty;
     //    //return new MemberAccess { SourceType = type, Name = member.Name, MemberTypes = member.MemberType, AccessBindingFlag = accessBindingFlag, MemberInfo = member };
     //    return new MemberAccess { SourceType = type, Name = member.Name, AccessBindingFlag = accessBindingFlag };
     //}
     //return null;
     TypeValueInfo typeValueInfo = type.zGetTypeValueInfo(name, memberType);
     if (typeValueInfo != null)
         //return new MemberAccess { SourceType = type, Name = valueInfo.Name, AccessBindingFlag = GetAccessBindingFlag(valueInfo.MemberTypes) };
         return new TypeValueAccess(typeValueInfo);
     else
         return null;
 }
开发者ID:labeuze,项目名称:source,代码行数:25,代码来源:TypeAccess.cs

示例10: VisitMemberType

 public virtual void VisitMemberType(MemberType memberType)
 {
     /*if (this.ThrowException)
     {
         throw (Exception)this.CreateException(memberType);
     }*/
 }
开发者ID:txdv,项目名称:Builder,代码行数:7,代码来源:Visitor.Empty.cs

示例11: getMember

 internal static StaffMember getMember(HttpSessionStateBase Session ,int memberID,MemberType membertype)
 {
     Dictionary<String, List<LibraryMemberBase>> librarymembers = Session["LibraryMembers"] as Dictionary<String, List<LibraryMemberBase>>;
     List<LibraryMemberBase> staffmemberlist = librarymembers[membertype.ToString()];
     StaffMember member = (StaffMember)staffmemberlist.Single(s => s.ID == memberID);
     return member;
 }
开发者ID:guapo832,项目名称:Library-Management-System,代码行数:7,代码来源:Members.cs

示例12: SetPermissionFilters

		public void SetPermissionFilters(int memberId, MemberType memberType, IEnumerable<PermissionFilter> permissionFilters)
		{
			if(permissionFilters == null)
				throw new ArgumentNullException("permissionFilters");

			this.SetPermissions(MembershipHelper.DATA_ENTITY_PERMISSION, memberId, memberType, permissionFilters);
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Security,代码行数:7,代码来源:PermissionProvider.cs

示例13: Add

 public string Add(MemberType memtype)
 {
     try
     {
         if (memtype != null)
         {
             if (!IsDuplicate(string.Empty, memtype.MemberTypeName))
             {
                 memtype.MemberTypeID = Guid.NewGuid().ToString();
                 memtype.DealerID = CommonConstant.GetFieldValueString(Session[CommonConstant.SessionUserID]);
                 memtype.UpdateDate = DateTime.Now;
                 memtype.CreateDate = DateTime.Now;
                 db.MemberTypes.Add(memtype);
                 db.SaveChanges();
                 return "Success";
             }
             else
             {
                 return "This member type name already in used.";
             }
         }
     }
     catch(Exception ex)
     {
         LogFile.writeLogFile(DateTime.Now, "MemberTypeController", ex.ToString());
     }
     return "Add member type failed.";
 }
开发者ID:Altier79,项目名称:Dreambox,代码行数:28,代码来源:MemberTypeController.cs

示例14: Member

 public Member(Lumber lumberType, MemberType memberType, Polygon geometry, string name = "")
 {
     this.MemberType = memberType;
     this.Lumber = lumberType;
     this.Geometry = geometry;
     this.Name = name;
 }
开发者ID:nickgclearspaninc,项目名称:TrussFree,代码行数:7,代码来源:Member.cs

示例15: MemberExistsException

		public MemberExistsException (string className, string memberName, MemberType existingMemberType, MemberType newMemberType, DomRegion errorLocation, string fileName)
			: base (errorLocation, fileName)
		{
			this.className = className;
			this.memberName = memberName;
			this.existingMemberType = existingMemberType;
			this.newMemberType = newMemberType;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:MemberExistsException.cs


注:本文中的MemberType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。