public ConfigViewModel(IClientApp app) { this.App = app; NavBar = new ConfigNavBarViewModel(this.App); this.AbortCommand = new RelayCommand(p => OnAbort()); this.ExitCommand = new RelayCommand(p => DoExit()); }
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(); }
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); }
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); }; }; } }
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(); }
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); }
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; }
public override void Initialize(IClientApp app) { app.ModuleOperations += (s, e) => { CommonModel.Modules["部门权限管理"].WPFTemplateType = typeof(OrgModule); }; this.LogSystem(app); }
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(); }
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); } }
private void LogSystem(IClientApp app) { var logSystem = ConfigurationHelper.GetAppSettingOrDefault("Rafy_RBAC_LogSystem", true); if (logSystem) { this.LogModuleSelected(); this.LogLogin(app); this.LogCommand(app); } }
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); }
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>(); }
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(); }
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); } }
//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); }
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 // }); //}; }
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); }
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); }; }; } }
public ConfigNavBarViewModel(IClientApp app) { this.App = app; CreateNavBar(); }
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(); }
public ChannelViewModel(IClientApp app) : base(app) { this.App.AddLog("Khai báo danh sách kênh", false); Channels = new ObservableCollection <ChannelItemViewModel>(); LoadData(); }
public ClientRequests(IClientApp client) { this.client = client; }
public MemeCreatorViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public MemeLibraryViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public LoginViewModel(IClientApp client, IClientRequests clientRequests) { this.client = client; this.clientRequests = clientRequests; }
public ConfigViewModelBase(IClientApp app) { this.App = app; }
public ClientController(IClientApp clientApp) { _clientApp = clientApp; }
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); } }
public ConnectionViewModel(IClientApp client) { this.client = client; }
public DateConfigViewModel(IClientApp app) : base(app) { this.App.AddLog("Khai báo thời gian", false); SystemTime = DateTime.Now; }