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


C# CSharp.PropertyBase类代码示例

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


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

示例1: SetMethod

			public SetMethod (PropertyBase method, Modifiers modifiers, ParametersCompiled parameters, Attributes attrs, Location loc)
				: base (method, Prefix, modifiers, attrs, loc)
			{
				this.parameters = parameters;
			}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:5,代码来源:property.cs

示例2: SetIndexerMethod

			public SetIndexerMethod (PropertyBase property, Modifiers modifiers, ParametersCompiled parameters, Attributes attrs, Location loc)
				: base (property, modifiers, parameters, attrs, loc)
			{
			}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:4,代码来源:property.cs

示例3: GetMethod

 public GetMethod(PropertyBase method, Accessor accessor)
     : base(method, accessor, "get_")
 {
 }
开发者ID:speier,项目名称:shake,代码行数:4,代码来源:property.cs

示例4: PropertyMethod

 public PropertyMethod(PropertyBase method, string prefix)
     : base(method, prefix)
 {
     this.method = method;
     this.ModFlags = method.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE);
 }
开发者ID:speier,项目名称:shake,代码行数:6,代码来源:property.cs

示例5: VisitProperty

			public void VisitProperty (PropertyBase p)
			{
				if (p.Get != null)
					VisitMethod(p.Get, false);		// We don't change the state of getter and setter
				if (p.Set != null)
					VisitMethod(p.Set, false);

				//Do we need to update some state on the property?
				switch (CurrentPass) {
					case Pass.DiscoverClassesAndMethods:
						break;

					case Pass.SetVirtualTypes:
						break;

					case Pass.FinalizeModifierFlags: {
						bool hasVirtual = false;
						bool hasOverride = false;
						if (p.Get != null) {
							MethodInfo methodInfo = GetMethodInfoFromCache(p.Get);
							if (methodInfo != null) {
								switch (methodInfo.Type) {
									case VirtualType.NotVirtual:
										if (verbose) {
											Console.WriteLine("[Auto-sealing] get property {0} is not virtual.", p.Get.GetSignatureForError());
										}
										break;
									case VirtualType.FirstVirtual:
										hasVirtual = true;
										if (verbose) {
											Console.WriteLine("[Auto-sealing] get property {0} is first virtual.", p.Get.GetSignatureForError());
										}
										break;
									case VirtualType.OverrideVirtual:
										hasOverride = true;
										if (verbose) {
											Console.WriteLine("[Auto-sealing] get property {0} is override.", p.Get.GetSignatureForError());
										}
										break;
									default:
										if (verbose) {
											Console.WriteLine("[Auto-sealing] Unexpected virtual type in get property {0}.", p.Get.GetSignatureForError());
										}
										break;
								}
							}
						}
						if (p.Set != null) {
							MethodInfo methodInfo = GetMethodInfoFromCache(p.Set);
							if (methodInfo != null) {
								switch (methodInfo.Type) {
									case VirtualType.NotVirtual:
										if (verbose) {
											Console.WriteLine("[Auto-sealing] set property {0} is not virtual.", p.Set.GetSignatureForError());
										}
										break;
									case VirtualType.FirstVirtual:
										hasVirtual = true;
										if (verbose) {
											Console.WriteLine("[Auto-sealing] set property {0} is first virtual.", p.Set.GetSignatureForError());
										}
										break;
									case VirtualType.OverrideVirtual:
										hasOverride = true;
										if (verbose) {
											Console.WriteLine("[Auto-sealing] set property {0} is override.", p.Set.GetSignatureForError());
										}
										break;
									default:
										if (verbose) {
											Console.WriteLine("[Auto-sealing] Unexpected virtual type in set property {0}.", p.Set.GetSignatureForError());
										}
										break;
								}
							}
						}

						if (hasVirtual) {
							p.ModFlags &= ~Modifiers.OVERRIDE;
							p.ModFlags |= Modifiers.VIRTUAL;
							if (verbose) {
								Console.WriteLine("[Auto-sealing] Make property {0} virtual.", p.GetSignatureForError());
							}
						} else if (hasOverride) {
							p.ModFlags &= ~Modifiers.VIRTUAL;
							p.ModFlags |= Modifiers.OVERRIDE;
							if (verbose) {
								Console.WriteLine("[Auto-sealing] Make property {0} override.", p.GetSignatureForError());
							}
						} else {
							p.ModFlags &= ~(Modifiers.VIRTUAL | Modifiers.OVERRIDE);
							if (verbose) {
								Console.WriteLine("[Auto-sealing] Remove virtual and override on property {0}.", p.GetSignatureForError());
							}
						}
						break;
					}
				}
			}
开发者ID:johnv315,项目名称:playscript-mono,代码行数:99,代码来源:module.cs

示例6: SetMethod

 public SetMethod(PropertyBase method)
     : base(method, "set_")
 {
     parameters = new ParametersCompiled (Compiler,
         new Parameter (method.type_expr, "value", Parameter.Modifier.NONE, null, Location));
 }
开发者ID:speier,项目名称:shake,代码行数:6,代码来源:property.cs

示例7: PropertyMethod

			public PropertyMethod (PropertyBase method, string prefix, Modifiers modifiers, Attributes attrs, Location loc)
				: base (method, prefix, attrs, loc)
			{
				this.method = method;
				this.ModFlags = modifiers | (method.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE));
			}
开发者ID:afaerber,项目名称:mono,代码行数:6,代码来源:property.cs

示例8: GetIndexerMethod

 public GetIndexerMethod(PropertyBase method, Accessor accessor)
     : base(method, accessor)
 {
     parameters = accessor.Parameters;
 }
开发者ID:speier,项目名称:shake,代码行数:5,代码来源:property.cs

示例9: case_217

void case_217()
#line 1939 "cs-parser.jay"
{
 		lexer.PropertyParsing = false;
		current_local_parameters = null;

		if (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null)
			((Indexer) current_property).ParameterInfo.CheckParameters (current_property);
	  
		if (doc_support)
			current_property.DocComment = ConsumeStoredComment ();
			
		current_property = null;		
	  }
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:14,代码来源:cs-parser.cs

示例10: case_201

void case_201()
#line 1801 "cs-parser.jay"
{
		valid_param_mod = 0;
		var type = (FullNamedExpression) yyVals[-5+yyTop];
		Indexer indexer = new Indexer (current_type, type, (MemberName) yyVals[-4+yyTop], (Modifiers) yyVals[-6+yyTop], (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]);
			
		current_property = indexer;

  		current_type.AddIndexer (indexer);
		lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
  		
		if (type.Type != null && type.Type.Kind == MemberKind.Void)
			report.Error (620, GetLocation (yyVals[-5+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ());  		

		if (indexer.ParameterInfo.IsEmpty) {
			report.Error (1551, GetLocation (yyVals[-3+yyTop]), "Indexers must have at least one parameter");
		}

		if (doc_support) {
			tmpComment = Lexer.consume_doc_comment ();
			Lexer.doc_state = XmlCommentState.Allowed;
		}

		lexer.PropertyParsing = true;
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:26,代码来源:cs-parser.cs

示例11: case_213

void case_213()
#line 1768 "cs-parser.jay"
{ 
		if (RootContext.Documentation != null)
			current_property.DocComment = ConsumeStoredComment ();
			
		lbag.AppendToMember (current_property, GetLocation (yyVals[-1+yyTop]));
		current_property = null;		
	  }
开发者ID:Ein,项目名称:monodevelop,代码行数:9,代码来源:cs-parser.cs

示例12: case_197

void case_197()
#line 1766 "cs-parser.jay"
{
		var type = (FullNamedExpression) yyVals[-3+yyTop];
		current_property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop],
			(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);
			
		if (type.Type != null && type.Type.Kind == MemberKind.Void)
			report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());					
			
		current_type.AddMember (current_property);
		lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));
		
		lexer.PropertyParsing = true;
	  }
开发者ID:segaman,项目名称:NRefactory,代码行数:15,代码来源:cs-parser.cs

示例13: case_207

void case_207()
#line 1704 "cs-parser.jay"
{
		current_property = new Property (current_class, (FullNamedExpression) yyVals[-3+yyTop], (Modifiers) yyVals[-4+yyTop],
			(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);
			
		if (current_property.TypeExpression.Type == TypeManager.void_type)
			Report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ());					
			
		current_container.AddProperty ((Property)current_property);
		lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));
		
		lexer.PropertyParsing = true;
	  }
开发者ID:Ein,项目名称:monodevelop,代码行数:14,代码来源:cs-parser.cs

示例14: yyparse

  /** the generated parser.
      Maintains a state and a value stack, currently with fixed maximum size.
      @param yyLex scanner.
      @return result of the last reduction, if any.
      @throws yyException on irrecoverable parse error.
    */
  internal Object yyparse (yyParser.yyInput yyLex)
  {
    if (yyMax <= 0) yyMax = 256;			// initial size
    int yyState = 0;                                   // state stack ptr
    int [] yyStates = new int[yyMax];	                // state stack 
    Object yyVal = null;                               // value stack ptr
    Object [] yyVals = new Object[yyMax];	        // value stack
    int yyToken = -1;					// current input
    int yyErrorFlag = 0;				// #tks to shift

    /*yyLoop:*/ for (int yyTop = 0;; ++ yyTop) {
      if (yyTop >= yyStates.Length) {			// dynamically increase
        int[] i = new int[yyStates.Length+yyMax];
        yyStates.CopyTo (i, 0);
        yyStates = i;
        Object[] o = new Object[yyVals.Length+yyMax];
        yyVals.CopyTo (o, 0);
        yyVals = o;
      }
      yyStates[yyTop] = yyState;
      yyVals[yyTop] = yyVal;
      if (debug != null) debug.push(yyState, yyVal);

      /*yyDiscarded:*/ for (;;) {	// discarding a token does not change stack
        int yyN;
        if ((yyN = yyDefRed[yyState]) == 0) {	// else [default] reduce (yyN)
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
            if (debug != null)
              debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
          }
          if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
              && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
            if (debug != null)
              debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
            yyState = yyTable[yyN];		// shift to yyN
            yyVal = yyLex.value();
            yyToken = -1;
            if (yyErrorFlag > 0) -- yyErrorFlag;
            goto continue_yyLoop;
          }
          if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
              && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
            yyN = yyTable[yyN];			// reduce (yyN)
          else
            switch (yyErrorFlag) {
  
            case 0:
              yyExpectingState = yyState;
              // yyerror(String.Format ("syntax error, got token `{0}'", yyname (yyToken)), yyExpecting(yyState));
              if (debug != null) debug.error("syntax error");
              if (yyToken == 0 /*eof*/ || yyToken == eof_token) throw new yyParser.yyUnexpectedEof ();
              goto case 1;
            case 1: case 2:
              yyErrorFlag = 3;
              do {
                if ((yyN = yySindex[yyStates[yyTop]]) != 0
                    && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
                    && yyCheck[yyN] == Token.yyErrorCode) {
                  if (debug != null)
                    debug.shift(yyStates[yyTop], yyTable[yyN], 3);
                  yyState = yyTable[yyN];
                  yyVal = yyLex.value();
                  goto continue_yyLoop;
                }
                if (debug != null) debug.pop(yyStates[yyTop]);
              } while (-- yyTop >= 0);
              if (debug != null) debug.reject();
              throw new yyParser.yyException("irrecoverable syntax error");
  
            case 3:
              if (yyToken == 0) {
                if (debug != null) debug.reject();
                throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
              }
              if (debug != null)
                debug.discard(yyState, yyToken, yyname(yyToken),
  							yyLex.value());
              yyToken = -1;
              goto continue_yyDiscarded;		// leave stack alone
            }
        }
        int yyV = yyTop + 1-yyLen[yyN];
        if (debug != null)
          debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
        yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
        switch (yyN) {
case 1:
#line 391 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
  {
		Lexer.check_incorrect_doc_comment ();
	  }
  break;
case 2:
//.........这里部分代码省略.........
开发者ID:runefs,项目名称:Marvin,代码行数:101,代码来源:cs-parser.cs

示例15: case_211

void case_211()
#line 1750 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{ 
		if (doc_support)
			current_property.DocComment = ConsumeStoredComment ();
			
		lbag.AppendToMember (current_property, GetLocation (yyVals[-1+yyTop]));
		current_property = null;		
	  }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:9,代码来源:cs-parser.cs


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