コード例 #1
0
ファイル: Form1.cs プロジェクト: brett-johnson/prototypes
 public Form1()
 {
     InitializeComponent();
       mCurrentFileName = "";
       mUpdated = false;
       textBoxOutput.Text = "";
       mWaitCursorCounter = new WaitCounter();
       mWaitCursorCounter.mValue = 0;
       tooltip = new ToolTip();
       tooltip.AutoPopDelay = 2000;
       tooltip.InitialDelay = 1000;
       tooltip.ReshowDelay = 500;
       tooltip.ShowAlways = true;
       tooltip.SetToolTip(buttonNew, "New Project");
       tooltip.SetToolTip(buttonOpen, "Open Project");
       tooltip.SetToolTip(buttonSave, "Save Project");
       tooltip.SetToolTip(buttonBuild, "Build Project");
       tooltip.SetToolTip(buttonClean, "Clean Project");
       tooltip.SetToolTip(buttonFind, "Find Driveclient Location");
 }
コード例 #2
0
    static void Main(string[] args)
    {
        Random      r       = new Random();
        WaitCounter counter = new WaitCounter();

        A[] arr = new A[10];
        for (int i = 0; i < arr.Length; i++)
        {
            arr[i] = new A(r.Next(2000, 5000), counter);
        }
        for (int i = 0; i < arr.Length; i++)
        {
            new Thread(arr[i].SomeFunc).Start();
        }
        while (counter.Counter < 5)
        {
            counter.Wait();
        }
        Console.WriteLine("{0} threads called set", counter.Counter);
        Thread.Sleep(7000);
        Console.WriteLine("{0} threads called set", counter.Counter);
    }
コード例 #3
0
ファイル: Form1.cs プロジェクト: brett-johnson/prototypes
 public CursorScopedWait(ref WaitCounter counter)
 {
     mCounter = counter;
     mCounter.mValue++;
     Cursor.Current = Cursors.WaitCursor;
 }
コード例 #4
0
 public A(int duration, WaitCounter counter)
 {
     id            = ID++;
     this.duration = duration;
     this.counter  = counter;
 }