The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: Enumerating Block Contents (xAP Framework.NET)


  • Subject: RE: Enumerating Block Contents (xAP Framework.NET)
  • From: "Sullivan, Glenn" <gsullivan@xxxxxxxxxxxxxx>
  • Date: Fri, 24 Jun 2005 07:54:37 -0400

Perfect, thank you...

So I have a service that logs to my MSDE database... But to get it to
work, I had to create a user account for it to run under, since MSDE
installs with Windows Authentication Only as it's default.

Do you think I need to automate the "create a user" part of this?
 I
can, through the service installation routine, but the way I look at it,
anyone who can set up MSDE and actually access a datasource that they
have created probably has the brains to know how to create a user, no?

Glenn Sullivan, MCSE+I  MCDBA
David Clark Company Inc.
-----Original Message-----
From: xAP_developer@xxxxxxx
[mailto:xAP_developer@xxxxxxx]
On Behalf Of Stuart Booth
Sent: Thursday, June 23, 2005 6:59 PM
To: xAP_developer@xxxxxxx
Subject: Re: [xAP_developer] Enumerating Block Contents (xAP
Framework.NET)

On Thu, 23 Jun 2005 13:21:20 -0400, "Sullivan, Glenn"
<gsullivan@xxxxxxx> wrote:

>Is there an easy way to enumerate (separately) the value pairs of a xAP
>block, using xAP Framework.net?

That's an interesting question. This probably isn't as ideal or
obvious as it perhaps might be.

The answer is that both the message block object (of class
xAPMessageBlock) and a header (derived from class xAPHeaderBase)
inherit from DictionaryBase.

Thus you can foreach all the DictionaryEntry's in the block or header.
So to iterate the block contents (this is in C# rather than VB, sorry)

foreach (DictionaryEntry entry in event_args.Message.Body)
{
String keyword = (String)entry.Key;
xAPPairValue pair_value = (xAPPairValue)entry.Value;
}

This gives you the pair keyword and the pair value (which will either
be a xAPASCIIValue object if it's a plain "Name=Value" entry in
the
message, or a xAPBinaryValue).

Obtaining the value text from 'pair_value' is simple via the Value
property on the xAPPairValue object.

>Basically, is there a similar .Item(index as integer) property that I'm
>missing?

Sadly not I'm afraid. There's only message_block["PairName"]
which
returns the value part, and only when it's a "Name=Value" pair
(ASCII
vs Binary), it seems too. Hmmm.

I'll sort something out for the next release.

HTH,

S
--
Stuart Booth <stuart@xxxxxxx>
xAPFramework.NET - a xAP software development framework for .NET

http://www.xapautomation.org/ 
     http://www.xapframework.net/




xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.