Exemplo n.º 1
0
 public void SaveCallHistory(CallHistory callHistory, string username)
 {
     try
     {
         FileStream fs = new FileStream("CallHistory-" + username + ".xml", FileMode.Create);
         this.serializer.Serialize(fs, callHistory);
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 2
0
        public CallHistory LoadCallHistory(string username)
        {
            CallHistory tmpCallHistory = new CallHistory();

            try
            {
                FileStream fs = new FileStream("CallHistory-" + username + ".xml", FileMode.OpenOrCreate);
                tmpCallHistory = (CallHistory)this.serializer.Deserialize(fs);
                fs.Close();
            }
            catch (Exception)
            {
            }
            return(tmpCallHistory);
        }
Exemplo n.º 3
0
        public CallHistory LoadCallHistory(string username)
        {
            CallHistory tmpCallHistory = new CallHistory();

            try
            {
                FileStream fs = new FileStream(Path.Combine(mPath, "CallHistory-" + username + ".xml"), FileMode.OpenOrCreate);
                tmpCallHistory = (CallHistory)this.serializer.Deserialize(fs);
                fs.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("LoadCallHistory : " + ex.Message);
            }
            return(tmpCallHistory);
        }
Exemplo n.º 4
0
        public void SaveCallHistory(CallHistory callHistory, string username)
        {
            try
            {
                if (callHistory.CallRecords.Length > maxsize)
                {
                    Array.Reverse(callHistory.CallRecords);
                    Array.Resize(ref callHistory.CallRecords, maxsize);
                    Array.Reverse(callHistory.CallRecords);
                }

                FileStream fs = new FileStream(Path.Combine(mPath, "CallHistory-" + username + ".xml"), FileMode.Create);
                this.serializer.Serialize(fs, callHistory);
            }
            catch (Exception ex)
            {
                Console.WriteLine("LoadCallHistory : " + ex.Message);
            }
        }
Exemplo n.º 5
0
        public void SaveCallHistory(CallHistory callHistory, string username)
        {


            try
            {


                if (callHistory.CallRecords.Length > maxsize)
                {
                    Array.Reverse(callHistory.CallRecords);
                    Array.Resize(ref callHistory.CallRecords, maxsize);
                    Array.Reverse(callHistory.CallRecords);
                }

                FileStream fs = new FileStream(Path.Combine(mPath, "CallHistory-" + username + ".xml"), FileMode.Create);
                this.serializer.Serialize(fs, callHistory);

            }
            catch (Exception ex)
            {
                Console.WriteLine("LoadCallHistory : " + ex.Message);
            }
        }
Exemplo n.º 6
0
        public CallHistory LoadCallHistory(string username)
        {
            CallHistory tmpCallHistory = new CallHistory();

            try
            {
                FileStream fs = new FileStream(Path.Combine(mPath, "CallHistory-" + username + ".xml"), FileMode.OpenOrCreate);
                tmpCallHistory = (CallHistory)this.serializer.Deserialize(fs);
                fs.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("LoadCallHistory : " + ex.Message);
            }
            return tmpCallHistory;
        }
Exemplo n.º 7
0
        private void ClientForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                if (e.CloseReason == CloseReason.UserClosing)
                {
                    if (DialogResult.Yes != MessageBox.Show(
                        Properties.Localization.txtInfoApplicationClosingDesc,
                         Properties.Localization.txtInfoApplicationClosing,
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Question)
                        )
                    {
                        e.Cancel = true;
                        return;
                    }
                }

                this.mFormIsClosing = true;
                this.WindowState = FormWindowState.Minimized;
                if (xmppControl.Connected) xmppControl.Disconnect();
                mySIPPhone.ShutdownEngine();

                UnregisterHotKey(this.Handle, this.GetType().GetHashCode());

                CallHistory tmpCallHistory = new CallHistory(mUserAccount.Username);
                tmpCallHistory.CallRecords = myCallHistoryRecords.ToArray();
                myCallHistorySerializer.SaveCallHistory(tmpCallHistory, mUserAccount.Username);
                myStorage.Close();

                if (myVideoPlugin != null) myVideoPlugin.Dispose();
            }
            catch (Exception ex)
            {
#if (TRACE)
                Console.WriteLine("AmiteloForm_FormClosing : " + ex.Message);     
#endif

            }
        }
Exemplo n.º 8
0
        private void ClientForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {

                this.FormIsClosing = true;

                UnregisterHotKey(this.Handle, this.GetType().GetHashCode());

                CallHistory tmpCallHistory = new CallHistory(myUserAccount.Username);
                tmpCallHistory.CallRecords = myCallHistoryRecords.ToArray();
                myCallHistorySerializer.SaveCallHistory(tmpCallHistory, myUserAccount.Username);
                mySIPPhone.ShutdownEngine();
                myVideoPlugin.UnInitialize();
                Thread.Sleep(10000);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Closing Form Exception : " + ex.Message);
                throw;
            }
        }
Exemplo n.º 9
0
        public void SaveCallHistory(CallHistory callHistory, string username)
        {

           
            try
            {
                 FileStream fs  = new FileStream("CallHistory-" + username + ".xml", FileMode.Create);
                this.serializer.Serialize(fs, callHistory);

            }
            catch (Exception)
            {


            }
        }
Exemplo n.º 10
0
 public CallHistory LoadCallHistory(string username)
 {
     CallHistory tmpCallHistory = new CallHistory();
   
     try
     {
          FileStream fs = new FileStream("CallHistory-" + username + ".xml", FileMode.OpenOrCreate);
        tmpCallHistory =  (CallHistory)this.serializer.Deserialize(fs);
        fs.Close();
     }
     catch (Exception)
     {
         
       
     }
     return tmpCallHistory;
 }