private static PackageWrapper TryGetWrapperFromPackage(Package package)
        {
            try
            {
                return(PackageWrapper.GetWrapperFromPackage(package));
            }
            catch (Exception e)
            {
                Log.Error(e.Message, typeof(PackageManagerWrapper));
            }

            return(null);
        }
Exemplo n.º 2
0
        public IEnumerable <IPackage> FindPackagesForCurrentUser()
        {
            List <PackageWrapper> packages = new List <PackageWrapper>();
            var user = WindowsIdentity.GetCurrent().User;

            if (user != null)
            {
                var id = user.Value;
                var m  = _packageManager.FindPackagesForUser(id);
                foreach (Package p in m)
                {
                    packages.Add(PackageWrapper.GetWrapperFromPackage(p));
                }
            }

            return(packages);
        }
Exemplo n.º 3
0
        public IEnumerable <IPackage> FindPackagesForCurrentUser()
        {
            List <PackageWrapper> packages = new List <PackageWrapper>();
            var user = WindowsIdentity.GetCurrent().User;

            if (user != null)
            {
                var id = user.Value;
                var m  = _packageManager.FindPackagesForUser(id);
                foreach (Package p in m)
                {
                    try
                    {
                        packages.Add(PackageWrapper.GetWrapperFromPackage(p));
                    }
                    catch (Exception e)
                    {
                        Log.Error(nameof(PackageManagerWrapper), e.Message, nameof(FindPackagesForCurrentUser));
                    }
                }
            }

            return(packages);
        }