示例#1
0
        private void Dispose(bool disposing)
        {
            if (disposed_)
            {
                return;
            }

            if (disposing)
            {
                // Free managed resources
                // ...
            }

            // Free native resources if there are any.
            PersonNatives.Delete(person_);

            disposed_ = true;
        }
示例#2
0
        static void Main(string[] args)
        {
            WriteLine($"Arch: {PersonNatives.GetArch()}");

            var person = new Person
            {
                Name = "Tom",
                Age  = 18,
            };

            var whatFormat = "Hello! This is {0}. I am {1} years old.";

            var what = string.Format(whatFormat, person.Name, person.Age);

            person.Say(what);

            person.Name = "Jerry";
            person.Age  = 12;

            what = string.Format(whatFormat, person.Name, person.Age);
            person.Say(what);

            ReadKey();
        }
示例#3
0
 public void Say(string what) => PersonNatives.Say(person_, what);