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

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


            }
        }
예제 #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;
 }