Saturday, October 29, 2022

extension methods

extension methods

  1. Extension Methods (C# Programming Guide)
  2. Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are static methods, but they're called as if they were instance methods on the extended type. For client code written in C#, F# and Visual Basic, there's no apparent difference between calling an extension method and the methods defined in a type.

    The most common extension methods are the LINQ standard query operators that add query functionality to the existing System.Collections.IEnumerable and System.Collections.Generic.IEnumerable <T > types.

    To use the standard query operators, first bring them into scope with a using System.Linq directive. Then any type that implements IEnumerable <T > appears to have instance methods such as GroupBy, OrderBy, Average, and so on. You can see these additional methods in IntelliSense statement completion when you type "dot" after an instance of an IEnumerable <T > type such as List<T > or Array.

    Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on. The parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.

    General Guidelines While it's still considered preferable to add functionality by modifying an object's code or deriving a new type whenever it's reasonable and possible to do so, extension methods have become a crucial option for creating reusable functionality throughout the .NET ecosystem. For those occasions when the original source isn't under your control, when a derived object is inappropriate or impossible, or when the functionality shouldn't be exposed beyond its applicable scope, Extension methods are an excellent choice.

  3. Reference: Array Class
  4. Provides methods for creating, manipulating, searching, and sorting arrays,

    thereby serving as the base class for all arrays in the common language runtime.

    Remarks The Array class is not part of the System.Collections namespaces. However, it is still considered a collection because it is based on the IList interface.

    The Array class is the base class for language implementations that support arrays. However, only the system and compilers can derive explicitly from the Array class. Users should employ the array constructs provided by the language.

    An element is a value in an Array. The length of an Array is the total number of elements it can contain. The lower bound of an Array is the index of its first element. An Array can have any lower bound, but it has a lower bound of zero by default. A different lower bound can be defined when creating an instance of the Array class using CreateInstance. A multidimensional Array can have different bounds for each dimension. An array can have a maximum of 32 dimensions.

    Unlike the classes in the System.Collections namespaces, Array has a fixed capacity. To increase the capacity, you must create a new Array object with the required capacity, copy the elements from the old Array object to the new one, and delete the old Array.

    The array size is limited to a total of 4 billion elements, and to a maximum index of 0X7FEFFFFF in any given dimension (0X7FFFFFC7 for byte arrays and arrays of single-byte structures).

    .NET Framework only: By default, the maximum size of an Array is 2 gigabytes (GB). In a 64-bit environment, you can avoid the size restriction by setting the enabled attribute of the gcAllowVeryLargeOb

  5. Type Class
  6. Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.

    Other Good Posts

  7. C# - Extension Method
  8. Extension methods, as the name suggests, are additional methods. Extension methods allow you to inject additional methods without modifying, deriving or recompiling the original class, struct or interface. Extension methods can be added to your own custom class, .NET framework classes, or third party classes or interfaces.

    Note: The only difference between a regular static method and an extension method is that the first parameter of the extension method specifies the type that it is going to operator on, preceded by the this keyword.

    Points to Remember :
    1. Extension methods are additional custom methods which were originally not included with the class.
    2. Extension methods can be added to custom, .NET Framework or third party classes, structs or interfaces.
    3. The first parameter of the extension method must be of the type for which the extension method is applicable, preceded by the this keyword.
    4. Extension methods can be used anywhere in the application by including the namespace of the extension method.
  9. Extension Methods in C#
  10. A C# extension methods allows developers to extend functionality of an existing type without creating a new derived type, recompiling, or otherwise modifying the original type. C# extension method is a special kind of static method that is called as if it was an instance methods on the extended type. In this article, we will create a class library and we will then extend its functionality from the caller code by implementing extension methods in C#.

    Benefits of extension methods
    1. Extension methods allow existing classes to be extended without relying on inheritance or having to change the class's source code.
    2. If the class is sealed than there in no concept of extending its functionality. For this a new concept is introduced, in other words extension methods.
    3. This feature is important for all developers, especially if you would like to use the dynamism of the C# enhancements in your class's design.
    Important points for the use of extension methods
    1. An extension method must be defined in a top-level static class.
    2. An extension method with the same name and signature as an instance method will not be called.
    3. Extension methods cannot be used to override existing methods.
    4. The concept of extension methods cannot be applied to fields, properties or events.
    5. Overuse of extension methods is not a good style of programming.
  11. Extension Methods in C#
  12. In this article, I am going to discuss the Extension Methods in C# with Examples. Please read our previous article where we discussed Sealed Class and Sealed Methods in C# with Examples. At the end of this article, you will understand what exactly C# Extension Methods are and when and how to use these extension methods in C#.

    While working with the Extension Method in C#, we need to remember the following points.
    1. Extension methods must be defined only under the static class. If you check our NewClass, then you will see that the NewClass is a static class.
    2. We already discussed that Static Class in C# contains only Static Members. As an extension method is defined under a static class, it means the extension method should be created as a static method whereas once the method is bound with another class, the method changes into non-static. Now, if you check the methods in NewClass, then you will see that all three methods are declared as static only.
    3. The first parameter of an extension method is known as the binding parameter which should be the name of the class to which the method has to be bound and the binding parameter should be prefixed with this As here we are creating these extension methods to extend the functionality of OldClass, so, you can check the first parameter of all these methods are going to be OldClass which is also prefixed with this keyword.
    4. An extension method can have only one binding parameter and that should be defined in the first place on the parameter list.
    5. If required, an extension method can be defined with normal parameters also starting from the second place of the parameter list. If you check the Test3 method, we have passed the second parameter as int and while calling this method we also need to pass one integer value.
  13. Extension Methods in C#
  14. Have you ever needed to extend a class provided by a third-party library? You might want to add functionality or simplify a particular set of methods in the library.

  15. Extension Method in C#
  16. In C#, the extension method concept allows you to add new methods in the existing class or in the structure without modifying the source code of the original type and you do not require any kind of special permission from the original type and there is no need to re-compile the original type. It is introduced in C# 3.0.

    Important Points:
    1. Here, Binding parameters are those parameters which are used to bind the new method with the existing class or structure. It does not take any value when you are calling the extension method because they are used only for binding not for any other use. In the parameter list of the extension method binding parameter is always present at the first place. if you write binding parameter to second, or third, or any other place rather than first place ,then the compiler will give an error. The binding parameter is created using this keyword followed by the name of the class in which you want to add a new method and the parameter name. For example:

      this Geek g

      Here, this keyword is used for binding, Geek is the class name in which you want to bind, and g is the parameter name.
    2. Extension methods are always defined as a static method, but when they are bound with any class or structure they will convert into non-static methods.
    3. When an extension method is defined with the same name and the signature of the existing method, then the compiler will print the existing method, not the extension method. Or in other words, the extension method does not support method overriding.
    4. You can also add new methods in the sealed class also using an extension method concept.
    5. It cannot apply to fields, properties, or events.
    6. It must be defined in top-level static class.
    7. Multiple binding parameters are not allowed means an extension method only contains a single binding parameter. But you can define one or more normal parameter in the extension method.
  17. How to implement and use Extension Methods in C#
  18. In C#, we can use the Extension Methods to extend both built-in types and custom types. These extension methods are introduced in C# 3.0

  19. File.ReadLines(String) Method in C# with Examples
  20. File.ReadLines(String) is an inbuilt File class method that is used to read the lines of a file.

  21. How to: Add class diagrams to projects
  22. To design, edit, and refactor classes and other types, add a class diagram to your C#, Visual Basic, or C++ project. To visualize different parts of the code in a project, add multiple class diagrams to the project.

Draw2D user control

  1. DrawingView: Simple Generic Winform 2D Drawing Component
  2. 2D Drawing component with Scaling, Zooming, Scrolling, Centering and Resizing capabilities

    Simple 2D Drawing Component that can be used in a WinForm applications. It allows you to create a simple 2D Drawing with scaling, zooming, scrolling, centering and resizing in your application. You can also save your drawing as an image or print it.

  3. Coding Tutorials
  4. Coding Tutorials: very good topics..

  5. MAIWO M.2 Nvme & SATA SSD Enclosure Reader Adapter, 10Gbps USB C 3.2 Gen2, Thunderbolt 3
  6. MAIWO M.2 Nvme & SATA SSD Enclosure Reader Adapter, 10Gbps USB C 3.2 Gen2, Thunderbolt 3

  7. ORICO Aluminum M.2 NVME SSD Enclosure Docking Station Dual Bay With Offline Clone
  8. ORICO Aluminum M.2 NVME SSD Enclosure Docking Station Dual Bay With Offline Clone

  9. ORICO Aluminium M.2 SSD Enclosure Dual Bay Type-C USB3.1 for NVME/NGFF SATA SSD Disk 10Gbps 4TB
  10. ORICO Aluminium M.2 SSD Enclosure Dual Bay Type-C USB3.1 for NVME/NGFF SATA SSD Disk 10Gbps 4TB

  11. QNAP TBS-464 M.2 NVMe SSD NASbook
  12. QNAP TBS-464 M.2 NVMe SSD NASbook

Saturday, October 1, 2022

Embed PDF into Excel

Embed PDF into Excel

  1. How to Embed a PDF File in an Excel Worksheet
  2. Sometimes you may have a need to embed a PDF file within the Excel workbook. This could be the case when you are creating a catalog and want to embed product specific PDFs.

Candlestick pattern

Candlestick pattern

  1. E01: Different Types Of Candlesticks (The Ultimate Guide To Candlestick Patterns)
  2. E01: Different Types Of Candlesticks (The Ultimate Guide To Candlestick Patterns)

    A good series: 6 series

  3. Ultimate Candlestick Patterns Trading Course (PRO INSTANTLY)
  4. Ultimate Candlestick Patterns Trading Course (PRO INSTANTLY)

  5. Ultimate MACD Indicator Trading Course (EXPERT INSTANTLY)
  6. In this video we show you the Wysetrade advanced MACD indicator trading strategy. MACD is used by many traders but is often used incorrectly. We combine all concepts from our past videos SO MAKE SURE YOU WATCH ALL OUR PAST VIDEOS TO GET CAUGHT UP

  7. E02: Reversal Candlestick Patterns, Part A (The Ultimate Guide To Candlestick Patterns)
  8. E02: Reversal Candlestick Patterns, Part A (The Ultimate Guide To Candlestick Patterns)

  9. E03: Reversal Candlestick Patterns, Part B (The Ultimate Guide To Candlestick Patterns)
  10. E03: Reversal Candlestick Patterns, Part B (The Ultimate Guide To Candlestick Patterns)

W D Gann video

W D Gann video

  1. WD GANN SQUARE OF 9 Lets Decode the Myth
  2. WD GANN SQUARE OF 9 Lets Decode the Myth

  3. Gann Angles (What is it really)
  4. Very basics of W.D.Gann's amazing rules

  5. Michael S Jenkins Explains Gann's Time and Price Squared
  6. Using Planetary longitudes and price conversions to forecast highs and lows in the market

  7. HOW TO SET UP A GANN CHART (GANN SQUARE & GANN BOX)
  8. William Delbert Gann (or W.D Gann), is a legendary name in the world of stock and commodity trading and perhaps one of the most successful stock and commodity traders who has ever lived. W.D Gann was a finance trader who developed the technical analysis methods such as the Gann Square, Gann Angles, Gann Box, etc. His life's work is now known as the Gann Theory.

  9. Michael S. Jenkins The Science of Numbers Forecasting the Stock Market Michael Jenkins 10.9K subscribers Subscribe 1.2K Dislike
  10. Forecasting future highs and lows in the stock market from the numbers encoded in prior movements Method Shown predicted Sept 22, 2014 top perfectly

  11. This completely changed the way I see numbers | Modular Arithmetic Visually Explained
  12. This completely changed the way I see numbers | Modular Arithmetic Visually Explained

  13. Michael S Jenkins The Science of Numbers Forecasting the Stock Market 2
  14. Michael S Jenkins The Science of Numbers Forecasting the Stock Market 2

  15. Price and Time Forecasting: Time as a Mathematical Object
  16. Michael S. Jenkins is a private trader and publisher of the Stock Cycles Forecast newsletter. He has worked in bank trust departments as a portfolio manager, ran three mutual funds and was in the top ten managers in the world in the late 70’s and early 80’s. In 1984 he moved to NYC to become a professional trader for a number of NYSE Specialist firms. In the past, Michael has been licensed as a stockbroker, commodity broker, hedge fund manager, and investment advisor.

  17. Breakfast with the Master 03-24-2014
  18. Andrew's Pitchforks Market Geometry Trading Strategies Timothy Morge shows you how he identifies market structure, looks for changes in the market's behavior and then uses his own methodology to find high probability trade set ups in the markets.

  19. Scott Hathaway - VCC Basics
  20. Scott Hathaway - VCC Basics

  21. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines
  22. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines

  23. HOW TO SET UP A GANN CHART (GANN SQUARE & GANN BOX)
  24. HOW TO SET UP A GANN CHART (GANN SQUARE RANGE) Brought to you by Forex Lens - Your Eye into the Markets!

  25. Trading with Gann Fans and Other Technical Indicators
  26. Trading with Gann Fans and Other Technical Indicators

  27. W.D Gann Mastercourse | Forecasting Price (Major Turns in the Market) | E04
  28. W.D Gann Mastercourse | Forecasting Price (Major Turns in the Market) | E04

  29. Mastering Fibonacci retracement levels – 2 part series Barry Norman
  30. Mastering Fibonacci retracement levels – 2 part series Barry Norman

  31. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines
  32. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines

  33. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines
  34. Gann's Secret Angle || Squaring The Trend in Order to Get Support and Resistance lines

  35. How To Predict Future Highs And Lows As WD Gann Did For 1929 || Basic Approach
  36. How To Predict Future Highs And Lows As WD Gann Did For 1929 || Basic Approach

  37. Gann's Reversal Points in Time || Easy Way to Find When the Market Will Turn
  38. Gann's Reversal Points in Time || Easy Way to Find When the Market Will Turn