Click here to Skip to main content
15,894,405 members
Articles / Programming Languages / C# 4.0

Universal Type Extender

Rate me:
Please Sign up or sign in to vote.
4.83/5 (30 votes)
5 Jun 2013Ms-PL11 min read 73.6K   569   62  
Emulate extension properties by extending any reference type with any other type.
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>UniversalTypeExtender</name>
    </assembly>
    <members>
        <member name="T:TB.ComponentModel.UniversalTypeExtender">
            <summary>
            Provides functionality for extending reference types with additional objects as a kind of properties.
            </summary>
        </member>
        <member name="M:TB.ComponentModel.UniversalTypeExtender.Extended``1(``0)">
            <summary>
            Creates an extender for the given object.
            The returned extender could be used to add other objects to this object as a kind of properties.
            </summary>
            <typeparam name="T">Type of the object to create an extender for.</typeparam>
            <param name="extendee">Object to create an extender for.</param>
            <returns>Extender assigned to <paramref name="extendee"/>.</returns>
        </member>
        <member name="P:TB.ComponentModel.UniversalTypeExtender.CollectGarbageIntervalInMilliseconds">
            <summary>
            Gets or sets the interval for checking for not existing items.
            The default is 15,000 milliseconds.
            </summary>
        </member>
        <member name="T:TB.ComponentModel.UniversalTypeExtender.Extender`1">
            <summary>
            Provides functionality for extending an object with additional objects as a kind of properties.
            </summary>
            <typeparam name="T"></typeparam>
        </member>
        <member name="M:TB.ComponentModel.UniversalTypeExtender.Extender`1.Dynamically">
            <summary>
            Extends the assigned object with a DynamicPropertyExtension which can handle dynamic property access.
            The returned extension is instantiated only once for an object and a call to the same object alway returns the same instance of the extension.
            </summary>
            <returns>
            DynamicPropertyExtension assigned to the specified object.
            The returned extension is instantiated only once for an object and a call to the same object alway returns the same instance of the extension.
            </returns>
        </member>
        <member name="M:TB.ComponentModel.UniversalTypeExtender.Extender`1.With``1">
            <summary>
            Extends the assigned object with an instance of the specified type.
            The returned extension is instantiated only once for an object and a call to the same object alway returns the same instance of the extension.
            </summary>
            <typeparam name="TE">Type of the extension.</typeparam>
            <returns>
            Instance of the specified type assigned to the specified object.
            The returned extension is instantiated only once for an object and a call to the same object alway returns the same instance of the extension.
            </returns>
        </member>
        <member name="T:TB.ComponentModel.Infrastructure.DynamicPropertyExtension">
            <summary>
            Represents an extension for dynamic property access.
            </summary>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.DynamicPropertyExtension.TryGetIndex(System.Dynamic.GetIndexBinder,System.Object[],System.Object@)">
            <summary>
            Provides the implementation for operations that get a value by index.
            </summary>
            <param name="binder">Provides information about the operation.</param>
            <param name="indexes">The indexes that are used in the operation.</param>
            <param name="result">The result of the index operation.</param>
            <returns>true if the operation is successful; otherwise, false.</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.DynamicPropertyExtension.TrySetIndex(System.Dynamic.SetIndexBinder,System.Object[],System.Object)">
            <summary>
            Provides the implementation for operations that set a value by index.
            </summary>
            <param name="binder">Provides information about the operation.</param>
            <param name="indexes">The indexes that are used in the operation.</param>
            <param name="value">The value to set to the object that has the specified index.</param>
            <returns>true if the operation is successful; otherwise, false.</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.DynamicPropertyExtension.TryGetMember(System.Dynamic.GetMemberBinder,System.Object@)">
            <summary>
            Provides the implementation for operations that get member values.
            </summary>
            <param name="binder">Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed.</param>
            <param name="result">The result of the get operation.</param>
            <returns>true if the operation is successful; otherwise, false.</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.DynamicPropertyExtension.TrySetMember(System.Dynamic.SetMemberBinder,System.Object)">
            <summary>
            Provides the implementation for operations that set member values.
            </summary>
            <param name="binder">Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned.</param>
            <param name="value">The value to set to the member.</param>
            <returns>true if the operation is successful; otherwise, false.</returns>
        </member>
        <member name="T:TB.ComponentModel.Infrastructure.ExtensionRepository">
            <summary>
            Represents a repository for <see cref="T:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem">ExtensionRepositoryItem</see>s.
            </summary>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.Get``1(``0)">
            <summary>
            Returns the item belonging to the specified object.
            </summary>
            <param name="forInstance">Object to get the item for.</param>
            <returns><see cref="T:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem">ExtensionRepositoryItem</see> belonging to the specified object.</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.GetExtension``1(System.Object)">
            <summary>
            Gets the specified extension for the specified object.<br/>
            Creates a new instance of the specified extension if it was not registered yet.
            </summary>
            <typeparam name="T">Type of the requested extension.</typeparam>
            <param name="forInstance">Object to get the extension for.</param>
            <returns>Extension</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.CollectGarbage">
            <summary>
            Removes weak object references which targets are not alive anymore.
            </summary>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.Count">
            <summary>
            Gets the number of elements actually contained in the repository.
            </summary>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.CollectGarbageIntervalInMilliseconds">
            <summary>
            Gets or sets the interval for checking for not existing items.
            The default is 15,000 milliseconds.
            </summary>
        </member>
        <member name="T:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItemTargetKey">
            <summary>
            Represents the key of an ExtensionRepositoryItem.
            Only for infrastructure.
            </summary>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItemTargetKey.#ctor(System.Object)">
            <summary>
            Initializes a new instance of the RepositoryItemTargetKey class.
            </summary>
            <param name="target">RepositoryItem.</param>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItemTargetKey.GetHashCode">
            <summary>
            Serves as a hash function for this type.
            </summary>
            <returns>A hash code for this instance.</returns>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItemTargetKey.Equals(System.Object)">
            <summary>
            Determines whether the specified object is equal to this instance.
            </summary>
            <param name="obj">The object to compare with this instance.</param>
            <returns>true if the specified object is equal to this instance otherwise, false.</returns>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItemTargetKey.Target">
            <summary>
            Gets the target.
            </summary>
        </member>
        <member name="T:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem">
            <summary>
            Represents an item for the <see cref="T:TB.ComponentModel.Infrastructure.ExtensionRepository">ExtensionRepository</see>.
            </summary>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem.#ctor(System.Object)">
            <summary>
            Initializes a new instance of the <see cref="T:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem">RepositoryItem</see> class, referencing the specified object.
            </summary>
            <param name="target">The object to track.</param>
        </member>
        <member name="M:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem.GetExtension``1">
            <summary>
            Gets the extension of the specified type.<br/>
            Creates a new instance of the specified type if it was not registered yet.
            </summary>
            <typeparam name="T">Type of the requested extension.</typeparam>
            <returns>Extension</returns>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem.Key">
            <summary>
            Gets the key of this instance.
            </summary>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem.Target">
            <summary>
            Gets the Target of this instance.
            </summary>
        </member>
        <member name="P:TB.ComponentModel.Infrastructure.ExtensionRepository.RepositoryItem.CouldBeCollectedByGC">
            <summary>
            Gets an indication whether the item could be garbage collected because its inner reference was garbage collected.
            </summary>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer
Germany Germany
--------------------------------
Thank you for voting
Best "Everything Else" Article
of September 2014

Comments and Discussions