예제 #1
0
        public IconProxy GetIcon(string businessObjectClass, string businessObject, string arguments)
        {
            if (businessObjectClass == null)
            {
                return(null);
            }

            Type type = TypeUtility.GetType(businessObjectClass, true);
            var  businessObjectProvider = BindableObjectProvider.GetProviderForBindableObjectType(type);
            var  bindableObjectClass    = businessObjectProvider.GetBindableObjectClass(type);
            IBusinessObjectWithIdentity businessObjectWithIdentity = null;

            if (!string.IsNullOrEmpty(businessObject))
            {
                var businessObjectClassWithIdentity = (IBusinessObjectClassWithIdentity)bindableObjectClass;
                businessObjectWithIdentity = businessObjectClassWithIdentity.GetObject(businessObject);
            }

            var iconInfo = BusinessObjectBoundWebControl.GetIcon(businessObjectWithIdentity, bindableObjectClass.BusinessObjectProvider);

            if (iconInfo != null)
            {
                return(IconProxy.Create(new HttpContextWrapper(Context), iconInfo));
            }

            return(null);
        }
        protected void RenderCellIcon(BocColumnRenderingContext <TBocColumnDefinition> renderingContext, IBusinessObject businessObject)
        {
            ArgumentUtility.CheckNotNull("renderingContext", renderingContext);
            ArgumentUtility.CheckNotNull("businessObject", businessObject);

            IconInfo icon = BusinessObjectBoundWebControl.GetIcon(businessObject, businessObject.BusinessObjectClass.BusinessObjectProvider);

            if (icon != null)
            {
                icon.Render(renderingContext.Writer, renderingContext.Control);
                renderingContext.Writer.Write(c_whiteSpace);
            }
        }
예제 #3
0
 private IconInfo GetIcon(IBusinessObject businessObject)
 {
     return(BusinessObjectBoundWebControl.GetIcon(businessObject, businessObject.BusinessObjectClass.BusinessObjectProvider));
 }