コード例 #1
1
ファイル: ProcessImage.cs プロジェクト: trevorpower/tadmap
      static public ImageProcessingResult Process(string imageName, IBinaryRepository binaryRepository)
      {
         var log = new EventLog("Application")
         {
            Source = "Tadmap"
         };

         log.WriteEntry("Processing image:" + imageName, EventLogEntryType.Information);

         Stream binary = binaryRepository.GetBinary(imageName);

         if (binary == null)
         {
            log.WriteEntry("No binary found:" + imageName, EventLogEntryType.Warning);
            return new ImageProcessingResult { Key = imageName, Result = ImageProcessingResult.ResultType.Failed }; // Image not available in the queue yet.
         }

         // If I have an image I should renew the message.

         IImageSet imageSet = new ImageSet1(imageName);

         int zoomLevels;
         int tileSize;
         imageSet.Create(binary, binaryRepository, out zoomLevels, out tileSize);
         log.WriteEntry("Processing finished.", EventLogEntryType.Information);

         return new ImageProcessingResult
         {
            Key = imageName,
            Result = ImageProcessingResult.ResultType.Complete,
            ZoomLevel = zoomLevels,
            TileSize = tileSize
         };
      }
コード例 #2
0
ファイル: ImageSetTests.cs プロジェクト: trevorpower/tadmap
      public void Image_Set_Has_Original_And_Preview_Strings()
      {
         IImageSet set = new ImageSet1("");

         Assert.IsNotNull(set.Original);
         Assert.IsNotNull(set.Preview);

      }
コード例 #3
0
ファイル: ImageService.cs プロジェクト: trevorpower/tadmap
      static private void ProcessImage(string imageName)
      {
         var log = new EventLog("Application")
         {
            Source = "Tadmap"
         };

         log.WriteEntry("Processing image:" + imageName, EventLogEntryType.Information);

         Stream binary = _binaryRepository.GetBinary(imageName);

         if (binary == null)
         {
            log.WriteEntry("No binary found:" + imageName, EventLogEntryType.Warning);
            return; // Image not available in the queue yet.
         }

         // If I have an image I should renew the message.

         IImageSet imageSet = new ImageSet1(imageName);

         imageSet.Create(binary, _binaryRepository);
         log.WriteEntry("Processing finished.", EventLogEntryType.Information);
      }