本文整理汇总了C#中NSCoder.DecodeObjectForKey方法的典型用法代码示例。如果您正苦于以下问题:C# NSCoder.DecodeObjectForKey方法的具体用法?C# NSCoder.DecodeObjectForKey怎么用?C# NSCoder.DecodeObjectForKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSCoder
的用法示例。
在下文中一共展示了NSCoder.DecodeObjectForKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
if (aDecoder.AllowsKeyedCoding)
{
Name = (NSString)aDecoder.DecodeObjectForKey("name");
CandidateClassName = (NSString)aDecoder.DecodeObjectForKey("candidateClassName");
}
return this;
}
示例2: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
if (aDecoder.AllowsKeyedCoding)
{
MajorKey = (NSString)aDecoder.DecodeObjectForKey("majorKey");
MinorKey = (NSString)aDecoder.DecodeObjectForKey("minorKey");
}
return self;
}
示例3: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
if (aDecoder.AllowsKeyedCoding)
{
ObjectID = aDecoder.DecodeIntForKey("objectID");
Object = aDecoder.DecodeObjectForKey("object");
Children = aDecoder.DecodeObjectForKey("children");
Parent = aDecoder.DecodeObjectForKey("parent");
ObjectName = (NSString)aDecoder.DecodeObjectForKey("objectName");
}
return self;
}
示例4: InitWithCoder
public override id InitWithCoder(NSCoder decoder)
{
id self = this;
base.InitWithCoder(decoder);
OrderedObjects = (NSArray)decoder.DecodeObjectForKey("orderedObjects");
return self;
}
示例5: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
if (aDecoder.AllowsKeyedCoding)
{
_imageName = (NSString)aDecoder.DecodeObjectForKey(@"NSImageName");
}
return self;
}
示例6: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
Connector = (NSNibBindingConnector)aDecoder.DecodeObjectForKey("connector");
}
return this;
}
示例7: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
ReferencedPartialClassDescriptions = (NSMutableArray)aDecoder.DecodeObjectForKey("referencedPartialClassDescriptions");
}
return this;
}
示例8: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
if (aDecoder.AllowsKeyedCoding)
{
Connection = (IBConnection)aDecoder.DecodeObjectForKey("connection");
ConnectionID = aDecoder.DecodeIntForKey("connectionID");
}
return self;
}
示例9: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
NSMenu menu;
if (base.InitWithCoder(aDecoder) == null)
return null;
if (aDecoder.AllowsKeyedCoding)
{
menu = (NSMenu)aDecoder.DecodeObjectForKey(@"NSMenu");
this.Menu = null;
this.Menu = menu;
if (aDecoder.ContainsValueForKey(@"NSAltersState"))
{
}
if (aDecoder.ContainsValueForKey(@"NSPullDown"))
{
}
if (aDecoder.ContainsValueForKey(@"NSUsesItemFromMenu"))
{
}
if (aDecoder.ContainsValueForKey(@"NSArrowPosition"))
{
}
if (aDecoder.ContainsValueForKey(@"NSPreferredEdge"))
{
}
if (aDecoder.ContainsValueForKey(@"NSSelectedIndex"))
{
}
if (aDecoder.ContainsValueForKey(@"NSMenuItem"))
{
}
}
return self;
}
示例10: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
//NSString title;
//NSString action;
//NSString key;
bool isSeparator = false;
//int keyMask;
if (aDecoder.ContainsValueForKey(@"NSIsSeparator"))
{
isSeparator = aDecoder.DecodeBoolForKey(@"NSIsSeparator");
}
Title = (NSString)aDecoder.DecodeObjectForKey("NSTitle");
IsDisabled = aDecoder.DecodeBoolForKey("NSIsDisabled");
IsSeparator = aDecoder.DecodeBoolForKey("NSIsSeparator");
SubMenu = (NSMenu)aDecoder.DecodeObjectForKey("NSSubmenu");
}
return this;
}
示例11: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
id menu = null;
base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
if (aDecoder.ContainsValueForKey(@"NSInterfaceStyle"))
{
_interface_style = (NSInterfaceStyle)aDecoder.DecodeIntForKey(@"NSInterfaceStyle");
}
if (aDecoder.ContainsValueForKey(@"NSMenu"))
{
menu = (NSMenu)aDecoder.DecodeObjectForKey(@"NSMenu");
}
if (aDecoder.ContainsValueForKey(@"NSNextResponder"))
{
NextResponder = (NSResponder)aDecoder.DecodeObjectForKey(@"NSNextResponder");
}
}
else
{
}
Menu = (NSMenu)menu;
return self;
}
示例12: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
if (aDecoder.AllowsKeyedCoding)
{
int colorSpace = aDecoder.DecodeIntForKey(@"NSColorSpace");
if ((colorSpace == 1) || (colorSpace == 2))
{
int length = 0;
byte[] data = null;
double red = 0.0;
double green = 0.0;
double blue = 0.0;
double alpha = 1.0;
NSString str = null;
NSScanner scanner = null;
if (aDecoder.ContainsValueForKey(@"NSRGB"))
{
data = aDecoder.DecodeBytesForKey(@"NSRGB", ref length);
str = (NSString)NSString.Alloc().InitWithBytes(data, (uint)data.Length, NSStringEncoding.NSASCIIStringEncoding);
scanner = (NSScanner)NSScanner.Alloc().InitWithString(str);
scanner.ScanDouble(ref red);
scanner.ScanDouble(ref green);
scanner.ScanDouble(ref blue);
scanner.ScanDouble(ref alpha);
}
if (colorSpace == 1)
{
self = NSColor.ColorWithCalibratedRed((double)red, (double)green, (double)blue, (double)alpha);
}
else
{
self = NSColor.ColorWithDeviceRed((double)red, (double)green, (double)blue, (double)alpha);
}
}
else if ((colorSpace == 3) || (colorSpace == 4))
{
int length = 0;
byte[] data = null;
double white = 0.0;
double alpha = 0.0;
NSString str = null;
NSScanner scanner = null;
if (aDecoder.ContainsValueForKey(@"NSWhite"))
{
data = aDecoder.DecodeBytesForKey(@"NSWhite", ref length);
str = (NSString)NSString.Alloc().InitWithBytes(data, (uint)data.Length, NSStringEncoding.NSASCIIStringEncoding);
scanner = (NSScanner)NSScanner.Alloc().InitWithString(str);
scanner.ScanDouble(ref white);
scanner.ScanDouble(ref alpha);
}
if (colorSpace == 3)
{
self = NSColor.ColorWithCalibratedWhite((double)white, (double)alpha);
}
else
{
self = NSColor.ColorWithDeviceWhite((double)white, (double)alpha);
}
}
else if (colorSpace == 5)
{
int length = 0;
byte[] data = null;
double cyan = 0.0;
double yellow = 0.0;
double magenta = 0.0;
double black = 0.0;
double alpha = 1.0;
NSString str = null;
NSScanner scanner = null;
if (aDecoder.ContainsValueForKey(@"NSCYMK"))
{
data = aDecoder.DecodeBytesForKey(@"NSCYMK", ref length);
str = (NSString)NSString.Alloc().InitWithBytes(data, (uint)data.Length, NSStringEncoding.NSASCIIStringEncoding);
scanner = (NSScanner)NSScanner.Alloc().InitWithString(str);
scanner.ScanDouble(ref cyan);
scanner.ScanDouble(ref yellow);
scanner.ScanDouble(ref magenta);
scanner.ScanDouble(ref black);
scanner.ScanDouble(ref alpha);
}
self = NSColor.ColorWithDeviceCyan((double)cyan, (double)magenta, (double)yellow, (double)black, (double)alpha);
}
else if (colorSpace == 6)
{
NSString catalog = (NSString)aDecoder.DecodeObjectForKey(@"NSCatalogName");
NSString name = (NSString)aDecoder.DecodeObjectForKey(@"NSColorName");
//NSColor color = (NSColor)aDecoder.DecodeObjectForKey(@"NSColor");
self = NSColor.ColorWithCatalogName(catalog, name);
}
else if (colorSpace == 10)
{
//.........这里部分代码省略.........
示例13: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
id self = this;
NSEnumerator e;
NSView sub;
NSArray subs;
if (base.InitWithCoder(aDecoder) == null)
return null;
_matrixToWindow = (NSAffineTransform)NSAffineTransform.Alloc().Init(); // Map to window coordinates
_matrixFromWindow = (NSAffineTransform)NSAffineTransform.Alloc().Init();// Map from window coordinates
if (aDecoder.AllowsKeyedCoding)
{
NSView prevKeyView = null;
NSView nextKeyView = null;
if (aDecoder.ContainsValueForKey("NSFrame"))
{
_frame = aDecoder.DecodeRectForKey("NSFrame");
}
else
{
_frame = NSRect.Zero;
if (aDecoder.ContainsValueForKey("NSFrameSize"))
{
_frame = aDecoder.DecodeSizeForKey("NSFrameSize");
}
}
// Set bounds rectangle
_bounds.Origin = NSPoint.Zero;
_bounds.Size = _frame.Size;
if (aDecoder.ContainsValueForKey("NSBounds"))
{
this.SetBounds(aDecoder.DecodeRectForKey(@"NSBounds"));
}
_sub_views = (NSMutableArray)NSMutableArray.Alloc().Init();
_tracking_rects = (NSMutableArray)NSMutableArray.Alloc().Init();
_cursor_rects = (NSMutableArray)NSMutableArray.Alloc().Init();
_is_rotated_from_base = false;
_is_rotated_or_scaled_from_base = false;
_rFlags.needs_display = Convert.ToUInt32(true);
_post_bounds_changes = true;
_post_frame_changes = true;
_autoresizes_subviews = true;
_autoresizingMask =(uint) NSViewAutoresizingMasks.NSViewNotSizable;
_coordinates_valid = false;
/*
* Note: don't zero _nextKeyView and _previousKeyView, as the key view
* chain may already have been established by super's initWithCoder:
*
* _nextKeyView = 0;
* _previousKeyView = 0;
*/
// previous and next key views...
prevKeyView = (NSView)aDecoder.DecodeObjectForKey("NSPreviousKeyView");
nextKeyView = (NSView)aDecoder.DecodeObjectForKey("NSNextKeyView");
if (nextKeyView != null)
{
NextKeyView = nextKeyView;
}
if (prevKeyView != null)
{
PreviousKeyView = prevKeyView;
}
if (aDecoder.ContainsValueForKey("NSvFlags"))
{
uint vFlags = (uint)aDecoder.DecodeIntForKey("NSvFlags");
//2013-06-02 10:40:22.872 Gorm[26233] NSvFlags: 0x112 (274) (274)
//2013-06-02 10:40:22.872 Gorm[26233] NSvFlags: 0x80000100 (-2147483392) (-2147483392)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x80000100 (-2147483392) (-2147483392)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x136 (310) (310)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x900 (2304) (2304)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x8000010a (-2147483382) (-2147483382)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x10a (266) (266)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.873 Gorm[26233] NSvFlags: 0x10a (266) (266)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x10a (266) (266)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x112 (274) (274)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x8000010a (-2147483382) (-2147483382)
//2013-06-02 10:40:22.874 Gorm[26233] NSvFlags: 0x100 (256) (256)
//2013-06-02 10:40:22.875 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.875 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.875 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.875 Gorm[26233] NSvFlags: 0x102 (258) (258)
//2013-06-02 10:40:22.876 Gorm[26233] NSvFlags: 0x104 (260) (260)
//2013-06-02 10:40:22.876 Gorm[26233] NSvFlags: 0x102 (258) (258)
//2013-06-02 10:40:22.876 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.879 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.885 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.893 Gorm[26233] NSvFlags: 0x10c (268) (268)
//2013-06-02 10:40:22.901 Gorm[26233] NSvFlags: 0x10c (268) (268)
//.........这里部分代码省略.........
示例14: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
//base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
if (aDecoder.ContainsValueForKey(@"NSDestination"))
{
_dst = aDecoder.DecodeObjectForKey(@"NSDestination");
}
if (aDecoder.ContainsValueForKey(@"NSSource"))
{
_src = aDecoder.DecodeObjectForKey(@"NSSource");
}
if (aDecoder.ContainsValueForKey(@"NSLabel"))
{
_tag = (NSString)aDecoder.DecodeObjectForKey(@"NSLabel");
}
}
else
{
}
return this;
}
示例15: InitWithCoder
//public NSCustomResource(NSObjectDecoder aDecoder)
// : base(aDecoder)
//{
//}
public override id InitWithCoder(NSCoder aDecoder)
{
NSObject realObject = null;
if (aDecoder.AllowsKeyedCoding)
{
_className = (NSString)aDecoder.DecodeObjectForKey("NSClassName");
_resourceName = (NSString)aDecoder.DecodeObjectForKey("NSResourceName");
if (_className == "NSSound")
{
//realObject = null;
}
else if (_className == "NSImage")
{
realObject = new NSImage();
((NSImage)realObject).ResourceName = _resourceName;
}
}
else
{
}
return realObject;
}