Beispiel #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)
     {
     }
 }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
Beispiel #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;
        }
Beispiel #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

            }
        }
Beispiel #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;
            }
        }
Beispiel #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)
            {


            }
        }
Beispiel #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;
 }