コード例 #1
0
 public GroupDetailsViewModel(IAppSettings appSettings, IDataServiceFactory dataServiceFactory, IMvxResourceLoader resourceLoader)
     : base(appSettings)
 {
     _dataServiceFactory = new DataServiceFactory(appSettings, _resourceLoader);
     _resourceLoader = resourceLoader;
     _groupedItems = new ObservableCollection<Group<Item>>();
 }
コード例 #2
0
 public LocationDataImporter(IDataServiceFactory dataServiceFactory)
 {
     _locationServiceProxy = dataServiceFactory.CreateLocationDataService(DataSourceType.Remote);
     _snapshotServiceProxy = dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Remote);
     _snapshotService      = dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Local);
     _pictureServiceProxy  = dataServiceFactory.CreatePictureService(DataSourceType.Remote);
     _pictureService       = dataServiceFactory.CreatePictureService(DataSourceType.Local);
 }
コード例 #3
0
 public LoginService(IMessageService messageService, IDialogService dialogService,
                     ILogService logService, IDataServiceFactory dataServiceFactory,
                     IUserService userService)
 {
     IsAuthenticated    = false;
     MessageService     = messageService;
     DialogService      = dialogService;
     LogService         = logService;
     DataServiceFactory = dataServiceFactory;
     UserService        = userService;
 }
コード例 #4
0
        private void SetUp()
        {
            _dataServiceFactory   = Substitute.For <IDataServiceFactory>();
            _locationServiceProxy = Substitute.For <ILocationDataService>();
            _snapshotServiceProxy = Substitute.For <ILocationSnapshotDataService>();
            _snapshotService      = Substitute.For <ILocationSnapshotDataService>();
            _pictureServiceProxy  = Substitute.For <IPictureService>();
            _pictureService       = Substitute.For <IPictureService>();

            _dataServiceFactory.CreateLocationDataService(DataSourceType.Remote).Returns(_locationServiceProxy);
            _dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Remote).Returns(_snapshotServiceProxy);
            _dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Local).Returns(_snapshotService);
            _dataServiceFactory.CreatePictureService(DataSourceType.Remote).Returns(_pictureServiceProxy);
            _dataServiceFactory.CreatePictureService(DataSourceType.Local).Returns(_pictureService);

            _locationToImport = new Location
            {
                Id   = 1,
                Name = "Barcelona"
            };
            _snapshotsToImport = new List <LocationSnapshot>
            {
                new LocationSnapshot
                {
                    Id              = 1,
                    LocationId      = 1,
                    PictureFileName = "Barcelona1.jpg"
                },
                new LocationSnapshot
                {
                    Id              = 2,
                    LocationId      = 1,
                    PictureFileName = "Barcelona2.jpg"
                },
            };

            _snapshotService.GetSnapshotsByLocationIdAsync(Arg.Any <int>())
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <IEnumerable <LocationSnapshot> >();
                tcs.SetResult(_snapshotsToImport);
                return(tcs.Task);
            });

            _pictureData = new byte[] { 1, 2, 3, 4 };
            _pictureService.GetSnapshotContentAsync(Arg.Any <LocationSnapshot>())
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <byte[]>();
                tcs.SetResult(_pictureData);
                return(tcs.Task);
            });
        }
コード例 #5
0
        public GroupedItemsViewModel(IAppSettings appSettings, IDataServiceFactory dataServiceFactory, IMvxResourceLoader resourceLoader)
            : base(appSettings)
        {
            _dataServiceFactory = new DataServiceFactory(appSettings, _resourceLoader);
            _resourceLoader = resourceLoader;

            _dataServices = new List<IDataService>();
            foreach (var source in DataServiceFactoryHelper.DataSources)
            {
                _dataServices.Add(_dataServiceFactory.GenerateService(source));
            }

            _groupedItems = new ObservableCollection<Group<Item>>();
        }
コード例 #6
0
 public CommandLineService(
     IMigrationServiceFactory migrationServiceFactory,
     IDataServiceFactory dataServiceFactory,
     IWorkspaceService workspaceService,
     IEnvironmentService environmentService,
     ITraceService traceService,
     IConfigurationService configurationService)
 {
     this._workspaceService        = workspaceService;
     this._environmentService      = environmentService;
     this._traceService            = traceService;
     this._configurationService    = configurationService;
     this._migrationServiceFactory = migrationServiceFactory;
     this._dataServiceFactory      = dataServiceFactory;
 }
コード例 #7
0
        public void SetupTests()
        {
            ClearAll();

            var settings = new Mock<IAppSettings>();
            settings.SetupProperty(s => s.DateFormatString, "ddd, d MMM yyyy");
            settings.SetupProperty(s => s.AutoPlayYoutubeVideos, true);
            settings.SetupProperty(s => s.ForceYoutubeVideosToLoadFullScreen, true);
            settings.SetupProperty(s => s.RssMaxItemsPerFeed, 30);

            var resourceLoader = new Mock<IMvxResourceLoader>();
            resourceLoader.Setup(r => r.GetTextResource(It.IsAny<string>())).Returns("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
                                                                                     "<items xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
                                                                                     "<item>" +
                                                                                     "<title>If you see me, \"LocalItemsFile\" is enabled!</title>" +
                                                                                     "<subtitle>Warning</subtitle>" +
                                                                                     "<description>To disable, set \"EnableLocalItemsFile = false\" in AppSettings.cs &lt;/br&gt;&lt;a href=\"http://bing.com\"&gt;By the way, I am html, click me and I'll take you to Bing&lt;/a&gt;</description>" +
                                                                                     "<image>http://www.irunoninsulin.com/wp-content/uploads/2010/06/green-check-mark.jpg</image>" +
                                                                                     "<group>Local Data</group>" +
                                                                                     "</item>" +
                                                                                     "<item>" +
                                                                                     "<title>Shi Tzu</title>" +
                                                                                     "<subtitle>small</subtitle>" +
                                                                                     "<description>A shih tzu is a toy dog breed weighing 5–7.25 kilograms with long silky hair. The breed originated in China. Shih Tzu were officially recognized by the American Kennel Club in 1969. The name is both singular and plural.</description>" +
                                                                                     "<image>http://us.123rf.com/400wm/400/400/isselee/isselee0906/isselee090600219/5085394-grey-shih-tzu-6-years-old-in-front-of-a-white-background.jpg</image>" +
                                                                                     "<group>Dog</group>" +
                                                                                     "</item>" +
                                                                                     "<item>" +
                                                                                     "<title>HTML Example</title>" +
                                                                                     "<subtitle>This uses JavaScript, too!</subtitle>" +
                                                                                     "<description>&lt;html&gt; &lt;body&gt; &lt;font face = \"Comic Sans MS\"&gt; &lt;font size=5&gt;There are all kinds of &lt;font color=\"blue\"&gt;&lt;i&gt;super fun&lt;/i&gt;&lt;/font&gt; things you can do with HTML in your XML files. &lt;br&gt;&lt;font size=3&gt;You can use http://htmledit.squarefree.com to preview your HTML. Then you can use Notepad++ to condense it all into one line easily. Just select all the text and press Ctrl+J for Join Lines in Notepad++. (It's also in the Edit menu under Line Operations.)&lt;br&gt;&lt;br&gt;  &lt;p id=\"demo\"&gt;Hey, what day is it??&lt;/p&gt; &lt;button onclick=\"myFunction()\"&gt;JavaScript Button&lt;/button&gt; &lt;script&gt; function myFunction() { var d = new Date(); var weekday=new Array(7); weekday[0]=\"It's Sunday\"; weekday[1]=\"It's Monday\"; weekday[2]=\"It's Tuesday\"; weekday[3]=\"It's Wednesday\"; weekday[4]=\"It's Thursday\"; weekday[5]=\"It's Friday\"; weekday[6]=\"It's Saturday\";  var x = document.getElementById(\"demo\"); x.innerHTML=weekday[d.getDay()]; } &lt;/script&gt;  &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;font face = \"Arial\"&gt; If you want to link to websites within your app, you can add &lt;font color=\"red\"&gt;target=_blank&lt;/font&gt; to your URL links and change the AppSettings.cs file to allow for it. By default, it is disabled. &lt;br&gt;&lt;br&gt; It's also helpful to know that you can use Excel to edit your XML files, but you don't have to. Sometimes Excel just gets in the way and it'd be easier to use something like Notepad++ to edit the code directly. But you have to remember that things need to be converted first. Use this website to convert things:&lt;br&gt;https://sites.google.com/site/infivivek/resourse-centre/online-resources/html-to-xml-converter &lt;br&gt;But if you do use Excel, make sure you copy all the HTML into the one line for the description. It might help to double-click the cell and then paste it. &lt;br&gt;&lt;br&gt; &lt;font face=\"Courier New\"&gt; Also, you can make your own RSS feeds for your website, even free Google sites. Then you can write up your own XML file to upload (much like this file) using this guide:&lt;br&gt;http://www.w3schools.com/rss/rss_tag_image.asp&lt;br&gt;If you use your own RSS feed, make sure there is an image somewhere in the HTML in the description (even if it's at the bottom of the page), and it'll show up in your app (both on the main page and the sub page). &lt;br&gt;&lt;br&gt;&lt;center&gt; You can even make tables. And center them. &lt;table border=\"1\"&gt;   &lt;tr&gt;     &lt;th&gt;Column 1&lt;/th&gt;     &lt;th&gt;Column 2&lt;/th&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td&gt;Row 1&lt;/td&gt;     &lt;td&gt;abcde&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;   &lt;td&gt;Row 2&lt;/td&gt;   &lt;td&gt;fghij&lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt; &lt;/center&gt; &lt;br&gt;&lt;br&gt;  Or you can &lt;a href=\"http://www.dominos.com\" target=_blank&gt;click here&lt;/a&gt; to order Dominos pizza. If you leave default settings on, you'll be ordering the pizza from within the app, but if you change AppSettings.cs like mentioned earlier, it'll open a new window. Or you could just call them at (713) 747-3800.  &lt;br&gt;&lt;br&gt; ...and this is &lt;b&gt;&lt;font color=\"green\"&gt;&lt;font size=5&gt;just the beginning.&lt;/font&gt;&lt;/font&gt;&lt;/b&gt; What else can &lt;b&gt;you&lt;/b&gt; think of to do?&lt;br&gt; &lt;br&gt;&lt;center&gt; &lt;img src=\"http://3.bp.blogspot.com/--P7JWhCCr1A/UecFPgmGWlI/AAAAAAAAGWg/P9Tor4nWi2A/s1600/madden-divider-line.png\" width=\"500\" height=\"15\" alt=\"border\"&gt; &lt;font size=2&gt;&lt;br&gt;If you find an image you like online, you can right-click and copy the URL and also view the image info to see the pixel dimensions--all without downloading it. &lt;/center&gt; &lt;/font&gt; &lt;/body&gt; &lt;/html&gt;</description>" +
                                                                                     "<image>http://101fundraising.org/wp-content/uploads/2013/09/lightbulb.gif</image>" +
                                                                                     "<group>HTML</group>" +
                                                                                     "</item>" +
                                                                                     "</items>");

            _dataServiceFactory = new DataServiceFactory(settings.Object, resourceLoader.Object);
        }
コード例 #8
0
 public TalukService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #9
0
 public LookupTables(ILogService logService, IDataServiceFactory dataServiceFactory)
 {
     LogService         = logService;
     DataServiceFactory = dataServiceFactory;
 }
コード例 #10
0
 public ExpenseHeadService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #11
0
ファイル: IUserFacade.cs プロジェクト: wes-cutting/Sandbox-V2
 public UserFacade(IDataServiceFactory factory)
 {
     this.factory = factory;
 }
コード例 #12
0
 public StudentEvaluationService(IDataServiceFactory dataServiceFactory) : base(dataServiceFactory)
 {
 }
コード例 #13
0
 public TeacherService(IDataServiceFactory dataServiceFactory) : base(dataServiceFactory)
 {
 }
コード例 #14
0
 public PropertyFacade(IDataServiceFactory service)
 {
     this.service = service;
 }
コード例 #15
0
 public RolePermissionService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #16
0
 public CustomerService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #17
0
 public StudentService(IDataServiceFactory dataServiceFactory) : base(dataServiceFactory)
 {
 }
コード例 #18
0
 public DataServiceRole(IDataServiceFactory serviceFactory)
     : base(serviceFactory)
 {
 }
コード例 #19
0
 public UserRoleService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #20
0
 protected DataServiceBase(IDataServiceFactory dataServiceFactory)
 {
     DataServiceFactory = dataServiceFactory;
 }
コード例 #21
0
 public ReceiptService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #22
0
 public UserFacade(IDataServiceFactory factory)
 {
     this.factory = factory;
 }
コード例 #23
0
 public PropCheckListMasterService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #24
0
 public PropertyCheckListService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #25
0
 public CourseRecordService(IDataServiceFactory dataServiceFactory) : base(dataServiceFactory)
 {
 }
コード例 #26
0
 public PlaceService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #27
0
 public OrderItemService(IDataServiceFactory dataServiceFactory)
 {
     DataServiceFactory = dataServiceFactory;
 }
コード例 #28
0
 public BankAccountService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #29
0
 public DropDownService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #30
0
 public PaymentService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #31
0
 public FirstViewModel(IDataServiceFactory dataServiceFactory)
 {
     _dataServiceFactory = dataServiceFactory;
 }
コード例 #32
0
 public PropertyMergeService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #33
0
 public GroupsService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #34
0
 public DataServiceWorker(IDataServiceFactory serviceFactory)
     : base(serviceFactory)
 {
 }
コード例 #35
0
 public ProductService(IDataServiceFactory dataServiceFactory, ILogService logService)
 {
     DataServiceFactory = dataServiceFactory;
     LogService         = logService;
 }
コード例 #36
0
 protected AbstractDataService(IDataServiceFactory serviceFactory)
 {
     _serviceFactory = serviceFactory;
 }
コード例 #37
0
 public ListingFacade(IDataServiceFactory dataFactory)
 {
     this.dataFactory = dataFactory;
 }