Contents tagged with C#

  • Useful Extension methods

    In this article, Brian examines extension methods and how they can be used with .NET Framework applications. He begins with a short introduction and then provides a detailed explanation of the application of extension methods with the help of source code in C#.

    Read more...

     

    Read more...

  • Useful Generic array functions

    The standard .NET Framework offers quite a few generic functions to munipulate arrays, however there are some functionalities where extra code will be needed such as Appending to the array, removing an element from the array, or removing all elements that fall under a condition.

    Should have some basic knowledge of Generic Classes, Lists, Arrays etc.

    The Array Object contains some useful generic functionalities such as:

    • ConvertAll<T,O>
    • Exists<T>
    • Find<T>
    • Resize<T>
    • TrueForAll<T>

    However, these functionalities by themselfs sometimes does not get the job done.

    Read more...

     

    Read more...

  • Another C# Legacy HTML parser using Tag processing.

    This article presents a simple HTML parser library developed for an automated application. The parser mainly detects tag syntax and it can collect a tag pair as a group.

    The parser was intended to be used with HTML content retrieved by .Net WebResponse class. So Ruxo Zheng also have developed a tool, named NativeWebSurf, that downloads HTML content by WebResponse and uses its parser to parse it into an HTML structure.

    Read more...

     

    Read more...

  • Database local cache

    You are developing a desktop application for managing a fitness center. The members information is of course to be stored in a database, so you define a "Members" table with fields such as name, birth date, telephone, and the like. But your happiness ends when you are faced with the requirement of recording the member's photo together with the rest of the data. Then the second most trascendental question in human history (right after the meaning of life) comes to your mind: Should I store the photo in the database for the sake of data consistency, or in the local filesystem for the sake of performance?

    This article presents a C# class that will allow you to grab the best of two worlds.

    Read more...

     

    Read more...

  • Understanding Interfaces in C#

    Interfaces are a very useful tool built into C#. In this article Brendan explains the basics of how interfaces work and for what they may be used. He explains how to create simple custom interfaces and how to implement them.

    Read more...

     

    Read more...