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(); } }
public string GetCallInfoWithPreviousOccurences() { //+1 means "call itself" int occurances = PreviousOccurencies.Count + 1; return("Phone number: " + PhoneNumber + " When: " + CallTime.ToLongTimeString() + " (" + GetReadableCallType() + ") (" + occurances + ")"); }
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); } }
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); } }
public string GetCallInfo() { return("Phone number: " + PhoneNumber + " When: " + CallTime.ToLongTimeString() + " (" + GetReadableCallType() + ")"); }
/// <summary> /// 鳴動時間の設定を記録します /// </summary> public static void SaveCallTime(CallTime time) { //列挙型を数値に変換して保存する PlayerPrefs.SetInt(callTimeKey, (int)time); }
public override string ToString() { return($"{CallTime.ToString("s")}:{UserName}: {Uri}"); }
//public bool IsCreateSuccess = false; //public FaultType type; public BombScreen(string number, CallTime ct) { vm = new BSViewModel(number, ct); this.DataContext = vm; InitializeComponent(); }
public override void FormTextRepOfCaller() { string dirTextRep = (CallDirection == CallDir.InCall) ? "input" : "output"; TextRepOfCall = $"There were {NumberOfCalls} {dirTextRep} calls from {CallTime.ToString()} to {LastCallTime.ToString()}."; }