示例#1
0
 public SwarmMemory(SwarmConnection c)
 {
     Master = "";
     BackUp = "";
     conn = c;
     TaskIndexList = new List<int>();
     ResultCollection = new Hashtable();
     SubResultCollection = new Hashtable();
 }
示例#2
0
 public SwarmMemory(SwarmConnection c)
 {
     Master = "";
     BackUp = "";
     conn = c;
 }
示例#3
0
文件: Chat.cs 项目: shranjan/pinac
 public ChatModule(SwarmConnection SConn)
 {
     SC = SConn;
     SC.ChatChanged += new SwarmConnection.ChatEventHandler(ChatMsg);
 }
示例#4
0
        //***   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);
        }
示例#5
0
      /// <summary>
      /// Default constructor - Initializing the intial things
      /// </summary>
      // TODO check all the initializations
      public ProgConf(SwarmConnection SConn)
      {
          InitializeComponent();
          SC = SConn;
          ChatModule Chat = new ChatModule(SC);
          mnuProg.Visibility = Visibility.Visible;
          txtMessage.Focus();

          //Event Registrations
          err.ProgConfError += new ErrorNotification(ShowError);
          SC.ListChanged += new SwarmConnection.ChangedEventHandler(setUserList);
          SC.TransOwner += new SwarmConnection.PrivelageEventHandler(OwnerChanged);
          SC.ChngPermission += new SwarmConnection.PrivelageEventHandler(NewAccessPermission);
          SC.AddPrev += new SwarmConnection.PrivelageEventHandler(NewAccessPermission);
          Chat.Chat += new ChatNotification(DisplayChat);

          //Add paragraph to rich text box
          rtbChat.Document.Blocks.Add(p);
      }
示例#6
0
文件: Error.cs 项目: zuzhu/pinac
 public void SetSwarmConnectionObject(SwarmConnection s)
 {
     SC = s;
     SC.ErrorChanged +=new SwarmConnection.ErrorEventHandler(ErrorMsg);
 }