public bool LoadFromFile(System.String file) { Dispose(); var io = CEngine.Instance.FileManager.OpenFileForRead(file, EFileType.Xnd, false); if (io == null) { return(false); } mNode = new XndNode(); if (false == mNode.Load(io)) { return(false); } return(true); }
public static async System.Threading.Tasks.Task <XndHolder> LoadXND(System.String file, Thread.Async.EAsyncTarget threadTarget = Thread.Async.EAsyncTarget.AsyncIO) { return(await CEngine.Instance.EventPoster.Post(() => { var io = CEngine.Instance.FileManager.OpenFileForRead(file, EFileType.Xnd, false); if (io == null) { return null; } XndNode node = new XndNode(); if (false == node.Load(io)) { return null; } XndHolder holder = new XndHolder(); holder.mNode = node; return holder; }, threadTarget)); }
public static XndHolder SyncLoadXND(System.String file) { var io = CEngine.Instance.FileManager.OpenFileForRead(file, EFileType.Xnd, false); if (io == null) { return(null); } XndNode node = new XndNode(); if (false == node.Load(io)) { return(null); } XndHolder holder = new XndHolder(); holder.mNode = node; return(holder); }
public static async System.Threading.Tasks.Task <XndHolder> LoadXND(System.String file) { return(await CEngine.Instance.EventPoster.Post(() => { var io = CEngine.Instance.FileManager.OpenFileForRead(file, EFileType.Xnd, false); if (io == null) { return null; } XndNode node = new XndNode(GetEmptyNativePointer()); if (false == node.Load(io)) { return null; } XndHolder holder = new XndHolder(); holder.mNode = node; return holder; })); }