Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Y

yunusdemiray

@yunusdemiray
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • threading and timercallback
    Y yunusdemiray

    bool stop = false;
    ...
    Thread t = new Thread(new ThreadStart(run)){IsBackground = true}.Start();
    ...

    private void run(){
    while(!stop){
    Thread.Sleep(60000);
    MonitorFunc();
    }
    }

    C# help question

  • Killing a process
    Y yunusdemiray

    How do you create excell processes? System.Diagnostics.Process.Start("...") Something like that? If so save the process that you create.

    List list = new List();
    Process p = System.Diagnostics.Process.Start("...");
    list.Add(p);
    ...
    list[i].Kill();

    :)

    C# question csharp

  • Multi thread, one dialog form [modified]
    Y yunusdemiray

    Hi, i have a problem about threads with windows forms. When users's sessions ended, i want to show a dialog box to inform them to relogin and then to show the relogin form. It was ok until i use threads in some forms to improve performance. When a thread reveices a session error, it shows the relogin form. Actualy i use invoke on the main thread. But while the dialog form is shown, another thread can make a service call and receive the same session error and so tries to show the same relogin form. But it is clear that only one instance of relogin form must be shown at the same time. So i have to use a locking mechanism. But since the thread that shows the dialog box is the main thread, this causes the main thread enter wait state. So the application freezes.

    public bool Relogin() {
    	Interlocked.Increment(ref waitingThreadCount);
    	event1.WaitOne();/\*Auto Reset Event\*/
    	if(this.loginResult == null) {/\*login result is type of bool?\*/
    		loginResult = ReloginForm.Show();//Runs as modal
    	}
    	Interlocked.Decrement(ref waitingThreadCount);
    	if(waitingThreadCount == 0) {
    		loginResult = null;
    	}
    	event1.Set();
    	return loginResult.Value;
    }
    

    modified on Thursday, June 11, 2009 2:40 AM

    C# help winforms performance question code-review
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups