Пример #1
0
        public static void Ctor_String()
        {
            string message   = "Created EntryPointNotFoundException";
            var    exception = new EntryPointNotFoundException(message);

            Assert.Equal(message, exception.Message);
            Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
        }
Пример #2
0
        public static void Ctor_Empty()
        {
            var exception = new EntryPointNotFoundException();

            Assert.NotNull(exception);
            Assert.NotEmpty(exception.Message);
            Assert.NotNull(exception.ToString());
            Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
        }
Пример #3
0
        public static string GetMinimalSupportedVersion(EntryPointNotFoundException ex)
        {
            MinimalLibVlcVersion minVersion = (MinimalLibVlcVersion)Attribute.GetCustomAttribute(ex.TargetSite, typeof(MinimalLibVlcVersion));

            if (minVersion != null)
            {
                return(minVersion.MinimalVersion);
            }

            return(string.Empty);
        }
Пример #4
0
        public static void Ctor_String_Exception()
        {
            string message        = "Created EntryPointNotFoundException";
            var    innerException = new Exception("Created inner exception");
            var    exception      = new EntryPointNotFoundException(message, innerException);

            Assert.Equal(message, exception.Message);
            Assert.Equal("Created inner exception", exception.GetBaseException().Message);
            Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
            Assert.Equal(innerException, exception.InnerException);
            Assert.Equal(innerException.HResult, exception.InnerException.HResult);
        }
        public static void HandleEntryPointNotFound(EntryPointNotFoundException ex)
        {
            if (EntryPointsNotFound)
            {
                return;
            }

            EntryPointsNotFound = true;
            Phoenix.Debug.Trace.Phoenix.TraceData(System.Diagnostics.TraceEventType.Critical, TypeExtensions.kNone,
                                                  "Failed to find a EditorUtils method",
                                                  ex);
        }
Пример #6
0
        public void MyTestMethod()
        {
            EntryPointNotFoundException entryPointNotFoundException = new EntryPointNotFoundException();

            StringBuilder builder = new StringBuilder();

            builder.ToString().Split(",".ToCharArray());

            var          fileName = "";
            Stream       stream   = new FileStream(fileName, FileMode.Open);
            StreamReader reader   = new StreamReader(stream);
            EntryPointNotFoundException exception = new EntryPointNotFoundException(fileName);


            Stream inputStream = File.OpenRead(fileName);
        }
Пример #7
0
        public virtual IPromise <T> Load()
        {
            if (loadPromise != null)
            {
                return(loadPromise);
            }

            loadPromise = Promise <T> .Create();

            if (HasValue == false)
            {
                loadPromise.Reject(new EntryPointNotFoundException("Link doesn't have any value"));
                return(loadPromise);
            }

#if USE_ADDRESSABLES
            if (loaded || AssetCache.Loaded(Path))
            {
                loadPromise.Resolve(Value);
                return(loadPromise);
            }

            if (IsGenerated())
            {
                cachedAsset = App.Core.Storage.Load <T>(this);
                Initialize(cachedAsset);
                loaded = cachedAsset != null;
                loadPromise.Resolve(cachedAsset);
                return(loadPromise);
            }

            loadHandle = Addressables.LoadAssetAsync <T>(Path);

            loadHandle.Value.Completed += a =>
            {
                if (Loaded == false)
                {
                    if (a.Status == AsyncOperationStatus.Succeeded)
                    {
                        cachedAsset = a.Result;
                        Initialize(cachedAsset);
                        loaded = cachedAsset != null;
                        loadPromise.Resolve(a.Result);
                    }
                    else
                    {
                        var e = new EntryPointNotFoundException($"Cannot load value from link: {Path}");
                        UnityEngine.Debug.LogException(e);
                        loadPromise.Reject(e);
                    }
                }
            };
#else
            if (loaded)
            {
                loadPromise.Resolve(Value);
                return(loadPromise);
            }

            if (IsGenerated())
            {
                cachedAsset = App.Core.Storage.Load <T>(this);
                Initialize(cachedAsset);
                loaded = cachedAsset != null;
                loadPromise.Resolve(cachedAsset);
                return(loadPromise);
            }

            loadHandle = Resources.LoadAsync <T>(Path);

            loadHandle.completed += r =>
            {
                if (Loaded == false && loadHandle.isDone && loadHandle.asset)
                {
                    cachedAsset = loadHandle.asset as T;
                    Initialize(cachedAsset);
                    loaded = cachedAsset != null;
                    loadPromise.Resolve(cachedAsset);
                }
                else
                {
                    loadPromise.Reject(new EntryPointNotFoundException($"Cannot load resource of type {typeof(T)} at path {Path}"));
                }
            };
#endif

            return(loadPromise);
        }