コード例 #1
0
        public IBusinessObjectPropertyPath GetPropertyPath()
        {
            if (_propertyPath != null)
            {
                return(_propertyPath);
            }

            if (string.IsNullOrEmpty(_propertyPathIdentifier))
            {
                _propertyPath = new NullBusinessObjectPropertyPath();
            }
            else if (_isDynamic)
            {
                _propertyPath = BusinessObjectPropertyPath.CreateDynamic(_propertyPathIdentifier);
            }
            else
            {
                if (BusinessObjectClass == null)
                {
                    if (!Remotion.Web.Utilities.ControlHelper.IsDesignMode(OwnerControl))
                    {
                        throw new InvalidOperationException("The property path could not be resolved because the Business Object Class is not set.");
                    }

                    return(new NullBusinessObjectPropertyPath());
                }
                else
                {
                    _propertyPath = BusinessObjectPropertyPath.CreateStatic(BusinessObjectClass, _propertyPathIdentifier);
                }
            }

            return(_propertyPath);
        }
コード例 #2
0
        public override void SetUp()
        {
            base.SetUp();

            _editModeHost                           = new FakeEditModeHost();
            _editModeHost.ID                        = "BocList";
            _editModeHost.RowIDProvider             = new FakeRowIDProvider();
            _editModeHost.EditModeControlFactory    = EditableRowControlFactory.CreateEditableRowControlFactory();
            _editModeHost.EditModeDataSourceFactory = new EditableRowDataSourceFactory();

            _editableRow    = new EditableRow(_editModeHost);
            _editableRow.ID = "Row";
            NamingContainer.Controls.Add(_editableRow);

            _value01 = (IBusinessObject)TypeWithAllDataTypes.Create("A", 1);

            _typeWithAllDataTypesClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(TypeWithAllDataTypes));

            _typeWithAllDataTypesStringValuePath = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "String");
            _typeWithAllDataTypesInt32ValuePath  = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "Int32");

            _typeWithAllDataTypesStringValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesStringValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath);

            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.SetPropertyPath(BusinessObjectPropertyPath.CreateDynamic("StringValue"));
            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.IsDynamic = true;

            _typeWithAllDataTypesInt32ValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesInt32ValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesInt32ValuePath);

            _typeWithAllDataTypesStringValueFirstValueCompoundColumn = new BocCompoundColumnDefinition();
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add(
                new PropertyPathBinding(_typeWithAllDataTypesStringValuePath));
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add(
                new PropertyPathBinding(_typeWithAllDataTypesStringValuePath));
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.FormatString = "{0}, {1}";

            _typeWithAllDataTypesStringValueCustomColumn = new BocCustomColumnDefinition();
            _typeWithAllDataTypesStringValueCustomColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath);
            _typeWithAllDataTypesStringValueCustomColumn.IsSortable = true;

            _commandColumn      = new BocCommandColumnDefinition();
            _rowEditModeColumn  = new BocRowEditModeColumnDefinition();
            _dropDownMenuColumn = new BocDropDownMenuColumnDefinition();
        }