Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 12-15-2006, 07:53 PM   #1 (permalink)
Forum Expert
 
Khaz's Avatar
 
Join Date: Mar 2003
Posts: 1,754
Default DataBinding to Console standard output

I'm interested in binding the Text property of a Windows Form application's TextBox to the standard output stream of the Console.
The Form app will be run from RunUO, and so it will be tied to the RunUO console. I'd like to be able to display all the text that gets sent to the console there, as well as in the form's textbox.
I have something started:
Code:
m_MainForm.ConsoleTBox.DataBindings.Add( new Binding( "Text", /*object*/, /*object property*/ );
I've tried redirecting the console output to a StreamWriter, but that doesn't have any properties I can feasibly use.
I wouldn't mind creating a new listener, but I can't find any events sent by either the StreamWriter or the Console that tells me when the text/buffer has been changed.

Taking all advice! :P
__________________
"Misfortune shows those who are not really friends." -Aristotle
"A multitude of words is no proof of a prudent mind." -Thales
Khaz is offline   Reply With Quote
Old 12-16-2006, 02:49 AM   #2 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,763
Default

Quote:
Originally Posted by Khaz
I'm interested in binding the Text property of a Windows Form application's TextBox to the standard output stream of the Console.
The Form app will be run from RunUO, and so it will be tied to the RunUO console. I'd like to be able to display all the text that gets sent to the console there, as well as in the form's textbox.
I have something started:
Code:
m_MainForm.ConsoleTBox.DataBindings.Add( new Binding( "Text", /*object*/, /*object property*/ );
I've tried redirecting the console output to a StreamWriter, but that doesn't have any properties I can feasibly use.
I wouldn't mind creating a new listener, but I can't find any events sent by either the StreamWriter or the Console that tells me when the text/buffer has been changed.

Taking all advice! :P
You would hook a TextWriter that you make to the Consoles TextWriter, then when it sends the text you just Append it to the Textbox.

A little word of advice however, you will have BIGTIME issues doing this if the console doesnt exist. If it isnt there and a Console.ReadKey or ReadLine comes up the program freaks out and crashes cause theres no console. The only way around this is alot of editing of scripts and server core files.

Take my advice, do not edit anything in the core, create a remoting program that does this, a GUI remoting program is a better idea, and you can do just as many if not more things to the server this way. Its secure, and you can create different things that ur staff can do, for instance, remote login for GMs ,Admins, Devs and such. Take my advice as ive gone down this road and infact have a fully functional GUI Server with plugin support and all, but the speed decrease from running it with GUI is noticable and not worth the effort.

Just my 2 cents. Remote Client FTW.

-Jeff
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 12-16-2006, 04:09 AM   #3 (permalink)
Forum Expert
 
Join Date: Jul 2005
Location: Istanbul/Turkey
Age: 27
Posts: 425
Default

here is a good way of doing what you need. it is not exactly what are you are looking for, you will need some changes. and you might not need to change the core, but only add a few scripts. here
__________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
noobie is offline   Reply With Quote
Old 12-16-2006, 01:31 PM   #4 (permalink)
Forum Expert
 
Khaz's Avatar
 
Join Date: Mar 2003
Posts: 1,754
Default

Yeah, I'm not interested in modifying the core for this task. Thanks
__________________
"Misfortune shows those who are not really friends." -Aristotle
"A multitude of words is no proof of a prudent mind." -Thales
Khaz is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5