public static void Main(string[] args) { PlotReceiver plot = new PlotReceiver(); Core obj = new Core(plot); executor obj1 = new executor(plot); obj1.errEvent += new executor.err(error); obj1.VisitLine("ubPlot(1,a,\"abc\",1D);vec[i]=i + 2;mat[i][j] = i + 2;"); }
//this is to know the type of invocation //public ProgWin() //{ // InitializeComponent(); // err.ProgWinError+=new ErrorNotification(ShowError); // keywords = FE.getKeywords(); //} public ProgWin(editorType e) { InitializeComponent(); et = e; err.ProgWinError += new ErrorNotification(ShowError); plot.image +=new PlotReceiver.BmpImage(EnablePlot); Controller = new executor(plot); Controller.resEvent +=new executor.result(Display); keywords = Controller.frontEnd.getKeywords(); err.SetExecutorObject(Controller); err.SetPlotObject(plot); }
public void SetExecutorObject(executor E) { Ex = E; Ex.errEvent +=new executor.err(ErrorMsg); }
//*** All the public functions ***// /// <summary> /// ProgWin Constructor /// </summary> /// <param name="e">editor type</param> /// <param name="sconn">Swarm Connection Object</param> /// <param name="ip">Self IP</param> /// <param name="port">Self Port</param> /// <param name="pid">PID of the program</param> /// <param name="uname">Self USername</param> public ProgWin(editorType e, SwarmConnection sconn, string ip, string port, string pid, string uname, string Prog) { InitializeComponent(); et = e; err.ProgWinError += new ErrorNotification(ShowError); plot.image += new PlotReceiver.BmpImage(EnablePlot); Controller = new executor(); Controller.resEvent += new executor.result(Display); keywords = Controller.frontEnd.getKeywords(); err.SetExecutorObject(Controller); err.SetPlotObject(plot); username = uname; progName = Prog; //Swarm Operations SC = sconn; SM = new SwarmMemory(SC); IP = ip; Port = port; PID = pid; SM.PermissionListCh += new SwarmMemory.PermissionListChanged(progUserListChange); SM.rnBtnClicked += new SwarmMemory.RunButtonClick(RunClicked); SM.srcChanged += new SwarmMemory.SourceCodeChanged(CollabEditing); SM.CloseP += new SwarmMemory.CloseProgram(SM_CloseP); SM.RerunP += new SwarmMemory.RerunProgram(SM_RerunP); SC.DisconnectChanged += new SwarmConnection.DisconnectEventHandler(SM_CloseP); SM.FinalResult += new SwarmMemory.GetFinalResult(SM_FinalResult); SM.createTheObjects(PID, IP, Port); //Finally the swarm memory object SC.InsertProgtoSC(SM); err.SetSwarmMemoryObject(SM); //Exec Operations Controller.setPlotObject(plot); Controller.setSMObject(SM); worker = new BackgroundWorker(); worker.DoWork += new DoWorkEventHandler(worker_DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); prog = new TextRange(rtbInput.Document.ContentStart, rtbInput.Document.ContentEnd).Text; userColor.Add(Colors.Brown); userColor.Add(Colors.Yellow); userColor.Add(Colors.Green); }