コード例 #1
0
ファイル: SoftwareIdentity.cs プロジェクト: vairam-svs/oneget
        public override bool YieldResult(PsRequest r) {
            if (r == null) {
                throw new ArgumentNullException("r");
            }

            return r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null;
        }
コード例 #2
0
        public override bool YieldResult(PsRequest r)
        {
            if (r == null)
            {
                throw new ArgumentNullException("r");
            }

            return(r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null);
        }
コード例 #3
0
        public override bool YieldResult(PsRequest r)
        {
            if (r == null)
            {
                throw new ArgumentNullException("r");
            }

            // if we get an xml swidtag string, use that
            if (!string.IsNullOrWhiteSpace(_xmlSwidTag))
            {
                return(r.YieldSoftwareIdentityXml(_xmlSwidTag, _commitImmediately) != null);
            }

            return(r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldTagId(r) && YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null);
        }
コード例 #4
0
        public override bool YieldResult(PsRequest r)
        {
            if (r == null)
            {
                throw new ArgumentNullException("r");
            }

            // if we get an xml swidtag string, use that
            if (!string.IsNullOrWhiteSpace(_xmlSwidTag))
            {
                return(r.YieldSoftwareIdentityXml(_xmlSwidTag, _commitImmediately) != null);
            }

            bool result = r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldTagId(r) && YieldXmlLang(r) &&
                          YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null;

            // check whether we have destination
            if (!string.IsNullOrWhiteSpace(_destinationPath))
            {
                var payload = r.AddPayload();

                // could not add the payload, return false
                if (string.IsNullOrWhiteSpace(payload))
                {
                    return(false);
                }

                if (r.AddDirectory(payload, System.IO.Path.GetFileName(_destinationPath), System.IO.Path.GetDirectoryName(_destinationPath), null, true) == null)
                {
                    // cannot add directory
                    return(false);
                }
            }

            return(result);
        }
コード例 #5
0
ファイル: SoftwareIdentity.cs プロジェクト: qbikez/oneget
        public override bool YieldResult(PsRequest r)
        {
            if (r == null) {
                throw new ArgumentNullException("r");
            }

            // if we get an xml swidtag string, use that
            if (!string.IsNullOrWhiteSpace(_xmlSwidTag))
            {
                return r.YieldSoftwareIdentityXml(_xmlSwidTag, _commitImmediately) != null;
            }

            return r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldTagId(r) && YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null;
        }
コード例 #6
0
ファイル: SoftwareIdentity.cs プロジェクト: dfinke/powershell
        public override bool YieldResult(PsRequest r) {
            if (r == null) {
                throw new ArgumentNullException("r");
            }

            // if we get an xml swidtag string, use that
            if (!string.IsNullOrWhiteSpace(_xmlSwidTag))
            {
                return r.YieldSoftwareIdentityXml(_xmlSwidTag, _commitImmediately) != null;
            }

            bool result = r.YieldSoftwareIdentity(FastPackageReference, Name, Version, VersionScheme, Summary, Source, SearchKey, FullPath, Filename) != null && YieldTagId(r) && YieldXmlLang(r)
                && YieldDetails(r) && YieldEntities(r) && YieldLinks(r) && YieldDependencies(r) && r.AddMetadata(FastPackageReference, "FromTrustedSource", FromTrustedSource.ToString()) != null;

            // check whether we have destination
            if (!string.IsNullOrWhiteSpace(_destinationPath))
            {
                var payload = r.AddPayload();

                // could not add the payload, return false
                if (string.IsNullOrWhiteSpace(payload))
                {
                    return false;
                }

                if (r.AddDirectory(payload, System.IO.Path.GetFileName(_destinationPath), System.IO.Path.GetDirectoryName(_destinationPath), null, true) == null)
                {
                    // cannot add directory
                    return false;
                }
            }

            return result;
        }