C# language feature:

  • Import of static type members into namespace

applies to

  • static methods of a single class

benefit

  • Improves reading of code (for well known static methods/classes)

how to use

  • 1) Use include statement with static modifier i.e. using static <namespace>;
  • 2) Omit namespace when referencing static methods.

example:

        void Import_of_static_type_members_into_namespace()
        {
            // 1) don't forget to include 'using static System.Math;'

            // 2) omit namespace when referencing static method
            double result = Sqrt(55);   

            // previously 
            double oldway = System.Math.Sqrt(55); 
        }