//A new stroke object named MyStroke is created. MyStroke is added to the StrokeCollection of the InkPresenter named MyIP private void MyIP_MouseLeftButtonDown(object sender, MouseEventArgs e) { MyIP.CaptureMouse(); if (eraseflag == true) { StylusPointCollection MyStylusPointCollection = new StylusPointCollection(); MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP)); NewStroke = new Stroke(MyStylusPointCollection); NewStroke.DrawingAttributes.Color = Colors.Red; MyIP.Strokes.Add(NewStroke); StylusPointCollection ErasePointCollection = new StylusPointCollection(); } else { StylusPointCollection pointErasePoints = e.StylusDevice.GetStylusPoints(MyIP); StrokeCollection hitStrokes = MyIP.Strokes.HitTest(pointErasePoints); if (hitStrokes.Count > 0) { foreach (Stroke hitStroke in hitStrokes) { MyIP.Strokes.Remove(hitStroke); //undoStack.Push(hitStroke); //undoStateBufferStack.Push(true); } } } }
private void MyIP_TouchDown(object sender, MouseEventArgs e) { MyIP.CaptureMouse(); StylusPointCollection MyStylusPointCollection = new StylusPointCollection(); MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP)); stroke = new Stroke(MyStylusPointCollection); stroke.DrawingAttributes.Color = color; MyIP.Strokes.Add(stroke); vibrate.Start(TimeSpan.FromMilliseconds(50)); }
private void doResolve(object sender, EventArgs e) { StreamReader input = new StreamReader(openFileDialog1.OpenFile()); string line = String.Empty; while ((line = input.ReadLine()) != null) { IPHostEntry MyHost = Dns.Resolve(line); textBox2.Text += line + "\r\n"; foreach (IPAddress MyIP in MyHost.AddressList) { textBox2.Text += ("\t" + MyIP.ToString() + "\r\n"); } } }
public Lobby(MyIP ip, string port, string player) : this(() => ip.CachedIPAddress.HasValue ? $"Host: {ip.CachedIPAddress.Value}:{port}" : "Resolving Host Address...", player) { }