static void Main(string[] args) { Console.Title = "HostB"; Console.ReadLine(); using (var sm = SharedMemory.Open("SM1")) { using (var r = sm.AsReader()) { Console.WriteLine(r.ReadInt32()); Console.WriteLine(r.ReadInt32()); Console.WriteLine(r.ReadInt32()); Console.WriteLine(r.ReadBytes(5).MakeString()); } } Console.ReadLine(); using (var sm2 = SharedMemory.Open("SM2")) { using (var r = sm2.AsReader(0L, 1L * 1024)) { Console.WriteLine(r.ReadBytes((int)r.Size).MakeString()); } Console.ReadLine(); using (var r = sm2.AsReader(1L * 1024, 1L * 1024)) { Console.WriteLine(r.ReadBytes((int)r.Size).MakeString()); } Console.ReadLine(); using (var r = sm2.AsReader(0L, 1L * 1024)) { Console.WriteLine(r.ReadBytes((int)r.Size).MakeString()); } Console.ReadLine(); } }
internal override void InitData() { _sharedMemory = new SharedMemory("FalconSharedMemoryArea"); _sharedMemory.Open(); _sharedMemory2 = new SharedMemory("FalconSharedMemoryArea2"); _sharedMemory2.Open(); }
void Profile_ProfileStarted(object sender, EventArgs e) { if (Parent != null && Parent.Profile != null && Parent.Profile.Interfaces.ContainsKey("Falcon")) { FalconInterface falconInterface = Parent.Profile.Interfaces["Falcon"] as FalconInterface; if (falconInterface != null) { ParseDatFile(falconInterface.CockpitDatFile); } } _textureMemory = new SharedMemory("FalconTexturesSharedMemoryArea"); _textureMemory.CheckValue = 0; _textureMemory.Open(); IsRunning = true; }