예제 #1
0
 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;
 }
예제 #3
0
 public ExportDiagramSpecToFileCommand(
     [NotNull] IAppServices appServices,
     [NotNull] IDiagramExporter diagramExporter)
     : base(appServices)
 {
     _diagramExporter = diagramExporter;
 }
예제 #4
0
 public ConfigurationPage()
 {
     InitializeComponent();
     appServices        = (Application.Current as App).AppServices;
     configurationModel = appServices.GetConfiguration();
     BindingContext     = configurationModel;
 }
예제 #5
0
        public BaseController(IAppServices appServices)
        {
            AppServices = appServices;

            //AppServices.LoginId = LoginId;
            AppServices.LoginIP = LoginIP;
        }
예제 #6
0
 public App()
 {
     InitializeComponent();
     //init application services
     AppServices = new AppServices();
     MainPage    = new MainPage();
 }
예제 #7
0
 public MainPage()
 {
     InitializeComponent();
     appServices = (Application.Current as App).AppServices;
     vm          = new MainPageViewModel();
     MainPageViewModel.AlertChanged += Vm_AlertChangedListener;
     AppServices.AlertChanged       += Vm_AlertChangedListener;
 }
예제 #8
0
 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;
 }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
        public HighlightDialogViewModel(IAppServices appServices,
                                        IProtoConfigManager <HighlightConfig> highlightConfigManager) : base(appServices)
        {
            _highlightConfigManager = highlightConfigManager;

            SetupCommands();

            LoadConfigs();
        }
예제 #13
0
        public FolderViewModel(IAppServices appServices,
                               IUiFactory uiFactory,
                               IViewModelFactory userViewModelFactory) : base(appServices)
        {
            _userViewModelFactory = userViewModelFactory;
            _uiFactory            = uiFactory;

            InitializeCommands();
            SetupEvents();
        }
예제 #14
0
 public DeskController(IWallpaperServices wallpaperServices,
                       IDeskServices deskServices,
                       IAppServices appServices,
                       IUserServices userServices)
 {
     _wallpaperServices = wallpaperServices;
     _deskServices      = deskServices;
     _appServices       = appServices;
     _userServices      = userServices;
 }
예제 #15
0
 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";
 }
예제 #16
0
        public KeyFolderViewModel(IAppServices appServices,
                                  IUiFactory uiFactory,
                                  IDataViewModelFactory dataViewModelFactory) : base(appServices)
        {
            _uiFactory = uiFactory;

            _dataViewModelFactory = dataViewModelFactory;

            InitializeCommands();
        }
예제 #17
0
 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();
        }
예제 #19
0
 public UserFolderViewModel(
     string name,
     string folderPath,
     IAppServices appServices,
     IUiFactory uiFactory)
     : base(appServices)
 {
     Name       = name;
     FolderPath = folderPath;
     InitializeEvents();
     _uiFactory = uiFactory;
 }
예제 #20
0
        public OptionsPanelViewModel(IAppServices appServices,
                                     IDialogFactory dialogFactory,
                                     IDocumentContainerPanelViewModel documentPanelViewModel,
                                     IUserDefinedSettings settings) : base(appServices)
        {
            _settings               = settings;
            _dialogFactory          = dialogFactory;
            _documentPanelViewModel = documentPanelViewModel;

            _documentPanelViewModel.SelectedPageChanged += _documentPanelViewModel_SelectedPageChanged;

            SetupCommands();
        }
예제 #21
0
 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);
 }
예제 #22
0
        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;
 }
예제 #24
0
        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);
            }
        }
예제 #25
0
파일: AppContext.cs 프로젝트: weeble/ohos
 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;
 }
예제 #26
0
        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());
            }
        }
예제 #27
0
        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;
                }
            };
        }
예제 #29
0
        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());
            };
        }
예제 #30
0
        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);
                }
            }
        }
예제 #31
0
        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)
 {
 }
예제 #33
0
파일: AppShell.cs 프로젝트: weeble/ohos
 /// <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;
     }
 }
예제 #34
0
파일: AppShellImpl.cs 프로젝트: weeble/ohos
 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();
     }
 }