Common.xml

<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Common</name>
    </assembly>
    <members>
        <member name="T:System.Diagnostics.Contracts.ContractEx">
            <summary>
            Extends the .NET frameworks Code Contracts model.
            </summary>
        </member>
        <member name="M:System.Diagnostics.Contracts.ContractEx.Check``1(System.Boolean)">
            <summary>
            Checks if the given condition is fulfilled and throws an exception of type <b>TEx</b>/>
            in case it is not.
            </summary>
            <typeparam name="TEx">exception type to throw</typeparam>
            <param name="condition">condition that need to be fulfilled</param>
        </member>
        <member name="M:System.Diagnostics.Contracts.ContractEx.Check``1(System.Boolean,System.String)">
            <summary>
            Checks if the given condition is fulfilled and throws an exception of type <b>TEx</b>
            in case it is not.
            </summary>
            <typeparam name="TEx">exception type to throw</typeparam>
            <param name="condition">>condition that need to be fulfilled</param>
            <param name="message">custom exception message</param>
        </member>
        <member name="M:System.Diagnostics.Contracts.ContractEx.Check``1(System.Func{System.Boolean})">
            <summary>
            Checks if the given condition is fulfilled and throws an exception of type <b>TEx</b>
            in case it is not.
            </summary>
            <typeparam name="TEx">exception type to throw</typeparam>
            <param name="condition">condition that need to be fulfilled</param>
        </member>
        <member name="M:System.Diagnostics.Contracts.ContractEx.Check``1(System.Func{System.Boolean},System.String)">
            <summary>
            Checks if the given condition is fulfilled and throws an exception of type <b>TEx</b>
            in case it is not.
            </summary>
            <typeparam name="TEx">exception type to throw</typeparam>
            <param name="condition">>condition that need to be fulfilled</param>
            <param name="message">custom exception message</param>
        </member>
        <member name="T:System.IO.DriveHelper">
            <summary>
            Allows to manage free drive letters in a smarter way.
            </summary>
        </member>
        <member name="M:System.IO.DriveHelper.GetNextFreeDrive">
            <summary>
            Returns the next available drive letter, starting at the end of the alphabet.
            </summary>
            <returns></returns>
        </member>
        <member name="M:System.IO.DriveHelper.Reclaim(System.Char)">
            <summary>
            Allows reclaiming of previously used letters without complete resynch.
            </summary>
            <param name="dl"></param>
        </member>
        <member name="M:System.IO.DriveHelper.Resynch">
            <summary>
            Resynchs to the currently available drives.
            </summary>
        </member>
        <member name="P:System.IO.DriveHelper.FreeDrives">
            <summary>
            Returns a copy of the current list of free drives.
            </summary>
        </member>
        <member name="T:System.Security.SecureStringExtensions">
            <summary>
            Extends SecureString to allow easier creation and access.
            </summary>
        </member>
        <member name="M:System.Security.SecureStringExtensions.Append(System.Security.SecureString,System.String)">
            <summary>
            Appends the contents of the <see cref="T:System.String"/>.
            </summary>
            <param name="str"></param>
            <param name="stringToAppend"></param>
        </member>
        <member name="M:System.Security.SecureStringExtensions.Decode(System.Security.SecureString)">
            <summary>
            Decodes the secure content to a plain <see cref="T:System.String"/>.
            </summary>
            <param name="str"></param>
            <returns></returns>
        </member>
        <member name="T:System.Threading.Tasks.AsyncLazy`1">
            <summary>
            Supports asynchronous initialization of a state variable without blocking in contructor.
            </summary>
            <typeparam name="T"></typeparam>
            <example><code>
            <![CDATA[
            var target = new AsyncLazy<string>(() =>
            {
                Thread.Sleep(300);
                return expectedString;
            });
            var result = await target;
            ]]></code>
            </example>
        </member>
        <member name="M:System.Threading.Tasks.AsyncLazy`1.#ctor(System.Func{`0})">
            <summary>
            CTOR: Calls the function asynchronously in the background to createT.
            </summary>
            <param name="valueFactory"></param>
        </member>
        <member name="M:System.Threading.Tasks.AsyncLazy`1.#ctor(System.Func{System.Threading.Tasks.Task{`0}})">
            <summary>
            CTOR: Uses a task factory called asynchronously in the background to create T.
            </summary>
            <param name="taskFactory"></param>
        </member>
        <member name="M:System.Threading.Tasks.AsyncLazy`1.GetAwaiter">
            <summary>
            <see cref="M:System.Threading.Tasks.Task.GetAwaiter"/>
            </summary>
            <returns></returns>
        </member>
        <member name="T:System.Threading.Tasks.AsyncPump">
             <summary>Provides a pump that supports running asynchronous methods on the current thread.</summary>
             <example><code><![CDATA[
             AsyncPump.Run(async delegate
             {
                 await DemoAsync();
             });
              
             static async Task DemoAsync()
             {
                 var d = new Dictionary<int, int>();
             
                 for (int i = 0; i < 10000; i++)
                 {
                     int id = Thread.CurrentThread.ManagedThreadId;
                     int count;
                     d[id] = d.TryGetValue(id, out count) ? count + 1 : 1;
                     await Task.Yield();
                 }
              
                 foreach (var pair in d)
                     Console.WriteLine(pair);
             }
             ]]>
             </code></example>
        </member>
        <member name="M:System.Threading.Tasks.AsyncPump.Run(System.Func{System.Threading.Tasks.Task})">
            <summary>Runs the specified asynchronous function.</summary>
            <param name="func">The asynchronous function to execute.</param>
        </member>
        <member name="T:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext">
            <summary>Provides a SynchronizationContext that's single-threaded.</summary>
        </member>
        <member name="F:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext._queue">
            <summary>The queue of work items.</summary>
        </member>
        <member name="F:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext._thread">
            <summary>The processing thread.</summary>
        </member>
        <member name="M:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext.Post(System.Threading.SendOrPostCallback,System.Object)">
            <summary>Dispatches an asynchronous message to the synchronization context.</summary>
            <param name="d">The System.Threading.SendOrPostCallback delegate to call.</param>
            <param name="state">The object passed to the delegate.</param>
        </member>
        <member name="M:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext.Send(System.Threading.SendOrPostCallback,System.Object)">
            <summary>Not supported.</summary>
        </member>
        <member name="M:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext.RunOnCurrentThread">
            <summary>Runs an loop to process all queued work items.</summary>
        </member>
        <member name="M:System.Threading.Tasks.AsyncPump.SingleThreadSynchronizationContext.Complete">
            <summary>Notifies the context that no more work will arrive.</summary>
        </member>
        <member name="T:System.Threading.Tasks.IProgressNotifier`1">
            <summary>
            Interface that can be used by async executing operations to communicate progress and partial results back to caller.
            </summary>
            <typeparam name="T">type used to pass partial results back to caller</typeparam>
        </member>
        <member name="M:System.Threading.Tasks.IProgressNotifier`1.Notify(`0,System.Int32)">
            <summary>
            Allows reporting operation progress back to caller side.
            </summary>
            <param name="chunk">data chunk for access</param>
            <param name="progressPercentage">current progress in the range [0;100]</param>
        </member>
        <member name="P:System.Threading.Tasks.IProgressNotifier`1.CancellationToken">
            <summary>
            Use token inside async operation to cancel operation.
            </summary>
        </member>
        <member name="T:System.Threading.Tasks.IProgressNotifier">
            <summary>
            Interface that can be used by async executing operations to communicate progress back to caller.
            </summary>
        </member>
        <member name="M:System.Threading.Tasks.IProgressNotifier.Notify(System.Int32)">
            <summary>
            Allows reporting operation progress back to caller side.
            </summary>
            <param name="progressPercentage">current progress in the range [0;100]</param>
        </member>
        <member name="P:System.Threading.Tasks.IProgressNotifier.CancellationToken">
            <summary>
            Use token inside async operation to cancel operation.
            </summary>
        </member>
        <member name="T:System.Threading.Tasks.Notifier`1">
            <summary>
            Can be passed to an async executing operation to report progress and partial results back to the caller.
            It takes care of routing the notifications back to caller's thread (e.g. UI thread).
            </summary>
            <remarks>Class requires <see cref="P:System.Threading.SynchronizationContext.Current"/> to be set, otherwise notification cannot be routed back
            to the calling thread. In order to use this from e.g. console applications or powershell, <see cref="T:System.Threading.Tasks.AsyncPump"/> can be used.</remarks>
            <typeparam name="T">Result type to communicate results back</typeparam>
            <example><code><![CDATA[
            int progress = 0;
            List<string> results = new List<string>();
            IEnumerable<string> totalResult = null;
             
            AsyncPump.Run(async delegate
            {
                IProgressNotifier<IEnumerable<string>> notifier = new Notifier<IEnumerable<string>>((partialResults, prog) =>
                {
                    progress = prog;
                    results.AddRange(partialResults);
                });
             
                totalResult = OperationWithProgressNotifications(notifier);
            });
             
            private IEnumerable<string> OperationWithProgressNotifications(IProgressNotifier<IEnumerable<string>> notifier)
            {
                List<string> results = new List<string>();
             
                for (int i = 0; i < 10; i++)
                {
                    string r = $"Result: {i}";
                    notifier.Notify(new[] {r}, (i+1)*10);
                    results.Add(r);
                }
             
                return results;
            }
            ]]>
            </code></example>
        </member>
        <member name="M:System.Threading.Tasks.Notifier`1.#ctor(System.Action{`0,System.Int32})">
            <summary>
            Class requires <see cref="P:System.Threading.SynchronizationContext.Current"/> to be set, otherwise notification cannot be routed back
            to the calling thread.
            </summary>
            <param name="callback"></param>
            <exception cref="T:System.InvalidOperationException"></exception>
        </member>
        <member name="M:System.Threading.Tasks.Notifier`1.CancelOperation">
            <summary>
            Allows cancelling the async operation.
            </summary>
        </member>
        <member name="T:System.Threading.Tasks.ProgressNotifier`1">
            <summary>
            Used as part of <see cref="T:System.Threading.Tasks.TaskFactoryEx"/>
            </summary>
            <typeparam name="T"></typeparam>
        </member>
        <member name="T:System.Threading.Tasks.TaskFactoryEx">
            <summary>
            Extends TaskFactory to create tasks that support progress notification and cancellation.
            </summary>
        </member>
        <member name="M:System.Threading.Tasks.TaskFactoryEx.StartNewWithProgress``1(System.Threading.Tasks.TaskFactory,System.Func{System.Threading.Tasks.IProgressNotifier{``0},``0},System.Action{``0,System.Int32},System.Threading.CancellationToken)">
            <summary>
            Start a task that supports reporting results back in chunks including cancellation and progress notifications.
            </summary>
            <example><code>
            var tokenSource = new CancellationTokenSource();
            var resultTask = Task.Factory.StartNewWithProgress&lt;int[]&gt;((pn) =>
            {
               var result = new List&lt;int&gt;();
               for (int i = 0; i &lt; 100000; i++)
               {
                   ...
                   result.Add(i);
                   pn.CancellationToken.ThrowIfCancellationRequested();
                   pn.Notify(new int[] { i }, i * 10);
               }
               return result.ToArray();
            },
               // Progress Handling
            (chunk, progressPercentage) =>
            {
               var threadID = Thread.CurrentThread.ManagedThreadId;
               Console.WriteLine("{0} - {2} - {1}", progressPercentage, string.Join&lt;int&gt;(", ", chunk), threadID);
               _threadOfExecution.Add(threadID);
            }, tokenSource.Token);
            </code>
            </example>
            <typeparam name="TResult">result type</typeparam>
            <param name="factory"><see cref="T:System.Threading.Tasks.TaskFactory"/> instance to be extended.</param>
            <param name="function">function to execute async</param>
            <param name="progressHandler">handler that gets called on the caller's thread (e.g. UI thread) and where progress can be reported back to the
            user.</param>
            <param name="cancellationToken">token that can be used inside the async function to abort the operation.</param>
            <returns><see cref="T:System.Threading.Tasks.Task"/> that can be awaited</returns>
        </member>
        <member name="M:System.Threading.Tasks.TaskFactoryEx.StartNewWithProgress(System.Threading.Tasks.TaskFactory,System.Action{System.Threading.Tasks.IProgressNotifier},System.Action{System.Int32},System.Threading.CancellationToken)">
            <summary>
            Start a task that supports supports cancellation and progress notifications.
            </summary>
            <example><code>
            var tokenSource = new CancellationTokenSource();
            var resultTask = Task.Factory.StartNewWithProgress((pn) =>
            {
               var result = new List&lt;int&gt;();
               for (int i = 0; i &lt; 100000; i++)
               {
                   ...
                   result.Add(i);
                   pn.CancellationToken.ThrowIfCancellationRequested();
                   pn.Notify(i * 10);
               }
               return result.ToArray();
            },
               // Progress Handling
            (progressPercentage) =>
            {
               var threadID = Thread.CurrentThread.ManagedThreadId;
               Console.WriteLine("{0} - {1}", progressPercentage, threadID);
               _threadOfExecution.Add(threadID);
            }, tokenSource.Token);
            </code>
            </example>
            <param name="factory"><see cref="T:System.Threading.Tasks.TaskFactory"/> instance to be extended.</param>
            <param name="function">function to execute async</param>
            <param name="progressHandler">handler that gets called on the caller's thread (e.g. UI thread) and where progress can be reported back to the
            user.</param>
            <param name="cancellationToken">token that can be used inside the async function to abort the operation.</param>
            <returns><see cref="T:System.Threading.Tasks.Task"/> that can be awaited</returns>
        </member>
        <member name="T:System.DateTimeUtils">
            <summary>
            Collection of <see cref="T:System.DateTime"/> extension methods.
            </summary>
        </member>
        <member name="M:System.DateTimeUtils.CoerceSubseconds(System.DateTime)">
            <summary>
            Coerces resolution to seconds, milliseconds and below are cut off.
            </summary>
            <param name="dt"></param>
            <returns></returns>
        </member>
        <member name="M:System.DateTimeUtils.IsInPast(System.DateTime)">
            <summary>
            Returns true, if dateTime lies in the past.
            </summary>
            <param name="dateTime"></param>
            <returns>true, if dateTime is in past.</returns>
        </member>
        <member name="M:System.DateTimeUtils.IsInFuture(System.DateTime)">
            <summary>
            Returns true, if dateTime lies in the future.
            </summary>
            <param name="dateTime"></param>
            <returns></returns>
        </member>
        <member name="T:Common.Security.ByteArrayExtension">
            <summary>
            Extensions to interop between <see cref="T:System.Security.SecureString"/> and byte[].
            </summary>
        </member>
        <member name="M:Common.Security.ByteArrayExtension.AsDecryptedSecureString(System.Byte[])">
            <summary>
            Decrypts an array of bytes and returns it as <see cref="T:System.Security.SecureString"/>.
            </summary>
            <param name="array"></param>
            <returns></returns>
        </member>
        <member name="M:Common.Security.ByteArrayExtension.AsEncryptedByteArray(System.Security.SecureString)">
            <summary>
            Encrypts the passed <see cref="T:System.Security.SecureString"/> and returns it as array of bytes.
            </summary>
            <param name="secString"></param>
            <returns></returns>
        </member>
        <member name="T:Common.Security.CryptoHelper">
            <summary>
            This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and
            decrypt data. As long as encryption and decryption routines use the same
            parameters to generate the keys, the keys are guaranteed to be the same.
            The class uses static functions with duplicate code to make it easier to
            demonstrate encryption and decryption logic. In a real-life application,
            this may not be the most efficient way of handling encryption, so - as
            soon as you feel comfortable with it - you may want to redesign this class.
            </summary>
            <example>
            string plainText = "Hello, World!"; // original plaintext
            string passPhrase = "Pas5pr@se"; // can be any string
            string passPhrase = "Pas5pr@se"; // can be any string
            string _saltValue = "s@1tValue"; // can be any string
            string _hashAlgorithm = "SHA1"; // can be "MD5"
            int _passwordIterations = 2; // can be any number
            string _initVector = "@1B2c3D4e5F6g7H8"; // must be 16 bytes
            int _keySize = 256; // can be 192 or 128
            </example>
        </member>
        <member name="M:Common.Security.CryptoHelper.#ctor">
            <summary>
            CTOR
            </summary>
        </member>
        <member name="M:Common.Security.CryptoHelper.Encrypt(System.Security.SecureString,System.String)">
            <summary>
            Encrypts specified plaintext using Rijndael symmetric key algorithm
            and returns a base64-encoded result.
            </summary>
            <param name="stringToEncrypt">string to be encrypted</param>
            <param name="passPhrase">Passphrase from which a pseudo-random masterPassword will be derived. The
            derived masterPassword will be used to generate the encryption key.
            Passphrase can be any string. In this example we assume that this
            passphrase is an ASCII string.</param>
            <returns></returns>
        </member>
        <member name="M:Common.Security.CryptoHelper.Encrypt(System.String,System.String)">
            <summary>
            Encrypts specified plaintext using Rijndael symmetric key algorithm
            and returns a base64-encoded result.
            </summary>
            <param name="plainText">
            Plaintext value to be encrypted.
            </param>
            <param name="passPhrase">
            Passphrase from which a pseudo-random masterPassword will be derived. The
            derived masterPassword will be used to generate the encryption key.
            Passphrase can be any string. In this example we assume that this
            passphrase is an ASCII string.
            </param>
            <returns>
            Encrypted value formatted as a base64-encoded string.
            </returns>
        </member>
        <member name="M:Common.Security.CryptoHelper.DecryptToSecureString(System.String,System.String)">
            <summary>
            Decrypts specified ciphertext using Rijndael symmetric key algorithm.
            For details <see cref="M:Common.Security.CryptoHelper.Decrypt(System.String,System.String)"/>.
            </summary>
            <param name="cipherText">encrypted string to decrypt</param>
            <param name="passPhrase">Base64-formatted ciphertext value.</param>
            <returns></returns>
        </member>
        <member name="M:Common.Security.CryptoHelper.Decrypt(System.String,System.String)">
            <summary>
            Decrypts specified ciphertext using Rijndael symmetric key algorithm.
            </summary>
            <param name="cipherText">
            Base64-formatted ciphertext value.
            </param>
            <param name="passPhrase">
            Passphrase from which a pseudo-random masterPassword will be derived. The
            derived masterPassword will be used to generate the encryption key.
            Passphrase can be any string. In this example we assume that this
            passphrase is an ASCII string.
            </param>
            <returns>
            Decrypted string value.
            </returns>
            <remarks>
            Most of the logic in this function is similar to the Encrypt
            logic. In order for decryption to work, all parameters of this function
            - except cipherText value - must match the corresponding parameters of
            the Encrypt function which was called to generate the
            ciphertext.
            </remarks>
        </member>
        <member name="T:Common.Security.MasterPasswordGenerator">
            <summary>
            Allows generating an internal password so that it does not need to be stored as string.
            </summary>
        </member>
        <member name="M:Common.Security.MasterPasswordGenerator.#ctor">
            <summary>
            CTOR
            </summary>
        </member>
        <member name="M:Common.Security.MasterPasswordGenerator.GetPassword">
            <summary>
            Returns the generated password.
            </summary>
            <returns></returns>
        </member>
        <member name="T:Common.Text.CharacterEncoder">
            <summary>
            Allows encoding special characters to their escaped html representation.
            </summary>
        </member>
        <member name="M:Common.Text.CharacterEncoder.Encode(System.String)">
            <summary>
            Encode special characters to their escaped html representation.
            </summary>
            <param name="originalText"></param>
            <returns></returns>
        </member>
    </members>
</doc>