예제 #1
0
        public bool Remove(CustomObject customObject)
        {
            bool result;

            if (customObject is DynamicCustomObject)
            {
                result = _dynamicCustomObjects.Remove((DynamicCustomObject)customObject);
            }
            else
            {
                result = _staticCustomObjects.Remove(customObject);
            }

            customObject.UnInitialize();
            _pane.Invalidate();
            return(result);
        }
예제 #2
0
        public bool Add(CustomObject customObject)
        {
            if (customObject.IsInitialized == false && customObject.Initialize(this) == false)
            {
                return(false);
            }

            if (customObject is DynamicCustomObject)
            {
                _dynamicCustomObjects.Add((DynamicCustomObject)customObject);
            }
            else
            {
                _staticCustomObjects.Add(customObject);
            }

            _pane.Invalidate();
            return(true);
        }
        public bool Add(CustomObject customObject)
        {
            if (customObject.IsInitialized == false && customObject.Initialize(this) == false)
            {
                return false;
            }

            if (customObject is DynamicCustomObject)
            {
                _dynamicCustomObjects.Add((DynamicCustomObject)customObject);
            }
            else
            {
                _staticCustomObjects.Add(customObject);
            }

            _pane.Invalidate();
            return true;
        }
        public bool Remove(CustomObject customObject)
        {
            bool result;
            if (customObject is DynamicCustomObject)
            {
                result = _dynamicCustomObjects.Remove((DynamicCustomObject)customObject);
            }
            else
            {
                result = _staticCustomObjects.Remove(customObject);
            }

            customObject.UnInitialize();
            _pane.Invalidate();
            return result;
        }
        public void Draw(GraphicsWrapper g, RectangleF drawingSpaceClipping, CustomObject.DrawingOrderEnum drawingOrder)
        {
            foreach (CustomObject customObject in _dynamicCustomObjects)
            {
                if (customObject.DrawingOrder == drawingOrder)
                {
                    customObject.Draw(g, _pane.CurrentDrawingSpaceMousePosition, drawingSpaceClipping, _pane.DrawingSpace);
                }
            }

            if (_currentObjectBuilt != null)
            {
                _currentObjectBuilt.Draw(g, _pane.CurrentDrawingSpaceMousePosition, drawingSpaceClipping, _pane.DrawingSpace);
            }
        }