public LockScreenPopupViewModel(PanaceaServices core, bool requireLogin) { _core = core; _requireLogin = requireLogin; LockScreenCommandVisibility = _requireLogin ? Visibility.Visible : Visibility.Collapsed; RemoteButtonsVisibility = Visibility.Collapsed; if (core.TryGetPairing(out IBoundTerminalManager pairing)) { if (pairing.IsBound()) { RemoteButtonsVisibility = Visibility.Visible; } ; } LockScreenCommand = new RelayCommand(args => { LockScreen(); SetResult(null); }); TurnOffScreenCommand = new RelayCommand(args => { TurnOffScreen(); SetResult(null); }); LockRemoteScreenCommand = new RelayCommand(args => { LockRemoteScreen(); SetResult(null); }); UnlockRemoteScreenCommand = new RelayCommand(args => { UnlockRemoteScreen(); SetResult(null); }); }
public BookListViewModel(PanaceaServices core, BooksPlugin plugin) { _plugin = plugin; _core = core; Provider = plugin.Provider; SetupCommands(); }
public NavigationButtonViewModel(PanaceaServices core) { _core = core; if (_core.TryGetRelayManager(out IRelayManager relay)) { _relay = relay; } bool pressed = false; ClickCommand = new RelayCommand(async args => { if (pressed) { return; } pressed = true; try { if (_relay != null && _relay.NurseCallAttached) { await _relay.SetNurseCallAsync(true); await Task.Delay(2000); await _relay.SetNurseCallAsync(false); } } finally { pressed = false; } }); }
//private readonly AudioManager _audioManager; public VisioForgeMediaPlayer(PanaceaServices core /*, AudioManager audioManager*/) { _logger = core.Logger; //_audioManager = audioManager; InitializeComponent(); try { visioforgePlayer = new VideoCapture { Dock = System.Windows.Forms.DockStyle.Fill, Mode = VFVideoCaptureMode.VideoPreview, Debug_Mode = false }; visioforgePlayer.SetLicenseKey("1DCD-7E69-5B15-9FBC-2200-4340", "", ""); visioforgePlayer.OnError += VisioforgePlayer_OnError; //visioforgePlayer.Debug_Dir = Utils.Path(); //Content = visioforgePlayer; visioforgePlayer.Click += (oo, ee) => OnClick(); PanelBox.Child = (visioforgePlayer); } catch (Exception ex) { _logger.Error(this, "Exception during Visioforge initialization / " + ex.Message); } }
public GameListViewModel(PanaceaServices core, GamesPlugin plugin) { _core = core; _plugin = plugin; Provider = plugin.Provider; SetupCommands(); }
public VideoListViewModel(PanaceaServices core, StreamingVideoPlugin plugin) { _core = core; _plugin = plugin; Provider = plugin.Provider; SetupCommands(); }
public StreamingVideoProvider(PanaceaServices core) : base(core, "streaming_video_collection/get_categories_only/", "streaming_video_collection/get_category_limited/{0}/{1}/{2}/", "streaming_video_collection/find/{0}/{1}/{2}/{3}/", 10) { }
public FavoritesPlugin(PanaceaServices core) { _core = core; _core.UserService.UserLoggedIn += UserService_UserLoggedIn; _core.UserService.UserLoggedOut += UserService_UserLoggedOut; _translator = new Translator("Favorites"); _manager = new FavoritesManager(_core); }
internal static async Task ExecuteFromAssembly(Assembly assembly, PanaceaServices core) { Type fooType = assembly.GetType("DevelopmentPlugin.CustomCode"); MethodInfo printMethod = fooType.GetMethod("RunAsync"); var inst = Activator.CreateInstance(fooType); await(Task) printMethod.Invoke(inst, BindingFlags.Public, null, new object[] { core }, CultureInfo.CurrentCulture); }
public static bool TryGetUserAccountManager(this PanaceaServices core, out IUserAccountManager manager) { manager = core.PluginLoader .GetPlugins <IUserAccountPlugin>() .FirstOrDefault() ?.GetUserAccountManager(); return(manager != null); }
public HospitalServerLazyItemProvider(PanaceaServices core, string categoriesUrl, string itemsUrl, string searchUrl, int pageSize) { _size = pageSize; this._core = core; this.categoriesUrl = categoriesUrl; this.itemsUrl = itemsUrl; this.searchUrl = searchUrl; }
public IeContainer(PanaceaServices core, Process p) { _p = p; _core = core; t = new DispatcherTimer(); t.Interval = TimeSpan.FromSeconds(1); t.Tick += T_Tick; InitializeComponent(); }
public ModernThemeManager(PanaceaServices core, Theme theme) { _core = core; _mainPage = new MainPageViewModel(_core, theme); InitializeComponent(); popup = new NotificationsWindow(); _translator = new Translator("core"); }
public HardwarePluginWrapper(PanaceaServices core) { _core = core; _core.PluginLoader.PluginLoaded += PluginLoader_PluginLoaded; _core.PluginLoader.PluginUnloaded += PluginLoader_PluginUnloaded; foreach (var p in core.PluginLoader.LoadedPlugins.Where(p => p.Value is IHardwarePlugin).Select(p => p.Value)) { PluginLoader_PluginLoaded(core.PluginLoader, p); } }
public QuantitySelectorPopupViewModel(PanaceaServices core, List <int> quantities, CategoryViewModel category) { _core = core; Category = category; Quantities = quantities; AddCommand = new RelayCommand((args) => { SetResult((int)args); }); }
public NavigationButtonViewModel(PanaceaServices core, DeveloperPanelPlugin plugin) { ClickCommand = new RelayCommand(args => { if (core.TryGetUiManager(out IUiManager ui)) { ui.Navigate(new MagicPinViewModel(plugin, core), false); } }); }
public ServiceMonitor(PanaceaServices core, IBillingManager billing) { _core = core; _billing = billing; _timer = new Timer() { Interval = 10000 }; _timer.Elapsed += _timer_Elapsed; }
public static bool TryGetUiManager(this PanaceaServices services, out IUiManager manager) { manager = null; var plugin = services.PluginLoader.GetPlugins <IUiManagerPlugin>().FirstOrDefault(); if (plugin == null) { return(false); } manager = plugin.GetUiManager(); return(true); }
public static bool TryGetWebBrowser(this PanaceaServices core, out IWebBrowserPlugin plugin) { plugin = null; var webbrowser = core.PluginLoader.GetPlugins <IWebBrowserPlugin>().FirstOrDefault(); if (webbrowser == null) { return(false); } plugin = webbrowser; return(true); }
public ClinicalButtonViewModel(PanaceaServices core, ClinicalButtonsPlugin plugin, ActionButtonModel actionButton) { this.core = core; this.actionButton = actionButton; Name = actionButton.Name; PluginName = actionButton.Settings.PluginName; ImgUrl = core.HttpClient.RelativeToAbsoluteUri(actionButton.ImgUrl); OpenCommand = new RelayCommand(args => { plugin.OpenItem(actionButton); }); }
public static bool TryGetGetRemoteDesktopPlugin(this PanaceaServices core, out IRemoteDesktop plugin) { plugin = null; var rdc = core.PluginLoader.GetPlugins <IRemoteDesktop>().FirstOrDefault(); if (rdc == null) { return(false); } plugin = rdc; return(true); }
public static bool TryGetCitrix(this PanaceaServices core, out ICitrixPlugin plugin) { plugin = null; var citrix = core.PluginLoader.GetPlugins <ICitrixPlugin>().FirstOrDefault(); if (citrix == null) { return(false); } plugin = citrix; return(true); }
public static bool TryGetFavoritesPlugin(this PanaceaServices core, out IFavoritesManager plugin) { plugin = null; var favorites = core.PluginLoader.GetPlugins <IFavoritesPlugin>().FirstOrDefault(); if (favorites == null) { return(false); } plugin = favorites.GetManager(); return(true); }
public static bool TryGetMediaPlayerContainer(this PanaceaServices services, out IMediaPlayerContainer container) { container = null; var plugin = services.PluginLoader.GetPlugins <IMediaPlayerContainer>().FirstOrDefault(); if (plugin == null) { return(false); } container = plugin; return(true); }
public MeditechPage(PanaceaServices core) { _core = core; _logger = core.Logger; _loadingwindow = new LoadingWindow(); _timer = new IdleTimer(TimeSpan.FromSeconds(Timeout)); _timer.Tick += _timer_Elapsed; _checker = new DispatcherTimer(); _checker.Interval = TimeSpan.FromSeconds(3); _checker.Tick += _checker_Tick; }
public static bool TryGetImprivata(this PanaceaServices core, out IImprivataPlugin plugin) { plugin = null; var imprivata = core.PluginLoader.GetPlugins <IImprivataPlugin>().FirstOrDefault(); if (imprivata == null) { return(false); } plugin = imprivata; return(true); }
public MyAccountViewModel(PanaceaServices core, IUserAccountManager manager) { _core = core; SignoutCommand = new RelayCommand(async arg => { if (_core.TryGetUiManager(out IUiManager ui)) { ui.GoHome(); } await manager.LogoutAsync(); }); BuyServiceCommand = new RelayCommand(arg => { if (_core.TryGetBilling(out IBillingManager billing)) { billing.NavigateToBuyServiceWizard(); } }); ChangeInfoCommand = new RelayCommand(arg => { if (_core.TryGetUiManager(out IUiManager ui)) { ui.Navigate(new UpdateAccountViewModel(_core)); } else { _core.Logger.Error(this, "ui manager not loaded"); } }); ChangeCredentialsCommand = new RelayCommand(arg => { if (_core.TryGetUiManager(out IUiManager ui)) { ui.Navigate(new UpdateCredentialsViewModel(_core)); } else { _core.Logger.Error(this, "ui manager not loaded"); } }); ResetPasswordCommand = new RelayCommand(async arg => { if (_core.TryGetUiManager(out IUiManager ui)) { await ui.ShowPopup <object>(new PasswordResetViewModel(_core)); } else { _core.Logger.Error(this, "ui manager not loaded"); } }); }
public MagicPinViewModel(DeveloperPanelPlugin plugin, PanaceaServices core) { _core = core; MachineName = Environment.MachineName; ShowDevPageCommand = new RelayCommand(args => { plugin.ShowDevPage(); }); StartLauncherCommand = new RelayCommand(args => { try { var path = Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Updater", "Support", "Launcher", "PanaceaLauncher"); Process.Start(path, "/show"); } catch (Exception ex) { } }); UnlockCommand = new RelayCommand(args => { try { var now = DateTime.Now; var first = now.Date.Month + now.Hour; var second = now.Date.Day + now.Minute; var pin = first * 100 + second; var input = Int32.Parse(Pin); if (input >= pin - 1 && input <= pin + 1) { Unlocked = true; Pin = ""; return; } Pin = ""; Error = "No!"; } catch { Error = "Oops! Something went wrong. Shame on us..."; } }, args => Pin?.Length >= 4); }
public static IHardwareManager GetHardwareManager(this PanaceaServices core) { if (_instance == null) { lock (_lock) { if (_instance == null) { _instance = new HardwarePluginWrapper(core); } } } return(_instance); }
public static RfidReaderPluginContainer GetRfidReaderContainer(this PanaceaServices services) { if (_instance == null) { lock (padlock) { if (_instance == null) { _instance = new RfidReaderPluginContainer(services.PluginLoader); } } } return(_instance); }