Exemplo n.º 1
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY_KEY;
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            else if (column == 1)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ARROWS_BOTH;
                data.ImageList = MappingDetailsImages.GetArrowsImageList();
            }
            else if (column == 2)
            {
                if (_mappingAssociationSetEnd.ScalarProperties.Count > row
                    &&
                    _mappingAssociationSetEnd.ScalarProperties[row].ScalarProperty != null
                    &&
                    _mappingAssociationSetEnd.ScalarProperties[row].ScalarProperty.ColumnName.Status == BindingStatus.Known
                    &&
                    _mappingAssociationSetEnd.ScalarProperties[row].ScalarProperty.ColumnName.Target.IsKeyProperty)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_COLUMN_KEY;
                }
                else
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_COLUMN;
                }
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }

            return(data);
        }
Exemplo n.º 2
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_RESULT_BINDING;
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            else if (column == 1)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ARROWS_RIGHT;
                data.ImageList = MappingDetailsImages.GetArrowsImageList();
            }
            else if (column == 2)
            {
                if (_mappingResultBindings.ResultBindings.Count > row &&
                    _mappingResultBindings.ResultBindings[row].ResultBinding != null &&
                    _mappingResultBindings.ResultBindings[row].ResultBinding.Name.Status == BindingStatus.Known &&
                    _mappingResultBindings.ResultBindings[row].ResultBinding.Name.Target.IsKeyProperty)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY_KEY;
                }
                else
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY;
                }
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }

            return(data);
        }
Exemplo n.º 3
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                if (_mappingColumnMappings.ScalarProperties.Count > row &&
                    _mappingColumnMappings.ScalarProperties[row].IsKeyColumn)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_COLUMN_KEY;
                }
                else
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_COLUMN;
                }
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            else if (column == 1)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ARROWS_BOTH;
                data.ImageList = MappingDetailsImages.GetArrowsImageList();
            }
            else if (column == 2)
            {
                // cache off the count
                var propertyCount = _mappingColumnMappings.ScalarProperties.Count;

                // cache off the property reference (if we have one)
                Property property = null;
                if (propertyCount > row &&
                    _mappingColumnMappings.ScalarProperties[row].ScalarProperty != null &&
                    _mappingColumnMappings.ScalarProperties[row].ScalarProperty.Name.Status == BindingStatus.Known)
                {
                    property = _mappingColumnMappings.ScalarProperties[row].ScalarProperty.Name.Target;
                }

                if (property != null &&
                    property.IsKeyProperty)
                {
                    // if we have a valid property and its a key, show the key icon
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY_KEY;
                }
                else if (property != null &&
                         property.IsComplexTypeProperty)
                {
                    // if we have a valid property and its a complex property, show that one
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_COMPLEX_PROPERTY;
                }
                else
                {
                    // in all other cases, show the default property icon
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY;
                }

                // regardless, we use the same image list
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }

            return(data);
        }
Exemplo n.º 4
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_TABLE;
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }

            return(data);
        }
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                var scalarProperty = row < ElementCount
                                         ? GetElement(row) as MappingFunctionImportScalarProperty
                                         : null;

                if (scalarProperty != null &&
                    scalarProperty.IsKeyProperty)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY_KEY;
                }
                else
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY;
                }
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            else if (column == 1)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ARROWS_LEFT;
                data.ImageList = MappingDetailsImages.GetArrowsImageList();
            }
            else if (column == 2)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_COLUMN;
                data.ImageList = MappingDetailsImages.GetIconsImageList();

                var scalarProperty = row < ElementCount
                                         ? GetElement(row) as MappingFunctionImportScalarProperty
                                         : null;

                if (scalarProperty != null &&
                    (scalarProperty.ModelItem == null || scalarProperty.IsComplexProperty))
                {
                    // gray out the text if it's default value or error message
                    data.GrayText = true;
                }
            }

            return(data);
        }
Exemplo n.º 6
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            if (column == 0)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_CONDITION;
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            if (column == 2)
            {
                // if the value of condition is empty string we want to show gray text "<Emtpy String>" instead
                var mc = GetElement(row) as MappingCondition;
                if (mc != null &&
                    mc.IsValueEmptyString)
                {
                    data.GrayText = true;
                }
            }

            return(data);
        }
Exemplo n.º 7
0
        protected override VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = base.GetDisplayData(row, column, requiredData);

            // construct underlying parameter
            Parameter param = null;

            if (row < ElementCount)
            {
                var mfsp = GetElement(row) as MappingFunctionScalarProperty;
                if (null != mfsp)
                {
                    param = mfsp.StoreParameter;
                }
            }

            if (column == 0)
            {
                data.Image     = data.SelectedImage = MappingDetailsImages.ICONS_PARAMETER;
                data.ImageList = MappingDetailsImages.GetIconsImageList();
            }
            else if (column == 1)
            {
                // direction of arrow icon depends on InOut of underlying parameter
                if (null != param &&
                    Parameter.InOutMode.Out == param.InOut)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ARROWS_RIGHT;
                }
                else if (null != param &&
                         Parameter.InOutMode.InOut == param.InOut)
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ARROWS_BOTH;
                }
                else
                {
                    data.Image = data.SelectedImage = MappingDetailsImages.ARROWS_LEFT;
                }
                data.ImageList = MappingDetailsImages.GetArrowsImageList();
            }
            else if (column == 2)
            {
                // do not show icon for Out parameters
                if (null != param &&
                    Parameter.InOutMode.Out != param.InOut)
                {
                    if (_mappingFunctionScalarProperties.ScalarProperties.Count > row &&
                        _mappingFunctionScalarProperties.ScalarProperties[row].ScalarProperty != null &&
                        _mappingFunctionScalarProperties.ScalarProperties[row].ScalarProperty.Name.Status == BindingStatus.Known &&
                        _mappingFunctionScalarProperties.ScalarProperties[row].ScalarProperty.Name.Target.IsKeyProperty)
                    {
                        data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY_KEY;
                    }
                    else
                    {
                        data.Image = data.SelectedImage = MappingDetailsImages.ICONS_PROPERTY;
                    }
                    data.ImageList = MappingDetailsImages.GetIconsImageList();
                }
            }

            return(data);
        }