示例#1
0
文件: EditorHost.cs 项目: yungtau/oea
        private WPFEntityPropertyViewMeta GetPropertyViewMeta(DetailLogicalView detailView)
        {
            var content = this.Content;

            var res = content as WPFEntityPropertyViewMeta;

            if (res != null)
            {
                return(res);
            }

            var entityPropertyName = content as string;

            if (entityPropertyName != null)
            {
                return(detailView.Meta.Property(entityPropertyName));
            }

            var mp = content as IManagedProperty;

            if (mp != null)
            {
                return(detailView.Meta.Property(mp));
            }

            return(null);
        }
示例#2
0
文件: EditorHost.cs 项目: yungtau/oea
        private void SetLayoutValues(DetailLogicalView detailView, WPFEntityPropertyViewMeta property)
        {
            if (property.DetailAsHorizontal != null)
            {
                var direction = property.DetailAsHorizontal.Value ? Orientation.Horizontal : Orientation.Vertical;
                this.SetIfNonLocal(OrientationProperty, direction);
            }

            if (property.DetailColumnsSpan != null)
            {
                this.SetIfNonLocal(Grid.ColumnSpanProperty, property.DetailColumnsSpan.Value);
            }

            var labelSize = property.DetailLabelSize ?? detailView.Meta.DetailLabelSize;

            if (labelSize != null)
            {
                if (this.Orientation == Orientation.Horizontal)
                {
                    this.SetIfNonLocal(LabelWidthProperty, labelSize.Value);
                }
                else
                {
                    this.SetIfNonLocal(LabelHeightProperty, labelSize.Value);
                }
            }

            if (property.DetailContentWidth != null)
            {
                if (!this.IsLocalValue(ContentWidthProperty))
                {
                    var value = property.DetailContentWidth.Value;

                    //0-1 之间表示相对值,否则表示绝对值。
                    if (value > 0 && value < 1)
                    {
                        value             = value / (1 - value);
                        this.ContentWidth = new GridLength(value, GridUnitType.Star);
                    }
                    else
                    {
                        this.ContentWidth = new GridLength(value);
                    }
                }
            }

            if (property.DetailHeight != null)
            {
                this.SetIfNonLocal(HeightProperty, property.DetailHeight.Value);
            }
        }
示例#3
0
        protected override void OnServiceInvoking(DetailLogicalView detailView, CancelEventArgs e)
        {
            base.OnServiceInvoking(detailView, e);

            var entity = detailView.Current as PurchaseOrder;

            if (entity.StorageInDirectly)
            {
                var btn = App.MessageBox.Show("您选择了直接入库,系统将会为本次采购自动生成一张相应的入库单。\r\n是否继续?".Translate(), MessageBoxButton.YesNo);
                if (btn == MessageBoxResult.No)
                {
                    e.Cancel = true;
                }
            }
        }
示例#4
0
文件: AddBill.cs 项目: yungtau/oea
 protected virtual void OnServiceInvoking(DetailLogicalView detailView, CancelEventArgs e)
 {
 }
示例#5
0
        private void SetLayoutValues(DetailLogicalView detailView, WPFEntityPropertyViewMeta property)
        {
            if (property.DetailAsHorizontal != null)
            {
                var direction = property.DetailAsHorizontal.Value ? Orientation.Horizontal : Orientation.Vertical;
                this.SetIfNonLocal(OrientationProperty, direction);
            }

            if (property.DetailColumnsSpan != null)
            {
                this.SetIfNonLocal(Grid.ColumnSpanProperty, property.DetailColumnsSpan.Value);
            }

            var labelSize = property.DetailLabelSize ?? detailView.Meta.DetailLabelSize;
            if (labelSize != null)
            {
                if (this.Orientation == Orientation.Horizontal)
                {
                    this.SetIfNonLocal(LabelWidthProperty, labelSize.Value);
                }
                else
                {
                    this.SetIfNonLocal(LabelHeightProperty, labelSize.Value);
                }
            }

            if (property.DetailContentWidth != null)
            {
                if (!this.IsLocalValue(ContentWidthProperty))
                {
                    var value = property.DetailContentWidth.Value;

                    //0-1 之间表示相对值,否则表示绝对值。
                    if (value > 0 && value < 1)
                    {
                        value = value / (1 - value);
                        this.ContentWidth = new GridLength(value, GridUnitType.Star);
                    }
                    else
                    {
                        this.ContentWidth = new GridLength(value);
                    }
                }
            }

            if (property.DetailHeight != null)
            {
                this.SetIfNonLocal(HeightProperty, property.DetailHeight.Value);
            }
        }
示例#6
0
        private WPFEntityPropertyViewMeta GetPropertyViewMeta(DetailLogicalView detailView)
        {
            var content = this.Content;

            var res = content as WPFEntityPropertyViewMeta;
            if (res != null) return res;

            var entityPropertyName = content as string;
            if (entityPropertyName != null) { return detailView.Meta.Property(entityPropertyName); }

            var mp = content as IManagedProperty;
            if (mp != null) { return detailView.Meta.Property(mp); }

            return null;
        }