public override string ToString(bool isFirst) { if (!isFirst) { return("[any property]"); } return(String.Format( "{0}.[any property]", TypeService.GetFriendlyName(typeof(TDescriptor)) )); }
/// <summary> /// Gets the next behavior in the stack and throws an 'ArgumentException' /// if no behavior that implements 'TBehavior' can be found. /// </summary> public TBehavior GetNextBehavior <TBehavior>() { TBehavior result; if (!TryGetBehavior <TBehavior>(out result)) { throw new ArgumentException( ExceptionTexts.BehaviorNotFound.FormatWith(TypeService.GetFriendlyName(typeof(TBehavior))) ); } return(result); }
public override string ToString() { switch (_type) { case PathStepType.ViewModel: return(TypeService.GetFriendlyName(_viewModel.GetType())); case PathStepType.Collection: return(TypeService.GetFriendlyName(_collection.GetType())); case PathStepType.Property: return(_property.PropertyName); default: throw new NotSupportedException(); } }
public void GetFriendlyName_ForGenericType_ReturnsNameInCharpSyntax() { var t = typeof(List <Nullable <TestStruct> >); Assert.AreEqual("List<Nullable<TestStruct>>", TypeService.GetFriendlyName(t)); }
public void GetFriendlyName_ForNonGenericType_ReturnsTypeName() { var t = typeof(Object); Assert.AreEqual("Object", TypeService.GetFriendlyName(t)); }
public override string ToString() { string descriptorTypeName = TypeService.GetFriendlyName(typeof(TDescriptor)); return(String.Format("{0}.{1}", descriptorTypeName, PropertyName)); }