Exemple #1
0
        /// <summary>
        ///     Initializes the shared UI library
        /// </summary>
        /// <param name="kernel"></param>
        public static void Initialize(IKernel kernel)
        {
            if (Initialized)
            {
                return;
            }

            IColorPickerService colorPickerService = kernel.Get <IColorPickerService>();

            GradientPicker.ColorPickerService = colorPickerService;
            ColorPicker.ColorPickerService    = colorPickerService;

            Initialized = true;
        }
Exemple #2
0
        /// <summary>Initializes a new instance of the <see cref="ExtractParameters"/> class.</summary>
        /// <param name="settings">The plug in settings.</param>
        /// <param name="data">The data structure that will hold the information used to extract sprites.</param>
        /// <param name="textureFile">The file used as the texture.</param>
        /// <param name="extractor">The extractor used to build the sprites.</param>
        /// <param name="colorPicker">The color picker service.</param>
        /// <param name="folderBrowser">The project file system folder browser service.</param>
        /// <param name="commonServices">The common services.</param>
        /// <exception cref="ArgumentNullException">Thrown when the any parameters are <b>null</b>.</exception>
        /// <exception cref="ArgumentMissingException">Thrown when the <see cref="SpriteExtractionData.Texture"/> property of the <paramref name="data"/> parameter is <b>null</b>.</exception>
        public ExtractParameters(ExtractSpriteToolSettings settings, SpriteExtractionData data, IContentFile textureFile, IExtractorService extractor, IColorPickerService colorPicker, IFileSystemFolderBrowseService folderBrowser, IViewModelInjection commonServices)
            : base(commonServices)
        {
            Settings      = settings ?? throw new ArgumentNullException(nameof(settings));
            Data          = data ?? throw new ArgumentNullException(nameof(data));
            Extractor     = extractor ?? throw new ArgumentNullException(nameof(extractor));
            ColorPicker   = colorPicker ?? throw new ArgumentNullException(nameof(colorPicker));
            FolderBrowser = folderBrowser ?? throw new ArgumentNullException(nameof(folderBrowser));
            TextureFile   = textureFile ?? throw new ArgumentNullException(nameof(textureFile));

            if (data.Texture == null)
            {
                throw new ArgumentMissingException(nameof(data.Texture), nameof(data));
            }
        }