public void VisitField(FieldDefinition field)
		{
			if (m_field == null)
			{
				if (field.FieldType.IsNative() && field.IsOwnedBy(m_type))
				{
					Log.DebugLine(this, "{0} is owned by the type", field.Name);				
					m_field = field;
				}
			}
		}
Esempio n. 2
0
		public void VisitField(FieldDefinition field)
		{			
			if (!m_disposable && !field.IsStatic)
			{
				TypeDefinition type = Cache.FindType(field.FieldType);
				if (type != null && type.TypeOrBaseImplements("System.IDisposable", Cache))
				{
					Log.DebugLine(this, "found a disposable field: {0}", field.Name);				
					if (!m_ownsField)
					{
						if (field.IsOwnedBy(m_type))
						{
							m_ownsField = true;
							Log.DebugLine(this, "{0} is disposable and owns {1}", m_type, field.Name);
				
							m_details = string.Format("{0}{1} ", m_details, field.Name);
						}
					}
				}
			}
		}
Esempio n. 3
0
		public void VisitField(FieldDefinition field)
		{			
			if (m_disposable && !field.IsStatic)
			{
				if (field.IsOwnedBy(m_type))
				{
					m_ownedFields.Add(field);
					
					TypeDefinition type = Cache.FindType(field.FieldType);
					if (type != null && type.TypeOrBaseImplements("System.IDisposable", Cache))
					{
						Log.DebugLine(this, "{0} is disposable", field.Name);
						m_disposableFields.Add(field.ToString());
					}
				}
				
				if (!m_hasNativeFields && field.FieldType.IsNative())
				{
					m_hasNativeFields = true;
				}
			}
		}