public void OnCallChanged(TypeCall typeCall)
 {
     if (CallChanged != null)
     {
         CallChanged(this, new TypeCallEventArgs(typeCall));
     }
 }
Exemplo n.º 2
0
 public AbstractCall(Abonent sender, Abonent receiver, int duration,
                     DateTime date, TypeCall type)
 {
     Sender   = sender;
     Receiver = receiver;
     Duration = duration;
     Date     = date;
     Type     = type;
 }
        public void AjouterAction(TypeCall typeCall, ICommand command)
        {
            if (typeCall == null || command == null)
            {
                return;
            }

            DicoCall.Add(typeCall, command);
        }
Exemplo n.º 4
0
        public void ChangerAction(TypeCall typeCall, ICommand commande)
        {
            if (typeCall == null || _ActionToTypeCall == null || !_ActionToTypeCall.ContainsKey(typeCall))
            {
                return;
            }

            _ActionToTypeCall[typeCall] = commande;
        }
Exemplo n.º 5
0
        public void SupprimerAction(TypeCall typeCall)
        {
            if (typeCall == null || _ActionToTypeCall == null || !_ActionToTypeCall.ContainsKey(typeCall))
            {
                return;
            }

            _ActionToTypeCall.Remove(typeCall);
        }
Exemplo n.º 6
0
 private async Task resolveTypes(List <ContractContents> items)
 {
     ESIClass esi = new ESIClass();
     await Task.Run(() =>
     {
         foreach (ContractContents item in items)
         {
             TypeCall info = esi.pullTypeInfo(item.type_id);
             typeInfo.Add(info);
         }
     });
 }
Exemplo n.º 7
0
        public void LancerAction(TypeCall typeCall, object parameter)
        {
            if (typeCall == null || _ActionToTypeCall == null && !_ActionToTypeCall.ContainsKey(typeCall))
            {
                return;
            }

            if (_ActionToTypeCall[typeCall] != null)
            {
                _ActionToTypeCall[typeCall].Execute(parameter);
            }
        }
Exemplo n.º 8
0
        public static EmergencyCallFactory EmergencyCall(TypeCall typeCall)
        {
            if (typeCall == TypeCall.Fire)
            {
                return(new EmergencyFireFactory());
            }
            if (typeCall == TypeCall.CarAccident)
            {
                return(new EmergencyCarAccidentFactory());
            }

            throw new ApplicationException("unrecognized call type");
        }
        public void LancerAction(TypeCall typeCall)
        {
            if (typeCall == null)
            {
                return;
            }

            ICommand command;

            if (DicoCall.TryGetValue(typeCall, out command))
            {
                command.Execute(typeCall);
            }
        }
Exemplo n.º 10
0
        public void AjouterAction(TypeCall typeCall, ICommand commande)
        {
            if (typeCall == null || commande == null)
            {
                return;
            }

            if (_ActionToTypeCall == null)
            {
                _ActionToTypeCall = new Dictionary <TypeCall, ICommand>();
            }

            if (_ActionToTypeCall.ContainsKey(typeCall))
            {
                return;
            }

            _ActionToTypeCall.Add(typeCall, commande);
        }
        public static TwilioVideoHelper GetOrCreate(Context context, TypeCall typeCall)
        {
            try
            {
                TypeCall = typeCall;

                if (Instance == null)
                {
                    Instance = new TwilioVideoHelper();
                }

                if (Instance.CurrentVideoTrack == null || Instance.CurrentAudioTrack == null)
                {
                    Instance.CreateLocalMedia(context);
                }

                return(Instance);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
                return(null);
            }
        }
Exemplo n.º 12
0
        public static TwilioVideoHelper GetOrCreate(Context context, TypeCall typeCall)
        {
            try
            {
                TypeCall = typeCall;

                if (Instance == null)
                {
                    Instance = new TwilioVideoHelper();
                }

                if (Instance.CurrentVideoTrack == null || Instance.CurrentAudioTrack == null)
                {
                    Instance.CreateLocalMedia(context);
                }

                return(Instance);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
 public TypeCallEventArgs(TypeCall typeCall)
 {
     _typeCall = typeCall;
 }
Exemplo n.º 14
0
        /// <summary>
        /// hàm trả về đường dẫn file âm thanh
        /// theo quy tắc số thời gian
        ///   - tìm đên thư mục của ngày đó, tìm file có Phonenumber và thoidiemgọi + kiểu gọi
        ///
        /// C:\ : thư mục gốc
        /// C:\TxRec\REC200905\20090516\10--A-50435142581---20090516220241.wav  (A : Cuộc gọi đến)
        ///                                                                     (B : Cuộc gọi đi)
        /// // lấy ds các file trong ngày
        ///
        /// </summary>
        /// <param name="PhoneNumber"></param>
        /// <param name="ThoiDiemGoi"></param>
        /// <param name="typeCall"></param>
        /// <returns></returns>
        public static string GetFileVoiceCuaMotCuocGoi(string Line, string PhoneNumber, DateTime ThoiDiemGoi, TypeCall typeCall, string ThuMucFileVoice)
        {
            try
            {
                // Lấy tất cả file thư mục gốc của ngày C:\TxRec\REC200905\20090516
                // tìm các file có PhoneNumber và thơi điểm gọi

                string ThuMucLuuFile = "";
                if (ThuMucFileVoice.Substring(ThuMucFileVoice.Length - 1, 1) == "\\")
                {
                    ThuMucLuuFile = ThuMucFileVoice + "TxRec";
                }
                else
                {
                    ThuMucLuuFile = ThuMucFileVoice + "\\TxRec";
                }

                if (ThoiDiemGoi.Month < 10)
                {
                    ThuMucLuuFile += string.Format("\\REC{0}0{1}", ThoiDiemGoi.Year, ThoiDiemGoi.Month);
                    ThuMucLuuFile += string.Format("\\{0}0{1}", ThoiDiemGoi.Year, ThoiDiemGoi.Month);
                }
                else
                {
                    ThuMucLuuFile += string.Format("\\REC{0}{1}", ThoiDiemGoi.Year, ThoiDiemGoi.Month);
                    ThuMucLuuFile += string.Format("\\{0}{1}", ThoiDiemGoi.Year, ThoiDiemGoi.Month);
                }
                if (ThoiDiemGoi.Day < 10)
                {
                    ThuMucLuuFile += string.Format("0{0}", ThoiDiemGoi.Day);
                }
                else
                {
                    ThuMucLuuFile += string.Format("{0}", ThoiDiemGoi.Day);
                }

                string FilenameThoiDiemGoi = "";

                FilenameThoiDiemGoi = ThoiDiemGoi.Year.ToString() + StringTools.GeMonthString(ThoiDiemGoi.Month) + StringTools.GeDayString(ThoiDiemGoi.Day) + StringTools.GeHourString(ThoiDiemGoi.Hour) + StringTools.GeMinuteString(ThoiDiemGoi.Minute) + StringTools.GeSecondString(ThoiDiemGoi.Second);

                string[] filePaths        = Directory.GetFiles(ThuMucLuuFile);
                string   retFilenameVoice = "";
                string   KieuCuocGoi      = "A";
                if (typeCall == TypeCall.Incoming)
                {
                    KieuCuocGoi = "A";
                }
                else
                {
                    KieuCuocGoi = "B";
                }

                List <string> listFilePathsOfPhone = new List <string>();

                // lay ra các cuoc goi cua so dien thoai
                if ((filePaths != null) && (filePaths.Length > 0))
                {
                    // lay ra các cuoc goi cua so dien thoai
                    for (int i = 0; i < filePaths.Length; i++)
                    {
                        if ((filePaths[i].Contains(PhoneNumber)) && filePaths[i].Contains(KieuCuocGoi))
                        {
                            if (filePaths[i].Substring(filePaths[i].Length - 17 - 1, 14).CompareTo(FilenameThoiDiemGoi) >= 0)
                            {
                                listFilePathsOfPhone.Add(filePaths[i]);
                            }
                        }
                    }
                    if (listFilePathsOfPhone.Count > 0)
                    {
                        retFilenameVoice = listFilePathsOfPhone[0];
                    }
                    else
                    {
                        retFilenameVoice = "";
                    }
                }
                else
                {
                    retFilenameVoice = "";
                }


                return(retFilenameVoice);
            }
            catch (Exception ex)
            {
                return("");  // lỗi không tồn tại thưc mục câm thanh
            }
        }