Esempio n. 1
0
 /// <summary>Gets the display.</summary>
 /// <param name="methodBase">The method base.</param>
 /// <returns>The display name.</returns>
 public static string GetDisplayName(MethodBase methodBase)
 {
     return methodBase.GetSignature(true);
 }
Esempio n. 2
0
		public int Register(MemberInfoData callee, MethodBase member) {
			if (NativesManager.Instance.IsNative(member)) {
				return this.RegisterNative(callee, member);
			} else {
				if ((member.IsVirtual || member.IsAbstract) && member.DeclaringType.IsSubclassOf(typeof(MK.JavaScript.Window))) {
					ThrowHelper.Throw("{0} cannot be called as it is virtual or abstract method of subclass of Window.", member.GetSignature());
				}
				MethodBaseData data;
				if (this.Methods.TryGetValue(member, out data)) {
					++data.HitCount;
				} else {
					//zaczynam numeracje metod od 1 a nie od zera... ciekawe kiedy to spowoduje problemy
					//dlaczego tak numeruje? bo if(0) zwraca false w .js
					data = new MethodBaseData(member, this.Methods.Count + 1);
					this.Methods[member] = data;

					if ((member.IsVirtual || member.IsAbstract)) {// && ((MethodInfo)member).GetBaseDefinition() == member) {
						var typeData = this.Resolve(member.DeclaringType);
						VirtualMethodCallData vmcd;
						if (!typeData.VirtualMethods.TryGetValue(data, out vmcd)) {
							typeData.VirtualMethods[data] = new VirtualMethodCallData();
						}
					}
					if (!member.IsAbstract)
						this.methodsToCompile.Enqueue(data);
				}
				if (this.PageCompiler.WindowAttribute.MethodsOnTop
					&& member.DeclaringType.GetDeclaringTypesWithType().Any(t => t == this.PageCompiler.WindowType)) {
					this.addDependency(this.PageCompiler.TypeData, data);
				} if (this.PageCompiler.WindowAttribute.RunAtThis.Any(t => member.DeclaringType.GetDeclaringTypesWithType().Contains(t))) {
					this.addDependency(this.PageCompiler.TypeData, data);
				} else {
					var moduleCompiler = this.GetModuleCompiler(member.DeclaringType);
					if (moduleCompiler != null) {
						this.addDependency(moduleCompiler.TypeData, data);
					} else {
						this.addDependency(callee, data);
					}
				}
				return data.Index;
			}
		}