コード例 #1
0
 public ConfigViewModel(IClientApp app)
 {
     this.App          = app;
     NavBar            = new ConfigNavBarViewModel(this.App);
     this.AbortCommand = new RelayCommand(p => OnAbort());
     this.ExitCommand  = new RelayCommand(p => DoExit());
 }
コード例 #2
0
        public CallLogSearchViewModel(IClientApp app) : base(app)
        {
            this.DisplayName = "NHẬT KÝ GHI ÂM";
            this.App.AddLog("Xem nhật ký ghi âm", false);
            this.RecordFolder  = this.App.Service.GetRecordFolder();
            this.Criteria      = new SearchCallLogCriteria();
            this.SearchCommand = new RelayCommand(p => DoSearch());

            var list = Proxy.CreateProxy().GetAllChannels();

            this.ChannelList = new List <KeyValuePair <int?, string> >();
            this.ChannelList.Add(new KeyValuePair <int?, string>(null, "Tất cả"));
            foreach (var c in list)
            {
                this.ChannelList.Add(new KeyValuePair <int?, string>(c.ChannelId, c.Number));
            }

            this.Player               = this.App.MediaPlayer;
            this.Player.Volume        = 5;
            this.Player.FileName      = null;
            this.Player.EnableLooping = false;

            this.DeleteCommand = new RelayCommand(p => OnDelete(), p => this.SelectedCallLog != null);

            DoSearch();
        }
コード例 #3
0
 public RadioTimeListViewModel(IClientApp app, byte type, bool showAll = true, bool isReadOnly = false) : base(app)
 {
     this.App.AddLog("Khai báo báo hiệu", false);
     IsReadOnly = isReadOnly;
     Type       = type;
     Init(showAll);
 }
コード例 #4
0
        private void LogCommand(IClientApp app)
        {
            if (ConfigurationHelper.GetAppSettingOrDefault("Rafy_RBAC_LogCommand", true))
            {
                CommandRepository.CommandCreated += (o, e) =>
                {
                    var cmd = e.Instance;

                    cmd.Executed += (sender, ee) =>
                    {
                        var view = ee.Parameter as LogicalView;
                        if (view == null)
                        {
                            return;
                        }

                        LogCommandSuccess((sender as ClientCommand).Meta, view);
                    };

                    cmd.ExecuteFailed += (sender, ee) =>
                    {
                        var view = ee.Parameter as LogicalView;
                        if (view == null)
                        {
                            return;
                        }

                        LogCommandFailed((sender as ClientCommand).Meta, view, ee.Exception);
                    };
                };
            }
        }
コード例 #5
0
 public SearchLogViewModel(IClientApp app) : base(app)
 {
     _searchDate        = DateTime.Now;
     _searchText        = null;
     this.SearchCommand = new RelayCommand(p => OnSearch());
     this.App.AddLog("Xem nhật thao tác", false);
     OnSearch();
 }
コード例 #6
0
 public ClientSettingViewModel(IClientApp app) : base(app)
 {
     this.App.AddLog("Khai báo bàn điều khiển", false);
     this.Setting             = ClientSetting.Instance;
     this.FileBrowseCommand   = new RelayCommand(p => SelectRingTone());
     this.TestRingToneCommand = new RelayCommand(p => OnTestRingTone(), p => !string.IsNullOrEmpty(this.RingTone) && !this.App.MediaPlayer.IsPlaying);
     this.StopRingToneCommand = new RelayCommand(p => OnStopRingTone(), p => this.App.MediaPlayer.IsPlaying);
 }
コード例 #7
0
 public DayTypeViewModel(IClientApp app, DayTypeConfig day) : base(app)
 {
     DayType         = day;
     Day             = new DayButtonViewModel(day.DayOfWeek);
     Type            = new DayTypeButtonViewModel(day.DayType);
     Day.OnClicked  += OnButtonClick;
     Type.OnClicked += OnButtonClick;
 }
コード例 #8
0
ファイル: RBACModule.cs プロジェクト: yungtau/oea
        public override void Initialize(IClientApp app)
        {
            app.ModuleOperations += (s, e) =>
            {
                CommonModel.Modules["部门权限管理"].WPFTemplateType = typeof(OrgModule);
            };

            this.LogSystem(app);
        }
コード例 #9
0
        public GroupListViewModel(IClientApp app) : base(app)
        {
            this.ShowButtons = true;
            PhoneNumbers     = _service.GetAllContacts();

            AddCommand    = new RelayCommand(p => Add());
            ModifyCommand = new RelayCommand(p => Modify(), p => ItemSelected != null);
            DeleteCommand = new RelayCommand(p => Delete(), p => ItemSelected != null);

            LoadGroups();
        }
コード例 #10
0
        public DayTypeConfigViewModel(IClientApp app) : base(app)
        {
            this.App.AddLog("Khai báo báo giờ", false);

            DTVMs = new List <DayTypeViewModel>();
            foreach (var item in _service.GetDayTypes())
            {
                var obj = new DayTypeViewModel(this.App, item);
                obj.OnButtonClicked += ButtonClick;
                DTVMs.Add(obj);
            }
        }
コード例 #11
0
        private void LogSystem(IClientApp app)
        {
            var logSystem = ConfigurationHelper.GetAppSettingOrDefault("Rafy_RBAC_LogSystem", true);

            if (logSystem)
            {
                this.LogModuleSelected();

                this.LogLogin(app);

                this.LogCommand(app);
            }
        }
コード例 #12
0
ファイル: Server.cs プロジェクト: Mindkid/ProjDAD
        public void addClient(IClientApp clientApp)
        {
            Monitor.Enter(this);
            chatRooms.Add(clientApp.GetChatRoom());

            clients.Add(clientApp, "pacman" + clients.Count);

            if (clients.Count == numerOfPlayers)
            {
                Thread thread = new Thread(() => startGame());
                thread.Start();
            }
            Monitor.Exit(this);
        }
コード例 #13
0
        public GroupViewModel(IClientApp app, ContactGroup g)
        {
            this.App = app;
            Details  = new ObservableCollection <GroupItemViewModel>();

            LoadContactGroup(g);

            Details.CollectionChanged += Details_CollectionChanged;
            DeleteItemCommand          = new RelayCommand(p => DeleteItem(), p => ItemSelected != null);
            AddItemCommand             = new RelayCommand(p => AddItem());
            UpCommand     = new RelayCommand(p => Up(), p => ItemSelected != null);
            DownCommand   = new RelayCommand(p => Down(), p => ItemSelected != null);
            TopCommand    = new RelayCommand(p => Top(), p => ItemSelected != null);
            BottomCommand = new RelayCommand(p => Bottom(), p => ItemSelected != null);
            DeleteList    = new List <GroupItemViewModel>();
        }
コード例 #14
0
        public DayTypeAlarmViewModel(IClientApp app) : base(app)
        {
            this.App.AddLog("Khai báo âm hiệu", false);
            ButtonList = new ObservableCollection <ConfigButtonViewModel>();
            var service = Proxy.CreateProxy();
            var list    = service.GetEnums("DayType");

            foreach (var item in list)
            {
                var obj = new ConfigButtonViewModel();
                obj.Value = item.Value;
                obj.Name  = item.Desc_VN;
                ButtonList.Add(obj);
                obj.OnClicked += TypeClick;
            }

            _isAlarmOnSwitch = service.IsAlartOnSwitch();
        }
コード例 #15
0
ファイル: Server.cs プロジェクト: Mindkid/ProjDAD
 private void startBoard(IClientApp client, int attempt)
 {
     try
     {
         client.setPacmanName(clients[client]);
     }
     catch(SocketException exc)
     {
         if (attempt <= KeyConfiguration.MAX_ATTEMPTS)
         {
             Thread.Sleep(ConnectionLibrary.INTERVAL_RESEND);
             startBoard(client, attempt++);
         }
         else
             Console.WriteLine(exc.Message);
     }
 
 }
コード例 #16
0
        //public static void RaiseDateTimeChangedEvent(DateTime dt)
        //{
        //    try
        //    {
        //        NovaAlert.Common.Utils.SystemDateHelper.SetSystemTime(dt);
        //        if (OnSystemDateTimeChangedHandler != null)
        //        {
        //            OnSystemDateTimeChangedHandler(null, new SystemDateTimeChangedEventArgs(dt));
        //        }
        //    }
        //    catch
        //    {
        //    }
        //}
        public static ContactViewModel ShowContact(IClientApp app, IEnumerable <HostPhoneViewModel> channels = null,
                                                   bool allowMultiSelect = false, Action <HostPhoneViewModel, string> callFunc = null)
        {
            var vm = new ContactViewModel(app, true, channels);

            vm.AllowMultiSelect = allowMultiSelect;
            vm.CallFunc         = callFunc;
            var v = new ContactListView();

            v.DataContext = vm;
            v.Height      = 500;
            v.Width       = 700;

            if (NovaAlert.Common.Wpf.ModalDialog.ShowControl(v, "Danh mục điện thoại") == true && vm.ItemSelected != null)
            {
                return(vm);
            }
            return(null);
        }
コード例 #17
0
        private void LogLogin(IClientApp app)
        {
            app.LoginSuccessed += (o, e) =>
            {
                AuditLogService.LogAsync(new AuditLogItem()
                {
                    Title = "登录成功",
                    Type  = AuditLogType.Login
                });
            };

            //app.LoginFailed += (o, e) =>
            //{
            //    AuditLogService.LogAsync(new AuditLogItem()
            //    {
            //        Title = "登录失败",
            //        Type = AuditLogType.Login
            //    });
            //};
        }
コード例 #18
0
        public ContactViewModel(IClientApp app, bool isModal = false, IEnumerable <HostPhoneViewModel> channels = null) : base(app)
        {
            this.AllowMultiSelect = false;
            this.Channels         = channels;
            IsShowModal           = isModal;

            if (IsShowModal)
            {
                this.App.AddLog("Xem danh bạ", false);
            }
            else
            {
                this.App.AddLog("Khai báo danh bạ", false);
            }

            AddContactCommand    = new RelayCommand(p => AddContact());
            EditContactCommand   = new RelayCommand(p => EditContact(), p => ItemSelected != null);
            DeleteContactCommand = new RelayCommand(p => OnDelete(), p => ItemSelected != null);
            Items = new ObservableCollection <ContactItemViewModel>();
            Init();
            ItemsView.Filter = new Predicate <object>(Filter);

            this.MakeCallCommand = new RelayCommand(p => OnMakeCall(), p => this.SelectedChannel != null);
        }
コード例 #19
0
ファイル: RBACWPFPlugin.cs プロジェクト: 569550384/Rafy
        private void LogLogin(IClientApp app)
        {
            app.LoginSuccessed += (o, e) =>
            {
                AuditLogService.LogAsync(new AuditLogItem()
                {
                    Title = "登录成功",
                    Type = AuditLogType.Login
                });
            };

            //app.LoginFailed += (o, e) =>
            //{
            //    AuditLogService.LogAsync(new AuditLogItem()
            //    {
            //        Title = "登录失败",
            //        Type = AuditLogType.Login
            //    });
            //};
        }
コード例 #20
0
ファイル: RBACWPFPlugin.cs プロジェクト: 569550384/Rafy
        private void LogCommand(IClientApp app)
        {
            if (ConfigurationHelper.GetAppSettingOrDefault("Rafy_RBAC_LogCommand", true))
            {
                CommandRepository.CommandCreated += (o, e) =>
                {
                    var cmd = e.Instance;

                    cmd.Executed += (sender, ee) =>
                    {
                        var view = ee.Parameter as LogicalView;
                        if (view == null) return;

                        LogCommandSuccess((sender as ClientCommand).Meta, view);
                    };

                    cmd.ExecuteFailed += (sender, ee) =>
                    {
                        var view = ee.Parameter as LogicalView;
                        if (view == null) return;

                        LogCommandFailed((sender as ClientCommand).Meta, view, ee.Exception);
                    };
                };
            }
        }
コード例 #21
0
 public ConfigNavBarViewModel(IClientApp app)
 {
     this.App = app;
     CreateNavBar();
 }
コード例 #22
0
 public DisplayDataViewModel(IClientApp app) : base(app)
 {
     this.App.AddLog("Khai báo hiển thị kết quả báo động", false);
     this.Contacts = _service.GetAllContacts();
     LoadData();
 }
コード例 #23
0
 public ChannelViewModel(IClientApp app) : base(app)
 {
     this.App.AddLog("Khai báo danh sách kênh", false);
     Channels = new ObservableCollection <ChannelItemViewModel>();
     LoadData();
 }
コード例 #24
0
ファイル: ClientRequests.cs プロジェクト: JakNat/Java-agh
 public ClientRequests(IClientApp client)
 {
     this.client = client;
 }
コード例 #25
0
 public MemeCreatorViewModel(IClientApp client, IClientRequests clientRequests)
 {
     this.client         = client;
     this.clientRequests = clientRequests;
 }
コード例 #26
0
 public MemeLibraryViewModel(IClientApp client, IClientRequests clientRequests)
 {
     this.client         = client;
     this.clientRequests = clientRequests;
 }
コード例 #27
0
 public LoginViewModel(IClientApp client, IClientRequests clientRequests)
 {
     this.client         = client;
     this.clientRequests = clientRequests;
 }
コード例 #28
0
 public ConfigViewModelBase(IClientApp app)
 {
     this.App = app;
 }
コード例 #29
0
ファイル: RBACWPFPlugin.cs プロジェクト: 569550384/Rafy
        private void LogSystem(IClientApp app)
        {
            var logSystem = ConfigurationHelper.GetAppSettingOrDefault("Rafy_RBAC_LogSystem", true);
            if (logSystem)
            {
                this.LogModuleSelected();

                this.LogLogin(app);

                this.LogCommand(app);
            }
        }
コード例 #30
0
 public ClientController(IClientApp clientApp)
 {
     _clientApp = clientApp;
 }
コード例 #31
0
ファイル: Server.cs プロジェクト: Mindkid/ProjDAD
 private void sendMoveToClient(Dictionary<String, KeyConfiguration.KEYS> pacmanMoves, IClientApp client, String serverName, int attempt)
 {
     try
     {
         client.receiveKey(pacmanMoves, serverName);
     }
     catch(SocketException exc)
     {
         if(attempt <= KeyConfiguration.MAX_ATTEMPTS)
         {
             Thread.Sleep(ConnectionLibrary.INTERVAL_RESEND);
             sendMoveToClient(pacmanMoves, client, serverName, attempt++);
         }
         else
             Console.WriteLine(exc.Message);
     }
 
 }
コード例 #32
0
 public ConnectionViewModel(IClientApp client)
 {
     this.client = client;
 }
コード例 #33
0
 public DateConfigViewModel(IClientApp app) : base(app)
 {
     this.App.AddLog("Khai báo thời gian", false);
     SystemTime = DateTime.Now;
 }