Ejemplo n.º 1
0
        public override void UpdateDatabaseAfterUpdateSchema()
        {
            base.UpdateDatabaseAfterUpdateSchema();
            AddressBookRecord record1 = ObjectSpace.FindObject <AddressBookRecord>(
                CriteriaOperator.Parse("Name == 'Mary Tellitson'"));

            if (record1 == null)
            {
                record1             = ObjectSpace.CreateObject <AddressBookRecord>();
                record1.Name        = "Mary Tellitson";
                record1.Email       = "*****@*****.**";
                record1.PhoneNumber = "+1-555-1112233";
                record1.Save();
            }
            AddressBookRecord record2 = ObjectSpace.FindObject <AddressBookRecord>(
                CriteriaOperator.Parse("Name == 'John Nilsen'"));

            if (record2 == null)
            {
                record2             = ObjectSpace.CreateObject <AddressBookRecord>();
                record2.Name        = "John Nilsen";
                record2.Email       = "*****@*****.**";
                record2.PhoneNumber = "+1-555-4445566";
                record2.Save();
            }
        }
        void writeMailAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            AddressBookRecord record    = (AddressBookRecord)e.CurrentObject;
            string            startInfo =
                String.Format("mailto:{0}?body=Hello, {1}!%0A%0A", record.Email, record.Name);

            Process.Start(startInfo);
        }