Exemple #1
0
        private void RejectCall()
        {
            DateTime now = DateTime.Now;

            if (calling != null)
            {
                if (currentCall == null)
                {
                    currentCall = new Call(FindContact(calling, true), calling, now, true);
                }
                CallTime callTime = currentCall.CallTime.Last();
                callTime.DurationMs = now.Subtract(callTime.Time).Milliseconds;

                if (calls.Count > 0 && currentCall.Equals(calls.First()))
                {
                    calls.First().CallTime.AddRange(currentCall.CallTime);
                }
                else
                {
                    calls.Add(currentCall);
                }

                currentCall = null;
                calling     = null;
                isIncoming  = false;

                UpdateControlsState();
                UpdateList();
            }
        }
Exemple #2
0
        public string GetCallInfoWithPreviousOccurences()
        {
            //+1 means "call itself"
            int occurances = PreviousOccurencies.Count + 1;

            return("Phone number: " + PhoneNumber + " When: " + CallTime.ToLongTimeString() + " (" + GetReadableCallType() + ") (" + occurances + ")");
        }
Exemple #3
0
        public int CompareTo(Call anotherCall)
        {
            if (anotherCall == null)
            {
                return(1);
            }

            if (ReferenceEquals(this, anotherCall))
            {
                return(0);
            }

            if (this.GetType() != anotherCall.GetType())
            {
                throw new ArgumentException("A Call instance was expected.", "anotherCall");
            }

            if (CallTime.CompareTo(anotherCall.CallTime) != 0)
            {
                return((-1) * CallTime.CompareTo(anotherCall.CallTime));
            }
            else
            {
                return(0);
            }
        }
Exemple #4
0
 public BSViewModel(string number, CallTime ct)
 {
     _callTime = ct;
     CallerID  = number;
     GetMainData();
     //在线创建
     IsOnline = true;
 }
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = Contact?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (int)Direction;
         hashCode = (hashCode * 397) ^ CallTime.GetHashCode();
         return(hashCode);
     }
 }
Exemple #6
0
 public string GetCallInfo()
 {
     return("Phone number: " + PhoneNumber + " When: " + CallTime.ToLongTimeString() + " (" + GetReadableCallType() + ")");
 }
 /// <summary>
 /// 鳴動時間の設定を記録します
 /// </summary>
 public static void SaveCallTime(CallTime time)
 {
     //列挙型を数値に変換して保存する
     PlayerPrefs.SetInt(callTimeKey, (int)time);
 }
Exemple #8
0
 public override string ToString()
 {
     return($"{CallTime.ToString("s")}:{UserName}: {Uri}");
 }
Exemple #9
0
 //public bool IsCreateSuccess = false;
 //public FaultType type;
 public BombScreen(string number, CallTime ct)
 {
     vm = new BSViewModel(number, ct);
     this.DataContext = vm;
     InitializeComponent();
 }
Exemple #10
0
        public override void FormTextRepOfCaller()
        {
            string dirTextRep = (CallDirection == CallDir.InCall) ? "input" : "output";

            TextRepOfCall = $"There were {NumberOfCalls} {dirTextRep} calls from {CallTime.ToString()} to {LastCallTime.ToString()}.";
        }