public async Task <IActionResult> Edit(int id, [Bind("OwnerId,FirstName,LastName,Email,Address,City,State,ZipCode,Comments")] PropertyOwner propertyOwner) { if (id != propertyOwner.OwnerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(propertyOwner); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropertyOwnerExists(propertyOwner.OwnerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(propertyOwner)); }
public CriteriaPropertyAttribute(string displayName, PropertyType propertyType, PropertyOwner propertyOwner, params CriteriaType[] criteriaTypes) : base(displayName) { PropertyType = propertyType; PropertyOwner = propertyOwner; CriteriaTypes = criteriaTypes; }
public ActionResult DeleteConfirmed(long id) { PropertyOwner propertyowner = db.PropertyOwners.Find(id); db.PropertyOwners.Remove(propertyowner); db.SaveChanges(); return(RedirectToAction("Index")); }
internal void UserRegistration() { //Start the Add address test Base.test = Base.extent.StartTest("User Registration"); //Populating the Excel sheet Global.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "Registration"); GlobalDefinition.wait(500); //Navigate to the Url GlobalDefinition.driver.Navigate().GoToUrl(ExcelLib.ReadData(2, "Url")); GlobalDefinition.wait(500); Global.GlobalDefinition.driver.Manage().Window.Maximize(); //Click on Sign Up Link SignupLink.Click(); GlobalDefinition.wait(500); //Enter Firstname FirstName.SendKeys(ExcelLib.ReadData(2, "FirstName")); GlobalDefinition.wait(500); //Enter lastname LastName.SendKeys(ExcelLib.ReadData(2, "LastName")); GlobalDefinition.wait(500); //Enter the Username EmailAddress.SendKeys(ExcelLib.ReadData(2, "EmailAddress")); GlobalDefinition.wait(500); //Enter the password Password.SendKeys(ExcelLib.ReadData(2, "Password")); GlobalDefinition.wait(1000); //Click on Choose Account ChooseAccount.Click(); GlobalDefinition.wait(500); //Select Property Owner PropertyOwner.Click(); GlobalDefinition.wait(1000); //Check TermsnConditionCheckbox TermsnConditionsCheckbox.Click(); GlobalDefinition.wait(1000); // Click on SignUp Button SignupButton.Click(); //Screenshot Global.SaveScreenShotClass.SaveScreenshot(GlobalDefinition.driver, "RegistrationPage"); //Reports Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Registration successfull"); }
public void PO_AddNewTenant() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Add a Tenant"); PropertyOwner obj = new PropertyOwner(); obj.AddTenant(); }
public void PO_SendRequest() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Add a rental property"); PropertyOwner obj = new PropertyOwner(); obj.SendRequest(); }
public void PO_Inspections() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Add a New Inspection Request"); PropertyOwner obj = new PropertyOwner(); obj.Inspections(); }
public void PO_AddNewProperty() { // Creates a toggle for the given test, adds all log events under it test = extent.StartTest("Search for a Property"); // Create an class and object to call the method PropertyOwner obj = new PropertyOwner(); obj.SearchAProperty(); }
// // GET: /PropertyOwner/Edit/5 public ActionResult Edit(long id = 0) { PropertyOwner propertyowner = db.PropertyOwners.Find(id); if (propertyowner == null) { return(HttpNotFound()); } return(View(propertyowner)); }
public void ThenPropertiesShouldIsSavedWithSuccessfullyAndDisplayedUnderProperties() { // Create an class and object to call the method PropertyOwner obj = new PropertyOwner(); obj.SearchAProperty(); //Close the broswer Global.Driver.driver.Close(); }
public async Task <IActionResult> Create([Bind("OwnerId,FirstName,LastName,Email,Address,City,State,ZipCode,Comments")] PropertyOwner propertyOwner) { if (ModelState.IsValid) { _context.Add(propertyOwner); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(propertyOwner)); }
public void AddProperties(PropertyOwner owner) { BGImage.Position = new Point(1590, 100); BGImage.Initialize(); AddPanelProperties(); if (owner != PropertyOwner.SLIDER && owner != PropertyOwner.TOGGLE) { _textProperties = new TextProperty(this); _textProperties.AddProperties(owner); foreach (var item in _textProperties.Properties) { _properties.Add(item.Key, item.Value); } } if (owner != PropertyOwner.LABEL) { _surfaceProperties = new SurfaceProperty(this); _surfaceProperties.AddProperties(owner); foreach (var item in _surfaceProperties.Properties) { _properties.Add(item.Key, item.Value); } } if (owner == PropertyOwner.COMBOBOX) { _advancedProperties = new AdvancedProperty(this); _advancedProperties.AddProperties(owner); foreach (var item in _advancedProperties.Properties) { _properties.Add(item.Key, item.Value); } } _generalProperties = new GeneralProperty(this); _generalProperties.AddProperties(owner); foreach (var item in _generalProperties.Properties) { _properties.Add(item.Key, item.Value); } _search.FieldWidth = 320; _search.SampleText = "Search for an item here..."; _search.StickSampleText = true; _search.TextColor = Color.White; AddEvents(); }
public void ThenAddedPropertyShouldBeDisplayedUnderMyproperties() { // test = extent.StartTest("Search Property"); // Create an class and object to call the method PropertyOwner obj = new PropertyOwner(); obj.SearchAProperty(); //Close the broswer Global.Driver.driver.Close(); }
public ActionResult Create(PropertyOwner propertyowner) { propertyowner.WhenCreated = DateTime.Now; if (ModelState.IsValid) { db.PropertyOwners.Add(propertyowner); db.SaveChanges(); return(RedirectToAction("Edit", new { id = propertyowner.PropertyOwnerID })); } return(View(propertyowner)); }
public void AddProperties(PropertyOwner owner) { _color = new ComboMulti("PropertyPanelCBTX", "PropertyPanelCBBGTX", DrawPriority.LOWEST); _txPicker = new FilePicker(); _alpha = new InputInfoArea("PropertyPanelCombinedArrowsTX"); _txPickLb = new Label("Texture:"); _colorLb = new Label("Color:"); _alphaLb = new Label("Alpha:"); _color.Initialize(); _txPicker.Initialize(); _alpha.Initialize(); _txPickLb.Initialize(); _colorLb.Initialize(); _alphaLb.Initialize(); _color.AddAuxiliaryInfo(); _color.AddName("Sprite Color", Color.White, Singleton.Font.GetFont(FontManager.FontType.STANDARD)); _txPickLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _colorLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _alphaLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); int lbWidth = (int)_alphaLb.TextSize.X; Properties.Add(_alphaLb, new Point(168 - lbWidth, 514)); Properties.Add(_alpha, new Point(171, 514)); if (owner != PropertyOwner.LABEL) { lbWidth = (int)_colorLb.TextSize.X; Properties.Add(_colorLb, new Point(168 - lbWidth, 181)); Properties.Add(_color, new Point(171, 181)); if (owner != PropertyOwner.SLIDER) { lbWidth = (int)_txPickLb.TextSize.X; Properties.Add(_txPickLb, new Point(168 - lbWidth, 240)); Properties.Add(_txPicker, new Point(171, 240)); } } _alpha.TextColor = Color.White; AddEvents(); }
public void PO_AddANewProperty(string TestDataSheetName, int TestDataSetNumber) { // Create a toggle for the test to log events test = extent.StartTest("Add a New Property"); //Set the excel path and sheet name for the test data for the test case ExcelLib.PopulateInCollection(Base.ExcelPath, TestDataSheetName); // Create a Property Details page object to add a new property PropertyDetails PropertyDetailsObj = new PropertyDetails(); //Verify that the new listing is displayed in the "My Properties" page //Proceed to verification if the property was added successfully if (PropertyDetailsObj.AddNewProperty(TestDataSetNumber) == true) { PropertyOwner PropertyOwnerObj = new PropertyOwner(); PropertyOwnerObj.VerifyNewProperty(TestDataSetNumber); } }
public ActionResult Edit(PropertyOwner propertyowner) { propertyowner.WhenCreated = DateTime.Now; propertyowner.WhenUpdated = db.PropertyOwners.Where(x => x.PropertyOwnerID == propertyowner.PropertyOwnerID).First().WhenUpdated; if (ModelState.IsValid) { using (var _db = new PortugalVillasContext()) { _db.PropertyOwners.Attach(propertyowner); _db.Entry(propertyowner).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Edit", new { id = propertyowner.PropertyOwnerID })); } } return(View(propertyowner)); }
public void AddProperties(PropertyOwner owner) { _comboAddConfirm = new TextBoxConfirmAction(); _addButton = new Button("PropertyPanelComboAddBTNTX", OverlayOption.NORMAL, DrawPriority.NORMAL); _remButton = new Button("PropertyPanelComboDelBTNTX", OverlayOption.NORMAL, DrawPriority.NORMAL); Properties.Add(_comboAddConfirm, new Point(55, 555)); _comboAddConfirm.Initialize(); _addButton.Initialize(); _addButton.Initialize(); _comboAddConfirm.AddButton(_addButton, 4); _comboAddConfirm.AddButton(_remButton, 4); _comboAddConfirm.Show(); AddEvents(); }
public void ServiceManager_Test01() { PropertyOwner propertyOwner = new PropertyOwner(); Service1 s1 = new Service1(); bool added = false; bool removed = false; ServiceManager.AdviseServiceAdded <IService1>(propertyOwner, null, s => { added = true; }); // Verify notifications not sent out when advising added.Should().BeFalse(); // Verify notifications not sent out after adding other service ServiceManager.AddService <Service1>(s1, propertyOwner, null); added.Should().BeFalse(); // Verify added notification sent out after adding this service ServiceManager.AddService <IService1>(s1, propertyOwner, null); added.Should().BeTrue(); added = false; ServiceManager.AdviseServiceRemoved <IService1>(propertyOwner, null, s => { removed = true; }); // Verify notifications not sent out after removing other service ServiceManager.RemoveService <Service1>(propertyOwner); removed.Should().BeFalse(); // Verify removed notification sent out after adding this service ServiceManager.RemoveService <IService1>(propertyOwner); removed.Should().BeTrue(); // Verify we aren't still listening to advised events ServiceManager.AddService <IService1>(s1, propertyOwner, null); added.Should().BeFalse(); // Verify notification sent out when advising to existing service ServiceManager.AdviseServiceAdded <IService1>(propertyOwner, null, s => { added = true; }); added.Should().BeTrue(); }
public void ServiceManager_Test01() { PropertyOwner propertyOwner = new PropertyOwner(); Service1 s1 = new Service1(); bool added = false; bool removed = false; ServiceManager.AdviseServiceAdded<IService1>(propertyOwner, null, s => { added = true; }); // Verify notifications not sent out when advising added.Should().BeFalse(); // Verify notifications not sent out after adding other service ServiceManager.AddService<Service1>(s1, propertyOwner, null); added.Should().BeFalse(); // Verify added notification sent out after adding this service ServiceManager.AddService<IService1>(s1, propertyOwner, null); added.Should().BeTrue(); added = false; ServiceManager.AdviseServiceRemoved<IService1>(propertyOwner, null, s => { removed = true; }); // Verify notifications not sent out after removing other service ServiceManager.RemoveService<Service1>(propertyOwner); removed.Should().BeFalse(); // Verify removed notification sent out after adding this service ServiceManager.RemoveService<IService1>(propertyOwner); removed.Should().BeTrue(); // Verify we aren't still listening to advised events ServiceManager.AddService<IService1>(s1, propertyOwner, null); added.Should().BeFalse(); // Verify notification sent out when advising to existing service ServiceManager.AdviseServiceAdded<IService1>(propertyOwner, null, s => { added = true; }); added.Should().BeTrue(); }
public async Task <CreatePropertyCommandResult> Handle(CreatePropertyCommand request, CancellationToken cancellationToken) { #region Create property aggregate root var createdProperty = new CreatePropertyCommandResult(); var address = new PropertyAddress(request.PropertySuiteNumber, request.PropertyNumber, request.PropertyStreet, request.PropertyCity, request.PropertyStateProvince, request.PropertyZipPostCode, request.PropertyCountry); var feature = new PropertyFeature(request.NumberOfBathrooms, request.NumberOfBathrooms, request.NumberOfLayers, request.NumberOfParking, request.BasementAvailable, request.TotalLivingArea, request.IsShared, request.FeatureNotes); var facility = new PropertyFacility(request.Stove, request.Refrigerator, request.Dishwasher, request.AirConditioner, request.Laundry, request.BlindsCurtain, request.Furniture, request.Tvinternet, request.CommonFacility, request.SecuritySystem, request.UtilityIncluded, request.FireAlarmSystem, request.FacilityNotes, request.Others); var property = new Property(request.PropertyName, request.PropertyDesc, request.Type, request.PropertyManagerUserName, request.PropertyBuildYear, true, request.IsShared, request.Status, request.BasementAvailable, DateTime.Now, DateTime.Now, address, facility, feature); await _context.AddAsync(property); #endregion PropertyOwner owner = null; if (request.PropertyOwnerId == 0) { object ownerAddress = null; if (!request.IsSameAddress) { ownerAddress = new OwnerAddress(request.OwnerStreetNumber, request.OwnerCity, request.OwnerStateProv, request.OwnerCountry, request.OwnerZipPostCode); } else { ownerAddress = new OwnerAddress(request.PropertySuiteNumber + " " + request.PropertyNumber + " " + request.PropertyStreet, request.PropertyCity, request.PropertyStateProvince, request.PropertyCountry, request.PropertyZipPostCode); } owner = property.AddOwner("NotSet", request.FirstName, request.LastName, request.ContactEmail, request.ContactTelephone1, request.ContactTelephone2, request.OnlineAccessEnbaled, request.UserAvartaImgUrl, request.IsActive, request.RoleId, request.Notes, (OwnerAddress)ownerAddress); await _context.AddAsync(owner); } else { owner = _context.PropertyOwner.FirstOrDefault(o => o.Id == request.PropertyOwnerId); var ownerProperty = property.AddExsitingOwner(owner); owner.OwnerProperty.Add(ownerProperty); } try { await _context.SaveChangesAsync(); // comment out for testing message sending ONLY int PropertyId = property.Id; int NewOwnerId = owner.Id; request.PropertyId = property.Id; request.CreatedDate = property.Created; request.UpdateDate = property.Modified; //Populate return resultEnum.GetName(typeof()) // createdProperty.Id = PropertyId; createdProperty.PropertyName = request.PropertyName; createdProperty.Type = request.Type.ToString(); createdProperty.Status = request.Status.ToString(); createdProperty.PropertyLogoImgUrl = request.PropertyLogoImgUrl; createdProperty.IsShared = request.IsShared; createdProperty.IsActive = request.IsActive; createdProperty.IsBasementSuite = request.IsBasementSuite; createdProperty.CreatedDate = DateTime.Now.ToString("MMMM dd, yyyy"); createdProperty.UpdateDate = DateTime.Now.ToString("MMMM dd, yyyy"); createdProperty.PropertySuiteNumber = request.PropertySuiteNumber; createdProperty.PropertyStreet = request.PropertyStreet; createdProperty.PropertyCity = request.PropertyCity; createdProperty.PropertyStateProvince = request.PropertyStateProvince; createdProperty.PropertyZipPostCode = request.PropertyZipPostCode; createdProperty.PropertyCountry = request.PropertyCountry; Log.Information("Property with id {PropertyName} has been successfully created.", property.PropertyName); // Publish Domain Event (MediatR pattern) AssetCore.Events.PropertyCreatedEvent domainEvent = new AssetCore.Events.PropertyCreatedEvent(property); await _mediator.Publish(domainEvent); // Publish Integration Event (RabbitMQ) var streetNum = request.PropertySuiteNumber + " " + request.PropertyNumber + " " + request.PropertyStreet; //var streetNum = address.PropertySuiteNumber + " " + address.PropertyNumber + " " + address.PropertyStreet; // Send message to MQ // PropertyCreatedEvent e = new PropertyCreatedEvent(Guid.NewGuid(), request.PropertyId, request.PropertyName, request.PropertyManagerUserName, request.PropertyBuildYear, request.Type.ToString(), request.BasementAvailable, request.IsShared, request.NumberOfBedrooms, request.NumberOfBathrooms, request.NumberOfLayers, request.NumberOfParking, request.TotalLivingArea, streetNum, request.PropertyCity, request.PropertyStateProvince, request.PropertyCountry, request.PropertyZipPostCode, NewOwnerId, request.FirstName, request.LastName, request.ContactEmail, request.ContactTelephone1, request.ContactTelephone2, request.OwnerStreetNumber, request.OwnerCity, request.OwnerStateProv, request.OwnerZipPostCode, request.OwnerCountry); try { await _messagePublisher.PublishMessageAsync(e.MessageType, e, "asset_created"); // publishing the message Log.Information("Message {MessageType} with Id {MessageId} has been published successfully", e.MessageType, e.MessageId); } catch (Exception ex) { Log.Error(ex, "Error while publishing {MessageType} message with id {MessageId}.", e.MessageType, e.MessageId); } // Log message for reconciliation purpose ******** This part can be replaced by Serilog *************** // var msgDetails = new MessageDetails(); msgDetails.PrincicipalId = e.PropertyId; msgDetails.PrincipalType = "Property"; msgDetails.PrincipalNameDesc = e.PropertyName; msgDetails.OperationType = "Create"; var details = msgDetails.ToBsonDocument(); var msg = new Message(e.MessageId, "Asset Management", details, "asset_created", "asset_created.*", "Publish", DateTime.Now); await _loggingService.LogMessage(msg); } catch (Exception ex) { //throw ex; Log.Error(ex, "Error while creating property, {PropertyName} has not been created.", request.PropertyName); } return(createdProperty); //return new CreatePropertyCommandResult() { }; }
public async Task <AddOwnerToExistingPropertyCommandResult> Handle(AddOwnerToExistingPropertyCommand request, CancellationToken cancellationToken) { var property = _context.Property.FirstOrDefault(p => p.Id == request.PropertyId); PropertyOwner owner = null; var addedOwner = new AddOwnerToExistingPropertyCommandResult(); // Check if the email already exist if adding new owner instead of existing owner // //var user = _context.PropertyOwner.FirstOrDefault(e => e.ContactEmail == request.ContactEmail); //if (user != null) //{ // return new AddOwnerToExistingPropertyCommandResult() { Notes = "The email already exists!"}; //} // populate the addedOnwer addedOwner.UserAvartaImgUrl = request.UserAvartaImgUrl; addedOwner.FirstName = request.FirstName; addedOwner.LastName = request.LastName; addedOwner.UserName = request.UserName; addedOwner.ContactEmail = request.ContactEmail; addedOwner.ContactTelephone1 = request.ContactTelephone1; addedOwner.ContactTelephone2 = request.ContactTelephone2; addedOwner.OnlineAccessEnbaled = request.OnlineAccessEnbaled; addedOwner.IsActive = request.IsActive; addedOwner.RoleId = request.RoleId; addedOwner.Notes = request.Notes; addedOwner.StreetNumber = request.StreetNumber; addedOwner.City = request.City; addedOwner.StateProv = request.StateProv; addedOwner.ZipPostCode = request.ZipPostCode; addedOwner.Country = request.Country; addedOwner.Created = DateTime.Now.ToString("MMMM dd, yyyy"); addedOwner.Updated = DateTime.Now.ToString("MMMM dd, yyyy"); if (request.PropertyOwnerId == 0) { // Check if the email already exist if adding new owner instead of existing owner // var user = _context.PropertyOwner.FirstOrDefault(e => e.ContactEmail == request.ContactEmail); if (user != null) { return(new AddOwnerToExistingPropertyCommandResult() { Notes = "The email already exists!" }); } var ownerAddress = new OwnerAddress(request.StreetNumber, request.City, request.StateProv, request.Country, request.ZipPostCode); owner = property.AddNewOwnerToProperty(request.PropertyId, request.UserName, request.FirstName, request.LastName, request.ContactEmail, request.ContactTelephone1, request.ContactTelephone2, false, request.UserAvartaImgUrl, request.IsActive, 2, request.Notes, ownerAddress); _context.Add(owner); } else { owner = _context.PropertyOwner.Include(a => a.Address).FirstOrDefault(o => o.Id == request.PropertyOwnerId); var ownerProperty = property.AddExistingOwnerToProperty(owner, request.PropertyId); _context.Add(ownerProperty); } try { await _context.SaveChangesAsync(); addedOwner.Id = owner.Id; // logging Log.Information("The new owner {OwnerName} has been added to the property {PorpertyName} successfully", request.FirstName + " " + request.LastName, property.PropertyName); // Send messages if necessary // Publish message to MQ for other service to consume AddOwnerEvent e = new AddOwnerEvent(new Guid(), owner.Id, request.PropertyId, owner.UserName, owner.FirstName, owner.LastName, owner.ContactEmail, owner.ContactTelephone1, owner.ContactTelephone2, owner.OnlineAccess, owner.UserAvartaImgUrl, owner.IsActive, owner.RoleId, owner.Notes, owner.Address.StreetNumber, owner.Address.City, owner.Address.StateProvince, owner.Address.ZipPostCode, owner.Address.Country); try { await _messagePublisher.PublishMessageAsync(e.MessageType, e, "asset_created"); // publishing the message Log.Information("Message {MessageType} with Id {MessageId} has been published successfully", e.MessageType, e.MessageId); } catch (Exception ex) { Log.Error(ex, "Error while publishing {MessageType} message with id {MessageId}.", e.MessageType, e.MessageId); } } catch (Exception ex) { //throw ex; Log.Error(ex, "Error occured while adding the new owner {OwnerName} to the property {PropertyName}.", request.FirstName + " " + request.LastName, property.PropertyName); } return(addedOwner); }
public void AddProperties(PropertyOwner owner) { _text = new TextBox("PropertyPanelTextboxTX", "PropertyPanelTextboxPointerTX", TextBoxType.TEXT, DrawPriority.NORMAL); _textColor = new ComboMulti("PropertyPanelCBTX", "PropertyPanelCBBGTX", DrawPriority.LOWEST); _name = new Label(""); _textColor.AddName("Text Color", Color.White, Singleton.Font.GetFont(FontManager.FontType.STANDARD)); _textColor.AddAuxiliaryInfo(); _nameLb = new Label("Name:"); _textLb = new Label("Text:"); _txtColorLb = new Label("Text Color:"); _text.Initialize(); _textColor.Initialize(); _name.Initialize(); _textLb.Initialize(); _nameLb.Initialize(); _txtColorLb.Initialize(); _textLb.Setup(); _nameLb.Setup(); _txtColorLb.Setup(); _textLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _txtColorLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _name.TextFont = Singleton.Font.GetFont(FontManager.FontType.ARIAL_BOLD); _name.TextColor = Color.Black; int lbWidth = (int)_nameLb.TextSize.X; Properties.Add(_nameLb, new Point(160 - lbWidth, 369)); Properties.Add(_name, new Point(171, 368)); if (owner != PropertyOwner.MULTITEXTBOX && owner != PropertyOwner.SLIDER && owner != PropertyOwner.TOGGLE) { _text.FieldWidth = 150; _text.TextColor = Color.White; lbWidth = (int)_textLb.TextSize.X; Properties.Add(_textLb, new Point(168 - lbWidth, 271)); Properties.Add(_text, new Point(171, 271)); lbWidth = (int)_txtColorLb.TextSize.X; Properties.Add(_txtColorLb, new Point(168 - lbWidth, 395)); Properties.Add(_textColor, new Point(171, 395)); } if (owner == PropertyOwner.MULTITEXTBOX) { lbWidth = (int)_txtColorLb.TextSize.X; Properties.Add(_txtColorLb, new Point(168 - lbWidth, 395)); Properties.Add(_textColor, new Point(171, 395)); } _nameLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); AddEvents(); }
public void ServiceManager_Test02() { PropertyOwner propertyOwner = new PropertyOwner(); int servicesAdded = 0; int servicesRemoved = 0; Service1 s1 = new Service1(); Service2 s2 = new Service2(); ServiceManager.AddService <IService1>(s1, propertyOwner, null); ServiceManager.GetService <IService1>(propertyOwner).Should().Be(s1); ServiceManager.GetService <Service1>(propertyOwner).Should().Be(s1); ServiceManager.RemoveService <IService1>(propertyOwner); ServiceManager.GetService <IService1>(propertyOwner).Should().BeNull(); ServiceManager sm = ServiceManager.FromPropertyOwner(propertyOwner, null); sm.Should().NotBeNull(); EventHandler <ServiceManagerEventArgs> onServiceAdded = (object sender, ServiceManagerEventArgs e) => { servicesAdded++; switch (servicesAdded) { case 1: e.Service.Should().Be(s1); e.ServiceType.Should().Be(typeof(IService1)); break; case 2: e.Service.Should().Be(s2); e.ServiceType.Should().Be(typeof(IService2)); break; } }; EventHandler <ServiceManagerEventArgs> onServiceRemoved = (object sender, ServiceManagerEventArgs e) => { servicesRemoved++; switch (servicesRemoved) { case 1: e.ServiceType.Should().Be(typeof(IService1)); break; case 2: e.ServiceType.Should().Be(typeof(IService2)); break; } }; sm.ServiceAdded += onServiceAdded; sm.ServiceRemoved += onServiceRemoved; ServiceManager.AddService <IService1>(s1, propertyOwner, null); ServiceManager.AddService <IService2>(s2, propertyOwner, null); ServiceManager.RemoveService <IService1>(propertyOwner); ServiceManager.RemoveService <IService2>(propertyOwner); ServiceManager.GetService <IService1>(propertyOwner).Should().BeNull(); ServiceManager.GetService <IService2>(propertyOwner).Should().BeNull(); }
public void ServiceManager_Test02() { PropertyOwner propertyOwner = new PropertyOwner(); int servicesAdded = 0; int servicesRemoved = 0; Service1 s1 = new Service1(); Service2 s2 = new Service2(); ServiceManager.AddService<IService1>(s1, propertyOwner, null); ServiceManager.GetService<IService1>(propertyOwner).Should().Be(s1); ServiceManager.GetService<Service1>(propertyOwner).Should().Be(s1); ServiceManager.RemoveService<IService1>(propertyOwner); ServiceManager.GetService<IService1>(propertyOwner).Should().BeNull(); ServiceManager sm = ServiceManager.FromPropertyOwner(propertyOwner, null); sm.Should().NotBeNull(); EventHandler<ServiceManagerEventArgs> onServiceAdded = (object sender, ServiceManagerEventArgs e) => { servicesAdded++; switch (servicesAdded) { case 1: e.Service.Should().Be(s1); e.ServiceType.Should().Be(typeof(IService1)); break; case 2: e.Service.Should().Be(s2); e.ServiceType.Should().Be(typeof(IService2)); break; } }; EventHandler<ServiceManagerEventArgs> onServiceRemoved = (object sender, ServiceManagerEventArgs e) => { servicesRemoved++; switch (servicesRemoved) { case 1: e.ServiceType.Should().Be(typeof(IService1)); break; case 2: e.ServiceType.Should().Be(typeof(IService2)); break; } }; sm.ServiceAdded += onServiceAdded; sm.ServiceRemoved += onServiceRemoved; ServiceManager.AddService<IService1>(s1, propertyOwner, null); ServiceManager.AddService<IService2>(s2, propertyOwner, null); ServiceManager.RemoveService<IService1>(propertyOwner); ServiceManager.RemoveService<IService2>(propertyOwner); ServiceManager.GetService<IService1>(propertyOwner).Should().BeNull(); ServiceManager.GetService<IService2>(propertyOwner).Should().BeNull(); }
public void AddProperties(PropertyOwner owner) { _posX = new InputInfoArea(); _posY = new InputInfoArea(); _scaleX = new InputInfoArea(); _scaleY = new InputInfoArea(); _expandX = new CheckBox("PropertyPanelCheckboxTX", OverlayOption.CHECKBOX, DrawPriority.HIGHEST); _expandY = new CheckBox("PropertyPanelCheckboxTX", OverlayOption.CHECKBOX, DrawPriority.HIGHEST); _scaleLb = new Label("Scale:"); _posLb = new Label("Position:"); _expandLb = new Label("Expand:"); _posXLb = new Label(":x"); _posYLb = new Label(":y"); _scaleXLb = new Label(":x"); _scaleYLb = new Label(":y"); _expandXLb = new Label(":x"); _expandYLb = new Label(":y"); _posXLb.Priority = DrawPriority.HIGH; _posYLb.Priority = DrawPriority.HIGH; _scaleXLb.Priority = DrawPriority.HIGH; _scaleYLb.Priority = DrawPriority.HIGH; _expandXLb.Priority = DrawPriority.HIGH; _expandYLb.Priority = DrawPriority.HIGH; _scaleLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _posLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _expandLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _posXLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _posYLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _scaleXLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _scaleYLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _expandXLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _expandYLb.TextFont = Singleton.Font.GetFont(FontManager.FontType.LUCIDA_CONSOLE); _scaleLb.Initialize(); _posLb.Initialize(); _expandLb.Initialize(); _posXLb.Initialize(); _posYLb.Initialize(); _scaleXLb.Initialize(); _scaleYLb.Initialize(); _expandXLb.Initialize(); _expandYLb.Initialize(); _posX.Initialize(); _posY.Initialize(); _scaleX.Initialize(); _scaleY.Initialize(); _expandX.Initialize(); _expandY.Initialize(); _scaleLb.Setup(); _posLb.Setup(); _expandLb.Setup(); _posXLb.Setup(); _posYLb.Setup(); _scaleXLb.Setup(); _scaleYLb.Setup(); _expandXLb.Setup(); _expandYLb.Setup(); int lbWidth = (int)_posLb.TextSize.X; Properties.Add(_posLb, new Point(168 - lbWidth, 214)); Properties.Add(_posXLb, new Point(224, 215)); Properties.Add(_posYLb, new Point(299, 215)); Properties.Add(_posX, new Point(171, 212)); Properties.Add(_posY, new Point(247, 212)); lbWidth = (int)_scaleLb.TextSize.X; Properties.Add(_scaleLb, new Point(168 - lbWidth, 457)); Properties.Add(_scaleXLb, new Point(224, 458)); Properties.Add(_scaleYLb, new Point(299, 458)); Properties.Add(_scaleX, new Point(171, 455)); Properties.Add(_scaleY, new Point(246, 455)); lbWidth = (int)_expandLb.TextSize.X; Properties.Add(_expandLb, new Point(168 - lbWidth, 310)); Properties.Add(_expandXLb, new Point(187, 310)); Properties.Add(_expandYLb, new Point(266, 310)); Properties.Add(_expandX, new Point(171, 310)); Properties.Add(_expandY, new Point(250, 310)); _posX.TextColor = Color.White; _posY.TextColor = Color.White; _scaleX.TextColor = Color.White; _scaleY.TextColor = Color.White; AddEvents(); }
/// <summary> /// Create a new PropertyOwner object. /// </summary> /// <param name="firstName">Initial value of FirstName.</param> /// <param name="lastName">Initial value of LastName.</param> /// <param name="middleName">Initial value of MiddleName.</param> public static PropertyOwner CreatePropertyOwner(string firstName, string lastName, string middleName) { PropertyOwner propertyOwner = new PropertyOwner(); propertyOwner.FirstName = firstName; propertyOwner.LastName = lastName; propertyOwner.MiddleName = middleName; return propertyOwner; }
public void GivenMoveToPropertiesPage() { PropertyOwner ownerobj = new PropertyOwner(); ownerobj.Common_methods(); }