Jump to content
MakeWebGames

"Interactive" tutorials over C#


a_bertrand

Recommended Posts

WPF is a completely different API but you can of course use it instead of WinForms. For most things it will work, and actually work better than WinForms some stuff are not yet fully supported and you need to do some kind of "hacks" with the windows API to get the results you want.

Anyhow back to your question, I decided to use WinForms for that tutorial as it was then possible to run it on Linux too.

Link to comment
Share on other sites

I love that you are introducing new things to the community a_bertrand, and I also respect you very much as a developer.

But, could you give me a reason why I would want to go and study C# on a university level, when I already will be taught C(++), Java and RPG?

I am will defiantly mainly use linux and unix variants when I will go work for corporate companies. I haven't seen that many people use C# for unix development, so that is why I am asking.

Other than creating desktop windows applications(and fyi, in ZA they use RPG for it), which is native to C# if I'm not wrong, what would I really use it for when I have knowledge of Java and C?

On the one hand Java runs on anything, so does C++. With C# I will need to incorporate every little thing to suit Mac, Linux or *nix.

Link to comment
Share on other sites

I have no clue what RPG is is in this context Spudinski, anyhow let me try to answer some of your questions:

1) C# is mainly for windows, windows phone platforms. This is a fact, but it doesn't mean it doesn't work or it doesn't bring anything to Linux or Mac. For example, you can take the Unity 3D engine which is completely cross platform and yet uses C# as main language. Why? Because as language C# offers quiet a few improvements over Java and A TONS of improvement over C++.

2) C# / .NET can run and runs quiet well on Linux as well as Mac and on other platforms (android, iphone and more). For this Mono is the keyword, it's free and offer most of the .NET framework (which is huge) across those platforms.

3) C# is not only for desktop applications, it's great as web environment (honestly so far and currently I find it the best in this area), but you can also use it for SOAP services, back-ends, DB development on MS SQL, mobile development, game development and much much more.

4) C++ has his advantages but MANY drawbacks. Portability without some special framework is not an option in C++ actually, and GUI development, web development is certainly not the best for C++ developers.

5) Java has some advantages when it comes to running on multiple platforms, but honestly I don't find it anymore a great language, and it is certainly sub-par compared to C# / .NET

Now talking about Mac and Linux development you could check MonoDevelop but honestly it is way behind Visual Studio, and now the real question, why would you develop for Linux and Mac? Mac is a near dead market and linux is a good market only on the sever segment. A lot of enterprises uses C# and .NET environments actually... so you should maybe rethink about it ;)

Link to comment
Share on other sites

Ok I made the code for it in WPF and ASP.NET for the web service:

http://garg.web.nowhere-else.org/web/tutorials/SoapChat.zip

The client connect to the web server for the SOAP communication, the server is responsible to propagate the events. The client get updates ever 2 sec and parse them based on the kind of message.

If you kill the client, the server should kick the connection after about 10 sec.

So you mainly have a complete chat client and server. To fully test it, start at least 2 clients.

I didn't wrote so far any side tutorial / documentation as it takes me quiet some time for doing so, however the code itself is not complex and should be easy to read. Let me know what kind of info you need in case.

BTW, there is one special trick involving the "Dispatcher.BeginInvoke". In WPF or WinForms you cannot modify anything on the GUI from a background thread. If you need to do it (like we do as the poller is on a second thread) you need to synchronize the threads and basically fire the modifications from the thread which owns the GUI. The dispatcher is there for that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...