コード例 #1
0
        public static bool DisplayTypeSelected(IDisplayType currentDisplayType, string name)
        {
            var displaytype     = DisplayType.DisplayType.GetReferenceByName(name);
            var displaytypeType = displaytype.GetType();

            return(currentDisplayType.GetType().Equals(displaytypeType));
        }
コード例 #2
0
ファイル: DisplayType.cs プロジェクト: dhq-boiler/Sunctum
        public static string GetPropertyName(IDisplayType displayType)
        {
            var name = displayType.GetType().Name;

            var fields = typeof(DisplayType).GetFields(BindingFlags.Static | BindingFlags.Public);

            return(fields.Single(x => ("DisplayType" + x.Name) == name).Name);
        }
コード例 #3
0
        public static string GeneratePropertyArray( Extension extension, IDisplayType displayType, SimpleContainer.Format format )
        {
            if( displayType is RecordGroupDisplayType ) {
            RecordGroupDisplayType recordGroupDisplayType = (RecordGroupDisplayType)displayType;
            if( null != displayType.ParentModel ) {
              string absoluteModelName = NameHelper.GetAbsoluteModelName( extension, displayType.ParentModel );
              recordGroupDisplayType.Set( string.Format( "wizards.suggest.{0}.searchWholePhrase", absoluteModelName ), 1 );
              recordGroupDisplayType.Set( string.Format( "wizards.suggest.{0}.maxItemsInResultList", absoluteModelName ), 10 );
              recordGroupDisplayType.Set( string.Format( "wizards.suggest.{0}.addWhere", absoluteModelName ), string.Format( "AND {0}.sys_language_uid=0", absoluteModelName ) );
            }
            recordGroupDisplayType.Set( "internal_type", "db" );
            recordGroupDisplayType.Set( "show_thumbs", recordGroupDisplayType.ShowThumbnails );
            recordGroupDisplayType.Set( "size", recordGroupDisplayType.Lines );
            recordGroupDisplayType.Set( "selectedListStyle", recordGroupDisplayType.SelectedListStyle );
            recordGroupDisplayType.Set( "multiple", recordGroupDisplayType.AllowDuplicates );
            recordGroupDisplayType.Set( "minitems", recordGroupDisplayType.MinItems );
            recordGroupDisplayType.Set( "maxitems", recordGroupDisplayType.MaxItems );
              }

              return displayType.GeneratePropertyArray( format );
        }