protected MvxValidationService(IValidator validator, IMvxMessenger messenger, IMvxLog log) { _validator = validator; _messenger = messenger; _log = log; _messenger.Subscribe<ValidationMessage>(OnValidationReceived, MvxReference.Strong); }
public XmlData() { var logProvider = Mvx.IoCProvider.Resolve <IMvxLogProvider>(); this._log = logProvider.GetLogFor("XmlData"); this.RezeptFilePath = Path.Combine(this.Dir, this.Filename); Debug.WriteLine(this.RezeptFilePath); if (File.Exists(this.RezeptFilePath)) { this.rootElement = XElement.Load(this.RezeptFilePath); var rzt = from item in this.rootElement.Descendants("rezept") select new RezeptItem() { RezeptId = (string)item.Attribute("id"), Rezeptname = (string)item.Attribute("name"), Rezeptanleitung = (string)item.Attribute("anleitung") }; this.rezepte = rzt.ToList <IRezeptItem>(); } else { this.rootElement = new XElement("rezepte"); this.rezepte = new List <IRezeptItem>(); } }
public static void Info(this IMvxLog logger, string message) { if (logger.IsInfoEnabled()) { logger.Log(MvxLogLevel.Info, message.AsFunc()); } }
public override void Initialize() { CreatableTypes() .EndingWith("Service") .AsInterfaces() .RegisterAsLazySingleton(); log = Mvx.IoCProvider.Resolve <IMvxLog>(); appSettings = Mvx.IoCProvider.Resolve <IAppSettings>(); TpsSerializer tpsSerializer = new TpsSerializer(log); FcsMessageSerializer fcsMessageSerializer = new FcsMessageSerializer(log); log.Debug("App: Initializing FcsService,TpsService and saleStatus as singleton.."); Mvx.IoCProvider.LazyConstructAndRegisterSingleton <ITpsService>(() => new TpsService(log, appSettings.TpsIpAddress, appSettings.TpsPort, tpsSerializer)); Mvx.IoCProvider.LazyConstructAndRegisterSingleton <IFcsService>(() => new FcsService(log, fcsMessageSerializer)); Mvx.IoCProvider.LazyConstructAndRegisterSingleton <Printer>(() => new Printer(appSettings)); Mvx.IoCProvider.LazyConstructAndRegisterSingleton <IDBAccess>(() => new DBAccess()); Mvx.IoCProvider.ConstructAndRegisterSingleton(typeof(PosManager)); Mvx.IoCProvider.ConstructAndRegisterSingleton(typeof(IPAddressManager)); Mvx.IoCProvider.LazyConstructAndRegisterSingleton <IReceiptGenerator>(() => new ReceiptGenerator( Mvx.IoCProvider.Resolve <PosManager>(), AppLanguage.multi, appSettings.FuelUnitPriceDecimal )); log.Debug("App: Load and configure all the neccessary settings.."); LoadAppSettings(); ConfigurePaymentServer(); ConfigureFcsServer(); RegisterAppStart <MainViewModel>(); }
public PropertyDetailsViewModel(IMvxNavigationService navigationService, IPropertyDetailsService propertyDetailsService, IMvxLog log, IUserDialogs userDialogs) { _navigationService = navigationService; _propertyDetailsService = propertyDetailsService; _log = log; _useDialogs = userDialogs; }
public static void Trace(this IMvxLog logger, string message) { if (logger.IsTraceEnabled()) { logger.Log(MvxLogLevel.Trace, message.AsFunc()); } }
public MainViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService) : base(logProvider, navigationService) { _log = logProvider.GetLogFor <MainViewModel>(); _log.Info("Main VM constrcuted"); //ShowChildCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<ChildViewModel>()); //ShowModalCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<ModalViewModel>()); //ShowModalNavCommand = // new MvxAsyncCommand(async () => await NavigationService.Navigate<ModalNavViewModel>()); //ShowTabsCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<TabsRootViewModel>()); //ShowSplitCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<SplitRootViewModel>()); //ShowOverrideAttributeCommand = new MvxAsyncCommand(async () => // await NavigationService.Navigate<OverrideAttributeViewModel>()); //ShowSheetCommand = new MvxAsyncCommand(async () => await NavigationService.Navigate<SheetViewModel>()); ShowWindowCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <WindowViewModel>()); //ShowMixedNavigationCommand = // new MvxAsyncCommand(async () => await NavigationService.Navigate<MixedNavFirstViewModel>()); ShowCustomBindingCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <CustomBindingViewModel>()); _counter = 3; }
public static void InfoFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsInfoEnabled()) { logger.LogFormat(MvxLogLevel.Info, message, args); } }
public static void DebugException(this IMvxLog logger, string message, Exception exception, params object[] formatParams) { if (logger.IsDebugEnabled()) { logger.Log(MvxLogLevel.Debug, message.AsFunc(), exception, formatParams); } }
public static void FatalFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsFatalEnabled()) { logger.LogFormat(MvxLogLevel.Fatal, message, args); } }
public static void Fatal(this IMvxLog logger, string message) { if (logger.IsFatalEnabled()) { logger.Log(MvxLogLevel.Fatal, message.AsFunc()); } }
public static void ErrorFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsErrorEnabled()) { logger.LogFormat(MvxLogLevel.Error, message, args); } }
public static void Error(this IMvxLog logger, string message) { if (logger.IsErrorEnabled()) { logger.Log(MvxLogLevel.Error, message.AsFunc()); } }
public MainOffersViewModel( IWebpageService webpageService, IBrowserService browserService, IMvxNavigationService navigationService, IUnitOfWork unitOfWork, ISnackbarMessageQueue snackbarMessageQueue, IMvxLog logger ) { _webpageService = webpageService; _browserService = browserService; _navigationService = navigationService; _unitOfWork = unitOfWork; SnackbarMessageQueue = snackbarMessageQueue; _logger = logger; Offers = new MvxObservableCollection <OfferViewModel>(); GetDataFromWebpageCommand = new MvxAsyncCommand(GetDataFromWebpage, CanGetDataFromWebpage); NavigateToOfferViewCommand = new MvxAsyncCommand(NavigateToOfferView); UpdatePricesCommand = new MvxAsyncCommand(UpdatePrices, CanUpdatePrices); DeleteCommand = new MvxAsyncCommand(DeleteOffer, CanDeleteOffer); InfoText = "Uruchomiono"; _logger.Debug("test uruchomiono MainOffersViewModel"); }
private DeviceCountryIdentifier(IMvxLogProvider mvxLogProvider) { _log = mvxLogProvider.GetLogFor <DeviceCountryIdentifier>(); _telephonyManager = new CTTelephonyNetworkInfo(); _log.Debug(_telephonyManager == null ? $"{nameof(CTTelephonyNetworkInfo)} is null" : $"{nameof(CTTelephonyNetworkInfo)} is not null"); }
public static void TraceFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsTraceEnabled()) { logger.LogFormat(MvxLogLevel.Trace, message, args); } }
public static void DebugFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsDebugEnabled()) { logger.LogFormat(MvxLogLevel.Debug, message, args); } }
public static void DebugException(this IMvxLog logger, string message, Exception exception) { if (logger.IsDebugEnabled()) { logger.Log(MvxLogLevel.Debug, message.AsFunc(), exception); } }
// ReSharper disable once UnusedParameter.Local private static void GuardAgainstNullLogger(IMvxLog logger) { if (logger == null) { throw new ArgumentNullException(nameof(logger)); } }
public static void Debug(this IMvxLog logger, string message) { if (logger.IsDebugEnabled()) { logger.Log(MvxLogLevel.Debug, message.AsFunc()); } }
public static void WarnFormat(this IMvxLog logger, string message, params object[] args) { if (logger.IsWarnEnabled()) { logger.LogFormat(MvxLogLevel.Warn, message, args); } }
public static void Warn(this IMvxLog logger, string message) { if (logger.IsWarnEnabled()) { logger.Log(MvxLogLevel.Warn, message.AsFunc()); } }
public PCNetworkListenerViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService) : base(logProvider, navigationService) { _log = logProvider.GetLogFor <PCNetworkListenerViewModel>(); _log.Info("PCNetworkListenerViewModel has been constructed {logProvider} {navigationService}", logProvider, navigationService); _parser = new ComboBoxSQLParseManager(logProvider); // Setup UI Commands RefreshNetMsgCommand = new MvxCommand(GetLogsFromManager); // Fetch Initial Data _stopwatch = new Stopwatch(); GetLogsFromManager(); // get singleton and create event handler IPcNetworkListener pcNetworkListener = Mvx.IoCProvider.Resolve <IPcNetworkListener>(); pcNetworkListener.MessageHit += PCNetworkManagerOnMessage; // set initial UI Fields int listeningPort = pcNetworkListener.GetAppSettingsDataUdpPort(); ListeningUDPPort = listeningPort.ToString(); TimeSinceLastStartup = GetDateFromTimeSpan(); RemoteControlTimeStamp = ""; }
public OldViewModel(IMvxLogProvider logProvider) { _mvxLog = logProvider.GetLogFor <OldViewModel>(); _mvxLog.Trace("OldViewModel.ctor called"); CloseCommand = new MvxCommand(OnClose); }
public TabsRootViewModel(IMvxNavigationService navigationService, IMvxLogProvider logProvider) { _log = logProvider.GetLogFor(nameof(TabsRootViewModel)); _navigationService = navigationService ?? throw new ArgumentNullException(nameof(navigationService)); ShowInitialViewModelsCommand = new MvxAsyncCommand(ShowInitialViewModels); ShowTabsRootBCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <TabsRootBViewModel>()); }
public MainViewModel(INotificationService notificationService, IMvxLogProvider logProvider) { _notificationService = notificationService; _mvxLog = logProvider.GetLogFor <MainViewModel>(); OldViewModelCommand = new MvxCommand(NotifyOldViewModel); NewViewModelCommand = new MvxCommand(NotifyNewViewModel); }
public NewViewModel(IMvxNavigationService mvxNavigationService, IMvxLogProvider logProvider) { _mvxNavigationService = mvxNavigationService; _mvxLog = logProvider.GetLogFor <NewViewModel>(); _mvxLog.Trace("NewViewModel.ctor called"); CloseCommand = new MvxAsyncCommand(OnCloseAsync); }
public SupplementaryCollectionViewSource(UICollectionView collectionView, NSString cellIdentifier, object headerVm = null, object footerVm = null) : base(collectionView, cellIdentifier) { _footerDataContext = footerVm; _headerDataContext = headerVm; mvxLog = Mvx.Resolve <IMvxLog>(); }
public MainViewModel(IMvxNavigationService navigationService, IMvxLog log, IAppSettings appSettings) { this.navigationService = navigationService; this.log = log; this.appSettings = appSettings; }
public ServiceBase(IMvxLog log, string baseUrl) { this.log = log; httpClient = new HttpClient(new HttpClientDiagnosticsHandler(new HttpClientHandler(), log)) { BaseAddress = new Uri(baseUrl) }; }