Partial Classes. RRS feed

  • Question

  • When we will use partial class and give me one example?
    Tuesday, April 30, 2013 5:46 AM


All replies

  • For example if you have auto-generated classes that will often generated and overwritten and you want to extend this classes with own code. Here you can use partial classes and your code will not lost on next auto-generation.


    Code Samples: Code Samples

    Tuesday, April 30, 2013 7:20 AM
  • The most apparent example gives the every day Windows Forms application, where the code defining and describing the design parts of your project are packed in one section of your partial class and the code behind, that defines the behaviour of your app in another. That allows the sharing of the work over multiple workgroups, i.e. one for the design parts and another for the functionality.

    for further details: http://msdn.microsoft.com/en-us/library/wa80x488%28v=vs.80%29.aspx

    Kind regards,


    Tuesday, April 30, 2013 7:27 AM
  • Thanq..
    Tuesday, April 30, 2013 9:01 AM
  • Thanq..
    Tuesday, April 30, 2013 9:01 AM
  • Tuesday, April 30, 2013 9:27 AM
  • The partial class is used to in single namespace. Partial class can't we declare in a different namespace. Partial class used to multi pal source file in a single namespace, but it will be compiled only single one class at runtime


    Suppose that we have a class "Seo programmer" The Seo- programmer <g class="gr_ gr_32 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" data-gr-id="32" id="32">""</g> class divided into source file  Seo _Programmer1"  and "Seo_Programmer2" but the compile the source code then create a single class.

    Saturday, May 26, 2018 3:33 PM