private void CreateOrUpdateFile(string path, string content, bool partialOverride) { Directory.CreateDirectory(path.ContainingDirectory()); if (partialOverride) { content = Marker.Update(File.Exists(path) ? File.ReadAllText(path) : string.Empty, content); } File.WriteAllText(path, content); }
protected override void Update(GameTime gameTime) { base.Update(gameTime); if (MySplineWalker != null && MySplineWalker.Initialized) { MySplineWalker.Update(gameTime); } if (MySplineMarker != null && MySplineMarker.Initialized) { MySplineMarker.Update(gameTime); } }
void HandleTUIOMsg() { List <TUIOMsg> msgs; lock (locker) { msgs = new List <TUIOMsg>(tuioMsgList); tuioMsgList.Clear(); } addMarkers.Clear(); updateMarkers.Clear(); removeMarkers.Clear(); foreach (var msg in msgs) { switch (msg.eventType) { case 0: case 1: { if (mMarkerDictionary.ContainsKey(msg.id) == false) { Marker m = new Marker(Tuio2Screen(msg.x, msg.y), MathUtil.StandardizeAngle(Mathf.Rad2Deg * msg.angle), msg.classID, msg.id); mMarkerDictionary.Add(m.guid, m); addMarkers.Add(m); } else { Marker m = mMarkerDictionary[msg.id]; m.Update(Tuio2Screen(msg.x, msg.y), MathUtil.StandardizeAngle(Mathf.Rad2Deg * msg.angle)); updateMarkers.Add(m); } } break; case 2: { if (mMarkerDictionary.ContainsKey(msg.id)) { Marker m = mMarkerDictionary[msg.id]; mMarkerDictionary.Remove(msg.id); removeMarkers.Add(m); } } break; default: break; } } }