Smartmobili.Cocoa.NSView.SetFrame C# (CSharp) Метод

SetFrame() публичный Метод

public SetFrame ( NSRect frameRect ) : void
frameRect NSRect
Результат void
        public virtual void SetFrame(NSRect frameRect)
        {
            bool	changedOrigin = false;
            bool	changedSize = false;
            NSSize old_size = _frame.Size;

            if (frameRect.Size.Width < 0)
            {
                //NSWarnMLog(@"given negative width", 0);
                //frameRect.Size.Width = 0;
                frameRect.Size = NS.MakeSize(0, frameRect.Size.Height);
            }
            if (frameRect.Size.Height < 0)
            {
                //NSWarnMLog(@"given negative height", 0);
                //frameRect.Size.Height = 0;
                frameRect.Size = NS.MakeSize(frameRect.Size.Width, 0);
            }

            if (NS.EqualPoints(_frame.Origin, frameRect.Origin) == false)
            {
                changedOrigin = true;
            }
            if (NS.EqualSizes(_frame.Size, frameRect.Size) == false)
            {
                changedSize = true;
            }

            if (changedSize == true || changedOrigin == true)
            {
                this._SetFrameAndClearAutoresizingError(frameRect);

                if (changedSize == true)
                {
                    if (_is_rotated_or_scaled_from_base == true)
                    {
                        NSAffineTransform matrix;
                        NSRect frame = _frame;

                        frame.Origin = NS.MakePoint(0, 0);
                        matrix = (NSAffineTransform)_boundsMatrix.Copy();
                        matrix.Invert();
                        matrix.BoundingRectFor(frame, ref _bounds);
                        //RELEASE(matrix);
                    }
                    else
                    {
                        _bounds.Size = frameRect.Size;
                    }
                }

                if (_coordinates_valid)
                {
                    //FIXME
                    //(*invalidateImp)(self, invalidateSel);
                }
                this.ResetCursorRects();
                this.ResizeSubviewsWithOldSize(old_size);
                if (_post_frame_changes)
                {
                    //[nc postNotificationName: NSViewFrameDidChangeNotification object: self];
                }
            }
        }
NSView