public void Clone(Physics2D.Contact contact) { this._type = contact._type; this._toiCount = contact._toiCount; this._toi = contact._toi; this.Friction = contact.Friction; this.Restitution = contact.Restitution; this.TangentSpeed = contact.TangentSpeed; this.Enabled = contact.Enabled; this.ChildIndexA = contact.ChildIndexA; this.ChildIndexB = contact.ChildIndexB; this.IsTouching = contact.IsTouching; this.IslandFlag = contact.IslandFlag; this.TOIFlag = contact.TOIFlag; this.FilterFlag = contact.FilterFlag; this.FixtureA = contact.FixtureA; this.FixtureB = contact.FixtureB; this._nodeA.Clone(contact._nodeA); this._nodeB.Clone(contact._nodeB); this.Manifold.LocalNormal = contact.Manifold.LocalNormal; this.Manifold.LocalPoint = contact.Manifold.LocalPoint; this.Manifold.PointCount = contact.Manifold.PointCount; for (int i = 0; i < contact.Manifold.PointCount; ++i) { this.Manifold.Points[i] = contact.Manifold.Points[i]; } this.Manifold.Type = contact.Manifold.Type; }
public async Task <Contact[]> GetContactsAsync(int companyId, Contact.ContactType type) { return(await _dbContext.Contacts .Where(c => c.Type.Equals(type)) .Include(c => c.WorkingContracts) .Where(c => c.WorkingContracts.Any(wc => wc.CompanyId == companyId)) .ToArrayAsync()); }
private void EditContact(OutputType outputType) { //Add new contact for edit string login = Common.GenerateRandomString(15) + "@mailforspam.com"; var addedContactInfo = contact.AddContact( "AddRandomContactName", "AddRandomContactSurname", login, Contact.ContactType.Email, output: outputType); //get new contact from service var contactAdded = contact.GetContacts().FirstOrDefault(c => c.contactId == addedContactInfo.Value); //prepare params to edit contact Contact.ContactType newContactType = Contact.ContactType.ICQ; string newFirstname = "testFirstName"; string newLastname = "testlastName"; string newAccount = Common.GenerateRandomString(15) + "@mailforspam.com"; string newCountry = "United States"; int timeZone = 240; //edit contact var key = contact.EditContact(contactAdded.contactId, contactType: newContactType, firstName: newFirstname, lastName: newLastname, account: newAccount, country: newCountry, timezone: timeZone, output: outputType); //check on success edit var contactFirstChanged = contact.GetContacts() .FirstOrDefault(c => c.contactId == addedContactInfo.Value); if (contactFirstChanged.contactType == newContactType && contactFirstChanged.name == newFirstname + " " + newLastname && contactFirstChanged.contactAccount == newAccount && contactFirstChanged.country == newCountry && contactFirstChanged.timezone == timeZone) { contact.DeleteContact(contactAdded.contactId); Assert.Pass("Contact with login " + contactAdded.contactAccount + " contact succesfully created, edited and deleted"); } else { contact.DeleteContact(contactAdded.contactId); Assert.Fail("Contact with login " + contactAdded.contactAccount + " contact NOT succesfully edited, but was deleted"); } }
static Contact() { // Note: this type is marked as 'beforefieldinit'. Contact.ContactType[,] expr_11 = new Contact.ContactType[4, 4]; expr_11[0, 0] = Contact.ContactType.Circle; expr_11[0, 1] = Contact.ContactType.EdgeAndCircle; expr_11[0, 2] = Contact.ContactType.PolygonAndCircle; expr_11[0, 3] = Contact.ContactType.ChainAndCircle; expr_11[1, 0] = Contact.ContactType.EdgeAndCircle; expr_11[1, 2] = Contact.ContactType.EdgeAndPolygon; expr_11[2, 0] = Contact.ContactType.PolygonAndCircle; expr_11[2, 1] = Contact.ContactType.EdgeAndPolygon; expr_11[2, 2] = Contact.ContactType.Polygon; expr_11[2, 3] = Contact.ContactType.ChainAndPolygon; expr_11[3, 0] = Contact.ContactType.ChainAndCircle; expr_11[3, 2] = Contact.ContactType.ChainAndPolygon; Contact._registers = expr_11; }
public async Task <Contact[]> GetContactsAsync(Contact.ContactType type) { return(await _dbContext.Contacts .Where(c => c.Type.Equals(type)) .ToArrayAsync()); }
public async Task <Contact> GetContactAsync(int id, Contact.ContactType type) { return(await _dbContext.Contacts .FirstOrDefaultAsync(c => (c.Id == id) && (c.Type.Equals(type)))); }