Ejemplo n.º 1
0
		public MethodDescription (MethodBase method, ArgumentSemantic semantic) {
			var minfo = method as MethodInfo;
			var retainReturnValue = minfo != null && minfo.GetBaseDefinition ().ReturnTypeCustomAttributes.IsDefined (typeof (ReleaseAttribute), false);
			var instanceCategory = minfo != null && XamCore.Registrar.DynamicRegistrar.HasThisAttributeImpl (minfo);

			// bitfields and a default value of -1 don't go very well together.
			if (semantic == ArgumentSemantic.None)
				semantic = ArgumentSemantic.Assign;

			if (retainReturnValue)
				semantic = semantic | (ArgumentSemantic) (RetainReturnValueFlag);
			if (instanceCategory)
				semantic |= (ArgumentSemantic) (InstanceCategoryFlag);

			this.method = method;
			this.semantic = semantic;
		}
Ejemplo n.º 2
0
        public MethodDescription(MethodBase method, ArgumentSemantic semantic)
        {
            var minfo             = method as MethodInfo;
            var retainReturnValue = minfo != null && minfo.GetBaseDefinition().ReturnTypeCustomAttributes.IsDefined(typeof(ReleaseAttribute), false);
            var instanceCategory  = minfo != null && XamCore.Registrar.DynamicRegistrar.HasThisAttributeImpl(minfo);

            // bitfields and a default value of -1 don't go very well together.
            if (semantic == ArgumentSemantic.None)
            {
                semantic = ArgumentSemantic.Assign;
            }

            if (retainReturnValue)
            {
                semantic = semantic | (ArgumentSemantic)(RetainReturnValueFlag);
            }
            if (instanceCategory)
            {
                semantic |= (ArgumentSemantic)(InstanceCategoryFlag);
            }

            this.method   = method;
            this.semantic = semantic;
        }
Ejemplo n.º 3
0
 public ExportAttribute(string selector, ArgumentSemantic semantic)
 {
     this.selector = selector;
     this.semantic = semantic;
 }
Ejemplo n.º 4
0
 public ExportAttribute(string selector)
 {
     this.selector = selector;
     this.semantic = ArgumentSemantic.None;
 }
		public DynamicExportAttribute (string selector, ArgumentSemantic semantic)
		{
			ArgumentSemantic = semantic;
			Selector = selector;
		}
Ejemplo n.º 6
0
 public UnmanagedMethodDescription(IntPtr method, ArgumentSemantic semantic)
 {
     this.method   = method;
     this.semantic = semantic;
 }
Ejemplo n.º 7
0
		public UnmanagedMethodDescription (IntPtr method, ArgumentSemantic semantic) {
			this.method = method;
			this.semantic = semantic;
		}
Ejemplo n.º 8
0
 public ExportAttribute(string selector, ArgumentSemantic semantic)
 {
     this.selector = selector;
     this.semantic = semantic;
 }
Ejemplo n.º 9
0
 public ExportAttribute(string selector)
 {
     this.selector = selector;
     this.semantic = ArgumentSemantic.None;
 }
Ejemplo n.º 10
0
 public MethodDescription(MethodBase method, ArgumentSemantic semantic)
 {
     this.method   = method;
     this.semantic = semantic;
 }
Ejemplo n.º 11
0
 public DynamicExportAttribute(string selector, ArgumentSemantic semantic)
 {
     ArgumentSemantic = semantic;
     Selector         = selector;
 }
Ejemplo n.º 12
0
		public MethodDescription (MethodBase method, ArgumentSemantic semantic) {
			this.method = method;
			this.semantic = semantic;
		}
Ejemplo n.º 13
0
			public bool SetExportAttribute (ExportAttribute ea, ref List<Exception> exceptions)
			{
				if (string.IsNullOrEmpty (ea.Selector)) {
					AddException (ref exceptions, Registrar.CreateException (4135, this, "The member '{0}' has an Export attribute without a selector. A selector is required.", FullName));
					return false;
				}
				Selector = ea.Selector;
				ArgumentSemantic = ea.ArgumentSemantic;
				IsVariadic = ea.IsVariadic;
				return true;
			}