Пример #1
0
        /// <summary>
        /// Handle the reception of an RTStrokeRemove object.
        /// </summary>
        /// <param name="rtStrokeRemove">Stroke to remove</param>
        private void RTStrokeRemoveReceived(RTStrokeRemove rtStrokeRemove)
        {
            // Remove the stroke ID from the arraylist of strokes for that page
            ((ArrayList)strokesPerPage[rtStrokeRemove.PageIdentifier]).Remove(rtStrokeRemove.StrokeIdentifier);

            // Get the remove id & call delete on it
            StringBuilder importData = new StringBuilder(2000);
            XmlTextWriter xml = CreateInitdXml(importData);

            xml.WriteStartElement( "PlaceObjects" );
            xml.WriteAttributeString( "pagePath", crntONFile );
            xml.WriteAttributeString( "pageGuid", rtStrokeRemove.PageIdentifier.ToString("B") );

            xml.WriteStartElement( "Object" );
            xml.WriteAttributeString( "guid", rtStrokeRemove.StrokeIdentifier.ToString("B") );
            xml.WriteElementString( "Delete", String.Empty );

            xml.WriteEndDocument();

            string finalData = importData.ToString();
            LogAsLastCommand( finalData );
            importer.Import( finalData );
        }
        /// <summary>
        /// Handle the reception of an RTStrokeRemove object.
        /// </summary>
        /// <param name="rtStrokeRemove">Stroke to remove</param>
        private void RTStrokeRemoveReceived(RTStrokeRemove rtStrokeRemove)
        {
            Log("StrokeRemove ID:" + rtStrokeRemove.StrokeIdentifier.ToString());
            
            // Get the id of the stroke to remove
            // Lookup in inkOverlay.Ink.Strokes if there is a stroke with this id
            // if so, delete it programatically
            Guid rtStrokeRemoveGuid = rtStrokeRemove.StrokeIdentifier;
            if (RemoveStroke(rtStrokeRemoveGuid))
            {
                this.Refresh();
            }

            // Pri3: else log it / except / assert (or something)
        }