Exemple #1
0
        private void textBox1_Leave(object sender, System.EventArgs e)
        {
            try
            {

                #region Module selection
                if(module==enum_Module.Whiteboard)
                {
                    msg.moduleType=Common.enum_Module.Whiteboard;
                }
                else if(module==enum_Module.Appshare)
                {
                    msg.moduleType=Common.enum_Module.Appshare;
                }
                else if(module==enum_Module.Webshare)
                {
                    msg.moduleType=Common.enum_Module.Webshare;
                }

                #endregion

                msg.ConferenceID = WebMeeting.Client.NetworkManager.thisInstance.profile.ConferenceID ;

                msg.start=this.textBox1.Location;//mouseDownPos;
                msg.end=this.textBox1.Location;
                msg.tool=(ushort)enum_WhiteboardToolCode.Text;//tool;
                msg.c=WebMeeting.Client.NetworkManager.thisInstance.profile.m_AssignedColor;
                msg.font= WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont;
                msg.thickness=this.lineThickness;

                msg.text=this.textBox1.Text;
                this.MsgPool_Annotation.Add(msg);
                this.MsgPool_SendAnnotation.Add(msg);
                msg.txtSize = localCopyOfFont.Size;

                msg.txtItalics =WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont.Italic;
                msg.txtBold = WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont.Bold;
                msg.txtUnderline = WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont.Underline;
                msg.FontFamily = WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont.Name;

                WebMeeting.Client.NetworkManager network = NetworkManager.thisInstance;
                msg.SenderID = NetworkManager.thisInstance.profile.ClientId;;
                msg.nSessionId = nSessionId;

                this.MsgPool_SendAnnotation.Add(msg);
                //network.SendLoadPacket(msg);
                this.textBox1.Text="";
                this.tool=enum_WhiteboardToolCode.None;
            }
            catch(Exception ex)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: whiteboard private void textBox1_Leave(object sender, System.EventArgs e)",ex,"",false);
                //Trace.WriteLine("private void textBox1_Leave(object sender, System.EventArgs e)"+" exception string :::: "+ex.ToString()+" stack trace ::: " +ex.StackTrace+" Message ::: "  +ex.Message);
            }
        }
Exemple #2
0
        private void _picBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            try
            {

                if(e.Button==MouseButtons.Left  )
                {

                    Thread.Sleep(10);
                    color = NetworkManager.thisInstance.profile.m_AssignedColor;
                    tool= (enum_WhiteboardToolCode)ClientUI.getInstance().whiteBoard.tool;

                    #region Module selection
                    if(module==enum_Module.Whiteboard)
                    {
                        msg.moduleType=Common.enum_Module.Whiteboard;
                    }
                    else if(module==enum_Module.Appshare)
                    {
                        msg.moduleType=Common.enum_Module.Appshare;
                    }
                    else if(module==enum_Module.Webshare)
                    {
                        msg.moduleType=Common.enum_Module.Webshare;
                    }

                    #endregion

                    if(this.tool==enum_WhiteboardToolCode.Brush )
                    {

                        DrawBrush(mouseLastPos_OnDown, new Point(e.X,e.Y),msg.c,msg.thickness);
                        msg.lst_Points.Add(mouseLastPos_OnDown);
                        this._picBox.Refresh();
                        this._picBox.Update();
                        Thread.Sleep(20);
                        this.mouseLastPos_OnDown=new Point(e.X,e.Y);

                    }

                    else if(this.tool==enum_WhiteboardToolCode.Pencil)
                    {
                        DrawPencil(mouseLastPos_OnDown, new Point(e.X,e.Y),msg.c,msg.thickness);
                        msg.lst_Points.Add(mouseLastPos_OnDown);
                        this._picBox.Refresh();
                        this._picBox.Update();
                        Thread.Sleep(20);
                        this.mouseLastPos_OnDown=new Point(e.X,e.Y);

                    }

                }
            }
            catch(Exception ex)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: whiteboard private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)",ex,"",false);

            }
        }
Exemple #3
0
        /// <summary>
        /// This method is for those tools which require explicit left click 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _picBox_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            this.flag_SendingThread=true;

            try
            {

                if(e.Button==MouseButtons.Left)
                {
                    color = NetworkManager.thisInstance.profile.m_AssignedColor;
                    tool= (enum_WhiteboardToolCode)ClientUI.getInstance().whiteBoard.tool;

                    #region Module selection
                    if(module==enum_Module.Whiteboard)
                    {
                        msg.moduleType=Common.enum_Module.Whiteboard;
                    }
                    else if(module==enum_Module.Appshare)
                    {
                        msg.moduleType=Common.enum_Module.Appshare;
                    }
                    else if(module==enum_Module.Webshare)
                    {
                        msg.moduleType=Common.enum_Module.Webshare;
                    }

                    #endregion

                    // To take the current mouse poisition
                    mouseCurrentPos.X=e.X;
                    mouseCurrentPos.Y=e.Y;

                    if((ushort)enum_WhiteboardToolCode.Brush==(ushort)tool ||   (ushort)enum_WhiteboardToolCode.Pencil==(ushort)tool)
                    {
                        //this.MsgPool_Annotation.Add(msg);
                        msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID ;
                        msg.SenderID =  NetworkManager.thisInstance.profile.ClientId;
                        msg.nSessionId = nSessionId;
                        msg.tool=(ushort)tool;
                        msg.c=this.color;

                        this.MsgPool_Annotation.Add(msg);
                        this.MsgPool_SendAnnotation.Add(msg);

                    }
                    else if(((ushort)tool & (ushort)( enum_WhiteboardToolCode.Eraser |enum_WhiteboardToolCode.PlaceHolderArrow)) == (ushort)tool)
                    {
                        //msg=new MsgAnnotation_Generic();
                        msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID ;
                        msg.start=new Point(mouseDownPos.X , mouseDownPos.Y); // new for checking why points are not new
                        msg.end=new Point(e.X,e.Y);
                        msg.tool=(ushort)tool;
                        msg.c=this.color;
                        msg.thickness=ClientUI.getInstance().whiteBoard.LineThickness;
                        msg.pencilLastPoint=new Point(this.pencilLastPoint.X,this.pencilLastPoint.Y);
                        msg.SenderID =  NetworkManager.thisInstance.profile.ClientId;

                        msg.nSessionId = nSessionId;
                        msg.text=NetworkManager.thisInstance.profile.Name;

                        this.MsgPool_Annotation.Add(msg);
                        this.MsgPool_SendAnnotation.Add(msg);

                        this._picBox.Refresh();
                        this._picBox.Update();

                    }
                    else
                    {
                        if((ushort)tool!=(ushort)enum_WhiteboardToolCode.Text)
                        {
                            msg.start=new Point(mouseDownPos.X , mouseDownPos.Y); // check here for new points
                            msg.end=new Point(e.X,e.Y);
                            msg.tool=(ushort)tool;
                            msg.c=this.color;

                            //msg.thickness=this.lineThickness;
                            msg.thickness=WebMeeting.Client.ClientUI.getInstance().whiteBoard.LineThickness;
                            msg.nSessionId = nSessionId;
                            msg.SenderID = NetworkManager.thisInstance.profile.ClientId;

                            this.MsgPool_Annotation.Add(msg);
                            this.MsgPool_SendAnnotation.Add(msg);

                            //WebMeeting.Client.NetworkManager network = NetworkManager.thisInstance;
                            //sendingArrayList.Add(msg);
                        }

                    }

                }

            }
            catch(Exception exp)
            {

            }
        }
Exemple #4
0
        private void _picBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            msg=new MsgAnnotation_Generic();
            //mouseDownPos=new Point(e.X,e.Y);
            this.flag_SendingThread=false;
            try
            {

                color = NetworkManager.thisInstance.profile.m_AssignedColor;
                tool= (enum_WhiteboardToolCode)ClientUI.getInstance().whiteBoard.tool;

                mouseDownPos=new Point(e.X,e.Y);

                if(this.textBox1.Visible==true)//!="")
                {
                    textBox1_Leave(this,new System.EventArgs());
                    this.textBox1.Visible=false;
                }
                pencilLastPoint=new Point(e.X,e.Y);
                if(this.tool==enum_WhiteboardToolCode.Brush ||this.tool==enum_WhiteboardToolCode.Pencil)
                {

                    this.mouseFirstPos_OnDown=new Point(e.X,e.Y);
                    this.mouseLastPos_OnDown=this.mouseFirstPos_OnDown;
                    msg.lst_Points.Add(this.mouseLastPos_OnDown);

                    msg.ConferenceID = WebMeeting.Client.NetworkManager.thisInstance.profile.ConferenceID ;
                    msg.tool=(ushort)tool;
                    msg.c=this.color;

                    if(tool == enum_WhiteboardToolCode.Brush)
                        msg.thickness=this.brushThickness;
                    else
                        msg.thickness=WebMeeting.Client.ClientUI.getInstance().whiteBoard.LineThickness;

                }
                else if(this.tool!=enum_WhiteboardToolCode.None)
                {

                    if(this.tool==enum_WhiteboardToolCode.Text)
                    {
                        if(this.textBox1.Text!="")
                        {
                            textBox1_Leave(this,new System.EventArgs());
                        }
                        textBox1.Font=WebMeeting.Client.ClientUI.getInstance().whiteBoard.localCopyOfFont;

                        this.textBox1.Top=e.Y;
                        this.textBox1.Left=e.X;
                        this.textBox1.Visible=true;
                        this.textBox1.Width=100;
                        this.textBox1.BorderStyle=BorderStyle.None;
                        this.textBox1.Focus();
                    }

                }
            }
            catch(Exception ex)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: whiteboard private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)",ex,"",false);
                //Trace.WriteLine("private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)"+" exception string :::: "+ex.ToString()+" stack trace ::: " +ex.StackTrace+" Message ::: "  +ex.Message);
            }
        }