private void HandleStateChange(object sender, TypeEventArgs args) { if (args.Type.GetInterface("IState") != null) { RequestStateChange(args.Type); } }
private void getData() { string args; new Task(() => { if (tcpClient.Connected) { stream = tcpClient.GetStream(); reader = new BinaryReader(stream); } while (tcpClient.Connected) { try { args = reader.ReadString(); Debug.Write(args); } catch (Exception ex) { break; } TypeEventArgs e = JsonConvert.DeserializeObject <TypeEventArgs>(args); OnDataRecived?.Invoke(this, e); } }).Start(); }
public void send(object sender, TypeEventArgs e) { string args = JsonConvert.SerializeObject(e); new Task(() => { if (tcpClient.Connected) { stream = tcpClient.GetStream(); writer = new BinaryWriter(stream); try { mutex.WaitOne(); writer.Write(args); mutex.ReleaseMutex(); } catch (Exception exc) { mutex.ReleaseMutex(); return; } } }).Start(); }
public void sendToServer(string data, CommandEnum command) { string[] args = new string[1]; args[0] = data; TypeEventArgs e = new TypeEventArgs((int)command, args); sendData?.Invoke(this, e); }
protected void UpdateProgress(TypeEventArgs e) { var status = string.Format("Performing analysis for {0}: {1} states, {2} transitions", e.EpaBuilder.Type.Name, e.EpaBuilder.States.Count, e.EpaBuilder.Transitions.Count); UpdateStatus(status); UpdateOutput(status); }
private void Navigator_ItemAdd(object sender, TypeEventArgs e) { this.m_SelectLast = true; Iocomp.Classes.CollectionBase collectionBase = base.WorkingInstance as Iocomp.Classes.CollectionBase; object value = GPFunctions.CreateInstance(e.Type, e.Type.FullName); ((IList)collectionBase).Add(value); base.Master.ForceDirtyUpdate(null); }
public LogModel() { logsList = new List <Log>(); webClient = WebClient.singeltonClient(); sendData += webClient.send; webClient.OnDataRecived += GetDataFromServer; TypeEventArgs e = new TypeEventArgs((int)CommandEnum.LogCommand, null); sendData?.Invoke(this, e); }
//Сменить тип отображаемых кривых private void ChangeGraphType(object sender, TypeEventArgs e) { outsType = e.type; var gItems = (List <GraphItem>)mDataModel.GetTypedItems(outsType); var gl = (GraphsList)CurveDisplayController; var gToDraw = gItems.FindAll((x) => x.enabled == true); GraphicsAdapter.instance.Fill(gItems); gl.ResetCurvelist(gItems); GraphicsAdapter.instance.ResetTitles(outsType); //GraphicsAdapter.instance. }
public void Execute_RaisesClassContextBeingProcessed() { _codeManagerDynamicMock.Stub(stub => stub.FlushCodeToDisk()).Return(new string[0]); object eventSender = null; TypeEventArgs eventArgs = null; _mixer.TypeBeingProcessed += (sender, args) => { eventSender = sender; eventArgs = args; }; _mixer.Execute(_configuration); Assert.That(eventSender, Is.SameAs(_mixer)); Assert.That(eventArgs.Type, Is.SameAs(_fakeMixedType)); }
private void updateAppconfig(TypeEventArgs e) { string[] data = e.Args; this.OutputDir = data[0]; this.SourceName = data[1]; this.LogName = data[2]; this.Thumbnail = data[3]; for (int i = 4; i < data.Length; i++) { addHandler(data[i]); } }
private void GetDataFromServer(object sender, TypeEventArgs e) { int type = e.TypeArgs; switch (type) { case (int)CommandEnum.LogCommand: massageLog(e.Args); break; case (int)CommandEnum.NewFileCommand: LogFile(e.Args); break; } }
//private int _counter; private void OnTypeLoaded(object sender, TypeEventArgs e) { var type = e.Type; if (IsLinked(type)) { FireTypeLinked(type); } else { LinkType(type); } //Debug.WriteLine((++_counter) + ":" + e.Type.FullName); }
public void getFromServer(object sender, TypeEventArgs e) { int type = e.TypeArgs; switch (type) { case (int)CommandEnum.GetConfigCommand: updateAppconfig(e); break; case (int)CommandEnum.CloseCommand: removeHandler(e); break; } }
public void getFile() { TypeEventArgs e = new TypeEventArgs((int)CommandEnum.LogCommand, null); sendData?.Invoke(this, e); }
private void OnTypeLinked(object sender, TypeEventArgs e) { RegisterType(e.Type); }
private void removeHandler(TypeEventArgs e) { string handler = e.Args[0]; this.handlers.Remove(handler); }