예제 #1
0
        //=============================================================================
        protected override void _InitProperties()
        {
            base._InitProperties();

            if (m_Properties != null)
            {
                try
                {
                    // Remove height property because bound sheet doesnt have any height.
                    // Also bound sheet doesnt have any roof, only warehouse sheet has roof.
                    Property_ViewModel heightProp = m_Properties.FirstOrDefault(prop => prop != null && prop.SystemName == PROP_DIMENSION_Z);
                    if (heightProp != null)
                    {
                        m_Properties.Remove(heightProp);
                    }

                    // Remove GeometryType_Property.
                    Property_ViewModel typeProp = m_Properties.FirstOrDefault(prop => prop != null && prop is GeometryType_Property);
                    if (typeProp != null)
                    {
                        m_Properties.Remove(typeProp);
                    }

                    if (m_Properties.FirstOrDefault(p => p.SystemName == BaseRectangleGeometry.PROP_NAME) == null)
                    {
                        m_Properties.Insert(0, new GeometryProperty(this, BaseRectangleGeometry.PROP_NAME, false, "Geometry"));
                    }
                }
                catch { }
            }
        }
예제 #2
0
        //=============================================================================
        protected override void _InitProperties()
        {
            m_Properties.Add(new GeometryType_Property(this));

            //
            m_Properties.Add(new GeometryProperty(this, PROP_DIMENSION_X, "Length", true, "Geometry"));
            m_Properties.Add(new GeometryProperty(this, PROP_DIMENSION_Y, "Depth", true, "Geometry"));
            m_Properties.Add(new GeometryProperty(this, PROP_DIMENSION_Z, "Height", _Is_HeightProperty_ReadOnly, true, "Geometry"));
            m_Properties.Add(new GeometryProperty(this, PROP_SWING_DOOR, "Swing Door", false, "Geometry"));

            // make Depth read-only
            Property_ViewModel depthProp = m_Properties.FirstOrDefault(p => p != null && p.SystemName == PROP_DIMENSION_Y);

            if (depthProp != null)
            {
                depthProp.IsReadOnly = true;
            }

            _UpdateProperties();
        }
예제 #3
0
        //=============================================================================
        private void _UpdateProperties()
        {
            if (m_Properties == null)
            {
                return;
            }

            if (m_bIsHorizontal)
            {
                // remove Y-pos
                Property_ViewModel _TopLeftPoint_Prop = m_Properties.FirstOrDefault(p => p != null && p.SystemName == PROP_TOP_LEFT_POINT_Y);
                if (_TopLeftPoint_Prop != null)
                {
                    m_Properties.Remove(_TopLeftPoint_Prop);
                }
                // add X-pos
                Property_ViewModel topLeftPointX_prop = m_Properties.FirstOrDefault(p => p != null && p.SystemName == PROP_TOP_LEFT_POINT_X);
                if (topLeftPointX_prop == null)
                {
                    m_Properties.Add(new GeometryProperty(this, PROP_TOP_LEFT_POINT_X, true, "Geometry"));
                }
            }
            else
            {
                // remove X-pos
                Property_ViewModel _TopLeftPoint_Prop = m_Properties.FirstOrDefault(p => p != null && p.SystemName == PROP_TOP_LEFT_POINT_X);
                if (_TopLeftPoint_Prop != null)
                {
                    m_Properties.Remove(_TopLeftPoint_Prop);
                }
                // add Y-pos
                Property_ViewModel topLeftPointY_prop = m_Properties.FirstOrDefault(p => p != null && p.SystemName == PROP_TOP_LEFT_POINT_Y);
                if (topLeftPointY_prop == null)
                {
                    m_Properties.Add(new GeometryProperty(this, PROP_TOP_LEFT_POINT_Y, true, "Geometry"));
                }
            }
        }