コード例 #1
0
        void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case SashModel.PARENT_PROPERTY_CODE:
                Bounds = SurfaceParent().Model.Bounds;
                break;

            case SashModel.SASH_TYPE_PROPERTY_CODE:
                Repaint();
                break;

            case SashModel.CHILD_PROPERTY_CODE:
                RemoveAllChildren();
                Surface              = Model.SurfaceChild;
                Surface.Frame        = SurfaceParent().Frame;
                Surface.Model.Bounds = InnerBounds;
                AddChild(Surface);
                break;

            case SashModel.CODE_PROPERTY_CODE:
                Repaint();
                break;
            }
            Surface.ParentBoundsChanged();
        }
コード例 #2
0
ファイル: PVCModel.cs プロジェクト: alibghz/urcie
        public void OnPropertyChanged(PVCModelPropertyChangedEventArgs e)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #3
0
        void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case MullionModel.LENGTH_PROPERTY_CODE:
            case MullionModel.MIDDLE_POINT_PROPERTY_CODE:
            case MullionModel.MULLION_TYPE_PROPERTY_CODE:
            case MullionModel.ORIENTATION_PROPERTY_CODE:
            case MullionModel.X_PROPERTY_CODE:
            case MullionModel.Y_PROPERTY_CODE:
                if (!SetBounds(Model.X, Model.Y, Model.Width, Model.Height))
                {
                    Model.X = X;
                    Model.Y = Y;
                    if (Model.Orientation == Orientation.Horizontal)
                    {
                        Model.Length = Width;
                    }
                    else
                    {
                        Model.Length = Height;
                    }
                }
                else if (Frame != null)
                {
                    Frame.OnDimensionChanged();
                }
                break;

            case MullionModel.CODE_PROPERTY_CODE:
                Label = Model.Code;
                InvalidatePaint();
                break;

            case MullionModel.VIRTUAL_PROPERTY_CODE:
                Model.MiddlePoint += 1;
                Model.MiddlePoint -= 1;
                Repaint();
                break;
            }
        }
コード例 #4
0
        public void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case SurfaceModel.X_PROPERTY_CODE:
            case SurfaceModel.WIDTH_PROPERTY_CODE:
            case SurfaceModel.HEIGHT_PROPERTY_CODE:
            case SurfaceModel.Y_PROPERTY_CODE:
            case SurfaceModel.BOUNDS_PROPERTY_CODE:
                if (Parent == null)
                {
                    Bounds = Model.Bounds;
                }
                else if (!SetBounds(Model.X, Model.Y, Model.Width, Model.Height))
                {
                    Model.Bounds = Bounds;
                }
                break;

            default:
                break;
            }
        }
コード例 #5
0
        /// <summary>
        /// Updates the aFrame based on the Model values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case PVCFrameModel.WIDTH_PROPERTY_CODE:
            case PVCFrameModel.HEIGHT_PROPERTY_CODE:
                if (!SetBounds(MINX, MINY, Model.Width, Model.Height))
                {
                    Model.Width  = Width;
                    Model.Height = Height;
                }
                else
                {
                    OnDimensionChanged();
                }
                break;

            case PVCFrameModel.CODE_PROPERTY_CODE:
                Label = Model.Code;
                ChildrenManager.UpdateFillingsCode(this);
                ChildrenManager.UpdateSashesCode(this);
                ChildrenManager.UpdateMullionsCode(this, Orientation.Horizontal);
                ChildrenManager.UpdateMullionsCode(this, Orientation.Vertical);
                InvalidatePaint();
                break;

            case PVCFrameModel.PROFILE_PROPERTY_CODE:
                InvalidateLayout();
                break;

            case PVCFrameModel.COLOR_PROPERTY_CODE:
            case PVCFrameModel.BORDER_COLOR_PROPERTY_CODE:
                InvalidatePaint();
                break;
            }
        }
コード例 #6
0
ファイル: Filling.cs プロジェクト: alibghz/urcie
        public void Model_PropertyChanged(object sender, PVCModelPropertyChangedEventArgs e)
        {
            switch (e.PropertyCode)
            {
            case FillingModel.PARENT_PROPERTY_CODE:
                if (Model.SurfaceParent != null && Model.SurfaceParent.ChildrenCount == 0)
                {
                    Model.SurfaceParent.AddChild(this);
                    Bounds = Model.SurfaceParent.Model.Bounds;
                }
                else
                {
                    Model.SurfaceParent = null;
                }
                break;

            case FillingModel.FILLING_TYPE_PROPERTY_CODE:
                break;

            case FillingModel.CODE_PROPERTY_CODE:
                break;
            }
            Repaint();
        }