Exemplo n.º 1
0
        public void Configure(IMvxPluginConfiguration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            var fileConfiguration = configuration as MvxFileConfiguration;

            if (fileConfiguration == null)
            {
                throw new MvxException("You must use a MvxFileConfiguration object for configuring the File Plugin, but you supplied {0}", configuration.GetType().Name);
            }

            _configuration = fileConfiguration;
        }
Exemplo n.º 2
0
        public void Configure(IMvxPluginConfiguration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            var fileConfiguration = configuration as MvxFileConfiguration;

            if (fileConfiguration == null)
            {
                throw new MvxException("You must use a MvxFileConfiguration object for configuring the File Plugin, but you supplied {0}", configuration.GetType().Name);
            }

            if (!Directory.Exists(fileConfiguration.BasePath))
            {
                var message = "File plugin configuration error : root folder '" + fileConfiguration.BasePath + "' does not exists.";
                MvxPluginLog.Instance.Error(message);
                throw new DirectoryNotFoundException(message);
            }

            _configuration = fileConfiguration;
        }