Пример #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return("Uploading...");
            }

            UploadResult result  = value as UploadResult;
            string       message = "";

            if (result.Success)
            {
                List <Uploader.DS4Artifacts> artifacts = result.Artifacts;

                foreach (var item in artifacts)
                {
                    message += "Status: Compeleted" + Environment.NewLine;
                    message += "Type: " + item.ArtifactsType + Environment.NewLine;
                    message += "Id: " + item.ArtifactsId + Environment.NewLine;
                    message += Environment.NewLine;
                }

                return(message);
            }

            if (result.Canceled)
            {
                return("UPLOAD CANCELED");
            }

            message = Uploader.GetErrorMsgFromWebException(result.Exception);

            return(message == "" ? result.Exception.Message : "UPLOAD FAILED: " + Environment.NewLine + message);
        }