Csharp/C Sharp/Data Types/Partial Type

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Partial type

 
using System;
using System.Collections.Generic;
using System.Text;
namespace PartialTypes
{
    // MyClass_Private.cs
    namespace PartialTypes
    {
        public partial class MyClass
        {
            // Private field data.
            private string someStringData;
            // All private helper members.
            public static void SomeStaticHelper() { }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
namespace PartialTypes
{
    // MyClass_Public.cs
    namespace PartialTypes
    {
        public partial class MyClass
        {
            // Constructors.
            public MyClass() { }
            // All public members.
            public void MemberA() { }
            public void MemberB() { }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
namespace PartialTypes
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
        }
    }
}