[Monodevelop-patches-list] r2157 - in trunk/MonoDevelop/Core/src/MonoDevelop.Core: . AddIns
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Jan 24 18:40:43 EST 2005
Author: lluis
Date: 2005-01-24 18:40:43 -0500 (Mon, 24 Jan 2005)
New Revision: 2157
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Core/AddIns/AddIn.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Core/ChangeLog
Log:
2005-01-24 Lluis Sanchez Gual <lluis at novell.com>
* AddIns/AddIn.cs: Use IsDefined() to look for custom attributes. It's
faster and uses less memory than GetCustomAttribute().
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Core/AddIns/AddIn.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Core/AddIns/AddIn.cs 2005-01-24 23:37:44 UTC (rev 2156)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Core/AddIns/AddIn.cs 2005-01-24 23:40:43 UTC (rev 2157)
@@ -245,9 +245,10 @@
foreach (FieldInfo fieldInfo in fieldInfoArray) {
// process XmlMemberAttributeAttribute attributes
- XmlMemberAttributeAttribute codonAttribute = (XmlMemberAttributeAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(XmlMemberAttributeAttribute));
- if (codonAttribute != null) {
+ if (fieldInfo.IsDefined (typeof(XmlMemberAttributeAttribute), true)) {
+ XmlMemberAttributeAttribute codonAttribute = (XmlMemberAttributeAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(XmlMemberAttributeAttribute));
+
// get value from xml file
XmlNode node = codonNode.Attributes [codonAttribute.Name];
@@ -271,9 +272,10 @@
}
// process XmlMemberAttributeAttribute attributes
- XmlMemberArrayAttribute codonArrayAttribute = (XmlMemberArrayAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(XmlMemberArrayAttribute));
- if (codonArrayAttribute != null) {
+ if (fieldInfo.IsDefined (typeof(XmlMemberArrayAttribute), true)) {
+ XmlMemberArrayAttribute codonArrayAttribute = (XmlMemberArrayAttribute)Attribute.GetCustomAttribute(fieldInfo, typeof(XmlMemberArrayAttribute));
+
// get value from xml file
XmlNode node = codonNode.Attributes [codonArrayAttribute.Name];
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Core/ChangeLog 2005-01-24 23:37:44 UTC (rev 2156)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Core/ChangeLog 2005-01-24 23:40:43 UTC (rev 2157)
@@ -1,3 +1,8 @@
+2005-01-24 Lluis Sanchez Gual <lluis at novell.com>
+
+ * AddIns/AddIn.cs: Use IsDefined() to look for custom attributes. It's
+ faster and uses less memory than GetCustomAttribute().
+
2005-01-11 Lluis Sanchez Gual <lluis at novell.com>
* AddIn.xsd: Added new codon type, and new condition.
More information about the Monodevelop-patches-list
mailing list