Common.Activity 1.1.6509.914

dotnet add package Common.Activity --version 1.1.6509.914
                    
NuGet\Install-Package Common.Activity -Version 1.1.6509.914
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Common.Activity" Version="1.1.6509.914" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Common.Activity" Version="1.1.6509.914" />
                    
Directory.Packages.props
<PackageReference Include="Common.Activity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Common.Activity --version 1.1.6509.914
                    
#r "nuget: Common.Activity, 1.1.6509.914"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Common.Activity&version=1.1.6509.914
                    
Install Common.Activity as a Cake Addin
#tool nuget:?package=Common.Activity&version=1.1.6509.914
                    
Install Common.Activity as a Cake Tool

About

A library for easy logging through form in Activity !

Advantages

With this library, you can organize your program more structured.

And you can use this library to realize some functions like workflows.

Usage

Install

Through cli:

dotnet add package Common.Activity

Import namespace

using Common.Activity;

Use

var activity = new Activity()
    {
        Id = 1,
        Name = "Activity_Calculate",
        Author = "Author",
        IconKind = null,
        Title = null,
        Category = null,
    }
    .Open("samples")
    .Assign("samples", "samples")
    .Assign("samples", "computer")
    .RemoveAssign("samples", "samples")
    .Label("samples", "running")
    .AppendTask(
        new ActivityTask()
            {
                Action = controller =>
                {
                    controller.LogContents(0, $"1 + 0 = {1 + 0}");
                    controller.Result = 1 + 0;
                    controller.Progress = new Progress(ProgressType.Tasks)
                    {
                        Value = new Tuple<int, int>(1, 1)
                    };
                },
            }
            .AppendTask(
                new ActivityTask()
                {
                    Action = controller =>
                    {
                        controller.LogContents(0, $"1 + 1 = {1 + 1}");
                        controller.Result = 1 + 1;
                        controller.Progress = new Progress(ProgressType.Tasks)
                        {
                            Value = new Tuple<int, int>(1, 1)
                        };
                    }
                }
            )
            .AppendTask(
                new ActivityTask()
                {
                    Action = controller =>
                    {
                        controller.LogContents(0, $"1 + 2 = {1 + 2}");
                        controller.Result = 1 + 2;
                        controller.Progress = new Progress(ProgressType.Tasks)
                        {
                            Value = new Tuple<int, int>(1, 1)
                        };
                    }
                }
            )
    )
    .ExecuteAllTasks();

If you use JsonSerializer in System.Text.Json to serialize activity,

var options = new JsonSerializerOptions()
{
    WriteIndented = true,
    IncludeFields = true,
};

Console.WriteLine(
    JsonSerializer.Serialize(activity, options)
);

the output would be like:

{
  "Id": 1,
  "Name": "Activity_Calculate",
  "Author": "Samples",
  "Title": null,
  "Category": null,
  "IconKind": null,
  "Assigners": [
    "computer"
  ],
  "Labels": [
    "running"
  ],
  "Tasks": [
    {
      "Name": null,
      "Progress": {
        "Value": {
          "Item1": 1,
          "Item2": 1
        }
      },
      "IsLoopTask": false,
      "SubTasks": [
        {
          "Name": null,
          "Progress": {
            "Value": {
              "Item1": 1,
              "Item2": 1
            }
          },
          "IsLoopTask": false,
          "SubTasks": [],
          "Contents": {
            "0": "1 \u002B 1 = 2"
          },
          "Warnings": {},
          "Errors": {},
          "Status": 3,
          "Result": 2
        },
        {
          "Name": null,
          "Progress": {
            "Value": {
              "Item1": 1,
              "Item2": 1
            }
          },
          "IsLoopTask": false,
          "SubTasks": [],
          "Contents": {
            "0": "1 \u002B 2 = 3"
          },
          "Warnings": {},
          "Errors": {},
          "Status": 3,
          "Result": 3
        }
      ],
      "Contents": {
        "0": "1 \u002B 0 = 1"
      },
      "Warnings": {},
      "Errors": {},
      "Status": 3,
      "Result": 1
    }
  ],
  "Operations": {
    "OpenAndCloseOperations": [
      {
        "Subject": "samples",
        "ExecuteTime": "2023-05-12T13:52:29.8833534Z",
        "Operation": 0
      }
    ],
    "AssignersRelatedOperations": [
      {
        "Subject": "samples",
        "ExecuteTime": "2023-05-12T13:52:29.8842917Z",
        "Operation": 0,
        "Targets": [
          "samples"
        ]
      },
      {
        "Subject": "samples",
        "ExecuteTime": "2023-05-12T13:52:29.8846075Z",
        "Operation": 0,
        "Targets": [
          "computer"
        ]
      },
      {
        "Subject": "samples",
        "ExecuteTime": "2023-05-12T13:52:29.8849135Z",
        "Operation": 1,
        "Targets": [
          "samples"
        ]
      }
    ],
    "LabelsRelatedOperations": [
      {
        "Subject": "samples",
        "ExecuteTime": "2023-05-12T13:52:29.8854133Z",
        "Operation": 0,
        "Targets": [
          "running"
        ]
      }
    ]
  },
  "Status": 1
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.6509.914 294 5/12/2023
1.1.6509.898 170 5/12/2023
1.1.6509.896 170 5/12/2023
1.0.6429.985 286 2/21/2023
1.0.6429.967 268 2/21/2023
1.0.6417.838 286 2/9/2023
1.0.6417.831 304 2/9/2023
1.0.6417.821 313 2/9/2023
1.0.6406.288 338 1/29/2023
1.0.6397.971 352 1/20/2023
1.0.6346.961 506 11/30/2022
1.0.0 382 11/30/2022