CapableObjects forum



Error: Attribute DataCell.InstantiatedObject has an invalid type: System.Object. Only arrays, enums,...

Posted By David Zajac 2014-01-06 04:39:21
Add to Favorites0

Error: Attribute DataCell.InstantiatedObject has an invalid type:...

Author Message
David Zajac
 Posted 2014-01-06 04:39:21
Supreme Being

Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)Supreme Being - (644 reputation)

Group: Forum Members
Last Active: 2014-01-07 08:03:40
Posts: 1, Visits: 17
644
Using ECO beta on Visual Studio 2013, XML Persistence

There are no Errors upon a solution rebuild

What's really puzzling is that this was working, now it won't pass model check or validation



Copied from TestTables.ecopkg

<Class Name="DataCell" AdditionalNamespaces="" IsAbstract="False" IsSealed="False" id="a2922773-972f-4459-a1da-c76746f83c91">
<Feature>
<Attribute Name="InstantiatedObject" Multiplicity="" Visibility="Public" id="650db080-6965-46a2-8551-f9bf6189d885">
<TaggedValue>
<TaggedValue Tag="persistence" Value="transient" />
<TaggedValue Tag="derived" Value="True" />
</TaggedValue>
<Type>
<Datatype idref="Object" />
</Type>
</Attribute>
<Attribute Name="Value" Multiplicity="" Visibility="Public" id="68c205ea-9af3-4bb9-863a-d165241d0090">
<TaggedValue>
<TaggedValue Tag="Eco.AllowNULL" Value="True" />
</TaggedValue>
<Type>
<Datatype idref="String" />
</Type>
</Attribute>
</Feature>
</Class>


Copied from EcoDataTypes.xml


<Type CanonicalName="Object" Type="System.Object">
<CommonName Name="Object" CaseSensitive="true"/>
<CommonName Name="System.Object" CaseSensitive="true"/>
<LanguageName Language="C#" Name="Object"/>
</Type>


copied from DataCell.eco.cs

[UmlElement(Id="650db080-6965-46a2-8551-f9bf6189d885", Index=Eco_LoopbackIndices.InstantiatedObject)]
[UmlTaggedValue("persistence", "transient")]
[UmlTaggedValue("derived", "True")]
[GeneratedCodeAttribute("ECO", "6.0.0.0")]
public object InstantiatedObject {
get {
return ((object)(this.eco_Content.get_MemberByIndex_OfflineAware(Eco_LoopbackIndices.InstantiatedObject, typeof(object))));
}
}


/// <summary>This method is called when InstantiatedObject needs to be calculated</summary>
partial void InstantiatedObjectDerive(ref Object res);


copied from DataCell.cs

partial void InstantiatedObjectDerive(ref System.Object res)
{
res = null;
string typename = this.Parameter.ValueType.Replace("&", "");
Type t = Type.GetType(typename);
if (t != null)
{
TypeConverter tc = TypeDescriptor.GetConverter(t);
if (tc.CanConvertFrom(typeof(System.String)))
{
res = tc.ConvertFrom(this.Value);
}
else
{
MethodInfo mi;
if ((mi = t.GetMethod("Parse", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy)) != null)
{
string value = this.Value;
object[] args = new object[1];
args[0] = value;
res = mi.Invoke(null, args);
}
}
}
}

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top