MessageDisplayer.ShowError C# (CSharp) Method

ShowError() public method

public ShowError ( string error ) : void
error string
return void
    public void ShowError(string error)
    {
        var errorTask = new ErrorTask
                            {
                                Category = TaskCategory.Misc,
                                Text = error,
                                CanDelete = true,
                            };
        errorProvider.Tasks.Add(errorTask);
    }

Usage Example

コード例 #1
0
    void DeployFiles(List <string> newStrings, string trimmed)
    {
        var success = false;

        try
        {
            foreach (var file in Directory.GetFiles(Path.Combine(contentsFinder.ContentFilesPath, "Fody")))
            {
                File.Copy(file, Path.Combine(trimmed, Path.GetFileName(file)), true);
                success = true;
            }
            var info = string.Format("Fody: Updated '{0}' to version {1}.", trimmed, CurrentVersion.Version);
            messageDisplayer.ShowInfo(info);
        }
        catch (Exception exception)
        {
            if (success)
            {
                var error = string.Format("Fody: Failed to update '{0}' to version {1} due to '{2}'. Please manually copy the contents of '{3}' to '{0}'.", trimmed, CurrentVersion.Version, exception.Message, contentsFinder.ContentFilesPath);
                messageDisplayer.ShowError(error);
            }
            else
            {
                var info = string.Format("Fody: Failed to update '{0}' to version {1} will try again later.", trimmed, CurrentVersion.Version);
                messageDisplayer.ShowInfo(info);
                newStrings.Add(trimmed);
            }
        }
    }
All Usage Examples Of MessageDisplayer::ShowError