[program-l] Re: Telling a C# implementation of SayTools to in fact UseSAPI

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Tue, 3 Mar 2009 16:38:31 -0500 (EST)

Hi Jim,
I think there are one or two Java ones, but try not to let that
discourage additional contributions.  Someone else can approach it
differently, code it more elegantly, or explain it better, etc.

Jamal

On Tue, 3 Mar
2009, Corbett, James wrote:

> Date: Tue, 3 Mar 2009 16:29:39 -0500
> From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
> Reply-To: program-l@xxxxxxxxxxxxx
> To: program-l@xxxxxxxxxxxxx
> Subject: [program-l] Re: Telling a C# implementation of SayTools to in
>     fact UseSAPI
>
> Jamil:
>
> Has anyone attempted a Java Fruit Basket?
>
> Jim
>
> -----Original Message-----
> From: program-l-bounce@xxxxxxxxxxxxx
> [mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of Jamal Mazrui
> Sent: March 3, 2009 16:18
> To: Program-l
> Subject: [program-l] Re: Telling a C# implementation of SayTools to in
> fact UseSAPI
>
> Late-bound COM automation can be tedious to code in C#!  In case it's
> helpful, the EdSharp source code (within EdSharp.cs) includes a Com
> class that makes things a bit easier.  In your example, try using the
> BindingFlags.SetProperty constant instead.
>
> By the way, you seem to have done more WPF programming with a screen
> reader than anyone I know.  Would you consider writing a "fruit basket"
> program that illustrates this framework?
>
> As you may know, folks on the list ProgrammingBlind@xxxxxxxxxxxxx
> developed a set of criteria for a sample GUI program, and have
> encouraged its implementation in various languages.  This allows someone
> considering a language to get a sense of what coding in it is like and
> what the resulting accessibility might be of a program.  The web site
> with criteria and implementations is
>
> http://FruitBasketDemo.AlacornComputer.com
>
> Cheers,
> Jamal
>
> On Tue, 3 Mar 2009,
> Jacob Kruger wrote:
>
> > Date: Tue, 3 Mar 2009 15:36:11 +0200
> > From: Jacob Kruger <jacobk@xxxxxxxxxxxx>
> > Reply-To: program-l@xxxxxxxxxxxxx
> > To: Program-l <program-l@xxxxxxxxxxxxx>
> > Subject: [program-l] Telling a C# implementation of SayTools to in
> fact
> >     UseSAPI
> >
> > Hi there
> >
> > While now again looking into WPF etc., I have put together a small
> > class to render a better description caption for various objects etc.
> > from within the WPF applications, and it makes use of what they call
> > event bubbling so that I just added an event handler for GotFocus to
> > the window class, and in that event code I send e.OriginalSource to
> > the other class that I then included in the application, and this gets
>
> > specifically sent to a method called SayObject, wherein I'm in fact
> > doing a switch based on the
> > Object.GetType.ToString() function to see what type of object it is,
> > and then getting Jaws etc. to say extra info relating to it's content
> etc. etc.
> >
> > The primary idea is that while I wouldn't want to get it to
> > necessarily speak extra unless the user was actually running a
> > screenreader, I was just wondering about in fact telling it to use
> SAPI as a backup in any case.
> >
> > Basically, the small bit of code from within Jamal's example code for
> > making it say something looks like the following:
> > Type t = Type.GetTypeFromProgID("Say.Tools");
> > object oST = Activator.CreateInstance(t); string sText = "Hello
> > world"; object[] aParams = {sText}; t.InvokeMember("Say",
> > BindingFlags.InvokeMethod, null, oST, aParams);
> >
> > I tried adding in the following 2 lines of code above the actual
> > invokeMember above to tell it to in fact use SAPI as a backup, but it
> > just generates errors relating to invalid execution or something (not
> > at that machine right now):
> > object[] aParams1 = {1};
> > t.InvokeMember("UseSAPIAsBackup", BindingFlags.InvokeMethod, null,
> > oST, aParams1);
> >
> > Maybe I'm just not used enough to C# syntax, or something, but I have
> > checked the cases of the methods/functions/variable names as much as I
>
> > can, so not sure why it doesn't want to do this.
> >
> > Since I'm also sort of busy migrating to C# from VB.Net, it would also
>
> > be best for me to figure this one out now already though.
> >
> > TIA
> >
> > Jacob Kruger
> > Blind Biker
> > Skype: BlindZA
> > '...fate had broken his body, but not his spirit...'
> >
> > ** To leave the list, click on the immediately-following link:-
> > ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> > ** If this link doesn't work then send a message to:
> > ** program-l-request@xxxxxxxxxxxxx
> > ** and in the Subject line type
> > ** unsubscribe
> > ** For other list commands such as vacation mode, click on the
> > ** immediately-following link:-
> > ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> > ** or send a message, to
> > ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
> >
> ** To leave the list, click on the immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> ** If this link doesn't work then send a message to:
> ** program-l-request@xxxxxxxxxxxxx
> ** and in the Subject line type
> ** unsubscribe
> ** For other list commands such as vacation mode, click on the
> ** immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> ** or send a message, to
> ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
> ** To leave the list, click on the immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
> ** If this link doesn't work then send a message to:
> ** program-l-request@xxxxxxxxxxxxx
> ** and in the Subject line type
> ** unsubscribe
> ** For other list commands such as vacation mode, click on the
> ** immediately-following link:-
> ** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
> ** or send a message, to
> ** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
>
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: