private void strokeBegin(bool erase) { activeStroke = new CairoStroke(erase?eraserStyle:penStyle); // Fix undo/redo strokes.RemoveRange(strokes.Count - undo, undo); undo = 0; strokes.Add(activeStroke); }
public void Deserialize(XmlTextReader xml) { Clear(); while (xml.Read()) { switch (xml.NodeType) { case XmlNodeType.Element: if (xml.Name == "handwriting-data") { break; } else if (xml.Name == "paper") { paper = Paper.Deserialize(xml); } else if (xml.Name == "strokes") { while (xml.Read()) { if (xml.NodeType == XmlNodeType.Element && xml.Name == "stroke") { CairoStroke stroke = new CairoStroke(xml); countPoints += stroke.Count; strokes.Add(stroke); } else if (xml.NodeType == XmlNodeType.EndElement) { break; } } } else { Console.WriteLine("Ignoring Unknown XML Element: {0}", xml.Name); } break; } } }
private void strokeEnd() { activeStroke = null; }
public void Deserialize(XmlTextReader xml) { Clear(); while(xml.Read()) { switch(xml.NodeType) { case XmlNodeType.Element: if(xml.Name == "handwriting-data") { break; } else if(xml.Name == "paper") { paper = Paper.Deserialize(xml); } else if(xml.Name == "strokes") { while(xml.Read()) { if(xml.NodeType == XmlNodeType.Element && xml.Name == "stroke") { CairoStroke stroke = new CairoStroke(xml); countPoints += stroke.Count; strokes.Add(stroke); } else if(xml.NodeType == XmlNodeType.EndElement) { break; } } } else { Console.WriteLine("Ignoring Unknown XML Element: {0}", xml.Name); } break; } } }