コード例 #1
0
        public void StartDocumentSharingReciever(MessageObject m)
        {
            try
            {
                if( NetworkManager.getInstance().profile.clientType==ClientType.ClientPresenter ||  NetworkManager.getInstance().profile.clientType==ClientType.ClientHost)
                {
                    m_bIsAllowedToAddAnnotations=true;
                    chkThumbNail.Checked = true;
                    this.btnNext.Visible=true;
                    this.btnPrev.Visible=true;

                    this.chkThumbNail.Visible=true;

                    this.btnFirst.Visible=true;
                    this.btnLast.Visible=true;
                    this.chkShowThumbNails.Visible=true;
                }
                else if( NetworkManager.getInstance().profile.clientType==ClientType.ClientAttendee)
                {

                    m_bIsAllowedToAddAnnotations=true;

                    chkThumbNail.Checked = false;
                    annotationBrowser.IsAttendee = true;
                    chkSynch.Visible = false;
                    IsAttendee = true;
                    AttendeeFormDocument();
                }

                WebMeeting.Common.DocumentSharing DocSharing = (WebMeeting.Common.DocumentSharing)m;
                m_DocumentMessage = DocSharing;
                this.sessionID = DocSharing.sessionID;
                switch(DocSharing.DocumentType)
                {
                    case DocumentMessageType.typeDocument:
                        SetDocumentAndPDFInterface();
                        break;
                    case DocumentMessageType.typePDF:
                        SetDocumentAndPDFInterface();
                        break;
                    case DocumentMessageType.typeExcel:
                        SetPresentationAndExcelInterface();
                        SetDocumentAndPDFInterface();
                    {
                        SetPresentationAndExcelInterface();
                        panelAnnotations.Visible = false;
                        nsButton1.Visible = false;
                        buttonDown.Visible = false;
                    }
                        break;
                    case DocumentMessageType.typePresentation:
                        SetPresentationAndExcelInterface();
                        SetDocumentAndPDFInterface();

                        break;
                };

                IntializationCompleted = true;
                SetControls(false);

                MessagePool.Add(m);
                m_bTerminated = false;
                RecieveThread = new Thread(new ThreadStart(RecieveThreadFunction));
                RecieveThread.Name = "StartDocumentSharingReciever Thread: RecieveThreadFunction()";
                RecieveThread.Start();
            }
            catch (WebException exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("documentSharingControl.cs ==> StartDocumentSharingInitiaterManageContent( line==> 1961",exp,null,false);
                //	MeetingAlerts alert=new MeetingAlerts();
                //	alert.ShowMessage(Alerts.MeetingAlerts.AlertType.NonFatal,this.Name + " Class : StartDocumentSharingReciever() function ," + ex.Source + " Source ," + ex.Message  ,true,false);
            }
        }
コード例 #2
0
        /// <summary>
        /// Processes a message in the queue
        /// </summary>
        /// <param name="obj"></param>
        private void ProcessMessage(MessageObject obj)
        {
            try
            {

                if(obj != null)
                {

                    WebMeeting.Common.DocumentSharing DocSharing = (WebMeeting.Common.DocumentSharing)obj;

                    DocumentSharingEx DocEx = new WebMeeting.Client.DocumentSharingEx(DocSharing.DocumentType,DocSharing.sessionID);
                    DocEx.OnStatusUpdateFunction = new WebMeeting.Client.DocumentSharingEx.OnStatusUpdate(OnStatusUpdate);

                    string localFilePath = this.DocumentFilePath;
                    SetControls(false);

            /////////////     ===============================================================//////////
            ///                                      By Zaeem uncomented
            /////////////     ===============================================================//////////

            /*
                    // used for downloading documents.

                    if(!m_DocumentDownloaded) // these checks are for ppt and xls sharing cause there can be Next and Previous movement messages
                    { // keep track if the presentation has already been downloaded don't download it again. just move the the current page of presentation
                        if(!DocEx.RecieveDocumentSharing(obj,out localFilePath)) //Failed
                        {
                            this.MessagePool.Remove(obj);

                            //						alert.ShowMessage(4,"Unable to download document to webserver","WebMeeting",MessageBoxButtons.OK,MessageBoxIcon.Error);
                            //Process failure

                            return;
                        }
                        else
                            this.m_DocumentDownloaded = true;

                        this.DocumentFilePath = localFilePath;

                        annotationBrowser.sheetsEventStores = new ArrayList();
                        annotationBrowser.sheetsEventStores.Add(annotationBrowser.eventStore);
                        // only for checking purpose
                        try
                        {
                            for(int i = 1 ;i < DocSharing.TotalPages ; i++) //Create Transparent Annotation windows over the
                                //browser control for drawing on each presentation page.
                            {
                                annotationBrowser.eventStore = new ArrayList();
                                annotationBrowser.sheetsEventStores.Add(annotationBrowser.eventStore );
                            }
                        }
                        catch(Exception ee)
                        {
                            annotationBrowser.eventStore = new ArrayList();
                            annotationBrowser.sheetsEventStores.Add(annotationBrowser.eventStore );
                            ee = ee;
                        }

                        this.documentTitle = Path.GetFileNameWithoutExtension(DocumentFilePath);
                        AddSaveMenus();

                    }
            */

            /////////////     ===============================================================//////////
            ///                                      End Block
            /////////////     ===============================================================//////////

                    /////////////

                    this.DocumentFilePath = localFilePath;
                    this.pictureCount = DocSharing.TotalPages;
                    //synchornizePPTAnnotations();
                    m_DocumentMessage = DocSharing;

                    switch(m_DocumentMessage.DocumentType)
                    {
                        case DocumentMessageType.typeDocument:
                        {//Load the Word Document
                            object oUrl = m_DocumentMessage.DownloadURL;
                            object o = new object();
                            if(!m_bVisited)
                            {
                                this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                                lblStatus.Text ="Document " + Path.GetFileName(this.DocumentFilePath);
                                m_bVisited = true;
                            }

                        }
                            break;
                        case DocumentMessageType.typePresentation:
                        {
            //							this.DocumentFilePath = localFilePath;
            //							localFilePath = Directory.GetParent(localFilePath).FullName;
                            //object oUrl = localFilePath + "\\slide" +
                            object oUrl = m_DocumentMessage.DownloadURL+DocSharing.CurrentPage.ToString() + ".jpg";
                            object o = new object();

                            if(currentImage != m_DocumentMessage.CurrentPage)
                            {
                                if(File.Exists(strLocalPath+"\\"+DocSharing.CurrentPage.ToString() + ".jpg"))
                                {
                                    oUrl=strLocalPath+"\\"+DocSharing.CurrentPage.ToString() + ".jpg";
                                    this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                                }
                                else
                                    this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                            }

                            currentImage = m_DocumentMessage.CurrentPage;
                            pictureCount = m_DocumentMessage.TotalPages;
                            /////////////////////////////////////////

                            annotationBrowser.currentSlideNo=currentImage ;
                            /////////////////////////////////////////
                            lblStatus.Text = "Slide " + currentImage.ToString() + " of " + pictureCount.ToString();

                        }break;
                        case DocumentMessageType.typePDF:
                        {
                            //object oUrl = Path.GetDirectoryName(localFilePath) + "\\"+  Path.GetFileNameWithoutExtension(localFilePath) + "\\index.htm";
                            object oUrl=this.m_DocumentMessage.DownloadURL;
                            object o = new object();
                            if(!m_bVisited)
                            {
                                this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                                m_bVisited = true;
                            }
                        }
                            break;
                        case DocumentMessageType.typeExcel:
                        {
                            object oUrl = m_DocumentMessage.DownloadURL;
                            object o = new object();
                            if((this.pictureCount == 1) || (m_DocumentMessage.TotalPages == 1))
                            {
                                lblStatus.Text = "Book 1 of 1";
                                this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                            }
                            else
                            {

                                string basePath = m_DocumentMessage.DownloadURL;
                                //string basePath = Path.GetDirectoryName(localFilePath);
                                //basePath +=  "\\" + Path.GetFileNameWithoutExtension(localFilePath) + "_files\\sheet";
                                //currentImage+=1;
                                if(this.m_DocumentMessage.CurrentPage > 10)
                                    basePath += this.m_DocumentMessage.CurrentPage.ToString() + ".htm";
                                else
                                    basePath += "00" +  this.m_DocumentMessage.CurrentPage.ToString() + ".htm";
                                //MessageBox.Show(basePath);

                                oUrl = basePath;
                                if(!m_bVisited)
                                {
                                    this.axWebBrowser1.Navigate2(ref oUrl,ref o,ref o,ref o,ref o);
                                    lblStatus.Text = "Book " + currentImage.ToString() + " of " + pictureCount.ToString();
                                    if(this.m_DocumentMessage.TotalPages==1)
                                        m_bVisited =true;

                                }

                            }

                        }
                            break;
                    }
                    SetControls(true);
                    lblStatus.Visible = false;

                    if(m_bOwnerofthisControl)
                    {
                        btnOptions.Visible = true;
                        btnOptions.Enabled = true;
                        btnOptions.Top = btnLast.Top+4;
                        //chkSynch.Visible = true;
                    }
                    else
                    {
                        btnOptions.Visible = false;

                    }
                    chkThumbNail.Enabled =  m_bIsAllowedToAddAnnotations;

                    if(this.documentType == DocumentMessageType.typePresentation && chkThumbnail==false)
                    {
                        try
                        {
                            if(ClientUI.getInstance().IsShowThumbnails())/*check either we need to display thumnails or not*/
                            {
                                createThumbnailThread = new Thread(new ThreadStart(CreateThumbnails));
                                createThumbnailThread.Name = "createThumbnailThread() : documentSharingControl";
                                createThumbnailThread.Start();
                            }
                        }
                        catch(Exception ex)
                        {
                            ex = ex;
                        }
                        //CreateThumbnails();

                        chkThumbnail=true;
                        this.panelAnnotations.Height=65;
                    }

                }
            }
            catch (WebException exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("documentSharingControl.cs ==>ProcessMessage( line==> 2265",exp,null,false);
                //MeetingAlerts alert=new MeetingAlerts();
                //alert.ShowMessage(Alerts.MeetingAlerts.AlertType.NonFatal,this.Name + " Class : ProcessMessage() function ," + ex.Source + " Source ," + ex.Message  ,true,false);
            }
        }
コード例 #3
0
        private void DocumentSharingThread()
        {
            //string strExt=".ppt";
            int no_of_RemoteFiles=8;
            string strPostRemoteUrl="";
            bool isRemoteUrlExist=false;
            string recordid="";
            MessageObject objMsg ;
            FileInfo theinfo;

            try
            {
                if(!this.IsLaunchFromMangeContent)
                {//in case false-----check manage content slideshow
                    //run when document is shared using menus.
                    //string Extension =strExt;//Path.GetExtension(DocumentFilePath);
                    string filename=Path.GetFileName(DocumentFilePath);
                    filenamed=Path.GetFileNameWithoutExtension(DocumentFilePath);
                    DocumentFilePath_temp=DocumentFilePath;
                    string Extension =Path.GetExtension(DocumentFilePath_temp);

                    theFile=new FileInfo(filename);

                    // 10 Mb Check
                    if((theFile.Length/1048576)>10)
                    {
                        MeetingAlerts alert=new MeetingAlerts();
                        alert.ShowMessage(Alerts.MeetingAlerts.AlertType.Info,"The size of this file is greater then 10Mb which may take time to Upload ",true,false);

                    }
                    //filenamed+=theFile.LastAccessTime.ToFileTime().ToString();

                    filenamed+=theFile.LastWriteTime.ToFileTime().ToString();
                    filenamed=filenamed.Replace('.','z');
                    filenamed=filenamed+Extension;
                    theFile.CopyTo(filenamed,true);
                    DocumentFilePath=Path.GetDirectoryName(DocumentFilePath)+@"\"+filenamed;
                    //DocumentFilePath=Path.GetFullPath(DocumentFilePath)+@"\"+filenamed;
                    Extension =Path.GetExtension(DocumentFilePath_temp);
                    //DocumentFilePath+=Extension
                    Extension = Extension.ToLower();

                    if(Extension == ".doc" ||Extension == ".docx")
                    {
                        documentType = DocumentMessageType.typeDocument;
                        strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                    }
                    else if(Extension == ".xls" ||Extension == ".xlsx")
                    {
                        documentType = DocumentMessageType.typeExcel;
                        if(no_of_RemoteFiles==1)
                            strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                        else
                            strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+"_files/sheet";
                    }
                    else if(Extension == ".ppt" || Extension == ".pptx")
                    {
                        documentType = DocumentMessageType.typePresentation;
                        // German PPT
                        //strPostRemoteUrl="/Folie";
                        strPostRemoteUrl="/slide";
                    }
                    else if(Extension == ".pdf")
                    {
                        documentType = DocumentMessageType.typePDF;
                        strPostRemoteUrl="/index.htm";
                    }

                    theinfo=new FileInfo(this.DocumentFilePath);
                    recordid=Client.ClientUI.getInstance().findRecord(Path.GetFileName(this.DocumentFilePath),theinfo.LastWriteTime.ToShortDateString().ToString());
                    if(recordid!="-1")
                        isRemoteUrlExist=true;
                    else
                    {
                        strLocalPath="";
                        isRemoteUrlExist=false;
                    }

                    //         Zaeem
                    if(isRemoteUrlExist==false)
                    {
                        DocumentSharingEx docEx = new WebMeeting.Client.DocumentSharingEx(
                            documentType,this.sessionID,Info.getInstance().FtpIP,Info.getInstance().UserName,
                            Info.getInstance().Password,Info.getInstance().ConferenceID);

                        docEx.OnStatusUpdateFunction = new WebMeeting.Client.DocumentSharingEx.OnStatusUpdate(OnStatusUpdate);
                        //MessageObject objMsg ;

                        //			docEx.DocumentShareStart(DocumentFilePath,out objMsg);

                        if(!docEx.DocumentShareStart(DocumentFilePath,out objMsg))
                        {
                            //Handle the failure;
                            MeetingAlerts alert=new MeetingAlerts();
                            alert.ShowMessage(Alerts.MeetingAlerts.AlertType.Info,"Unable to upload document to webserver",true,false);
                            return;
                        }
                        //						if(WebMeeting.Client.ClientUI.getInstance().InsertNewRecord(filename,((DocumentSharing)objMsg).DownloadURL,this.DocumentFilePath,((DocumentSharing)objMsg).TotalPages,((DocumentSharing)objMsg).DocumentType.ToString(),this.sessionID))
                        //							MessageBox.Show("Record Inserted");
                        //						else
                        //							MessageBox.Show("Record Not Inserted");
                        //
                        if(Extension == ".doc" ||Extension == ".docx")
                        {
                            documentType = DocumentMessageType.typeDocument;
                            strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                        }
                        else if(Extension == ".xls" || Extension == ".xlsx")
                        {
                            documentType = DocumentMessageType.typeExcel;

                            if(((DocumentSharing)objMsg).TotalPages==1)
                                //if()
                                strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                            else
                                strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+"_files/sheet";
                        }
                        else if(Extension == ".ppt" || Extension == ".pptx")
                        {
                            documentType = DocumentMessageType.typePresentation;
                            // German PPT
                            //strPostRemoteUrl="/Folie";
                            strPostRemoteUrl="/slide";
                        }
                        else if(Extension == ".pdf")
                        {
                            documentType = DocumentMessageType.typePDF;
                            strPostRemoteUrl="/index.htm";
                        }

                        IntializationCompleted = true;
                        //((DocumentSharing)objMsg).TotalPages=no_of_RemoteFiles;

                        ((DocumentSharing)objMsg).DownloadURL+=strPostRemoteUrl;
                        //MessageBox.Show("==>((DocumentSharing)objMsg).DownloadURL"+((DocumentSharing)objMsg).DownloadURL);
                        this.pictureCount = ((DocumentSharing)objMsg).TotalPages;
                        //theinfo=new FileInfo(this.DocumentFilePath);
                        Client.ClientUI.getInstance().InsertNewRecord(Path.GetFileName(DocumentFilePath),((DocumentSharing)objMsg).DownloadURL, Application.StartupPath +"\\" + this.sessionID.ToString()  ,((DocumentSharing)objMsg).TotalPages,((DocumentSharing)objMsg).DocumentType.ToString(),this.sessionID,theinfo.LastWriteTime.ToShortDateString().ToString());
                        theinfo=null;
                    }
                        ////////////               BY Zaeem                     ///////
                    else
                    {
                        DocumentSharing msg=new DocumentSharing();
                        objMsg=msg;
                        DataRow drShareMessage;
                        drShareMessage=Client.ClientUI.getInstance().getRecord(Convert.ToInt32(recordid));
                        string Extsion =Path.GetExtension(drShareMessage["FileName"].ToString());
                        this.strLocalPath=drShareMessage["LocalPath"].ToString();
                        if(Extsion == ".doc" ||Extsion == ".docx")
                        {
                            ((DocumentSharing)objMsg).DocumentType= DocumentMessageType.typeDocument;
                            //strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                        }
                        else if(Extsion == ".xls" || Extsion == ".xlsx")
                        {
                            ((DocumentSharing)objMsg).DocumentType= DocumentMessageType.typeExcel;
                            //							if(no_of_RemoteFiles==1)
                            //								strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+".htm";
                            //							else
                            //								strPostRemoteUrl="/"+Path.GetFileNameWithoutExtension(DocumentFilePath)+"_files/sheet";
                        }
                        else if(Extsion == ".ppt" || Extsion == ".pptx")
                        {
                            ((DocumentSharing)objMsg).DocumentType= DocumentMessageType.typePresentation;
                            //	strPostRemoteUrl="/slide";
                        }
                        else if(Extsion == ".pdf")
                        {
                            ((DocumentSharing)objMsg).DocumentType= DocumentMessageType.typePDF;
                            //	strPostRemoteUrl="/index.htm";
                        }
                        this.documentType=((DocumentSharing)objMsg).DocumentType;
                        //drShareMessage["LocalPath"]
                        ((DocumentSharing)objMsg).SenderID= NetworkManager.getInstance().profile.ClientId;
                        ((DocumentSharing)objMsg).ConferenceID=NetworkManager.getInstance().profile.ConferenceID;
                        ((DocumentSharing)objMsg).senderProfile=NetworkManager.getInstance().profile;
                        //((DocumentSharing)objMsg).ConferenceID=Info.getInstance().ConferenceID;
                        ((DocumentSharing)objMsg).sessionID=Convert.ToInt32(drShareMessage["Session"].ToString());
                        ((DocumentSharing)objMsg).DocumentSharingSessionId=Convert.ToInt32(drShareMessage["Session"].ToString());
                        ((DocumentSharing)objMsg).CurrentPage=1;
                        //						((DocumentSharing)objMsg).MessageType=
                        ((DocumentSharing)objMsg).nScrollX=0;
                        ((DocumentSharing)objMsg).nScrollY=0;
                        this.sessionID=	Convert.ToInt32(drShareMessage["Session"].ToString());
                        IntializationCompleted = true;
                        //drShareMessage["Session"]
                        ((DocumentSharing)objMsg).TotalPages=Convert.ToInt32(drShareMessage["TotalPages"]);
                        ((DocumentSharing)objMsg).DownloadURL=drShareMessage["RemoteURL"].ToString();

                        this.pictureCount = ((DocumentSharing)objMsg).TotalPages;
                        drShareMessage=null;
                    }

                    ProcessMessage(objMsg); //TODO:: optimized way is to add this mssg to poll and let thread do it
                    //but this causses file sharing error while same machine testing

                    //MessagePool.Add(objMsg);
                    NetworkManager.getInstance().SendMessage(objMsg);
                }//end if
                else
                {//start else
                    //runs when document sharing starts from manage content slideshow page

                    string Extension = this.strExtension;//Path.GetExtension(DocumentFilePath);
                    Extension = Extension.ToLower();

                    if(Extension == ".doc" || Extension == ".docx")
                        documentType = DocumentMessageType.typeDocument;
                    else if(Extension == ".xls" || Extension == ".xlsx")
                        documentType = DocumentMessageType.typeExcel;
                    else if(Extension == ".ppt" || Extension == ".pptx")
                        documentType = DocumentMessageType.typePresentation;
                    else if(Extension == ".pdf")
                        documentType = DocumentMessageType.typePDF;

                    //					DocumentSharingEx docEx = new WebMeeting.Client.DocumentSharingEx(
                    //						documentType,this.sessionID,Info.getInstance().FtpIP,Info.getInstance().UserName,
                    //						Info.getInstance().Password,Info.getInstance().ConferenceID);

                    //					docEx.OnStatusUpdateFunction = new WebMeeting.Client.DocumentSharingEx.OnStatusUpdate(OnStatusUpdate);
                    //					MessageObject objMsg ;

                    //			docEx.DocumentShareStart(DocumentFilePath,out objMsg);

                    NetworkManager networkMngr = NetworkManager.getInstance();
                    WebMeeting.Common.DocumentSharing message = new WebMeeting.Common.DocumentSharing();
                    message.SenderID = networkMngr.profile.ClientId;
                    message.senderProfile = networkMngr.profile;
                    message.sessionID = this.sessionID;
                    message.DocumentSharingSessionId = this.sessionID;
                    message.DownloadURL = "Already Downloaded," + this.strRemoteUrl;
                    message.DocumentType = documentType;
                    message.CurrentPage=1;
                    message.TotalPages=this.no_of_pages;

                    /*if(!docEx.DocumentShareStart(DocumentFilePath,out objMsg))
                    {
                        //Handle the failure;
                        MeetingAlerts alert=new MeetingAlerts();
                        alert.ShowMessage(Alerts.MeetingAlerts.AlertType.Info,"Unable to upload document to webserver",true,false);
                        return;
                    }*/

                    IntializationCompleted = true;
                    //this.pictureCount = ((DocumentSharing)objMsg).TotalPages; //  by junaid for now
                    this.m_DocumentDownloaded=true;
                    this.ProcessMessageManageContent(message); //TODO:: optimized way is to add this mssg to poll and let thread do it
                    //but this causses file sharing error while same machine testing
                    this.m_DocumentMessage=	message;
                    message.DownloadURL="Already Downloaded," + message.DownloadURL;
                    //MessagePool.Add(objMsg);
                    NetworkManager.getInstance().SendMessage(message);
                }//end else

            }
            catch (WebException err)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("documentSharingControl.cs ==> DocumentSharingThread() line==> 1773",err,null,false);
                //MeetingAlerts alert=new MeetingAlerts();
                //alert.ShowMessage(Alerts.MeetingAlerts.AlertType.NonFatal,this.Name + " Class : DocumentSharingThread() function ," + ex.Source + " Source ," + ex.Message ,true,false);
            }

            finally
            {
                try
                {
                    theFile=new FileInfo(filenamed);
                    theFile.Delete();
                }
                catch(Exception exp){}
            }
        }
コード例 #4
0
 private void annotationBrowser_OnScroll(int nVScroll, int nHScroll)
 {
     try
     {
         lastScrolPos.X = nHScroll;
         lastScrolPos.Y = nVScroll;
         if(!IsAttendee && chkSynch.Checked)
         {
             DocumentSharing _msg = new DocumentSharing();
             _msg.bEnabled = m_DocumentMessage.bEnabled;
             _msg.CurrentPage = m_DocumentMessage.CurrentPage;
             _msg.DocumentSharingSessionId = m_DocumentMessage.DocumentSharingSessionId;
             _msg.DocumentType = m_DocumentMessage.DocumentType;
             _msg.DownloadURL = m_DocumentMessage.DownloadURL;
             _msg.MessageType = m_DocumentMessage.MessageType;
             _msg.nScrollX = nHScroll;
             _msg.nScrollY = nVScroll;
             _msg.SenderID = m_DocumentMessage.SenderID;
             _msg.senderProfile= m_DocumentMessage.senderProfile;
             _msg.sessionID= m_DocumentMessage.sessionID;
             _msg.TotalPages= m_DocumentMessage.TotalPages;
             _msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID ;
             scrollMessages.Add(_msg);
             //scrollMessagesArray.Add(_msg);
         }
     }
     catch (WebException exp)
     {
         WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("documentSharingControl.cs ==>annotationBrowser_OnScroll( line==> 2684",exp,null,false);
         //MeetingAlerts alert=new MeetingAlerts();
         //alert.ShowMessage(Alerts.MeetingAlerts.AlertType.NonFatal,this.Name + " Class : annotationBrowser_OnScroll() function ," + ex.Source + " Source ," + ex.Message  ,true,false);
     }
 }
コード例 #5
0
ファイル: conferenceRoom.cs プロジェクト: zaeem/FlexCollab
        /// <summary>
        /// Convert Presentation Document.
        /// </summary>
        /// <param name="strPath"></param>
        /// <param name="savePath"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool ConvertPresentationDocument(string strPath, string savePath,ref DocumentSharing msg)
        {
            try
            {
                PowerPoint.Application	ppApp;
                PowerPoint.PpSaveAsFileType format;
                format= PowerPoint.PpSaveAsFileType.ppSaveAsJPG;//.ppSaveAsJPG;
                try
                {

                    ppApp= new PowerPoint.Application();
                    ppApp.Presentations.Open(strPath,Microsoft.Office.Core.MsoTriState.msoCTrue,Microsoft.Office.Core.MsoTriState.msoCTrue,Microsoft.Office.Core.MsoTriState.msoFalse);
                }
                catch(Exception ee)
                {
                    Console.Write("Unable to convert PowerPoint document " + ee.Message);
                    return false;
                }

                try
                {
                    ppApp.Presentations.Item(1).SaveAs(savePath,format,Microsoft.Office.Core.MsoTriState.msoCTrue);
                    ppApp.Presentations.Item(1).Close();
                    //ConvertBMPToJPG(savePath);
                    ppApp.Quit();
                    System.Threading.Thread.Sleep(500);
                    string[] files = Directory.GetFiles(savePath,"*.jpg");
                    if(files != null)
                    {
                        msg.TotalPages = files.Length;
                        //Console.WriteLine("No of Files in presentation ::::"+files.Length.ToString());
                    }
                    else
                    {
                        msg.CurrentPage = 1;
                        msg.TotalPages =1;
                    }
                    //Thread.Sleep(500);
                    return true;

                }
                catch(Exception ee)
                {
                    string errorText = "Unable to save specified Presentation. Access is denied. "+ ee.Message;
                    Console.Write("Unable to convert Powerpoint Document " + errorText);
                    return false;
                }
            }
            catch(Exception ee)
            {
                Console.Write("Unable to Convert PowerPoint Document. " + ee.Message);
                return false;
            }
        }
コード例 #6
0
ファイル: conferenceRoom.cs プロジェクト: zaeem/FlexCollab
        /// <summary>
        /// Convert Excel Document
        /// </summary>
        /// <param name="strPath"></param>
        /// <param name="savePath"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool ConvertExcelDocument(string strPath,string savePath,ref DocumentSharing msg)
        {
            try
            {
                if(ExcelDocument(strPath,savePath))
                {
                    System.Threading.Thread.Sleep(1000);

                    string temp2= Directory.GetParent(savePath).FullName + "\\" + Path.GetFileNameWithoutExtension(strPath) + "_Files";
                    Console.WriteLine("Remote Directory of Excel..... "+temp2);
                    try
                    {
                        msg.TotalPages = 1;
                        msg.CurrentPage = 1;
                        if(Directory.Exists(temp2))
                        {
                            string[] strfiles = Directory.GetFiles(temp2,"sheet*.htm");
                            if(strfiles != null)
                            {
                                foreach (string strfile in strfiles)
                                {
                                    byte[] buffer = ReadFile(strfile);
                                    string str ;//= buffer.ToString();

                                    System.Text.UTF8Encoding a = new System.Text.UTF8Encoding();
                                    str =a.GetString(buffer,0,buffer.Length);
                                    string toFind = "window.name!=\"frSheet\"";
                                    int nStart = str.IndexOf(toFind);
                                    str  = str.Replace(toFind,"1 != 1");
                                    WriteFile(str,strfile);
                                }
                                //Console.WriteLine("No of Sheet Files::::" + strfiles.Length.ToString());
                                msg.TotalPages = strfiles.Length;
                                msg.CurrentPage = 1;
                            }
                            else
                            {
                                msg.TotalPages = 1;
                                msg.CurrentPage = 1;
                            }
                        }
                        return true;
                    }
                    catch(Exception ee)
                    {
                        Console.WriteLine("Exception in the procedure of Excel Documentation"+ ee.ToString());
                    }
                }

            }
            catch(Exception ee)
            {
            }
            return false;
        }