当前位置: 首页>>代码示例>>C#>>正文


C# NSMutableDictionary.SetObject方法代码示例

本文整理汇总了C#中NSMutableDictionary.SetObject方法的典型用法代码示例。如果您正苦于以下问题:C# NSMutableDictionary.SetObject方法的具体用法?C# NSMutableDictionary.SetObject怎么用?C# NSMutableDictionary.SetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NSMutableDictionary的用法示例。


在下文中一共展示了NSMutableDictionary.SetObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToDictionary

		internal NSDictionary ToDictionary ()
		{
			var ret = new NSMutableDictionary ();

			if (AffineMatrix.HasValue){
				var a = AffineMatrix.Value;
				var affine = new NSNumber [6];
				affine [0] = NSNumber.FromFloat (a.xx);
				affine [1] = NSNumber.FromFloat (a.yx);
				affine [2] = NSNumber.FromFloat (a.xy);
				affine [3] = NSNumber.FromFloat (a.yy);
				affine [4] = NSNumber.FromFloat (a.x0);
				affine [5] = NSNumber.FromFloat (a.y0);
				ret.SetObject (NSArray.FromNSObjects (affine), CISampler.AffineMatrix);
			}
			if (WrapMode.HasValue){
				var k = WrapMode.Value == CIWrapMode.Black ? CISampler.WrapBlack : CISampler.FilterNearest;
				ret.SetObject (k, CISampler.WrapMode);
			}
			if (FilterMode.HasValue){
				var k = FilterMode.Value == CIFilterMode.Nearest ? CISampler.FilterNearest : CISampler.FilterLinear;
				ret.SetObject (k, CISampler.FilterMode);
			}
			return ret;
		}
开发者ID:kangaroo,项目名称:monomac,代码行数:25,代码来源:CISampler.cs

示例2: ToDictionary

		public NSDictionary ToDictionary ()
		{
			var dict = new NSMutableDictionary ();
			if (CodecType != null)
				dict.SetObject (new NSString (CodecType), QTMovie.ImageCodecType);
			if (Quality.HasValue)
				dict.SetObject (NSNumber.FromInt32 ((int) Quality.Value), QTMovie.ImageCodecQuality);
			if (TimeScale.HasValue)
				dict.SetObject (NSNumber.FromInt32 (TimeScale.Value), QTTrack.TimeScaleAttribute);
			return dict;
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:11,代码来源:QTMovie.cs

示例3: ToDictionary

 //public bool? ProtectedFile { get; set; }
 internal NSDictionary ToDictionary()
 {
     var dict = new NSMutableDictionary ();
     if (AppendOnly.HasValue)
         dict.SetObject (NSNumber.FromBoolean (AppendOnly.Value), NSFileManager.AppendOnly);
     if (Busy.HasValue)
         dict.SetObject (NSNumber.FromBoolean (Busy.Value), NSFileManager.Busy);
     if (CreationDate != null)
         dict.SetObject (CreationDate, NSFileManager.CreationDate);
     if (ModificationDate != null)
         dict.SetObject (ModificationDate, NSFileManager.ModificationDate);
     if (OwnerAccountName != null)
         dict.SetObject (new NSString (OwnerAccountName), NSFileManager.OwnerAccountName);
     if (DeviceIdentifier.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (DeviceIdentifier.Value), NSFileManager.DeviceIdentifier);
     if (FileExtensionHidden.HasValue)
         dict.SetObject (NSNumber.FromBoolean (FileExtensionHidden.Value), NSFileManager.ExtensionHidden);
     if (FileGroupOwnerAccountID.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (FileGroupOwnerAccountID.Value), NSFileManager.GroupOwnerAccountID);
     if (FileOwnerAccountID.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (FileOwnerAccountID.Value), NSFileManager.OwnerAccountID);
     if (HfsTypeCode.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (HfsTypeCode.Value), NSFileManager.HfsTypeCode);
     if (PosixPermissions.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (PosixPermissions.Value), NSFileManager.PosixPermissions);
     if (FileReferenceCount.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (FileReferenceCount.Value), NSFileManager.ReferenceCount);
     if (FileSystemFileNumber.HasValue)
         dict.SetObject (NSNumber.FromUInt32 (FileSystemFileNumber.Value), NSFileManager.SystemFileNumber);
     if (FileSize.HasValue)
         dict.SetObject (NSNumber.FromUInt64 (FileSize.Value), NSFileManager.Size);
     if (Immutable.HasValue)
         dict.SetObject (NSNumber.FromBoolean (Immutable.Value), NSFileManager.Immutable);
     //if (ProtectedFile.HasValue)
     //dict.SetObject (NSNumber.FromBoolean (ProtectedFile.Value), NSFileManager.ProtectedFile);
     if (FileType.HasValue){
         NSString v = null;
         switch (FileType.Value){
         case NSFileType.Directory:
             v = NSFileManager.TypeDirectory; break;
         case NSFileType.Regular:
             v = NSFileManager.TypeRegular; break;
         case NSFileType.SymbolicLink:
             v = NSFileManager.TypeSymbolicLink; break;
         case NSFileType.Socket:
             v = NSFileManager.TypeSocket; break;
         case NSFileType.CharacterSpecial:
             v = NSFileManager.TypeCharacterSpecial; break;
         case NSFileType.BlockSpecial:
             v = NSFileManager.TypeBlockSpecial; break;
         default:
             v = NSFileManager.TypeUnknown; break;
         }
         dict.SetObject (v, NSFileManager.NSFileType);
     }
     return dict;
 }
开发者ID:roblillack,项目名称:maccore,代码行数:58,代码来源:NSFileManager.cs


注:本文中的NSMutableDictionary.SetObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。