예제 #1
0
        public MapGameMV(IAppSettings settings, IImageDataProvider imageDataProvider)
            : base(settings)
        {
            _imageDataProvider = imageDataProvider;

            MessengerInstance.Register <StartCountryGuessNotification>(this, n =>
            {
                if (Game != null)
                {
                    Marker = n.Marker;
                    Game.AskQuestion(n.Question);

                    Answers = Game.Answers
                              .Select(o => new GameAnswerMV(_imageDataProvider, n.Question, (ICountryAnswer)o))
                              .ToList();
                }
            });

            MessengerInstance.Register <CountryGuessNotification>(this, n =>
            {
                if (Game != null)
                {
                    Game.AnswerQuestion(n.Question, n.Answer);

                    Marker  = null;
                    Answers = null;
                }
            });

            CancelGuessCommand = new RelayCommand(() =>
            {
                Marker  = null;
                Answers = null;
            });
        }
예제 #2
0
        public void addgdilayer(string layername, IImageDataProvider datapro, config incfg)
        {
            //config cfg = getCoordinate(incfg);
            Envelope en = new Envelope(incfg.minX, incfg.maxX, incfg.minY, incfg.maxY);

            mapControl1.addGDIlayer(layername, datapro, incfg);
        }
예제 #3
0
        /// <summary>
        /// This can help determine what kind of file format a file is, without actually opening the file.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public virtual DataFormat GetFileFormat(string fileName)
        {
            string ext = Path.GetExtension(fileName);

            foreach (IDataProvider dp in DataProviders)
            {
                if (GetSupportedExtensions(dp.DialogReadFilter).Contains(ext))
                {
                    IVectorProvider vp = dp as IVectorProvider;
                    if (vp != null)
                    {
                        return(DataFormat.Vector);
                    }
                    IRasterProvider rp = dp as IRasterProvider;
                    if (rp != null)
                    {
                        return(DataFormat.Raster);
                    }
                    IImageDataProvider ip = dp as IImageDataProvider;
                    if (ip != null)
                    {
                        return(DataFormat.Image);
                    }
                    return(DataFormat.Custom);
                }
            }
            return(DataFormat.Custom);
        }
예제 #4
0
 public ContentController(ILogger <ContentController> logger, IImageDataProvider imageDataProvider, IContentApiRequestHandler contentDataProvider, IContentService contentService)
 {
     _logger              = logger;
     _imageDataProvider   = imageDataProvider;
     _contentDataProvider = contentDataProvider;
     _contentService      = contentService;
 }
 public ImageController(IImageDataProvider imageDataProvider, IImageFactory imageFactory, IImageRepository imageRespository, IImageUrlProvider imageUrlProvider)
 {
     _imageDataProvider = imageDataProvider;
     _imageFactory = imageFactory;
     _imageRespository = imageRespository;
     _imageUrlProvider = imageUrlProvider;
 }
예제 #6
0
        public GameAnswerMV(IImageDataProvider imageDataProvider, ICountryQuestion question, ICountryAnswer answer)
        {
            _question = question;
            _answer   = answer;

            _flag = imageDataProvider.GetImage(_answer.Country.SmallFlag);

            GuessCommand = new RelayCommand(() => MessengerInstance.Send(new CountryGuessNotification(_question, _answer)));
        }
예제 #7
0
 public PageService(IEKProvider provider)
 {
     _dal = provider;
     _navigationProvider = provider.NavigationProvider;
     _dataProvider       = provider.DataProvider;
     _siteProvider       = provider.SiteProvider;
     _imageProvider      = provider.ImageProvider;
     _roleProvider       = provider.RoleProvider;
 }
예제 #8
0
 public PageService(IEKProvider provider)
 {
     _dal = provider;
     _navigationProvider = provider.NavigationProvider;
     _dataProvider = provider.DataProvider;
     _siteProvider = provider.SiteProvider;
     _imageProvider = provider.ImageProvider;
     _roleProvider = provider.RoleProvider;
 }
예제 #9
0
        //从内存加载图片
        public void addGDIlayer(string layername, IImageDataProvider datapro, config cfg)
        {
            //delete existing same layer
            ILayer layer = this.mapBox.Map.GetLayerByName(layername);

            if (layer != null)
            {
                if (mp != null)
                {
                    mp.Dispose();
                    mp = null;
                }

                if (img != null)
                {
                    img.Dispose();
                    img = null;
                }

                if (p != null)
                {
                    DeleteObject(p);
                }

                this.mapBox.Map.Layers.Remove(layer);
                ((Layer)layer).Dispose();

                GC.Collect();
            }
            //get data from data provider

            if (datapro == null)
            {
                DefaultData dd = new DefaultData();

                mp = dd.GetData();
            }
            else
            {
                mp = datapro.GetData();
            }

            p   = mp.GetHbitmap();
            img = Image.FromHbitmap(p);

            ImageGDILayer gdilayer = new ImageGDILayer(layername, img, cfg);

            this.mapBox.Map.Layers.Insert(0, gdilayer);
            this.mapBox.Map.ZoomToBox(gdilayer.Envelope);
            this.mapBox.Refresh();

            //System.Diagnostics.Process.GetCurrentProcess().MinWorkingSet = new System.IntPtr(5);
        }
예제 #10
0
        public ImageViewModel(IImageDataProvider imageProvider)
        {
            _imageProvider   = imageProvider;
            PropertyChanged += async(s, e) =>
            {
                if (e.PropertyName == "SearchQuery")
                {
                    Images = await _imageProvider.FindImagesAsync(searchQuery);

                    RaisePropertyChanged(() => Images);
                }
            };
        }
예제 #11
0
        public QuizGameMV(IAppSettings settings, IImageDataProvider imageDataProvider)
            : base(settings)
        {
            _imageDataProvider = imageDataProvider;

            MessengerInstance.Register <CountryGuessNotification>(this, n =>
            {
                if (Game != null)
                {
                    Game.AnswerQuestion(n.Question, n.Answer);
                }
            });
        }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of <see cref="Uploader"/>
 /// </summary>
 /// <param name="imageDataProvider">Image data provider</param>
 /// <param name="mappingFactory">Mapping factory</param>
 /// <param name="metadataExtractorFactory">Metadata extractor factory</param>
 /// <param name="builderService">Builder service</param>
 /// <param name="publishingService">Publishing service</param>
 /// <param name="imageWriteService">Image write service</param>
 /// <param name="writeService">Write service</param>
 public Uploader(IImageDataProvider imageDataProvider,
                 IMappingFactory mappingFactory,
                 IMetadataExtractorFactory metadataExtractorFactory,
                 IBuilderService builderService,
                 IPublishingService publishingService,
                 IImageWriteService imageWriteService,
                 IWriteService writeService)
 {
     _imageDataProvider        = imageDataProvider;
     _mappingFactory           = mappingFactory;
     _metadataExtractorFactory = metadataExtractorFactory;
     _builderService           = builderService;
     _publishingService        = publishingService;
     _imageWriteService        = imageWriteService;
     _writeService             = writeService;
 }
예제 #13
0
        /// <summary>
        /// Creates a new image using an appropriate data provider
        /// </summary>
        /// <param name="fileName">The string fileName to open an image for</param>
        /// <param name="width">The integer width in pixels</param>
        /// <param name="height">The integer height in pixels</param>
        /// <param name="inRam">Boolean, true if the entire file should be created in memory</param>
        /// <param name="progHandler">A Progress handler</param>
        /// <param name="bandType">The band color type</param>
        /// <returns>An IImageData interface allowing access to image data</returns>
        public virtual IImageData CreateImage(string fileName, int width, int height, bool inRam,
                                              IProgressHandler progHandler, ImageBandType bandType)
        {
            // First check for the extension in the preferred plugins list
            fileName = fileName.ToLower();
            string ext = Path.GetExtension(fileName);

            if (ext != null)
            {
                IImageData result;
                if (PreferredProviders.ContainsKey(ext))
                {
                    IImageDataProvider rp = PreferredProviders[ext] as IImageDataProvider;
                    if (rp != null)
                    {
                        result = rp.Create(fileName, width, height, inRam, progHandler, bandType);
                        if (result != null)
                        {
                            return(result);
                        }
                    }

                    // if we get here, we found the provider, but it did not succeed in opening the file.
                }

                // Then check the general list of developer specified providers... but not the directory providers

                foreach (IDataProvider dp in DataProviders)
                {
                    if (GetSupportedExtensions(dp.DialogWriteFilter).Contains(ext))
                    {
                        IImageDataProvider rp = dp as IImageDataProvider;
                        if (rp != null)
                        {
                            // attempt to open with the fileName.
                            result = rp.Create(fileName, width, height, inRam, progHandler, bandType);
                            if (result != null)
                            {
                                return(result);
                            }
                        }
                    }
                }
            }

            throw new ApplicationException(DataStrings.FileTypeNotSupported);
        }
예제 #14
0
 public static IImageDataProvider GetImageDataProvider()
 {
     if (_provider != null)
     {
         return(_provider);
     }
     Lock.EnterReadLock();
     try
     {
         if (_provider == null)
         {
             _provider = new ImageDataProvider();
         }
     }
     finally
     {
         Lock.ExitReadLock();
     }
     return(_provider);
 }
예제 #15
0
 public FY3AVirrDataCreator()
 {
     m_ImgDataProvider = new FY3AVirrImgDataProvider(m_L1Datafile);
     m_BorderDataProvider = new FY3AVirrBorderDataProvider(m_L1Datafile);
 }
 public ImageMonikerCreator(IImageDataProvider imageDataProvider) : this()
 {
     _imageDataProvider = imageDataProvider;
 }
예제 #17
0
        //从内存加载图片
        public void addGDIlayer(string layername, IImageDataProvider datapro, config cfg)
        {
            //delete existing same layer
            ILayer layer = this.mapBox.Map.GetLayerByName(layername);

            if (layer != null)
            {

                if (mp != null)
                {
                    mp.Dispose();
                    mp = null;
                }

                if (img != null)
                {
                    img.Dispose();
                    img = null;
                }

                if (p != null)
                {
                    DeleteObject(p);
                }

                this.mapBox.Map.Layers.Remove(layer);
                ((Layer)layer).Dispose();

                GC.Collect();
            }
            //get data from data provider

            if (datapro == null)
            {
                DefaultData dd = new DefaultData();

                mp = dd.GetData();
            }
            else
            {
                mp = datapro.GetData();
            }

            p = mp.GetHbitmap();
            img = Image.FromHbitmap(p);

            ImageGDILayer gdilayer = new ImageGDILayer(layername, img, cfg);
            this.mapBox.Map.Layers.Insert(0, gdilayer);
            this.mapBox.Map.ZoomToBox(gdilayer.Envelope);
            this.mapBox.Refresh();

            //System.Diagnostics.Process.GetCurrentProcess().MinWorkingSet = new System.IntPtr(5);
        }
예제 #18
0
 public void addgdilayer(string layername, IImageDataProvider datapro, config incfg)
 {
     //config cfg = getCoordinate(incfg);
     Envelope en = new Envelope(incfg.minX, incfg.maxX, incfg.minY, incfg.maxY);
     mapControl1.addGDIlayer(layername, datapro, incfg);
 }
 public ImageMonikerFactory(IImageMonikerCreator imageMonikerCreator, IImageDataProvider imageDataProvider)
 {
     _imageMonikerCreator = imageMonikerCreator;
     _imageDataProvider   = imageDataProvider;
 }
예제 #20
0
 public QuizGameAnswerMV(IImageDataProvider imageDataProvider, ICountryQuestion question, ICountryAnswer answer, int column, int row)
     : base(imageDataProvider, question, answer)
 {
     Column = column;
     Row    = row;
 }
예제 #21
0
 public ImageRepository(IImageDataProvider imageDataProvider, IImageFactory imageFactory)
 {
     _imageDataProvider = imageDataProvider;
     _imageFactory      = imageFactory;
 }
 public ImageRepository(IImageDataProvider imageDataProvider, IImageFactory imageFactory)
 {
     _imageDataProvider = imageDataProvider;
     _imageFactory = imageFactory;
 }
예제 #23
0
 public void SetImageLayer(IImageDataProvider provider)
 {
     imglayer.dataPro = provider;
 }
예제 #24
0
 public void SetImageLayer(IImageDataProvider provider)
 {
     imglayer.dataPro = provider;
 }