当前位置: 首页>>代码示例>>C#>>正文


C# IPackageFile.GetStream方法代码示例

本文整理汇总了C#中IPackageFile.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# IPackageFile.GetStream方法的具体用法?C# IPackageFile.GetStream怎么用?C# IPackageFile.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackageFile的用法示例。


在下文中一共展示了IPackageFile.GetStream方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckFile

        private static string CheckFile(string url, IPackageFile file)
        {
            var binary = new BinaryStoreManager();
            var symbol = new SymbolStoreManager();

            var name = Path.ChangeExtension(Path.GetFileName(file.Path), "pdb");
            var compressedName = name.Substring(0, name.Length - 1) + '_';

            string hash;

            using (var stream = file.GetStream())
                hash = binary.ReadPdbHash(stream);

            byte[] buffer;

            try
            {
                using (var client = new WebClient())
                    buffer = client.DownloadData(string.Format("{0}/{1}/{2}/{3}", url, name, hash, compressedName));
            }
            catch (WebException exception)
            {
                return ((HttpWebResponse)exception.Response).StatusCode.ToString();
            }

            //using (var stream = new MemoryStream(buffer))
            //    if (symbol.ReadHash(stream) != hash)
            //        return "MISMATCHED";

            return "FOUND";
        }
开发者ID:xuanvu,项目名称:SymbolSource.Community,代码行数:31,代码来源:SymbolServerChecker.cs

示例2: Process

 internal static string Process(IPackageFile file, IPropertyProvider propertyProvider)
 {
     using (var stream = file.GetStream())
     {
         return Process(stream, propertyProvider, throwIfNotFound: false);
     }
 }
开发者ID:Newtopian,项目名称:nuget,代码行数:7,代码来源:Preprocessor.cs

示例3: CopyPackageFileToPath

 private async Task CopyPackageFileToPath(string installPath, IPackageFile packageFile)
 {
     using (var fileStream = File.Create(Path.Combine(installPath, Path.GetFileName(packageFile.Path))))
     {
         await packageFile.GetStream().CopyToAsync(fileStream);
     }
 }
开发者ID:ibebbs,项目名称:OneCog.SemanticLogging.Service.Utility,代码行数:7,代码来源:Installer.cs

示例4: GetXml

 private static XElement GetXml(IPackageFile file, IProjectSystem projectSystem)
 {
     using (Stream stream = file.GetStream())
     {
         var content = Preprocessor.Process(file, projectSystem);
         return XElement.Parse(content);
     }
 }
开发者ID:monoman,项目名称:NugetCracker,代码行数:8,代码来源:XmlTransfomer.cs

示例5: VerifySigned

 private static bool VerifySigned(IPackageFile packageFile)
 {
     bool result;
     using (Stream stream = packageFile.GetStream())
     {
         System.IO.StreamReader streamReader = new System.IO.StreamReader(stream);
         string text = streamReader.ReadToEnd();
         result = (text.IndexOf("# SIG # Begin signature block", StringComparison.OrdinalIgnoreCase) > -1 && text.IndexOf("# SIG # End signature block", StringComparison.OrdinalIgnoreCase) > -1);
     }
     return result;
 }
开发者ID:modulexcite,项目名称:DnxTools,代码行数:11,代码来源:PowerShellScriptIsSignedRule.cs

示例6: GetConfigurationFileAsBytes

        private static byte[] GetConfigurationFileAsBytes(IPackageFile agentConfigurationFile)
        {
            var agentConfigurationFileStream = agentConfigurationFile.GetStream();

            byte[] configBytes;

            using (var memoryStream = new MemoryStream())
            {
                agentConfigurationFileStream.CopyTo(memoryStream);
                configBytes = memoryStream.ToArray();
                memoryStream.Close();
            }
            return configBytes;
        }
开发者ID:repne,项目名称:DeployD,代码行数:14,代码来源:AgentConfigurationDownloader.cs

示例7: SaveAssemblyFile

 private void SaveAssemblyFile(string installPath, IPackageFile file)
 {
     var targetPath = installPath.AppendPath(file.Path);
     Directory.CreateDirectory(targetPath.ParentDirectory());
     using (Stream outputStream = File.Create(targetPath)){
         file.GetStream().CopyTo(outputStream);
     }
 }
开发者ID:amughni,项目名称:BlogSamples,代码行数:8,代码来源:PackageInstaller.cs

示例8: UpdateFile

 protected virtual void UpdateFile(string exePath, IPackageFile file)
 {
     using (Stream fromStream = file.GetStream(), toStream = File.Create(exePath))
     {
         fromStream.CopyTo(toStream);
     }
 }
开发者ID:xero-github,项目名称:Nuget,代码行数:7,代码来源:UpdateCommand.cs

示例9: CopyFileToLocation

        void CopyFileToLocation(FileSystemInfoBase target, IPackageFile x)
        {
            var targetPath = Path.Combine(target.FullName, x.EffectivePath);

            var fi = fileSystem.GetFileInfo(targetPath);
            if (fi.Exists) fi.Delete();

            var dir = fileSystem.GetDirectoryInfo(Path.GetDirectoryName(targetPath));
            if (!dir.Exists) dir.Create();

            using (var inf = x.GetStream())
            using (var of = fi.Open(FileMode.CreateNew, FileAccess.Write)) {
                log.Debug("Writing {0} to app directory", targetPath);
                inf.CopyTo(of);
            }
        }
开发者ID:KyleGobel,项目名称:Shimmer,代码行数:16,代码来源:UpdateManager.cs

示例10: InstallFile

 /// <summary>
 /// Installs a new package file
 /// </summary>
 /// <param name="package">
 /// The package being installed
 /// </param>
 /// <param name="file">
 /// The file to install
 /// </param>
 private void InstallFile(IPackage package, IPackageFile file)
 {
     // map the package file to its deployment location (or suppress it)
      var path = GetFullPath(file);
      if (path == null)
     Log.Trace("Skipping file {0}", file);
      else
      {
     Log.Trace("Extracting file {0} to {1}", file, path);
     // extract the package file and stamp it with the package date
     ExtractFile(file.GetStream(), path);
     File.SetLastWriteTimeUtc(
        path,
        (package.Published ?? DateTimeOffset.UtcNow).UtcDateTime
     );
      }
 }
开发者ID:modulexcite,项目名称:NLogEx,代码行数:26,代码来源:DeploymentManager.cs

示例11: ContentEquals

 internal static bool ContentEquals(IPackageFile targetFile, string fullPath)
 {
     bool isEqual;
     using (var dependencyFileStream = targetFile.GetStream())
     using (var fileContentsStream = File.OpenRead(fullPath))
     {
         isEqual = dependencyFileStream.ContentEquals(fileContentsStream);
     }
     return isEqual;
 }
开发者ID:atheken,项目名称:nuget,代码行数:10,代码来源:ProjectFactory.cs

示例12: ExtractToSymbols

        private string ExtractToSymbols(IPackage package, IPackageFile symbolFile)
        {
            var path = symbolsPathResolver.GetSymbolsPath(package, symbolFile);

            EnsureDirectory(path);

            using (var file = File.Open(path, FileMode.OpenOrCreate))
                symbolFile.GetStream().CopyTo(file);

            return path;
        }
开发者ID:juankakode,项目名称:nupeek,代码行数:11,代码来源:SymbolService.cs

示例13: UpdateFile

 private static void UpdateFile(string newFilePath, IPackageFile file)
 {
     EnsureDirectory(newFilePath);
     using (Stream fromStream = file.GetStream(), toStream = File.Create(newFilePath))
     {
         fromStream.CopyTo(toStream);
     }
 }
开发者ID:Powerino73,项目名称:paradox,代码行数:8,代码来源:LauncherApp.cs

示例14: UpdateFile

        private bool UpdateFile(string exePath, IPackageFile file)
        {
            using (Stream fromStream = file.GetStream())
            {
                if (fromStream == null)
                {
                    return false;
                }

                using (Stream toStream = this.filesystemAccessor.GetWriteStream(exePath))
                {
                    if (toStream == null)
                    {
                        return false;
                    }

                    fromStream.CopyTo(toStream);

                    return true;
                }
            }
        }
开发者ID:andreaskoch,项目名称:NuDeploy,代码行数:22,代码来源:SelfUpdateService.cs

示例15: UnpackFile

 private void UnpackFile(string fileOut, IPackageFile file)
 {
     var stream = File.OpenWrite(fileOut);
     file.GetStream().CopyTo(stream);
 }
开发者ID:CloudMorph,项目名称:cloudmorph-fabric,代码行数:5,代码来源:LibraryService.cs


注:本文中的IPackageFile.GetStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。