[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Ruby-WordNet 0.02

Michael Granger

9/14/2003 11:09:00 PM

Fellow Rubyists,

I'd like to announce the 0.02 release of Ruby-WordNet, a Ruby interface
to the WordNet® Lexical Database. WordNet is an online lexical
reference system whose design is inspired by current psycholinguistic
theories of human lexical memory. English nouns, verbs, adjectives and
adverbs are organized into synonym sets, each representing one
underlying lexical concept.

For more information, visit the project page at:

<http://www.deveiate.org/code/Ruby-WordNe...

Or you can download the module directly from:

<http://www.deveiate.org/code/Ruby-WordNet-0.02....

Thanks for reading.
--
Michael Granger <ged@FaerieMUD.org>
Rubymage, Believer, Architect
The FaerieMUD Consortium <http://www.FaerieMU...


3 Answers

Jim Hudson

2/14/2008 2:09:00 PM

0

Thanks for checking into this, Linda.

In my case, I can't use the TextChanged event for these text-boxes. The
validation has to be applied after the user has finished typing (thus, in the
Binding for my TextBox, I specify UpdateSourceTrigger="LostFocus"). What I
need is an event that will fire AFTER Binding updates the souce, and AFTER
the VaidationRule has been evaluated.

Any other idea?

--
Jim Hudson



Jim Hudson

2/14/2008 2:53:00 PM

0

Ahah!!! I thought about your suggestion, and tried a variation, and SOLVED
it!!

I should mention that I'm building my app with VS2008, and it's configured
to use .Net 3.5. The trick that I describe below may not work on .Net 3.0.

The trick is to set up the validation in XAML, as normal:

<TextBox x:Name="InputNameTextBox" >
<TextBox.Text>
<Binding Path="InputName" UpdateSourceTrigger="LostFocus">
<Binding.ValidationRules>
<NameValidationRule />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>

BUT, instead of hooking up a LostFocus handler in the XAML, I hook it up in
the code-behind:

InputNameTextBox.LostFocus += new
RoutedEventHandler(InputNameTextBox_LostFocus);

.
.
.

void InputNameTextBox_LostFocus(object sender, RoutedEventArgs e)
{
if (Validation.GetHasError(InputNameTextBox) ||
Validation.GetHasError(otherTextBox) ||
Validation.GetHasError(yetAnotherTextBox))
{
OKButton.IsEnabled = false;
CancelButton.IsDefault = true;
OKButton.IsDefault = false;
}
else
{
OKButton.IsEnabled = true;
CancelButton.IsDefault = false;
OKButton.IsDefault = true;
}
}

THEN, at runtime, the ValidationRule fires FIRST, FOLLOWED by the LostFocus
handler.

Thanks for your help!!
--
Jim Hudson


v-lliu

2/15/2008 2:02:00 AM

0

Hi Jim,

I'm glad to hear that you have solved the problem! Thank you for sharing
the solution with us. I think it will defintely benefit all of the readers
in the newsgroup!

If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance!

Have a nice day!

Sincerely,
Linda Liu
Microsoft Online Community Support