public virtual void Notify(DataIdentifier Identifier) { this.DataIdentifier = Identifier; if (this.communicationManager == null) { this.communicationManager = new CommunicationManager() { RemoteAddress = ModuleConfiguration.Default_MulticastAddress, RemotePort = ModuleConfiguration.Default_MulticastPort, LocalAddress = ModuleConfiguration.Default_LocalAddress, LocalPort = ModuleConfiguration.Default_LocalPort, TimeToLive = ModuleConfiguration.Default_TimeToLive, PipeName = ModuleConfiguration.Default_PipeName }; //this.communicationManager.Start(); this.communicationManager.Start((int)(ModuleConfiguration.Default_CommunicationType)); } byte[] data = CommonUtility.BinarySerialize(Identifier); //JsonUtility.JsonSerialize(Identifier, null, null); this.communicationManager.Send(data); }
private void saveAppState() { Dictionary <string, object> appState = new Dictionary <string, object>(); appState.Add("Namespace", this.textBoxNamespace.Text); appState.Add("ClassName", this.textBoxClassname.Text); appState.Add("AssemblyName", this.textBoxAssemblyName.Text); appState.Add("OutputDir", this.textBoxOutputDir.Text); appState.Add("ShouldCompile", this.checkBoxShouldCompile.Checked); appState.Add("FieldMappings", this.fieldMappins); byte[] appStateBytes = CommonUtility.BinarySerialize(appState); using (FileStream fileStream = new FileStream("appState.dat", FileMode.Create, FileAccess.Write, FileShare.Write)) { fileStream.Write(appStateBytes, 0, appStateBytes.Length); } }