本文整理汇总了C#中NSCoder.VersionForClassName方法的典型用法代码示例。如果您正苦于以下问题:C# NSCoder.VersionForClassName方法的具体用法?C# NSCoder.VersionForClassName怎么用?C# NSCoder.VersionForClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSCoder
的用法示例。
在下文中一共展示了NSCoder.VersionForClassName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitWithCoder
//.........这里部分代码省略.........
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)
{
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);