Critique my first C#.NET application

Soldato
Joined
12 Jun 2005
Posts
5,361
Hi there,

This is the first C# program I have created:

Download eSync

Download eSync Source

Basically - you choose two locations, change some of the options to suit yourself and it syncs the second directory, to match the first. Great if you have your music library in two locations for instance (which is why i created the program).

Being a VB man myself it's taken some time to get used to the syntax and having to explicitly convert everything the right data types yourself, although, now I have done it, I think that's one of the many great things about C#, despite the fact it was very annoying at the beginning.

Another thing I thought was good, was the fact it doesn't take into account newlines so you could make the code fit so you didn't have to scroll horizontally.

Anywho - for anyone who has learnt/is learning VB, i strongly suggest C#. I will be using it from now on when i can.

Thanks for looking.
 
Last edited:
One suggestion that I'd make, though, would be to move your sync logic outside your main form. It's usually best to have only display logic in your form classes.

I know what you are saying - and it makes sense - its just i don't know how i would do it.

Do you mean: create a whole new sync class with the background worker in it and handle all the sync in that class.
 
Pretty much, though I'd keep the thread management in the form class, as threading is a UI issue.

Hmm...well this is something new to me...could you explain how you'd go about it. I need the background worker reportprogress event to update the log - so how would i keep the background worker in the form and outsource the syncing to a class? Would i have to do cross-thread calls or something?

Sorry if that makes no sense - i've been drinking.

EDIT:

Yeah, i understand, it does make sense to move the sync logic, its just i thought it's not a big program....but if it was bigger, it does make sense - thanks.
 

Yeah that's what i meant by "cross-thread" calls....that's what I call it any ways. Thanks. I'll have a look at sorting that out later today.


Can't run the .exe here, say's it 'encountered a problem'. :(

Needs .NET 2. If you don't have that then it won't run. Its for windows only as well.

(It may require .NET 3 - but i don't think so.)
 
I also couldnt get it to compile - said something about a certificate issue or something? I don't have anything .Net 3 or above related on my machine...

Yeah - i don't know how to sort that out - its to do with a key...but i dont know how to get rid of the key.

Anyone know - its something to do with visual studios?
 
I was just messing around with moving the stuff to external classes and was wondering: where are the "Settings" actually stored?

I thought they might be stored in an external file, but it appears not, as there are no files created in the directory of the program, unless its stored in a different location?

Thanks.

EDIT:

Also does anyone a decent tutorial for working with databases in VS.NET 2005 (C# or VB).

EDIT Again:

Are settings "slower" to access than a variable. For instance, if i had a variable of boolean type and a settings of boolean type, would the variable be quicker to reference?
 
Last edited:
Back
Top Bottom