Exemplo n.º 1
0
    private void SetUploader(string name)
    {
        switch (name)
        {
        case "imgur":
        {
            _uploader = new ImgurFileTrackedUpload(IMGUR_CLIENT_ID);
        }
        break;

        case "giphy":
        {
            _uploader = new GiphyFileTrackedUpload(GIPHY_BETA_CLIENT_ID);
        }
        break;

        case "gfycat":
        {
            _uploader = new GfycatFileTrackedUpload(GFYCAT_CLIENT_ID, GFYCAT_CLIENT_SECRET);
        }
        break;

        default:
        {
            throw new Exception("Unknown radio button option");
        }
        }

        _settings.UploadServiceName = name;
    }
Exemplo n.º 2
0
        public UploadDialog(IFileTrackedUpload uploader, string fileName)
        {
            if (uploader == null)
            {
                throw new ArgumentNullException("uploader");
            }

            if (fileName == null)
            {
                throw new ArgumentNullException("fileName");
            }

            _uploader       = uploader;
            _fileName       = fileName;
            _canceled       = false;
            _uploadFinished = false;

            this.Build();
        }