本文整理汇总了C#中NSCoder.DecodeValueOfObjCType2方法的典型用法代码示例。如果您正苦于以下问题:C# NSCoder.DecodeValueOfObjCType2方法的具体用法?C# NSCoder.DecodeValueOfObjCType2怎么用?C# NSCoder.DecodeValueOfObjCType2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSCoder
的用法示例。
在下文中一共展示了NSCoder.DecodeValueOfObjCType2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
base.InitWithCoder(aDecoder);
if (aDecoder.AllowsKeyedCoding)
{
// do nothing for now...
}
else
{
//this._setDelegate(aDecoder.DecodeObject);
//[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_error_action];
aDecoder.DecodeValueOfObjCType2<SEL>(out _error_action);
}
_text_object = null;
return this;
}
示例2: InitWithCoder
//.........这里部分代码省略.........
}
else if (colorSpace == 10)
{
NSImage image = (NSImage)aDecoder.DecodeObjectForKey(@"NSImage");
self = NSColor.ColorWithPatternImage(image);
}
return self;
}
else if (aDecoder.VersionForClassName(@"NSColor") < 3)
{
double red;
double green;
double blue;
double cyan;
double magenta;
double yellow;
double black;
double hue;
double saturation;
double brightness;
double alpha;
double white;
int active_component;
int valid_components;
NSString colorspace_name;
NSString catalog_name;
NSString color_name;
bool is_clear;
// Version 1
aDecoder.DecodeValueOfObjCType2<double>(out red);
aDecoder.DecodeValueOfObjCType2<double>(out green);
aDecoder.DecodeValueOfObjCType2<double>(out blue);
aDecoder.DecodeValueOfObjCType2<double>(out alpha);
aDecoder.DecodeValueOfObjCType2<bool>(out is_clear);
// Version 2
aDecoder.DecodeValueOfObjCType2<NSString>(out colorspace_name);
aDecoder.DecodeValueOfObjCType2<NSString>(out catalog_name);
aDecoder.DecodeValueOfObjCType2<NSString>(out color_name);
aDecoder.DecodeValueOfObjCType2<double>(out cyan);
aDecoder.DecodeValueOfObjCType2<double>(out magenta);
aDecoder.DecodeValueOfObjCType2<double>(out yellow);
aDecoder.DecodeValueOfObjCType2<double>(out black);
aDecoder.DecodeValueOfObjCType2<double>(out hue);
aDecoder.DecodeValueOfObjCType2<double>(out saturation);
aDecoder.DecodeValueOfObjCType2<double>(out brightness);
aDecoder.DecodeValueOfObjCType2<double>(out white);
aDecoder.DecodeValueOfObjCType2<int>(out active_component);
aDecoder.DecodeValueOfObjCType2<int>(out valid_components);
if (colorspace_name.IsEqualToString(@"NSDeviceCMYKColorSpace"))
{
self = NSColor.ColorWithDeviceCyan((double)cyan, (double)magenta, (double)yellow, (double)black, (double)alpha);
}
else if (colorspace_name.IsEqualToString(@"NSDeviceWhiteColorSpace"))
{
self = NSColor.ColorWithDeviceWhite((double)white, (double)alpha);
}
else if (colorspace_name.IsEqualToString(@"NSCalibratedWhiteColorSpace"))
{
self = NSColor.ColorWithCalibratedWhite((double)white, (double)alpha);
示例3: InitWithCoder
public override id InitWithCoder(NSCoder aDecoder)
{
if (aDecoder.AllowsKeyedCoding)
{
NSData data = (NSData)aDecoder.DecodeObjectForKey("NSFileWrapperData");
return InitWithSerializedRepresentation(data);
}
else
{
int wrapperType;
NSString preferredFilename;
NSDictionary fileAttributes;
id wrapperData;
//NSImage iconImage;
aDecoder.DecodeValueOfObjCType2<int>(out wrapperType);
// Dont restore the file name
preferredFilename = (NSString)aDecoder.DecodeObject();
fileAttributes = (NSDictionary)aDecoder.DecodeObject();
wrapperData = aDecoder.DecodeObject();
//iconImage = aDecoder.DecodeObject();
switch ((GSFileWrapperType)wrapperType)
{
case GSFileWrapperType.GSFileWrapperRegularFileType:
{
InitRegularFileWithContents((NSData)wrapperData);
break;
}
case GSFileWrapperType.GSFileWrapperSymbolicLinkType:
{
InitSymbolicLinkWithDestination((NSString)wrapperData);
break;
}
case GSFileWrapperType.GSFileWrapperDirectoryType:
{
InitDirectoryWithFileWrappers((NSDictionary)wrapperData);
break;
}
}
if (preferredFilename != null)
{
SetPreferredFilename(preferredFilename);
}
if (fileAttributes != null)
{
SetFileAttributes(fileAttributes);
}
//if (iconImage != null)
//{
// SetIcon(iconImage);
//}
}
return this;
}