public static string PropertyTitle(this IMemberSpec memberSpec, INakedObjectAdapter nakedObjectAdapter, INakedObjectManager manager, ISession session, IObjectPersistor persistor)
        {
            if (nakedObjectAdapter == null)
            {
                return("");
            }

            string text  = null;
            var    regex = memberSpec.GetFacet <IRegExFacet>();

            if (regex != null)
            {
                text = regex.Format(nakedObjectAdapter.TitleString());
            }

            var mask = memberSpec.GetFacet <IMaskFacet>();

            if (mask != null)
            {
                var title = memberSpec.ReturnSpec.GetFacet <ITitleFacet>();
                text = title.GetTitleWithMask(mask.Value, nakedObjectAdapter, manager, session, persistor);
            }

            return(text ?? nakedObjectAdapter.TitleString());
        }
예제 #2
0
        public static string PropertyTitle(this IMemberSpec memberSpec, INakedObject nakedObject, INakedObjectManager manager)
        {
            if (nakedObject == null)
            {
                return("");
            }
            string text  = null;
            var    regex = memberSpec.GetFacet <IRegExFacet>();

            if (regex != null)
            {
                text = regex.Format(nakedObject.TitleString());
            }
            var mask = memberSpec.GetFacet <IMaskFacet>();

            if (mask != null)
            {
                var title = memberSpec.ReturnSpec.GetFacet <ITitleFacet>();
                text = title.GetTitleWithMask(mask.Value, nakedObject, manager);
            }
            return(text ?? (nakedObject.TitleString()));
        }