public void UploadContent(string imageStoreConnectionString, string remoteDestination, string localSource, IImageStoreProgressHandler progressHandler, TimeSpan timeout, CopyFlag imageCopyFlag, bool acquireSourceReaderLock)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("localSource", localSource).NotNullOrEmpty();
                Requires.Argument <string>("remoteDestination", remoteDestination).NotNullOrEmpty();
                Requires.Argument <string>("imageStoreConnectionString", imageStoreConnectionString).NotNullOrEmpty();

                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                if (progressHandler == null)
                {
                    imageStore.UploadContent(
                        remoteDestination,
                        localSource,
                        timeout,
                        CopyFlag.AtomicCopy,
                        acquireSourceReaderLock);
                }
                else
                {
                    imageStore.UploadContent(
                        remoteDestination,
                        localSource,
                        progressHandler,
                        timeout,
                        imageCopyFlag,
                        acquireSourceReaderLock);
                }
            }
Ejemplo n.º 2
0
        private void OutputImageStoreContent(
            List <ImageStoreFile> sourceFiles,
            List <ImageStoreFolder> sourceFolders,
            string version,
            IImageStore imageStore,
            StoreLayoutSpecification storeLayoutSpecification,
            IClusterConnection clusterConnection,
            TimeoutHelper helper)
        {
            var targetFiles   = new List <ImageStoreFile>();
            var targetFolders = new List <ImageStoreFolder>();

            this.GetImageStoreContentByAppVersionImpl(
                sourceFiles,
                sourceFolders,
                targetFiles,
                targetFolders,
                version,
                imageStore,
                storeLayoutSpecification,
                clusterConnection,
                helper);

            targetFiles.ForEach(file => { base.OutputStoreFileInfo(file); });
            targetFolders.ForEach(folder => { base.OutputStoreFolderInfo(folder); });
        }
Ejemplo n.º 3
0
 public QueryImageStoreViewModel(IImageStore imageStore, AppViewModel parent)
 {
     this.ImageStore      = imageStore;
     this.Name            = imageStore.Name;
     this.QueryImages     = new ObservableCollection <ImageInfoViewModel>();
     this.ParentViewModel = parent;
 }
Ejemplo n.º 4
0
 public ImageController(IFolkeConnection session, IForumUserService <TUser, TUserView> accountService, IImageStore imageStore, ForumsDataMapping <TUser, TUserView> forumsDataMapping)
 {
     this.session           = session;
     this.accountService    = accountService;
     this.imageStore        = imageStore;
     this.forumsDataMapping = forumsDataMapping;
 }
Ejemplo n.º 5
0
 public MnistController(IMnistInterpreter mnist, IImageStore image_store, INetworkProposalStorage network_store, Db db)
 {
     this.mnist         = mnist ?? throw new ArgumentNullException(nameof(mnist));
     this.image_store   = image_store ?? throw new ArgumentNullException(nameof(image_store));
     this.network_store = network_store ?? throw new ArgumentNullException(nameof(network_store));
     this.db            = db;
 }
Ejemplo n.º 6
0
 public ImageController(ILogger <GimmickController> logger, Random random, IConfiguration config, IImageStore imageStore)
 {
     _logger         = logger;
     this.random     = random;
     this.config     = config;
     this.imageStore = imageStore;
 }
Ejemplo n.º 7
0
 public Acquisition(IImageStore imageStore)
 {
     _imageFetchers = new List <IImageFetcher> {
         new LocalImageFetcher(), new GoogleCSEFetcher(), new InstagramImageFetcher(), new TwitterImageFetcher()
     };
     _imageStore = imageStore;
 }
Ejemplo n.º 8
0
 public MessageRepository(
     ApplicationDbContext dbContext,
     UserContext userContext,
     AccountRepository accountRepository,
     BoardRepository boardRepository,
     SmileyRepository smileyRepository,
     IImageStore imageStore,
     BBCodeParser bbcParser,
     GzipWebClient webClient,
     ImgurClient imgurClient,
     YouTubeClient youTubeClient,
     ILogger <MessageRepository> log
     )
 {
     DbContext         = dbContext;
     CurrentUser       = userContext;
     AccountRepository = accountRepository;
     BoardRepository   = boardRepository;
     SmileyRepository  = smileyRepository;
     ImageStore        = imageStore;
     BBCParser         = bbcParser;
     WebClient         = webClient;
     ImgurClient       = imgurClient;
     YouTubeClient     = youTubeClient;
     Log = log;
 }
Ejemplo n.º 9
0
 ///<summary></summary>
 public FormDocSign(Document docCur, IImageStore imageStore)
 {
     InitializeComponent();
     //Can only allow tablet signatures on Windows, since we use a native dll to handle the tablet interaction.
     if (Environment.OSVersion.Platform != PlatformID.Unix)
     {
         //Add signature box for Topaz signatures.
         sigBoxTopaz          = new Topaz.SigPlusNET();
         sigBoxTopaz.Location = sigBox.Location;                  //this puts both boxes in the same spot.
         sigBoxTopaz.Name     = "sigBoxTopaz";
         sigBoxTopaz.Size     = new System.Drawing.Size(394, 91); //Must be same dimensions as the sigBox.
         sigBoxTopaz.TabIndex = 92;
         sigBoxTopaz.Text     = "sigPlusNET1";
         sigBoxTopaz.Visible  = false;
         Controls.Add(sigBoxTopaz);
         sigBox.SetTabletState(1);                //It starts out accepting input. It will be set to 0 if a sig is already present.  It will be set back to 1 if note changes or if user clicks Clear.
         //Add button to initiate a Topaz signature.
         butTopazSign = new OpenDental.UI.Button();
         butTopazSign.AdjustImageLocation = new System.Drawing.Point(0, 0);
         butTopazSign.Autosize            = true;
         butTopazSign.BtnShape            = OpenDental.UI.enumType.BtnShape.Rectangle;
         butTopazSign.BtnStyle            = OpenDental.UI.enumType.XPStyle.Silver;
         butTopazSign.CornerRadius        = 4F;
         butTopazSign.Location            = new System.Drawing.Point(370, 61);
         butTopazSign.Name     = "butTopazSign";
         butTopazSign.Size     = new System.Drawing.Size(81, 25);
         butTopazSign.TabIndex = 89;
         butTopazSign.Text     = "Sign Topaz";
         butTopazSign.Click   += new System.EventHandler(this.butTopazSign_Click);
         Controls.Add(butTopazSign);
     }
     DocCur          = docCur;
     this.imageStore = imageStore;
     Lan.F(this);
 }
 public void TestSetup()
 {
     this.imageBuilderTestContext = ImageBuilderTestContext.Create(this.TestContext.TestName);
     this.imageBuilder            = imageBuilderTestContext.ImageBuilder;
     this.imageStore = imageBuilderTestContext.ImageStore;
     ImageBuilderTest.CreateDropAndSetFabricCodePath();
 }
Ejemplo n.º 11
0
        private IImageStore CreateImageStore(string connectionEndpoint, string imageStoreConnectionString, string workingDirectory, string certThumbprint)
        {
            if (!imageStoreConnectionString.StartsWith("file:", StringComparison.OrdinalIgnoreCase) &&
                !imageStoreConnectionString.StartsWith("fabric:", StringComparison.OrdinalIgnoreCase))
            {
                throw new ArgumentException();
            }

            string[]        connectionEndpoints = { connectionEndpoint };
            X509Credentials securityCredentials = null;

            if (certThumbprint != null && certThumbprint.Length > 0)
            {
                securityCredentials = new X509Credentials();
                securityCredentials.RemoteCertThumbprints.Add(certThumbprint);
                securityCredentials.FindType      = X509FindType.FindByThumbprint;
                securityCredentials.FindValue     = certThumbprint;
                securityCredentials.StoreLocation = StoreLocation.CurrentUser;
                securityCredentials.StoreName     = "MyStore";
            }

            IImageStore imageStore = ImageStoreFactoryProxy.CreateImageStore(
                imageStoreConnectionString,
                null,
                connectionEndpoints,
                securityCredentials,
                workingDirectory,
                false);

            return(imageStore);
        }
Ejemplo n.º 12
0
        protected void RemoveApplicationPackage(string imageStoreConnectionString, string applicationPackagePath)
        {
            try
            {
                if (imageStoreConnectionString.StartsWith(Constants.ImageStoreConnectionFabricType, StringComparison.OrdinalIgnoreCase))
                {
                    var clusterConnection = this.SessionState.PSVariable.GetValue(Constants.ClusterConnectionVariableName, null) as IClusterConnection;
                    if (clusterConnection.SecurityCredentials != null && clusterConnection.SecurityCredentials.CredentialType == CredentialType.Claims)
                    {
                        clusterConnection.FabricClient.ImageStore.DeleteContent(imageStoreConnectionString, applicationPackagePath, this.GetTimeout());
                        this.WriteObject(StringResources.Info_RemoveApplicationPackageSucceeded);
                        return;
                    }
                }

                IImageStore imageStore = this.CreateImageStore(imageStoreConnectionString, Path.GetTempPath());
                imageStore.DeleteContent(applicationPackagePath, this.GetTimeout());
                this.WriteObject(StringResources.Info_RemoveApplicationPackageSucceeded);
            }
            catch (Exception exception)
            {
                this.ThrowTerminatingError(
                    exception,
                    Constants.RemoveApplicationPackageErrorId,
                    null);
            }
        }
Ejemplo n.º 13
0
        public AccountRepository(
            ApplicationDbContext dbContext,
            UserContext userContext,
            UserManager <DataModels.ApplicationUser> userManager,
            SignInManager <DataModels.ApplicationUser> signInManager,
            IHttpContextAccessor httpContextAccessor,
            IActionContextAccessor actionContextAccessor,
            IUrlHelperFactory urlHelperFactory,
            IEmailSender emailSender,
            IImageStore imageStore,
            ILogger <AccountRepository> log
            )
        {
            DbContext   = dbContext;
            UserContext = userContext;

            UserManager   = userManager;
            SignInManager = signInManager;

            HttpContextAccessor = httpContextAccessor;
            UrlHelper           = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);

            EmailSender = emailSender;
            ImageStore  = imageStore;

            Log = log;
        }
Ejemplo n.º 14
0
		public MessageRepository(
			ApplicationDbContext dbContext,
			UserContext userContext,
			AccountRepository accountRepository,
			BoardRepository boardRepository,
			RoleRepository roleRepository,
			SmileyRepository smileyRepository,
			IHubContext<ForumHub> forumHub,
			IActionContextAccessor actionContextAccessor,
			IUrlHelperFactory urlHelperFactory,
			IImageStore imageStore,
			BBCodeParser bbcParser,
			GzipWebClient webClient,
			ImgurClient imgurClient,
			YouTubeClient youTubeClient,
			ILogger<MessageRepository> log
		) {
			DbContext = dbContext;
			UserContext = userContext;
			AccountRepository = accountRepository;
			BoardRepository = boardRepository;
			RoleRepository = roleRepository;
			SmileyRepository = smileyRepository;
			ForumHub = forumHub;
			UrlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
			ImageStore = imageStore;
			BBCParser = bbcParser;
			WebClient = webClient;
			ImgurClient = imgurClient;
			YouTubeClient = youTubeClient;
			Log = log;
		}
Ejemplo n.º 15
0
        /// <summary>
        /// Constructor for ImageManager
        /// </summary>
        public ImageManager()
        {
            // INSTANTIATE _images
            _images = new ImageStore();

            // INSTANTIATE _imageProcessorr
            _imageProcessor = new ImageProcessor();
        }
Ejemplo n.º 16
0
 internal FabricLayoutInfo(IImageStore imageStore, string clusterManifestFileName, bool useMSI)
 {
     this.ImageStore        = imageStore;
     this.ImageStoreWrapper = new ImageStoreWrapper(imageStore, TestDirectory);
     this.fullInfrastructureManifestFolderName = Path.Combine(TestUtility.TestDirectory, Path.GetRandomFileName());
     this.UseMSI = useMSI;
     InitializeManifest(clusterManifestFileName);
 }
Ejemplo n.º 17
0
 public SmileyRepository(
     ApplicationDbContext dbContext,
     IImageStore imageStore,
     ILogger <SmileyRepository> log
     )
 {
     DbContext  = dbContext;
     ImageStore = imageStore;
 }
            public Task DeleteContentAsync(string imageStoreConnectionString, string remoteLocation, TimeSpan timeout)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("remoteLocation", remoteLocation).NotNullOrEmpty();
                Requires.Argument <string>("imageStoreConnectionString", imageStoreConnectionString).NotNullOrEmpty();
                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                return(imageStore.DeleteContentAsync(remoteLocation, timeout));
            }
            public Task <ImageStorePagedContent> ListPagedContentAsync(string imageStoreConnectionString, ImageStoreListDescription listDescription, TimeSpan timeout)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("remoteLocation", listDescription.RemoteLocation).NotNullOrEmpty();
                Requires.Argument <string>("imageStoreConnectionString", imageStoreConnectionString).NotNullOrEmpty();
                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                return(imageStore.ListPagedContentWithDetailsAsync(listDescription, timeout));
            }
            public void DownloadContent(string imageStoreConnectionString, string remoteSource, string localDestination, TimeSpan timeout, CopyFlag imageCopyFlag)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("remoteSource", remoteSource).NotNullOrEmpty();
                Requires.Argument <string>("localDestination", localDestination).NotNullOrEmpty();
                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                imageStore.DownloadContent(remoteSource, localDestination, timeout, imageCopyFlag);
            }
            public Task <ImageStoreContent> ListContentAsync(string imageStoreConnectionString, string remoteLocation, bool isRecursive, TimeSpan timeout)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("remoteLocation", remoteLocation).NotNullOrEmpty();
                Requires.Argument <string>("imageStoreConnectionString", imageStoreConnectionString).NotNullOrEmpty();
                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                return(imageStore.ListContentWithDetailsAsync(remoteLocation, isRecursive, timeout));
            }
Ejemplo n.º 22
0
        internal SQLiteRecipeStore(SQLiteAsyncConnection connection, IImageStore imageStore, IIngredientStore ingredientStore,
                                   IPictogramStore pictogramStore, IRecipeStepStore stepStore) : base(connection, imageStore)
        {
            _ingredientStore = ingredientStore;
            _pictogramStore  = pictogramStore;
            _stepStore       = stepStore;

            // TODO: replace with default image
            _defaultImage = null;
        }
Ejemplo n.º 23
0
 public ImageMemeCommands(ILogger <HomieBot> logger, IConfiguration configuration, IImageStore imageStore, IImageProcessor imageProcessor, Random random)
 {
     this.logger         = logger;
     this.configuration  = configuration;
     this.imageStore     = imageStore;
     this.imageProcessor = imageProcessor;
     this.random         = random;
     this.templates      = configuration.GetSection("MemeTemplates").Get <IEnumerable <MemeTemplate> >();
     this.collections    = configuration.GetSection("ImageCollections").Get <IEnumerable <ImageCollection> >();
 }
Ejemplo n.º 24
0
 public Smileys(
     ApplicationDbContext dbContext,
     SmileyRepository smileyRepository,
     IImageStore imageStore
     )
 {
     DbContext        = dbContext;
     SmileyRepository = smileyRepository;
     ImageStore       = imageStore;
 }
Ejemplo n.º 25
0
        public void TestSetup()
        {
            var testName = this.TestContext.TestName;

#if DotNetCoreClr
            testName = this.TestContext.FullyQualifiedTestClassName + "." + this.TestContext.TestName;
#endif
            this.imageBuilderTestContext = ImageBuilderTestContext.Create(testName);
            this.imageStore = imageBuilderTestContext.ImageStore;
        }
Ejemplo n.º 26
0
        public static IImageStore GetImageStore(Patient patient)
        {
            Type imageStoreType = Type.GetType(ImageStoreTypeName, false);

            if (imageStoreType == null || !typeof(IImageStore).IsAssignableFrom(imageStoreType))
            {
                imageStoreType = typeof(FileStore);
            }

            IImageStore store = (IImageStore)Activator.CreateInstance(imageStoreType);

            store.OpenPatientStore(patient);
            return(store);
        }
Ejemplo n.º 27
0
 public ImageManager(
     IImageStore imageStore,
     IHttpContextAccessor contextAccessor,
     ErrorDescriber errorDescriber,
     IMapper mapper,
     ILogger <ImageManager> logger)
     : base(
         contextAccessor: contextAccessor,
         errorDescriber: errorDescriber,
         mapper: mapper,
         logger: logger)
 {
     ImageStore = imageStore ?? throw new ArgumentNullException(nameof(imageStore));
 }
            public Task UploadContentAsync(string imageStoreConnectionString, string remoteDestination, string localSource, TimeSpan timeout, CopyFlag imageCopyFlag, bool acquireSourceReaderLock)
            {
                this.fabricClient.ThrowIfDisposed();
                Requires.Argument <string>("localSource", localSource).NotNullOrEmpty();
                Requires.Argument <string>("remoteDestination", remoteDestination).NotNullOrEmpty();
                Requires.Argument <string>("imageStoreConnectionString", imageStoreConnectionString).NotNullOrEmpty();

                IImageStore imageStore = this.fabricClient.GetImageStore(imageStoreConnectionString);

                return(imageStore.UploadContentAsync(
                           remoteDestination,
                           localSource,
                           timeout,
                           imageCopyFlag,
                           acquireSourceReaderLock));
            }
Ejemplo n.º 29
0
        public void TestApplicationPackage(string connectionEndpoint, string applicationPackagePath, string applicationParameter, string imageStoreConnectionString, string certThumbprint)
        {
            string[] parameters = applicationParameter.Split(',');
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            for (int i = 0; i < parameters.Length / 2; i += 2)
            {
                dictionary.Add(parameters[i], parameters[i + 1]);
            }

            var testRootPath = Path.Combine(Path.GetTempPath(), string.Format(CultureInfo.InvariantCulture, "{0}_{1}", "TestApplicationPackage", DateTime.Now.Ticks));

            try
            {
                var applicationName         = new DirectoryInfo(applicationPackagePath).Name;
                var testRootApplicationPath = Path.Combine(testRootPath, applicationName);
                FabricDirectory.Copy(applicationPackagePath, testRootApplicationPath, true);
                ImageBuilderUtility.RemoveReadOnlyFlag(testRootApplicationPath);

                var fileImageStoreConnectionString = string.Format(CultureInfo.InvariantCulture, "{0}{1}", "file:", testRootPath.TrimEnd(Path.DirectorySeparatorChar));
                var sourceImageStore = ImageStoreFactoryProxy.CreateImageStore(fileImageStoreConnectionString);

                IImageStore destinationImageStore = null;
                if (string.IsNullOrEmpty(imageStoreConnectionString))
                {
                    destinationImageStore = sourceImageStore;
                }
                else
                {
                    destinationImageStore = this.CreateImageStore(connectionEndpoint, imageStoreConnectionString, testRootPath, certThumbprint);
                }

                var imagebuilder = new ImageBuilder(sourceImageStore, destinationImageStore, this.GetFabricFilePath("ServiceFabricServiceModel.xsd"), testRootPath);

                imagebuilder.ValidateApplicationPackage(
                    applicationName,
                    dictionary);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                FabricDirectory.Delete(testRootPath, true, true);
            }
        }
Ejemplo n.º 30
0
        public void CopyApplicationPackage(string connectionEndpoint, string applicationPackagePath, string imageStoreConnectionString, string relativeDestinationPath, string certThumbprint)
        {
            IImageStore imageStore = CreateImageStore(connectionEndpoint, imageStoreConnectionString, Path.GetTempPath(), certThumbprint);

            if (string.IsNullOrEmpty(relativeDestinationPath))
            {
                relativeDestinationPath = new DirectoryInfo(applicationPackagePath).Name;
            }

            ImageBuilderUtility.ValidateRelativePath(relativeDestinationPath);

            imageStore.UploadContent(
                relativeDestinationPath,
                applicationPackagePath,
                AzureCliProxy.DefaultTimeSpan,
                CopyFlag.AtomicCopy,
                false);
        }
Ejemplo n.º 31
0
 protected StandardImageManipulator(IImageStore imageStore, ILayersCmsImageReads imageReads)
 {
     ImageStore = imageStore;
     _imageReads = imageReads;
 }
Ejemplo n.º 32
0
 public HistoryController(IImageStore imageStore)
 {
     _imageStore = imageStore;
 }
 internal ImageHandlerInternal(IImageStore imageStore, DateTime now)
     : this() {
     _imageStore = imageStore;
     _now = now;
 }
Ejemplo n.º 34
0
 public ImageResizerManipulator(IImageStore imageStore, ILayersCmsImageReads imageReads)
     : base(imageStore, imageReads)
 {
 }
Ejemplo n.º 35
0
 public PageController(IImageStore imageStore)
 {
     _pages = Data.Biggy.PageList;
     _imageStore = imageStore;
 }
 internal ImageHandler(IImageStore imageStore, DateTime now)
     : this(new ImageHandlerInternal(imageStore, now)) {
 }
Ejemplo n.º 37
0
 public ImageController(IImageStore imageStore)
 {
     _imageStore = imageStore;
 }
Ejemplo n.º 38
0
 public DifferencesController(IImageStore imageStore)
 {
     _imageStore = imageStore;
 }