Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
            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;
                }));
            }