public override id InitWithCoder(NSCoder aDecoder)
        {
            base.InitWithCoder(aDecoder);

            if (aDecoder.AllowsKeyedCoding)
            {
                if (aDecoder.ContainsValueForKey("NSViewClass"))
                {
                    _viewClass = (id)aDecoder.DecodeObjectForKey("NSViewClass");
                }
                if (aDecoder.ContainsValueForKey("NSWindowClass"))
                {
                    _windowClass = (NSString)aDecoder.DecodeObjectForKey("NSWindowClass");
                }
                if (aDecoder.ContainsValueForKey("NSWindowStyleMask"))
                {
                    _windowStyle = (uint)aDecoder.DecodeIntForKey("NSWindowStyleMask");
                }
                if (aDecoder.ContainsValueForKey("NSWindowBacking"))
                {
                    _backingStoreType = (NSBackingStoreType)aDecoder.DecodeIntForKey("NSWindowBacking");
                }
                if (aDecoder.ContainsValueForKey("NSWindowView"))
                {
                    _view = (id)aDecoder.DecodeObjectForKey("NSWindowView");
                }
                if (aDecoder.ContainsValueForKey("NSWTFlags"))
                {
                    uint flags = (uint)aDecoder.DecodeIntForKey("NSWTFlags");
                    _flags = PrimitiveConversion.FromLong<GSWindowTemplateFlags>(flags);
                }
                if (aDecoder.ContainsValueForKey("NSMinSize"))
                {
                    _minSize = aDecoder.DecodeSizeForKey("NSMinSize");
                }
                if (aDecoder.ContainsValueForKey("NSMaxSize"))
                {
                    _maxSize = aDecoder.DecodeSizeForKey("NSMaxSize");
                }
                else
                {
                    _maxSize = new NSSize((float)10e+4, (float)10e+4);
                }

                if (aDecoder.ContainsValueForKey("NSWindowRect"))
                {
                    _windowRect = aDecoder.DecodeRectForKey("NSWindowRect");
                }
                if (aDecoder.ContainsValueForKey("NSFrameAutosaveName"))
                {
                    _autosaveName = (NSString)aDecoder.DecodeObjectForKey("NSFrameAutosaveName");
                }
                if (aDecoder.ContainsValueForKey("NSWindowTitle"))
                {
                    _title = (NSString)aDecoder.DecodeObjectForKey("NSWindowTitle");
                    _windowStyle |= (uint)NSWindowStyleMasks.NSTitledWindowMask;
                }

                //_baseWindowClass = [NSWindow class];
            }
            else
            {
                //[NSException raise: NSInvalidArgumentException 
                //             format: @"Can't decode %@ with %@.",NSStringFromClass([self class]),
                //             NSStringFromClass([coder class])];
            }

            //if (aDecoder.AllowsKeyedCoding)
            //{
            //    StyleMask = (NSWindowStyleMasks)aDecoder.DecodeIntForKey("NSWindowStyleMask");
            //    Backing = aDecoder.DecodeIntForKey("NSWindowBacking");
            //    WindowRect = aDecoder.DecodeRectForKey("NSWindowRect");
            //    NSWTFlags = (uint)aDecoder.DecodeIntForKey("NSWTFlags");
            //    if (aDecoder.ContainsValueForKey("NSWindowTitle"))
            //    {
            //        Title = (NSString)aDecoder.DecodeObjectForKey("NSWindowTitle");
            //        StyleMask |= NSWindowStyleMasks.NSTitledWindowMask;
            //    }

            //    WindowClass = (NSString)aDecoder.DecodeObjectForKey("NSWindowClass");
            //    Toolbar = (NSToolbar)aDecoder.DecodeObjectForKey("NSViewClass");
            //    WindowView = (NSView)aDecoder.DecodeObjectForKey("NSWindowView");
            //    ScreenRect = (NSRect)aDecoder.DecodeRectForKey("NSScreenRect");
            //    IsRestorable = aDecoder.DecodeBoolForKey("NSWindowIsRestorable");

            //    MinSize = aDecoder.DecodeSizeForKey("NSMinSize");

            //    if (aDecoder.ContainsValueForKey("NSMaxSize"))
            //    {
            //        MaxSize = aDecoder.DecodeSizeForKey("NSMaxSize");
            //    }
            //    else
            //    {
            //        MaxSize = new NSSize((float)10e+4, (float)10e+4);
            //    }
            //}

            return this;
        }
Example #2
0
        public virtual id InitWithContentRect(NSRect contentRect, int aStyle, NSBackingStoreType bufferingType, bool flag)
        {
            id self = this;

            return self;
        }
Example #3
0
 public BoingWindow(NSRect contentRect, NSWindowStyleMask windowStyle, NSBackingStoreType bufferingType, bool deferCreation, NSScreen screen)
     : base(contentRect, windowStyle, bufferingType, deferCreation, screen)
 {
 }
Example #4
0
 public override Id InitWithContentRectStyleMaskBackingDeferScreen(NSRect aContentRect, NSWindowStyleMasks aWindowStyle, NSBackingStoreType aBufferingType, bool aDeferCreation, NSScreen aScreen)
 {
     // overridden to set NSBorderlessWindowMask for no title bar
     this.SendMessageSuper(ThisClass,
                           "initWithContentRect:styleMask:backing:defer:screen:",
                           aContentRect,
                           NSWindowStyleMasks.NSBorderlessWindowMask,
                           aBufferingType, aDeferCreation, aScreen);
     return(this);
 }