Beispiel #1
0
        protected override void LoadChildren()
        {
            LoadedAssembly.LoadResult loadResult = LoadedAssembly.GetLoadResultAsync().Result;
            if (!loadResult.IsOK)
            {
                // if we crashed on loading, then we don't have any children
                return;
            }

            try
            {
                if (loadResult is LoadedAssembly.LoadResult.Successful success)
                {
                    LoadChildrenForPEFile(success.PEFile);
                }
                else if (loadResult is LoadedAssembly.LoadResult.PackageFallback package)
                {
                    this.Children.AddRange(PackageFolderTreeNode.LoadChildrenForFolder(package.Package.RootFolder));
                }
                else
                {
                    throw new InvalidOperationException("Unexpected LoadResult type: " + loadResult?.GetType().FullName);
                }
            }
            catch (Exception ex)
            {
                App.UnhandledException(ex);
            }
        }
Beispiel #2
0
		protected override void LoadChildren()
		{
			LoadedAssembly.LoadResult loadResult;
			try
			{
				loadResult = LoadedAssembly.GetLoadResultAsync().Result;
			}
			catch
			{
				// if we crashed on loading, then we don't have any children
				return;
			}
			try
			{
				if (loadResult.PEFile != null)
				{
					LoadChildrenForPEFile(loadResult.PEFile);
				}
				else if (loadResult.Package != null)
				{
					var package = loadResult.Package;
					this.Children.AddRange(PackageFolderTreeNode.LoadChildrenForFolder(package.RootFolder));
				}
			}
			catch (Exception ex)
			{
				App.UnhandledException(ex);
			}
		}