Esempio n. 1
0
        public MPropertyDef Create(PropertyDef newProp)
        {
            if (FindAny(newProp) != null)
            {
                throw new ApplicationException("Can't add a property when it's already been added");
            }

            var propDef = new MPropertyDef(newProp, this, properties.Count);

            Add(propDef);
            TypeDef.Properties.Add(newProp);
            return(propDef);
        }
Esempio n. 2
0
		void CreateProperty(MPropertyDef propDef, MMethodDef methodDef, string overridePrefix) {
			if (!methodDef.Owner.HasModule)
				return;

			var newPropertyName = overridePrefix + propDef.PropertyDef.Name;
			if (!DotNetUtils.HasReturnValue(methodDef.MethodDef))
				CreatePropertySetter(newPropertyName, methodDef);
			else
				CreatePropertyGetter(newPropertyName, methodDef);
		}
Esempio n. 3
0
 public void Add(MPropertyDef p)
 {
     properties.Add(p);
 }
Esempio n. 4
0
		void PrepareRenameProperty(MPropertyDef propDef) {
			if (propDef.IsVirtual())
				throw new ApplicationException("Can't rename virtual props here");
			var propInfo = Property(propDef);
			if (propInfo.renamed)
				return;

			string propName = propInfo.oldName;
			if (!NameChecker.IsValidPropertyName(propName))
				propName = propInfo.suggestedName;
			if (!NameChecker.IsValidPropertyName(propName)) {
				if (propDef.IsItemProperty())
					propName = "Item";
				else
					propName = variableNameState.GetNewPropertyName(propDef.PropertyDef);
			}
			variableNameState.AddPropertyName(propName);
			propInfo.Rename(propName);

			RenameSpecialMethod(propDef.GetMethod, "get_" + propName);
			RenameSpecialMethod(propDef.SetMethod, "set_" + propName);
		}
Esempio n. 5
0
		public PropertyInfo Property(MPropertyDef prop) {
			return memberInfos.Property(prop);
		}
Esempio n. 6
0
		public void Add(MPropertyDef prop) {
			allPropertyInfos[prop] = new PropertyInfo(prop);
		}
Esempio n. 7
0
		public PropertyInfo(MPropertyDef propertyDef)
			: base(propertyDef) {
		}
Esempio n. 8
0
		public bool TryGetProperty(MPropertyDef p, out PropertyInfo info) {
			return allPropertyInfos.TryGetValue(p, out info);
		}
Esempio n. 9
0
		public PropertyInfo Property(MPropertyDef prop) {
			return allPropertyInfos[prop];
		}
Esempio n. 10
0
 public void add(MPropertyDef p)
 {
     properties.add(p);
 }
Esempio n. 11
0
		public MPropertyDef Create(PropertyDef newProp) {
			if (FindAny(newProp) != null)
				throw new ApplicationException("Can't add a property when it's already been added");

			var propDef = new MPropertyDef(newProp, this, properties.Count);
			Add(propDef);
			TypeDef.Properties.Add(newProp);
			return propDef;
		}
Esempio n. 12
0
		public void Add(MPropertyDef p) {
			properties.Add(p);
		}
Esempio n. 13
0
 public PropertyInfo prop(MPropertyDef prop)
 {
     return memberInfos.prop(prop);
 }
Esempio n. 14
0
 public void add(MPropertyDef p)
 {
     properties.add(p);
 }