예제 #1
0
        /// <summary>
        /// Handle the reception of an EraseType. This is used to handle the eraser icon 
        /// that removes all strokes on the screen.
        /// </summary>
        /// <param name="eraseReceived">Contains the erase type. Right now there is
        /// only EraseAll, but it might be extended later on</param>
        private void RTFrameReceived(RTFrame rtFrameReceived)
        {
            if ( rtFrameReceived.ObjectTypeIdentifier == new Guid(RTDocumentHelper.constEraseAllGuid)
                && crntPage != Guid.Empty )
            {
                // Delete all strokes on this page
                ArrayList strokes = (ArrayList)this.strokesPerPage[crntPage];

                StringBuilder importData = new StringBuilder(2000);
                XmlTextWriter xml = CreateInitdXml(importData);

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

                foreach( Guid strokeID in strokes )
                {
                    xml.WriteStartElement( "Object" );
                    xml.WriteAttributeString( "guid", strokeID.ToString("B") );
                    xml.WriteElementString( "Delete", String.Empty );
                    xml.WriteEndElement(); // end Object
                }

                xml.WriteEndDocument();

                string finalData = importData.ToString();
                LogAsLastCommand( finalData );
                importer.Import( finalData );
            }
            else if( (!this.IsSender) && (rtFrameReceived.ObjectTypeIdentifier == new Guid(constOpenRemoteGuid)) )
            {
                RemoteFileOpenReceived((string)rtFrameReceived.Object);
            }
        }
 /// <summary>
 /// Handle the reception of an rtFrame object. This is used to handle the erase all 
 /// message that removes all strokes on the screen.
 /// </summary>
 private void RTFrameReceived(RTFrame rtFrameReceived)
 {
     if (rtFrameReceived.ObjectTypeIdentifier != Guid.Empty)
     {
         // If receive a delete all stroke message
         if (rtFrameReceived.ObjectTypeIdentifier == new Guid(RTDocumentHelper.constEraseAllGuid))
         {
             // Delete all stroke
             DeleteAllStrokes();
         } 
             // This code is to request remote capa to open a a local rtd file
             // rtFrameReceived.object contains the string path to the file to open
             // Pri1: This code is temporary
         else if ((!presentationCapability.IsSending) &&
             (rtFrameReceived.ObjectTypeIdentifier == new Guid(constOpenRemoteGuid)))
         {
             openLocalFile((string)rtFrameReceived.Object);
         }
             // JCB: Removed
             // This code is to exits the remote capability viewer when the initiator exits
             // Pri1: This feature and is going to be removed, because it will be taking care at the networking level
         else if ((!presentationCapability.IsSender) &&
             (rtFrameReceived.ObjectTypeIdentifier == new Guid(constExitRemoteGuid)))
         {
             // Exit the viewer capability
             // Pri1: This will be taking care at the networking level
             this.Close();
         }
         else if(rtFrameReceived.ObjectTypeIdentifier == new Guid(RTDocumentHelper.constResendTocGuid))
         {
             rtDocumentHelper.SendDocumentBody();
         }
     }
 }