Dec 17, 2011 12:22 PM
(This post was last modified: Dec 18, 2011 06:23 AM by hgdfhsdgdfgdfh.)
This library I decided to release contains some useful re-usable functions and classes I have been using in many projects.
Features (atm)
- C# 2.0
- Mostly object oriented
- Func&Action delegates from .NET 3.5
- Async/synch tasks (haven't found similar in .NET framework 2, but in newer versions this functionality already exists)
- Cryptographic wrappers (encrypt byte array...)
- Compression wrappers (compress byte array)
- Enumerable comparers (like SequenceEquals for later .NET versions)
- Network library (high level networking, in BETA)
Note that some things may already exist in .NET framework. I'll be adding more functionality into this library from my old and new projects.
Feel free to suggest anything you would like to have in this library.
Some example code
Async task
Example array compare code (from tests)
Code:
Get
Please report any bugs you find and give suggestions. You can use issue tracker on CodePlex site.
CodePlex: http://dstd.codeplex.com/
License
License for the code is General Public License v2.
Features (atm)
- C# 2.0
- Mostly object oriented
- Func&Action delegates from .NET 3.5
- Async/synch tasks (haven't found similar in .NET framework 2, but in newer versions this functionality already exists)
- Cryptographic wrappers (encrypt byte array...)
- Compression wrappers (compress byte array)
- Enumerable comparers (like SequenceEquals for later .NET versions)
- Network library (high level networking, in BETA)
Note that some things may already exist in .NET framework. I'll be adding more functionality into this library from my old and new projects.
Feel free to suggest anything you would like to have in this library.
Some example code
Async task
Code
private void MainForm_Load(object sender, EventArgs e)
{
UselessTask task = new UselessTask(); // create task
task.RunAsync(asyncCallback);
// or use following to accomplish same thing:
// DSTD.Threading.TaskRunner.RunAsync(task, asyncCallback);
}
void asyncCallback(DSTD.Threading.AsyncRunEventArgs<string> obj)
{
MessageBox.Show(obj.Result);
}
internal class UselessTask : DSTD.Threading.Runnable<string>
{
public UselessTask() : base(true, true) { }
protected override string Run()
{
System.Threading.Thread.Sleep(1000); // do some work
return "Hello, World!"; // return task result
}
}Example array compare code (from tests)
Code:
Code
bool arraysEqual = DSTD.Comparers.EnumerableSequenceEqualityComparer<int>.Create().SequenceEquals(
new[] {1, 2, 3},
new[] {1, 2, 3});Get
Please report any bugs you find and give suggestions. You can use issue tracker on CodePlex site.
CodePlex: http://dstd.codeplex.com/
License
License for the code is General Public License v2.

