예제 #1
0
        //<Snippet3>
        // Accepts a string that contains ink data in ink
        // serialized format (ISF) and converts it into a StrokeCollection.
        public void LoadStrokes()
        {
            StrokeCollectionConverter converter =
                new StrokeCollectionConverter();

            if (converter.CanConvertFrom(typeof(string)))
            {
                StrokeCollection newStrokes =
                    (StrokeCollection)converter.ConvertFrom(null, null, strokesString);
                presenter.Strokes.Clear();
                presenter.Strokes.Add(newStrokes);
            }
        }
예제 #2
0
파일: InkEraser.cs 프로젝트: wzchua/docs
    public InkEraser()
    {
        presenter    = new InkPresenter();
        this.Content = presenter;

        // Create a StrokeCollection the string and add it to
        StrokeCollectionConverter converter =
            new StrokeCollectionConverter();

        if (converter.CanConvertFrom(typeof(string)))
        {
            StrokeCollection newStrokes =
                converter.ConvertFrom(strokesString) as StrokeCollection;
            presenter.Strokes.Clear();
            presenter.Strokes.Add(newStrokes);
        }
    }