public override string ToString(bool isFirst)
        {
            if (!isFirst)
            {
                return("[any property]");
            }

            return(String.Format(
                       "{0}.[any property]",
                       TypeService.GetFriendlyName(typeof(TDescriptor))
                       ));
        }
示例#2
0
        /// <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);
        }
示例#3
0
        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));
        }
示例#6
0
        public override string ToString()
        {
            string descriptorTypeName = TypeService.GetFriendlyName(typeof(TDescriptor));

            return(String.Format("{0}.{1}", descriptorTypeName, PropertyName));
        }