Monobjc.AppKit.NSNib.InstantiateNibWithOwnerTopLevelObjects C# (CSharp) Метод

InstantiateNibWithOwnerTopLevelObjects() публичный статический Метод

public static InstantiateNibWithOwnerTopLevelObjects ( NSString resourceName, Id owner ) : bool
resourceName Monobjc.Foundation.NSString
owner Id
Результат bool
		public static bool InstantiateNibWithOwnerTopLevelObjects (NSString resourceName, Id owner)
		{
			if (resourceName == null) {
				throw new ArgumentNullException("resourceName");
			}
			if (owner == null) {
				throw new ArgumentNullException("owner");
			}
			return InstantiateNibWithOwnerTopLevelObjects (owner.GetType (), resourceName, owner);
		}
		

Same methods

NSNib::InstantiateNibWithOwnerTopLevelObjects ( Type type, NSString resourceName, Id owner ) : bool

Usage Example

Пример #1
0
        public static bool LoadNibResourceNamedOwner(this NSBundle bundle, Type type, NSString resourceName, Id owner)
        {
            bool result = false;
            Assembly assembly = type.Assembly;

            using (Stream stream = assembly.GetManifestResourceStream(resourceName))
            {
                if (stream != null)
                {
                    byte[] buffer = new byte[stream.Length];
                    stream.Read(buffer, 0, (int)stream.Length);
                    stream.Close();

                    String fileName = Path.GetTempFileName();
                    File.WriteAllBytes(fileName, buffer);

					NSNib nib = new NSNib(NSURL.URLWithString(fileName));
					NSArray topLevelObjects;
					result = nib.InstantiateNibWithOwnerTopLevelObjects(owner, out topLevelObjects);
					nib.Release();

                    File.Delete(fileName);
                }
            }

            return result;
        }
All Usage Examples Of Monobjc.AppKit.NSNib::InstantiateNibWithOwnerTopLevelObjects