public ShowSourceFileCommand( [NotNull] IAppServices appServices, [NotNull] IDiagramNode diagramNode) : base(appServices) { _diagramNode = diagramNode; }
protected override void OnAppearing() { base.OnAppearing(); appServices = (Application.Current as App).AppServices; addressModel = appServices.GetAddress(); BindingContext = addressModel; }
public ExportDiagramSpecToFileCommand( [NotNull] IAppServices appServices, [NotNull] IDiagramExporter diagramExporter) : base(appServices) { _diagramExporter = diagramExporter; }
public ConfigurationPage() { InitializeComponent(); appServices = (Application.Current as App).AppServices; configurationModel = appServices.GetConfiguration(); BindingContext = configurationModel; }
public BaseController(IAppServices appServices) { AppServices = appServices; //AppServices.LoginId = LoginId; AppServices.LoginIP = LoginIP; }
public App() { InitializeComponent(); //init application services AppServices = new AppServices(); MainPage = new MainPage(); }
public MainPage() { InitializeComponent(); appServices = (Application.Current as App).AppServices; vm = new MainPageViewModel(); MainPageViewModel.AlertChanged += Vm_AlertChangedListener; AppServices.AlertChanged += Vm_AlertChangedListener; }
public AddItemsToDiagramCommand( [NotNull] IAppServices appServices, [NotNull] IReadOnlyCollection <ModelNodeId> modelNodeIds, bool followWithViewport) : base(appServices) { _modelNodeIds = modelNodeIds; _followWithViewport = followWithViewport; }
public MainPageViewModel() { appServices = (Application.Current as App).AppServices; _dailyViewModel = new DailyWeatherViewModel(); _forecastViewModel = new ObservableCollection <ForecastWeatherViewModel>(); _detailedWeatheVM = new DetailedWeatherViewModel(); weatherService = new WeatherService(); AppServices.DataChanged += RefreshWeatherData; }
public LoginViewModel(IAppServices services, IAppFactory factory, IMessenger messenger) { _services = services ?? throw new ArgumentNullException(nameof(services)); _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _messenger = messenger ?? throw new ArgumentNullException(nameof(messenger)); LoginCommand = new RelayCommand(LoginCommandMethod); CreateUserCommand = new RelayCommand(CreateUserCommandMethod); }
private void RegisterShellCommands(IMenuCommandService menuCommandService, IAppServices appServices) { var commandSetGuid = PackageGuids.SoftVisCommandSetGuid; var commandRegistrant = new CommandRegistrant(menuCommandService, appServices); commandRegistrant.RegisterCommands(commandSetGuid, ShellCommands.CommandSpecifications); commandRegistrant.RegisterToggleCommands(commandSetGuid, ShellCommands.ToggleCommandSpecifications); commandRegistrant.RegisterCombos(commandSetGuid, ShellCommands.ComboSpecifications); }
public HighlightDialogViewModel(IAppServices appServices, IProtoConfigManager <HighlightConfig> highlightConfigManager) : base(appServices) { _highlightConfigManager = highlightConfigManager; SetupCommands(); LoadConfigs(); }
public FolderViewModel(IAppServices appServices, IUiFactory uiFactory, IViewModelFactory userViewModelFactory) : base(appServices) { _userViewModelFactory = userViewModelFactory; _uiFactory = uiFactory; InitializeCommands(); SetupEvents(); }
public DeskController(IWallpaperServices wallpaperServices, IDeskServices deskServices, IAppServices appServices, IUserServices userServices) { _wallpaperServices = wallpaperServices; _deskServices = deskServices; _appServices = appServices; _userServices = userServices; }
public CommandViewModel(IAppServices appServices, CommandResolver commandResolver) { _eventAggregator = appServices.EventAggregator; _log = appServices.Log; _appServices = appServices; _commandResolver = commandResolver; _eventAggregator.Subscribe(this); _matchedItems = new BindableCollection <MatchResult>(); DisplayName = "Command"; }
public KeyFolderViewModel(IAppServices appServices, IUiFactory uiFactory, IDataViewModelFactory dataViewModelFactory) : base(appServices) { _uiFactory = uiFactory; _dataViewModelFactory = dataViewModelFactory; InitializeCommands(); }
public LogViewerGridViewModel(IAppServices appServices, IUserDefinedSettings settings, IProtoConfigManager <HighlightConfig> highlightConfigManager, string filePath) : base(appServices) { _settings = settings; _highlightConfigManager = highlightConfigManager; LoadHighlightSettings(); LocalPath = filePath; ReadFile(filePath); }
public FolderCreationViewModel(IAppServices appServices, IFolderViewModel parent) : base(appServices) { var logger = appServices.GetLogger <FolderCreationViewModel>(); logger.Log(LoggingLevel.Debug, "mememe"); _logger = logger; _parent = parent; SetupCommands(); }
public UserFolderViewModel( string name, string folderPath, IAppServices appServices, IUiFactory uiFactory) : base(appServices) { Name = name; FolderPath = folderPath; InitializeEvents(); _uiFactory = uiFactory; }
public OptionsPanelViewModel(IAppServices appServices, IDialogFactory dialogFactory, IDocumentContainerPanelViewModel documentPanelViewModel, IUserDefinedSettings settings) : base(appServices) { _settings = settings; _dialogFactory = dialogFactory; _documentPanelViewModel = documentPanelViewModel; _documentPanelViewModel.SelectedPageChanged += _documentPanelViewModel_SelectedPageChanged; SetupCommands(); }
public AppShellModule( IAppServices aFullPrivilegeAppServices, IConfigFileCollection aConfiguration, IXappServer aXappServer, string aNodeGuid) { string storePath = aConfiguration.GetElementValueAsFilepath(e=>e.Element("system-settings").Element("store")); if (storePath == null) { storePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "store"); } DefaultStoreDirectory storeDirectory = new DefaultStoreDirectory(storePath); string installBase = aConfiguration.GetElementValueAsFilepath(e=>e.Element("system-settings").Element("installed-apps")); if (installBase == null) { installBase = Path.Combine(storePath, DefaultAppsDirectory); } string systemAppConfigDir = aConfiguration.GetElementValueAsFilepath(e => e.Element("system-settings").Element("system-app-config")); IConfigFileCollection systemAppsConfig; if (!string.IsNullOrEmpty(systemAppConfigDir)) { systemAppsConfig = ConfigFileCollection.ReadDirectoryInOrder(new DirectoryInfo(systemAppConfigDir), "*.xml"); } else { systemAppsConfig = new NullConfigFileCollection(); } DefaultAppsDirectory appsDirectory = new DefaultAppsDirectory(installBase); DefaultZipReader zipReader = new DefaultZipReader(); //DefaultAddinManager addinManager = new DefaultAddinManager(installBase, installBase, installBase); var addinManager = new MefAddinManager(appsDirectory); AppMetadataStore appMetadataStore = new AppMetadataStore(new DirectoryInfo(Path.Combine(storePath, "_installed"))); ZipVerifier zipVerifier = new ZipVerifier(zipReader); AppShell = new AppShell( aFullPrivilegeAppServices, aConfiguration, addinManager, appsDirectory, storeDirectory, (aDevice, aAppName, aAppIconUri, aAppDescriptionUri)=> new ProviderApp( aDevice, aNodeGuid, String.Format("/{0}/Upnp/Resources/", aNodeGuid), aAppName, aAppIconUri, aAppDescriptionUri), zipReader, appMetadataStore, zipVerifier, new SystemAppsConfiguration(systemAppsConfig), aXappServer, false); }
public AddAddressPage(Page parentPage, Action <ExtendedAddress> saved = null) { InitializeComponent(); mAppServices = DependencyService.Get <IAppServices>(); ParentPage = parentPage; Saved = saved; mStates = mAddressFacade.GetStates(); stateEntry.Items.Clear(); foreach (var item in mStates.Keys) { stateEntry.Items.Add(item); } }
public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IAppServices appServices, IConfiguration configuration, IEmailSender emailSender, ILogger <AccountController> logger) { _userManager = userManager; _signInManager = signInManager; _appServices = appServices; _configuration = configuration; _emailSender = emailSender; _logger = logger; }
public HomeMasterPage() { try { InitializeComponent(); IsLoggedIn = Shared.IsLoggedIn; mAppServices = DependencyService.Get <IAppServices>(); LabelAppVersion.Text = "v" + mAppServices.AppVersion + " " + AppResources.AppVersion; this.SizeChanged += (sender, e) => { try { ImageLogo.WidthRequest = this.Width * 0.6; if (this.Width >= 350) { LabelAppVersion.FontSize = Device.GetNamedSize(NamedSize.Small, LabelAppVersion); } else if (this.Width >= 290) { LabelAppVersion.FontSize = Device.GetNamedSize(NamedSize.Small, LabelAppVersion) * 0.9; } else if (this.Width >= 250) { LabelAppVersion.FontSize = Device.GetNamedSize(NamedSize.Small, LabelAppVersion) * 0.8; } else { LabelAppVersion.FontSize = Device.GetNamedSize(NamedSize.Small, LabelAppVersion) * 0.7; } } catch (Exception e1) { ExceptionHandler.Catch(e1); } }; LoadMenu(); } catch (Exception e) { ExceptionHandler.Catch(e); } }
public AppContext( IAppServices aServices, string aStaticPath, string aStorePath, IConfigFileCollection aConfiguration, DvDevice aDevice, string aAppName, IXappServer aXappServer ) { iXappServer = aXappServer; Services = aServices; StaticPath = aStaticPath; StorePath = aStorePath; Configuration = aConfiguration; Device = aDevice; Name = aAppName; }
public void NavigateTo(Type targetType) { if (targetType != null) { mAppServices = DependencyService.Get <IAppServices>(); var page = (Page)Activator.CreateInstance(targetType); NavigationHandler.SetDetailPage(page); Task.Run(() => { new System.Threading.ManualResetEvent(false).WaitOne(200); }).ContinueWith(t => { IsPresented = false; var itemsSource = masterPage.ListView.ItemsSource; masterPage.ListView.ItemsSource = null; masterPage.ListView.ItemsSource = itemsSource; }, TaskScheduler.FromCurrentSynchronizationContext()); } }
public SigninPage() { try { InitializeComponent(); mAppServices = DependencyService.Get <IAppServices>(); LabelForgotYourPassword.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(() => { Device.OpenUri(new Uri(PCLAppConfig.ConfigurationManager.AppSettings["ForgotPasswordUrl"])); }) }); } catch (Exception e) { ExceptionHandler.Catch(e); } }
public GroupedDeliveryAddressListPage(Page parentPage, Action <GroupedDeliveryDestination> saved = null) { InitializeComponent(); ParentPage = parentPage; Saved = saved; mAppServices = DependencyService.Get <IAppServices>(); double lastWidth = 0; double lastHeight = 0; this.SizeChanged += (sender, e) => { if (this.Width > 1 && this.Height > 1) { if (lastWidth < this.Width || lastHeight < this.Height) { lastWidth = this.Width; lastHeight = this.Height; ImageBackgroundFront.WidthRequest = this.Width; ImageBackgroundFront.HeightRequest = lastHeight; ImageBackgroundBehind.WidthRequest = this.Width; ImageBackgroundBehind.HeightRequest = lastHeight; } } }; ImageBackgroundBehind.SizeChanged += (sender, e) => { if (this.ImageBackgroundBehind.Width > 1 && this.ImageBackgroundBehind.Height > 1) { ImageBackgroundFront.WidthRequest = this.ImageBackgroundBehind.Width; ImageBackgroundFront.HeightRequest = this.ImageBackgroundBehind.Height; } }; }
public ServiceNotAvailablePage(ExtendedAddress extendedAddress, string fullName = "", string email = "") { InitializeComponent(); mAppServices = DependencyService.Get <IAppServices>(); if (!string.IsNullOrEmpty(fullName)) { EntryFullName.Text = fullName; } if (!string.IsNullOrEmpty(email)) { EntryEmail.Text = email; } if (!string.IsNullOrEmpty(extendedAddress.BasicAddress.ZipCode)) { LabelServicesAreNotCurrentlyAvailable.Text = AppResources.ServicesAreNotCurrentlyAvailableZipCode + " " + extendedAddress.BasicAddress.ZipCode + "."; } else { LabelServicesAreNotCurrentlyAvailable.Text = AppResources.ServicesAreNotCurrentlyAvailable; } GreenButtonNotifyMe.Clicked += (sender, e) => { this.IsBusy = true; var fullname = EntryFullName.Text; var id = EntryFullName.Text; Task.Run(() => { }).ContinueWith((arg) => { Utils.ShowSuccessMessage(AppResources.LeadsGenerationMessage, 4); Navigation.PopAsync(); this.IsBusy = false; }, TaskScheduler.FromCurrentSynchronizationContext()); }; }
public void Initialize(HttpConfiguration config) { if (_initialized) { return; } // Load repository configuration object temp = null; if ((temp = ConfigurationManager.GetSection("repoConfig")) != null) { _repoConf = temp as RepositoryConfig; } var builder = new ContainerBuilder(); try { builder.RegisterApiControllers(Assembly.GetExecutingAssembly()); RegisterAll(builder); _initialized = true; } catch (Exception err) { throw; } finally { if (_initialized) { _container = builder.Build(); _services = new AutofacServices(_container); } } }
void ListView_ItemTapped(object sender, ItemTappedEventArgs e) { try { var item = e.Item as MasterPageItemViewModel; if (item != null && !IsChanging) { masterPage.ListView.SelectedItem = null; foreach (var masterPageItemViewModel in masterPage.ListView.ItemsSource.Cast <MasterPageItemViewModel>().ToList()) { //masterPageItemViewModel.IsSelected = masterPageItemViewModel == item; } if (item.TargetType != null) { mAppServices = DependencyService.Get <IAppServices>(); var page = (Page)Activator.CreateInstance(item.TargetType); NavigationHandler.SetDetailPage(page); Task.Run(() => { new System.Threading.ManualResetEvent(false).WaitOne(200); }).ContinueWith(t => { IsPresented = false; var itemsSource = masterPage.ListView.ItemsSource; masterPage.ListView.ItemsSource = null; masterPage.ListView.ItemsSource = itemsSource; }, TaskScheduler.FromCurrentSynchronizationContext()); } } } catch (Exception e1) { ExceptionHandler.Catch(e1); } }
protected AsyncCommandWithParameterBase(IAppServices appServices) : base(appServices) { }
/// <summary> /// Create an app shell. Hosted apps are not automatically started. /// </summary> /// <param name="aFullPrivilegeAppServices"> /// Services that will be provided to apps granted permissions. /// (If we implement restricted permissions, such apps would /// receive only a subset of these services.) /// </param> /// <param name="aConfiguration"> /// Parsed config files. Some pre-installed apps need to read /// configuration information (such as location of serial devices) /// from these files. /// </param> /// <param name="aAddinManager"> /// Interface to the addin manager that handles actual loading of /// plugins. (Currently we use MEF.) /// </param> /// <param name="aAppsDirectory"> /// Interface to inspect and manipulate the apps directory, where /// we put app binaries and their static data. /// </param> /// <param name="aStoreDirectory"> /// Interface to inspect and manipulate the store directory, where /// apps store their dynamic, persistent data. /// </param> /// <param name="aAppProviderConstructor"> /// Constructor to create an AppProvider. The AppShell is responsible /// for creating a device for each app and publishing the app service /// on that device on behalf of the app, and it uses this to construct /// such a provider. (Unit tests need to be able to pass in a /// substitute here. /// </param> /// <param name="aZipReader"> /// Reads entries from a zip file. /// </param> /// <param name="aAppMetadataStore"> /// Stores persistent data about apps, such as deferred deletions or /// upgrades. /// </param> /// <param name="aZipVerifier"> /// Verifies that a zip file contains a valid OpenHome app. /// </param> /// <param name="aAutoStart"> /// If true, start the AppShell immediately. Otherwise, caller needs /// to call Start() when they want to start apps. /// </param> public AppShell( IAppServices aFullPrivilegeAppServices, IConfigFileCollection aConfiguration, IAddinManager aAddinManager, IAppsDirectory aAppsDirectory, IStoreDirectory aStoreDirectory, Func<DvDevice, string, string, string, IDvProviderOpenhomeOrgApp1> aAppProviderConstructor, IZipReader aZipReader, IAppMetadataStore aAppMetadataStore, IZipVerifier aZipVerifier, ISystemAppsConfiguration aSystemAppsConfiguration, IXappServer aXappServer, bool aAutoStart) { lock (iLock) { iImpl = new AppShellImpl( aFullPrivilegeAppServices, aConfiguration, aAddinManager, aAppsDirectory, aStoreDirectory, aAppProviderConstructor, aZipReader, aAppMetadataStore, aZipVerifier, aSystemAppsConfiguration, aXappServer, aAutoStart); iImpl.AppStatusChanged += OnAppStatusChanged; } }
public AppShellImpl( IAppServices aFullPrivilegeAppServices, IConfigFileCollection aConfiguration, IAddinManager aAddinManager, IAppsDirectory aAppsDirectory, IStoreDirectory aStoreDirectory, Func<DvDevice, string, string, string, IDvProviderOpenhomeOrgApp1> aAppProviderConstructor, IZipReader aZipReader, IAppMetadataStore aMetadataStore, IZipVerifier aZipVerifier, ISystemAppsConfiguration aSystemAppsConfiguration, IXappServer aXappServer, bool aAutoStart) { iFullPrivilegeAppServices = aFullPrivilegeAppServices; iZipVerifier = aZipVerifier; iXappServer = aXappServer; //iZipReader = aZipReader; iMetadataStore = aMetadataStore; iConfiguration = aConfiguration; iAddinManager = aAddinManager; iAppsDirectory = aAppsDirectory; iStoreDirectory = aStoreDirectory; iAppProviderConstructor = aAppProviderConstructor; iNodeRebooter = iFullPrivilegeAppServices.NodeRebooter; //iApps = new Dictionary<string, PublishedApp>(); iHistory = new List<HistoryItem>(); // !!!! restore previous history from disk iKnownApps = new Dictionary<string, KnownApp>(); foreach (var app in iMetadataStore.LoadAppsFromStore()) { GetOrCreateKnownApp(app.AppName); } foreach (string dirname in iAppsDirectory.GetAppSubdirectories()) { GetOrCreateKnownApp(dirname); } MarkSystemApps(aSystemAppsConfiguration); if (aAutoStart) { Start(); } }