How to customize an application which is console? - winforms

Sorry for the bad English. I'm new to C# and trying to develop an application that manages and controls some other console applications.
It gets console apps as Process.MainWindowHandle for input.
But what I need to know is: How can I change their Console.BackgroundColor property?
Thanks for helping me.

There is no easy way for communication between processes. However there are some options for doing that
Shared Memory
Reading from a common file and use FileWatcher
Using MSMQ
Using WCF using NetNamedPipeBinding

Related

Want to "screen-scrape" a Silverlight application

I have to use a cumbersome Silverlight application that I don't own and that I have to use as part of my job. In the past a web application that was painful to use I would just "screen-scrape" by doing direct posts, using a browser object to manipulate, call JS directly, but Silverlight doesn't make that possible as far as I know and the company that owns the application says a programmatic API for the application (WSDL/REST) is "something we are considering in the future". I'm sure someone has figured out how to do this but I'm not searching with the right key-words. Any help is GREATLY appreciated!
I am in the similar situation and saw ppl suggested something like `teststack' or 'white'. But i don't know how to use them yet.
One dumb way I can think of is to save the 'screen shots' as jpg files and use machine learning algorithm to 'read' the information you needed.

How are you integrating help into your WPF application. Any recommendations?

The question says it all really. If you are writing a WPF application, how are you integrating the application help? What is the state of play in mid-2013?
It seems that there is no clear answer to this from an afternoon with a search engine, but several options:
Write your own fancy tooltip based help (but where are you getting your data from?)
Use .CHM files and the Windows Forms help system (seems archaic to me).
Use Microsoft Help Viewer 1.X or Microsoft Help 2.0.
There is some confusion as to which is more recent / approved of by MS. It appear Help Viewer 1.X might be the recommended option over Microsoft Help 2.0. It doesn't help that the names are so similar...
What is the status of 2.0? Should we use it? Was it ever fully deployed?
Use a third-party product to author your help files and link to them somehow - DocToHelp/NetHelp, NetAdvantage on-line help, etc...
Furthermore, what XAML based mark-up / attributes are you using to provide the necessary context? What is the recommended method?
It seems surprising there is no clear path for supporting application based help in WPF.
My current preference is to use a third party help authorizing system to generate HTML based help.
We then use a WebBrowser to display this help as needed. The authoring system we use makes it fairly easy to extract out a single page from the main help (each "topic" is a single HTML file, and can be included with full contents or not as desired).
Granted, this definitely felt like a bit of a nasty hack at first - but once we wrote the basic plumbing (some attached properties for xaml to specify attributes for context location and add behavior to trigger help, etc), it's fairly clean.
One very nice advantage to this approach, however, is a single help system build works perfectly in all contexts - we can include the documentation online, expose it locally for use in a browser, and use it with context from within our application directly.

REST communication with WPF

I am trying to write a Help Desk Application.
The problem I am facing is how to put up a chat like communication between the REST service and my application. I am confused and a rookie as well.
All I know is GET(URI) and POST(URI) methods from which I get the XML.
Can anyone guide me in the right direction?
REST is probably not the best architectural style to build a chat application. You should look at protocols like XMPP and AMQP. They are much more suited to this two-way communication model.
You simply need to write a REST client in C#/.NET
WPF has nothing to do with your question. The post/get uri's will get you the data that needs to be presented. How it is presented is what you deal with using WPF, but the REST part itself is independent of any language/platform.

Options for Async Silverlight-to-WPF communication?

What's the fastest communication model for a Silverlight component communicating with a WPF component? That is, at the very least I'd like to consume an event from a Silverlight component in a WPF component.
I understand you can use WCF to build a bridge
I understand you can use Javascript to bridge from WPF -> Silverlight (and I have that working)
I understand you can use COM to go the other way (Silveright -> WPF)
However I'm looking for a tighter communication model (not using COM) - perhaps like EventAggregator (Silverlight component pubs, WPF component subs)...but I've only seen eventAggregation in WPF or Silverlight but not both at the same time.
Any ideas for creating such an eventAgg / eventBus, without using WCF, without using COM?
Open to any approaches / ideas; might be something I haven't considered.
Thanks.
Interesting challenge - could you provide a little more detail on why you need to do this?
My first question is: Are you envisioning these two apps running on the same machine, at the same time? Both are important.
If the answer is yes (same machine, both running) then you should be able to implement a solution using WCF, with the service self-hosted in the WPF app, the Silverlight client referencing it, and a cross-domain policy setup appropriately.
If the answer is yes, but not at the same time, then you'll need a third party, like a Message Bus, perhaps implemented as a Windows Service. NServiceBus comes to mind.
In any case, WCF really is the best solution for messaging in Silverlight. If you were going Silverlight app-to Silverlight app there is a mechanism for that that doesn't require WCF.
A message bus would give you the Event Aggregator functionality you're thinking of - a player who is always there to accept subscriptions and publications.
Another option (if running at the same time) is to elevate your Silverlight app to full-trust and use Sockets. See this link for more info (he provides an example that may be helpful).

Any good solutions for an integrated help system in WPF applications?

I'm just starting up a new, big project that will be using WPF for the front end. I'm looking for some kind of solution for an integrated help system. The basic use case for this is that the user needs to be able to reach context sensitive help at any time when using the system. The help content should be localized and displayed within the application (not popup an external .chm file).
I'm looking for real world experience in creating and/or using a third party system that can handle the complete flow for this, including a work flow for localizing the help content. Any input is appreciated! Thank you.
One suggestion is to compose help as FlowDocuments. They're simple to compose (and you can whip up an editor using RichTextBox. They can be stored as resources in your assembly and you just use a FlowDocumentReader to view them. That basically lets you fully integrate help into your app the way you want it without needing any external tools or controls.
How about using tooltips ? Wpf tooltips can have any kind of content... can't think of a more integrated help system ;o)
Here is an article by Pete O'Hanlon Easy help with WPF
I suppose you can customize this solution to fit your needs.
Is there a particular reason that you can't popup an external .chm file, or is it for aesthetic purposes? If you must wrap your own implementation, you might want to look at this article on Code Project. It's not WPF specific, but it should serve as a real starting point for you.

Resources