示例#1
0
 /// <summary>
 /// constructor passing in four parameters
 /// </summary>
 /// <param name="id">id parameter</param>
 /// <param name="pcQueue">parameter for IPCQueue</param>
 /// <param name="configFile">parameter for ConfigData</param>
 /// <param name="IOhandler">paraemter for IConstituencyFileReader</param>
 public Producer(string id, IPCQueue pcQueue, ConfigData configFile, IConstituencyFileReader IOhandler)
 {
     this.id      = id;
     finished     = false; // Initially not finished
     this.pcQueue = pcQueue;
     //counter = 0; // Initial value for the work item counter]
     this.configFile = configFile;
     this.IOhandler  = IOhandler;
     (T = new Thread(run)).Start(); // Create a new thread for this producer and get it started
     RunningThreads++;              // Increment the number of running producer threads;
 }
示例#2
0
 public FormsBasedUI(IConstituencyFileReader IOhandler)
 {
     InitializeComponent();
     this.IOhandler = IOhandler;
 }
示例#3
0
        }                                                       // Result of the work, when null indicates that the work has not yet
        // been completed, note this is a read-only property

        public Work(ConfigRecord data, IConstituencyFileReader IOhandler) //extra param for IconstituencyIO
        {
            constituency      = null;                                     // Result of the work is initially null, this shows that the work has not yet been completed
            this.configRecord = data;                                     // Data is initialised when the work is instantiated
            this.IOhandler    = IOhandler;
        }