Esempio n. 1
0
        public EditSchemeViewModel(
            IWindowManager windowManager,
            ISchemeStorageService schemeStorage,
            INavigationService navigationService,
            ISharingService sharingService,
            IBitmapService bitmapService)
        {
            this.windowManager     = windowManager;
            this.schemeStorage     = schemeStorage;
            this.navigationService = navigationService;
            this.sharingService    = sharingService;
            this.bitmapService     = bitmapService;

            Types = new BindableCollection <SchemeTypeViewModel>
            {
                new SchemeTypeViewModel(SchemeType.Complimentary, new ComplimentarySchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Analogous, new AnalogousSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Triad, new TriadSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Monochromatic, new MonochromeSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Custom, new CustomSchemeEditorViewModel(windowManager))
            };

            SelectedType = Types[0];

            foreach (var type in Types)
            {
                type.Editor.PropertyChanged += (s, e) =>
                {
                    NotifyOfPropertyChange(() => CanSave);
                    NotifyOfPropertyChange(() => CanShare);
                };
            }
        }
        // CTOR
        public MediaContentViewModel(
            INavigationService navigationService,
            IPlaylistDataService playlistDataService,
            ISharingService sharingService,
            ISettingsDataService settingsDataService,
            IPresentationDataService presentationDataService,
            ICategoryContentDataService categoryContentDataService,
            IDocumentInfoDataService documentInfoDataService,
            ICategoryDataService categoryDataService,
            IContentReviewDataService contentReviewDataService) : base(settingsDataService)
        {
            _presentationDataService    = presentationDataService;
            _navigationService          = navigationService;
            _playlistDataService        = playlistDataService;
            _sharingService             = sharingService;
            _contentReviewDataService   = contentReviewDataService;
            _categoryContentDataService = categoryContentDataService;
            _documentInfoDataService    = documentInfoDataService;
            _categoryDataService        = categoryDataService;


            // Create an empty list to work from
            _relatedContent = new List <MediaLink>();

            // Create the flyout
            _relatedContentFlyout = new RelatedContentFlyout();

            // Setup the messages
            RegisterMessages();
        }
Esempio n. 3
0
        public YourTimesViewModel(IApplicationStateService applicationStateService, ICTimeService cTimeService, ISharingService sharingService)
        {
            Guard.NotNull(applicationStateService, nameof(applicationStateService));
            Guard.NotNull(cTimeService, nameof(cTimeService));
            Guard.NotNull(sharingService, nameof(sharingService));

            this._applicationStateService = applicationStateService;
            this._cTimeService = cTimeService;
            this._sharingService = sharingService;

            this.WhenAnyValue(f => f.StartDate, f => f.EndDate)
                .Select(f => CTime2Resources.GetFormatted("MyTimes.TitleFormat", this.StartDate, this.EndDate))
                .Subscribe(name => this.DisplayName = name);

            this.LoadTimes = UwCoreCommand.Create(this.LoadTimesImpl)
                .ShowLoadingOverlay(CTime2Resources.Get("Loading.Times"))
                .HandleExceptions()
                .TrackEvent("LoadTimes");
            this.LoadTimes.ToProperty(this, f => f.Times, out this._timesHelper);

            this.Share = UwCoreCommand.Create(this.ShareImpl)
                .HandleExceptions()
                .TrackEvent("ShareMyTimes");

            this.StartDate = DateTimeOffset.Now.StartOfMonth();
            this.EndDate = DateTimeOffset.Now.WithoutTime();
        }
Esempio n. 4
0
        public ListViewModel(
            IToDoService toDoService, 
            IMessenger messenger, 
            IDispatcher dispatcher,
            ISearchService searchService,
            ISharingService sharingService
            )
        {
            _toDoService = toDoService;
            _searchService = searchService;
            _dispatcher = dispatcher;
            _messenger = messenger;
            _sharingService = sharingService;

            Items = new ObservableCollection<ToDoItem>();
            SearchResult = new ObservableCollection<ToDoItem>();

            RegisterSubscriptions();
            SetupCommands();
            
            Items.CollectionChanged += (s, c) =>
            {
                var count = Items.Count;
                Count = count;
                messenger.Send(new ItemCountChanged { Count = count });
            };
            PopulateItems();
        }
        public SharingController(ISharingService sharingService, IConfiguration conf)
        {
            var strConn = conf.GetValue <string>("Oracle:ConnStr");

            _sharingService = sharingService;
            _sharingService.Connect(strConn);
        }
Esempio n. 6
0
 public SharingServicePlayer(ISharingService service, int playerId, bool isLocal)
 {
     _service = service ?? throw new ArgumentNullException("Sharing service can't be null");
     PlayerId = playerId;
     IsLocal  = isLocal;
     // Start with an invalid pose until one is received from the server
     _pose = new Pose(Vector3.positiveInfinity, Quaternion.identity);
 }
Esempio n. 7
0
 public ProfileController(IMapper mapper, ICommentService commentService, SignInManager <User> signInManager, UserManager <User> userManager, ISharingService sharingService)
 {
     _signInManager  = signInManager;
     _userManager    = userManager;
     _sharingService = sharingService;
     _commentService = commentService;
     _mapper         = mapper;
 }
Esempio n. 8
0
        public BaseViewModel(ISharingService sharingService,
		    IPageNavigationService pageNavigationService,
		    IUnityContainer unityContainer)
        {
            _sharingService = sharingService;
            _pageNavigationService = pageNavigationService;
            _unityContainer = unityContainer;
        }
 public PresentationDataService(
     ISharingService sharingService,
     IContentReviewDataService contentReviewDataService,
     IEventDataService eventDataService)
 {
     _sharingService           = sharingService;
     _contentReviewDataService = contentReviewDataService;
     _eventDataService         = eventDataService;
 }
Esempio n. 10
0
 public ShareController(ISharingService sharingService, UserManager <User> userManager,
                        SignInManager <User> signInManager, IMapper mapper, ICategoryService categoryService)
 {
     _sharingService  = sharingService;
     _userManager     = userManager;
     _signInManager   = signInManager;
     _mapper          = mapper;
     _categoryService = categoryService;
 }
Esempio n. 11
0
 public HomeController(ICommentService commentService, ISharingService sharingService, UserManager <User> userManager,
                       SignInManager <User> signInManager, IUserService userService, IMapper mapper)
 {
     _sharingService = sharingService;
     _userManager    = userManager;
     _signInManager  = signInManager;
     _commentService = commentService;
     _userService    = userService;
     _mapper         = mapper;
 }
Esempio n. 12
0
 public FoldersController(IFolderService folderService,
                          IAuthorizationService authorizationService,
                          ISharingService sharingService,
                          ILinkGenerator <FolderDTO> linkGenerator)
 {
     _folderService        = folderService;
     _authorizationService = authorizationService;
     _sharingService       = sharingService;
     _linkGenerator        = linkGenerator;
 }
Esempio n. 13
0
 public SharingController(IFolderService folderService,
                          IFileService fileService, ISharingService sharingService,
                          IShareStatusService shareStatusService, IAuthorizationService authorizationService)
 {
     _folderService        = folderService;
     _fileService          = fileService;
     _sharingService       = sharingService;
     _shareStatusService   = shareStatusService;
     _authorizationService = authorizationService;
 }
Esempio n. 14
0
        static App()
        {
            Container = ContainerContext.Current;
            Container.Register<IMessenger>(Messenger.Default);

            NotificationService = Container.Get<INotificationService>();
            ApplicationService = Container.Get<IApplicationService>();
            SharingService = Container.Get<ISharingService>();
            SearchService = Container.Get<ISearchService>();
        }
Esempio n. 15
0
        public void Setup()
        {
            IInfraDAL dal     = new InfraDAL();
            var       strConn = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))" +
                                "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)));" +
                                "User Id=ZIVPROJ;Password=1234;";

            _service = new SharingServiceImpl(new DocMarkingSystemDALImpl(dal), new SharingWebSocketImpl(new SocketHandlerInfra(new ConnectionManagerInfra())));
            _service.Connect(strConn);
        }
        //private ICommand _navigateToVideoPlayerPageCommand;
        public VideosCollectionPageViewModel(IUnityContainer unityContainer,
            IPageNavigationService pageNavigationService,
            ISharingService sharingService)
            : base(sharingService, pageNavigationService, unityContainer)
        {
            _unityContainer = unityContainer;
            _pageNavigationService = pageNavigationService;
            _sharingService = sharingService;

            InitializeData();
        }
Esempio n. 17
0
 public DocumentController(
     IDocumentService documentService,
     IUsersService userService,
     ISharingService sharingService,
     IEmailService emailService,
     IPathProvider pProvider)
 {
     _documentService = documentService ?? throw new ArgumentNullException(nameof(documentService));
     _userService     = userService ?? throw new ArgumentNullException(nameof(userService));
     _emailService    = emailService ?? throw new ArgumentNullException(nameof(emailService));
     _sharingService  = sharingService ?? throw new ArgumentNullException(nameof(sharingService));
     _pProvider       = pProvider;
 }
Esempio n. 18
0
        public ItemDetailsPageViewModel(IPageNavigationService pageNavigationService,
            ISharingService sharingService,
            List<Item> items,
            Item selectedItem,
            IUnityContainer unityContainer,
            ILiveTileService liveTileService)
            : base(sharingService, pageNavigationService, unityContainer)
        {
            _sharingService = sharingService;
            _liveTileService = liveTileService;

            ItemsCollection = items;
            SelectedItem = selectedItem;
        }
Esempio n. 19
0
        public AlbumPhotosPageViewModel(
            IPageNavigationService pageNavigationService,
            List<FlickrImage> flickrImages,
            ISharingService sharingService,
            ILiveTileService liveTileService,
            ILockScreenService lockScreenService,
            IUnityContainer unityContainer)
            : base(sharingService, pageNavigationService, unityContainer)
        {
            _sharingService = sharingService;
            _liveTileService = liveTileService;
            _lockScreenService = lockScreenService;

            FlickrImagesCollection = flickrImages;
            SelectedFlickrImage = FlickrImagesCollection[0];
        }
        protected override void Configure()
        {
            _builder.RegisterType <EventAggregator>().As <IEventAggregator>().SingleInstance();
            _builder.Register(x => _frameAdapter).As <INavigationService>().SingleInstance();
            _builder.Register(x => Container).As <IContainer>().SingleInstance();
            _builder.RegisterInstance(this).AsSelf().As <IActivateComponent>().As <ISessionEvents>().SingleInstance();
            _builder.RegisterType <SettingsWindowManager>().As <ISettingsWindowManager>().AutoActivate().SingleInstance();

            _builder.RegisterType <SharingService>().As <ISharingService>().SingleInstance();
            _builder.RegisterType <SettingsService>().As <ISettingsService>().SingleInstance();
            RegisterViewModels(x => typeof(INotifyPropertyChanged).IsAssignableFrom(x));
            _builder.RegisterAssemblyModules(AssemblySource.Instance.ToArray());

            HandleConfigure(_builder);
            Container = _builder.Build();

            ViewModelLocator.LocateForView = LocateForView;
            SharingService = Container.Resolve <ISharingService>();
            _rootFrame     = CreateApplicationFrame();
        }
        protected override void Configure()
        {
            _builder.RegisterType<EventAggregator>().As<IEventAggregator>().SingleInstance();
            _builder.Register(x => _frameAdapter).As<INavigationService>().SingleInstance();
            _builder.Register(x => Container).As<IContainer>().SingleInstance();
            _builder.RegisterInstance(this).AsSelf().As<IActivateComponent>().As<ISessionEvents>().SingleInstance();
#if WINDOWS_APP
            _builder.RegisterType<SettingsWindowManager>().As<ISettingsWindowManager>().AutoActivate().SingleInstance();
            _builder.RegisterType<SettingsService>().As<ISettingsService>().SingleInstance();
#endif
            _builder.RegisterType<SharingService>().As<ISharingService>().SingleInstance();

            RegisterViewModels(x => typeof(INotifyPropertyChanged).IsAssignableFrom(x));
            _builder.RegisterAssemblyModules(AssemblySource.Instance.ToArray());

            HandleConfigure(_builder);
            Container = _builder.Build();

            ViewModelLocator.LocateForView = LocateForView;
            SharingService = Container.Resolve<ISharingService>();
            _rootFrame = CreateApplicationFrame();
        }
Esempio n. 22
0
        public DetailedStatisticViewModel(ICTimeService cTimeService, IApplicationStateService applicationStateService, INavigationService navigationService, ISharingService sharingService)
        {
            Guard.NotNull(cTimeService, nameof(cTimeService));
            Guard.NotNull(applicationStateService, nameof(applicationStateService));
            Guard.NotNull(navigationService, nameof(navigationService));
            Guard.NotNull(sharingService, nameof(sharingService));

            this._cTimeService = cTimeService;
            this._applicationStateService = applicationStateService;
            this._navigationService = navigationService;
            this._sharingService = sharingService;

            this.LoadChart = UwCoreCommand.Create(this.LoadChartImpl)
                .ShowLoadingOverlay(CTime2Resources.Get("Loading.LoadCharts"))
                .HandleExceptions();
            this.LoadChart.ToProperty(this, f => f.ChartItems, out this._chartItemsHelper);

            this.GoToMyTimesCommand = UwCoreCommand.Create(this.GoToMyTimes)
                .HandleExceptions();

            this.Share = UwCoreCommand.Create(this.ShareImpl)
                .HandleExceptions()
                .TrackEvent("ShareDetailedStatistic");
        }
 public SharingServicePlayer(ISharingService service, int playerId, bool isLocal)
 {
     _service = service ?? throw new ArgumentNullException("Sharing service can't be null");
     PlayerId = playerId;
     IsLocal  = isLocal;
 }
 /// <summary>
 /// Release the sharing service.
 /// </summary>
 public void Dispose()
 {
     _service = null;
 }
 private SharingServiceTarget(ISharingService service)
 {
     _service               = service ?? throw new ArgumentNullException("Provider can't be null");
     _service.Connected    += ProviderConnected;
     _service.Disconnected += ProviderDisconnected;
 }
Esempio n. 26
0
 public void TearDown()
 {
     _sharingService = null;
 }
 public CategoryListViewComponent(ICategoryService categoryService, ISharingService sharingService)
 {
     _categoryService = categoryService;
     _sharingService  = sharingService;
 }
Esempio n. 28
0
 public SharingController()
 {
     _sharingService = new SharingService();
 }
Esempio n. 29
0
 public SharingController(ISharingService sharingService)
 {
     _sharingService = sharingService;
 }
        protected override void Configure()
        {
            _builder.RegisterType<EventAggregator>().As<IEventAggregator>().SingleInstance();
            _builder.Register(x => _frameAdapter).As<INavigationService>().SingleInstance();
            _builder.Register(x => Container).As<IContainer>().SingleInstance();

            _builder.RegisterType<SharingService>().As<ISharingService>().SingleInstance();
            _builder.RegisterType<SettingsService>().As<ISettingsService>().SingleInstance();

            _builder.RegisterAssemblyTypes(AssemblySource.Instance.Concat(new[] { typeof(IStorageMechanism).GetTypeInfo().Assembly }).ToArray())
                .AssignableTo<IStorageMechanism>()
                .AsImplementedInterfaces();

            _builder.RegisterType<StorageCoordinator>().AsSelf().SingleInstance();

            RegisterViewModels(x => !string.IsNullOrEmpty(x.Namespace) &&
                x.Namespace.Contains("ViewModels") &&
                    typeof(INotifyPropertyChanged).IsAssignableFrom(x));

            _builder.RegisterAssemblyTypes(AssemblySource.Instance.ToArray())
                .AssignableTo<IStorageHandler>()
                .AsSelf()
                .AsImplementedInterfaces()
                .SingleInstance();

            HandleConfigure(_builder);
            Container = _builder.Build();

            ViewModelLocator.LocateForView = LocateForView;

            _exportedTypeCache = AssemblySource.Instance.SelectMany(a => a.GetExportedTypes()).Where(x => x.IsAssignableTo<FrameworkElement>()).ToArray();
            ViewLocator.LocateTypeForModelType = (modelType, displayLocation, context) =>
            {
                var viewTypeName = modelType.FullName;

                if (Execute.InDesignMode)
                {
                    viewTypeName = ViewLocator.ModifyModelTypeAtDesignTime(viewTypeName);
                }

                viewTypeName = viewTypeName.Substring(
                    0,
                    viewTypeName.IndexOf('`') < 0
                        ? viewTypeName.Length
                        : viewTypeName.IndexOf('`')
                    );

                var viewTypeList = ViewLocator.TransformName(viewTypeName, context);
                var viewType = viewTypeList.Join(_exportedTypeCache, n => n, t => t.FullName, (n, t) => t).FirstOrDefault();

                if (viewType == null)
                    Debug.WriteLine("View not found. Searched: {0}.", string.Join(", ", viewTypeList.ToArray()));

                return viewType;
            };

            SharingService = Container.Resolve<ISharingService>();
            _storageCoordinator = Container.Resolve<StorageCoordinator>();
            _storageCoordinator.Start();

            _rootFrame = CreateApplicationFrame();
        }
Esempio n. 31
0
 public void Setup()
 {
     _sharingService = new SharingServiceImpl(_drawingDal);
 }
 public ShareSourceViewModel(INavigationService navigationService, ISharingService sharingService)
     : base(navigationService)
 {
     this.sharingService = sharingService;
 }
 public Sharing(ISharingService _SharingService)
 {
     SharingService = _SharingService;
 }
 public ShareSourceViewModel(INavigationService navigationService, ISharingService sharingService)
     : base(navigationService)
 {
     this.sharingService = sharingService;
 }
Esempio n. 35
0
        public MainPageViewModel(
            IPageNavigationService pageNavigationService,
            IItemsService dataService,
            ITweetsService tweetsService,
            IVideosService youtubeChannelService,
            ISettingsService settingsService,
            IUnityContainer unityContainer,
            IItemsRepository itemsRepository,
            ITweetsRepository tweetsRepository,
            IImagesRepository imagesRepository,
            IVideosRepository videosRepository,
            ICarsRepository carsRepository,
            IFlickrService flickrService,
            ISharingService sharingService)
            : base(
                sharingService,
                pageNavigationService,
                unityContainer)
        {
            _pageNavigationService = pageNavigationService;
            _dataService = dataService;
            _tweetsService = tweetsService;
            _youtubeChannelService = youtubeChannelService;
            _unityContainer = unityContainer;
            _itemsRepository = itemsRepository;
            _tweetsRepository = tweetsRepository;
            _imagesRepository = imagesRepository;
            _videosRepository = videosRepository;
            _flickrService = flickrService;
            _carsRepository = carsRepository;

            //CarModelsCollection = carsRepository.GetAll();

#if WINDOWS_PHONE
            if (DesignerProperties.IsInDesignTool)
#else // !WINDOWS_PHONE
			if (DesignMode.DesignModeEnabled)
#endif
            {
                //InitializeDataForDesignMode();
                InitializeDataFromOnlineAsync();
            }
        }
Esempio n. 36
0
 public SharingController(IPhotosService photosService, ISharingService sharingService, ISharingAggregator sharingAggregator)
 {
     _photosService     = photosService;
     _sharingService    = sharingService;
     _sharingAggregator = sharingAggregator;
 }