Not exactly. Create an abstract class Tools, with methods for Start, Stop ...

Then create a derivated class for Electric, another one for Hydrolic and so on.
Derivated classes inherit the properties and methods defined in the abstract class.
Eventually, you may override these properties and methods in the derivated class, if a distinct processing is needed.

For instance, if the Start method is distinct for Hydrolic and Electric, you can override the Start method in each of these classes.

See MSDN for more information :
http://msdn.microsoft.com/en-us/library/k535acbf(VS.71).aspx

in c#, you may use an abstract class for Tools and a derivated class for each of the tools.

homeboy commented: So, I just create classes abstract for Tools (Electric, Hydraulic & Mechanic) and derivated class for Started, Stopped & Stopped urgently. Am I right ? +0

1) Install mono on your Linux system
2) copy you program .exe (for instance myProgram.exe) and associated dll from Visual udio onto the Linux.
3) In Linux type the command :
mono myProgram.exe
4) See ... what happens.

Again, you must add a reference to the namespace where your form is.

"Add a reference" is an option of VS that can be triggered in several ways, for instance in VS2010 :

  • in the solution explorer, right click the name of your project. A menu will appear, select "Add a reference".
  • Select your projet; in the Project tag of VS main menu, select "Add a reference" ...
  • in solution explorer, select your project, select "reference", right click it ...

First, in the server project, you must add a reference to the client namespace (if the two project are not in the same namespace).

Then you can start the form as usual, for instance :

            Application.Run(new Form2());

Must'n you close the file after writing ?

I have noticed that when I install a new .NET program (using msi file) on a slow computer, this program needs a lot of time for its first execution. Once the first run is done, if I restart the same program, execution time is normal (even after restarting the computer). So, it seems that during the very first execution, some special treatment is done by the CLR.

Any ideas about the cause of this phenomenon ?

I did something similar in the past. I had a rather hard time making it works. I suggest the following :

  • get the child window handle from the Process object (MainWindowHandle property)
  • set this window as the foreground window using SetForegroundWindow (unmanaged function)
  • loop until GetForegroundWindow() is true, then use SendKeys to send your message to the child window.

Sorry, Robby, I cannot write the program for you. If you have a specific question, somebody will be pleased to help, but "what's next ?" sounds a little vague, doesn't it ?

In order to select a file for reading, see the class OpenFileDialog
See MSDN at msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog(VS.80).aspx

is rec instanciated ?

I confirm that such a program can be easily written in C#. Try to do it. If you have problem, we will be pleased to help.

See CodeProject at http://www.codeproject.com/
They have serveral articles about load balancing.

There are several way to share data beween applications. I would suggest communication via a port (UDPCLient for instance, easy to implement).

Shared memory is a solution when you have important volume of data to exchange (bitmap) but I fear you have to write a dll in non managed code for this.

You can try the Clipboard class that allow to write and read the containt of the clipboard. It is very simple to implement but I am a little suspicious with using the clipboard because it is shared by all applications.

You can use a string, it is an object.
If you absolutely need an int, you can create a small class :

public class Tag {public int value = 0;}

that you use in your form :

Tag tag = new Tag {value = 12};
this.button1.Tag = tag;

When a thread encounter the instruction Monitor.Enter(block)

  • if the memory block is not locked, the thread lock the variable and continue the execution.
  • if the memory block is locked by another thread, the present thread will stop until memory is unlocked.
    The Monitor.Exit(block) will unlock the memory.
    So, if you enclose your sensible code between a Monitor.Enter and a Monitor.Exit, I think it will do what you asked.

The global variable block can be tested and modified by both workers. This may be unsafe.
I suggest to use Monitor class to lock the variable before using it :
For instance :
Monitor.Enter(block);
block = "busy";
Monitor.Exit(block);

Hi,

I suggest you to develop a very useful system. The goal of this system will be to answer to question such as “I am a student in … and want an idea of a graduation project in the field of ...”.

The system will use a database containing worlds related to the field, such as “database, factory method, concurrent, web server, Sylverlight, Linux, webcam, speech recognition, ASP.NET ...”.
It will randomly select 5 of these items and Google them. Then it will analyze the results and determine if some interesting idea come out of it.

ddanbe commented: Like!!! +14

With .Net, you have two types of variables that will be usefull to solve your problem :
DateTime and TimeSpan. The last one is the difference between two DateTime. So you can write something like :
DateTime t1;
DateTime t2;
TimeSpan delta = t2 - t1;

TimeSpan embarks a bunch of methods to convert into differents units.

            String userDate = "10/13/2012";
            try
            {
                Convert.ToDateTime(userDate);
            }
            catch (System.Exception ex)
            {
                // Error message ...
            }

Alternatively, you may declare static the variable isMyFormValid.

If your stack A and B are located in distinct threads, each of these thread can write in a common C stack. But you must lock the C stack before writing in it. For this, I use Monitor.Enter(Cstack) to lock and Monitor.Exit(Cstack) when done, to free the data. Is this Monitor class clear for you ?

Hi,
It sounds so obvious that I probably miss the question :
Create another stack C.
Dequeue the first element from A (=>1) and B(=>5)
Compare these elements and enqueue the smaller into C (=>1)
Dequeue a new element from A (=>2) (because you have used the previous element from A)
And so on, when A and B are empty, you have a sorted stack C.
Patrick.

Hi,
It sounds so obvious that I probably miss the question :
Create another stack C.
Dequeue the first element from A (=>1) and B(=>5)
Compare these elements and enqueue the smaller into C (=>1)
Dequeue a new element from A (=>2) (because you have used the previous element from A)
And so on, when A and B are empty, you have a sorted stack C.

Hi,

I guess I had a similar issue, that I solved like this :
In the main thread, I want to start a new WindowsForm :

  Thread t = new Thread(StartMyForm);
  t.TrySetApartmentState(ApartmentState.STA);
  t.Start();

And

public static void  StartMyForm()
        {
            Application.Run(new MyForm(..));
        }

Hope it may help.
Patrick.

Hi guys,

According to Frédéric Elie, in Ondes de surfaces des liquides, the wave speed, in infinitely deep water is

c = sqrt ( g lambda / (2 PI))
where
c is the speed of the phase
g = gravity acceleration = 9.8 m / s²

If you can read french http://fred.elie.free.fr/ondes_surface_liquide.pdf

Regards.
Patrick.