From: eliassal on
Hi I have a function in a dll that returns an object which I need to get
somes items as follows

public object[] CreateFacts(RuleSetInfo ruleSetInfo)
{
XmlDocument doc = new XmlDocument();
//Loading the XML from xml file to be tested against rule.
doc.Load(@_xmlDocToBeused);
TypedXmlDocument txd = new TypedXmlDocument(_DocType, doc);

//Preeapre facts object
object[] facts = new object[1];
facts[0] = txd;

return facts;
}


In my app, I neeed to retrieve this 1st item, I am trying the following

object fact = fc.CreateFacts(RSSetInfo);

I need something like that

TypedXmlDocument test = fact[0];
but geting error indicating that "CAN NOT APPLY INDEXING WITH [0] to an
expression of type object

I tried several casting but it is not working

Thanks for your help
From: Family Tree Mike on
On 1/6/2010 5:13 PM, eliassal wrote:
> Hi I have a function in a dll that returns an object which I need to get
> somes items as follows
>
> public object[] CreateFacts(RuleSetInfo ruleSetInfo)
> {
> XmlDocument doc = new XmlDocument();
> //Loading the XML from xml file to be tested against rule.
> doc.Load(@_xmlDocToBeused);
> TypedXmlDocument txd = new TypedXmlDocument(_DocType, doc);
>
> //Preeapre facts object
> object[] facts = new object[1];
> facts[0] = txd;
>
> return facts;
> }
>
>
> In my app, I neeed to retrieve this 1st item, I am trying the following
>
> object fact = fc.CreateFacts(RSSetInfo);
>
> I need something like that
>
> TypedXmlDocument test = fact[0];
> but geting error indicating that "CAN NOT APPLY INDEXING WITH [0] to an
> expression of type object
>
> I tried several casting but it is not working
>
> Thanks for your help

Try:

object [] fact = fc.CreateFacts(RSSetInfo);

--
Mike
From: eliassal on
Thanks

"Family Tree Mike" wrote:

> On 1/6/2010 5:13 PM, eliassal wrote:
> > Hi I have a function in a dll that returns an object which I need to get
> > somes items as follows
> >
> > public object[] CreateFacts(RuleSetInfo ruleSetInfo)
> > {
> > XmlDocument doc = new XmlDocument();
> > //Loading the XML from xml file to be tested against rule.
> > doc.Load(@_xmlDocToBeused);
> > TypedXmlDocument txd = new TypedXmlDocument(_DocType, doc);
> >
> > //Preeapre facts object
> > object[] facts = new object[1];
> > facts[0] = txd;
> >
> > return facts;
> > }
> >
> >
> > In my app, I neeed to retrieve this 1st item, I am trying the following
> >
> > object fact = fc.CreateFacts(RSSetInfo);
> >
> > I need something like that
> >
> > TypedXmlDocument test = fact[0];
> > but geting error indicating that "CAN NOT APPLY INDEXING WITH [0] to an
> > expression of type object
> >
> > I tried several casting but it is not working
> >
> > Thanks for your help
>
> Try:
>
> object [] fact = fc.CreateFacts(RSSetInfo);
>
> --
> Mike
> .
>