static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            File           f = new File();
            FileController c = new FileController(f);  // controls access to File f

            // start two threads, one for the reader and one for the writer:
            new Thread(ReaderThread).Start(c);
            new Thread(WriterThread).Start(c);
            // the main thread is still running:
            MessageBox.Show("System initiated.");
        }
Beispiel #2
0
        private Status state;     // STATE VARIABLE --- remembers if the form
        // is in act of reading the file

        public RForm(FileController c)
        {
            this.c = c;
            state  = Status.Closed;
            InitializeComponent();
        }
Beispiel #3
0
        private Status state = Status.Closed; // STATE VARIABLE: remembers if form
        // is in process of writing file

        public WForm(FileController c)
        {
            this.c = c;
            InitializeComponent();
        }