public void WhithTarget() { MappedProperty mp = Factory.getVanillaTestObject(); IMappableProperty newTarget = Factory.getMappedPropertyObject(); mp.Target = newTarget; Assert.IsTrue(mp.IsMapped); }
public void Vanilla() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); /* method to test*/ IMappableProperty source = mp.Source; /* evaluation */ Assert.IsNull(source); }
public void Vanilla() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); /* method to test*/ IMappableProperty target = mp.Target; /* evaluation */ Assert.IsNull(target); }
public void SetSourceByMappedProperty() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); mp.Source = Factory.getMappedPropertyObject(); /* method to test*/ IMappableProperty source = mp.Source; /* evaluation */ Assert.IsNotNull(source); Assert.IsTrue(source is MappedProperty); }
public void ChangeTargetFromMappedPropertyToNull() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); mp.Target = Factory.getMappedPropertyObject(); mp.Target = null; /* method to test*/ IMappableProperty target = mp.Target; /* evaluation */ Assert.IsNull(target); }
public void SetTargetToProperty() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); mp.Target = Factory.getPropertyObject(); /* method to test*/ IMappableProperty target = mp.Target; /* evaluation */ Assert.IsNotNull(target); Assert.IsTrue(target is Property); }
public void ChangeSourceFromMappedPropertyToNull() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); mp.Source = Factory.getMappedPropertyObject(); mp.Source = null; /* method to test*/ IMappableProperty source = mp.Source; /* evaluation */ Assert.IsNull(source); }
public void ChangeSourceFromMappedPropertyToProcedureProperty() { /* setup */ MappedProperty mp = Factory.getVanillaTestObject(); mp.Source = Factory.getMappedPropertyObject(); mp.Source = Factory.getProcedurePropertyObject(); /* method to test*/ IMappableProperty source = mp.Source; /* evaluation */ Assert.IsNotNull(source); Assert.IsTrue(source is ProcedureProperty); }
private IMappableProperty FindTarget(IMappableProperty source) { foreach (IMappableProperty targetProperty in TargetProperties) { if (targetProperty is UXSessionProperty) { continue; } if ((targetProperty.Name == source.Name) && (targetProperty.Type == source.Type)) { return(targetProperty); } } return(null); }
public void AutoMapProperties() { foreach (ListViewItem item in propertyListView.Items) { MappedProperty property = item.Tag as MappedProperty; if (property != null) { IMappableProperty target = FindTarget(property.Source); bool hasTarget = target != null; if (property.IsEnabled && !property.IsMapped && hasTarget) { property.Target = target; UpdateListItem(item); } } } RefreshView(); }
void TargetPropertyClickEventHandler(object sender, EventArgs e) { if (propertyListView.SelectedItems.Count == 1) { MappedProperty property = propertyListView.SelectedItems[0].Tag as MappedProperty; IMappableProperty target = (sender as ToolStripMenuItem).Tag as IMappableProperty; if (target != null) { property.Target = target; property.IsEnabled = true; } else { property.Target = null; } UpdateListItem(propertyListView.SelectedItems[0]); } }
private void MapProperty(MappedProperty mappedProperty, IMappableProperty sourceProperty) { bool newMappedProperty = false; if (mappedProperty == null) { mappedProperty = new MappedProperty(); mappedProperty.Source = sourceProperty; mappedProperty.Sequence = PropertyMap.MappedProperties.Count + 1; mappedProperty.PropertyMap = PropertyMap; PropertyMap.MappedProperties.Add(mappedProperty); newMappedProperty = true; } if (newMappedProperty) { mappedProperty.IsEnabled = EnablePropertiesByDefault; } ListViewItem item = CreateListItem(mappedProperty); UpdateListItem(item); }