• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FullPath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FullPath的典型用法代码示例。如果您正苦于以下问题:C# FullPath类的具体用法?C# FullPath怎么用?C# FullPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FullPath类属于命名空间,在下文中一共展示了FullPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FileWithSections

 public FileWithSections(IFileSystem fileSystem, FullPath filename)
 {
     _fileSystem = fileSystem;
       _filename = filename;
       _fileUpdateVolatileToken = new FileUpdateVolatileToken(_fileSystem, filename);
       _sections = new Lazy<Dictionary<string, List<string>>>(ReadFile);
 }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:7,代码来源:FileWithSections.cs


示例2: LoadProcesses

    public void LoadProcesses() {
      _processes.Clear();
      List<ChromiumProcess> chromes = new List<ChromiumProcess>();
      HashSet<int> chromePids = new HashSet<int>();
      foreach (Process p in Process.GetProcesses()) {
        // System.Diagnostics.Process uses a naive implementation that is unable to deal with many
        // types of processes (such as those already under a debugger, or those with a high
        // privilege level), so use NtProcess instead.
        NtProcess ntproc = new NtProcess(p.Id);
        if (!ntproc.IsValid)
          continue;

        FullPath processPath = new FullPath(ntproc.Win32ProcessImagePath);
        if (processPath.StartsWith(_installationData.InstallationPath)) {
          chromes.Add(new ChromiumProcess(ntproc, _installationData));
          chromePids.Add(p.Id);
        }
      }

      foreach (ChromiumProcess chrome in chromes) {
        // Only insert root processes at this level, child processes will be children of one of
        // these processes.
        if (!chromePids.Contains(chrome.ParentPid)) {
          ChromeProcessViewModel viewModel = new ChromeProcessViewModel(_root, chrome);
          viewModel.LoadProcesses(chromes.ToArray());
          _processes.Add(viewModel);
        }
      }
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:29,代码来源:InstalledBuildViewModel.cs


示例3: GetProjectFromRootPath

 public IProject GetProjectFromRootPath(FullPath projectRootPath)
 {
     var name = projectRootPath;
       lock (_lock) {
     return _knownProjectRootDirectories.Get(name);
       }
 }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:7,代码来源:ProjectFileDiscoveryProvider.cs


示例4: CreateEntries

    private void CreateEntries(DirectoryEntry searchResults) {
      if (!_enabled)
        return;

      using (new TimeElapsedLogger("Creating document tracking entries for search results")) {
        _searchResults.Clear();
        foreach (DirectoryEntry projectRoot in searchResults.Entries) {
          var rootPath = new FullPath(projectRoot.Name);
          foreach (FileEntry fileEntry in projectRoot.Entries) {
            var path = rootPath.Combine(new RelativePath(fileEntry.Name));
            var spans = fileEntry.Data as FilePositionsData;
            if (spans != null) {
              _searchResults[path] = spans;

              // If the document is open, create the tracking spans now.
              var document = _textDocumentTable.GetOpenDocument(path);
              if (document != null) {
                var entry = new DocumentChangeTrackingEntry(spans);
                _trackingEntries[path] = entry;
                entry.CreateTrackingSpans(document.TextBuffer);
              }
            }
          }
        }
      }
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:26,代码来源:SearchResultsDocumentChangeTracker.cs


示例5: GetPathChangeKind

 public PathChangeKind GetPathChangeKind(FullPath path) {
   PathChangeKind result;
   if (!_map.Value.TryGetValue(path, out result)) {
     result = PathChangeKind.None;
   }
   return result;
 }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:7,代码来源:FullPathChanges.cs


示例6: EnumerateParents

 private IEnumerable<FullPath> EnumerateParents(FullPath path)
 {
     var directory = path.Parent;
       for (var parent = directory; parent != default(FullPath); parent = parent.Parent) {
     yield return parent;
       }
 }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:7,代码来源:ChromiumDiscovery.cs


示例7: FetchRunningDocumentTable

    private bool FetchRunningDocumentTable() {
      var rdt = new RunningDocumentTable(_serviceProvider);
      foreach (var info in rdt) {
        // Get doc data
        if (!FullPath.IsValid(info.Moniker))
          continue;

        var path = new FullPath(info.Moniker);
        if (_openDocuments.ContainsKey(path))
          continue;

        // Get vs buffer
        IVsTextBuffer docData = null;
        try {
          docData = info.DocData as IVsTextBuffer;
        }
        catch (Exception e) {
          Logger.LogWarning(e, "Error getting IVsTextBuffer for document {0}, skipping document", path);
        }
        if (docData == null)
          continue;

        // Get ITextDocument
        var textBuffer = _vsEditorAdaptersFactoryService.GetDocumentBuffer(docData);
        if (textBuffer == null)
          continue;

        ITextDocument document;
        if (!_textDocumentFactoryService.TryGetTextDocument(textBuffer, out document))
          continue;

        _openDocuments[path] = document;
      }
      return true;
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:35,代码来源:TextDocumentTable.cs


示例8: FileWithSections

 public FileWithSections(IFileSystem fileSystem, FullPath filename) {
   _fileSystem = fileSystem;
   _filename = filename;
   _fileLines = new Lazy<IList<string>>(ReadFileLines);
   _hash = new Lazy<string>(ComputeHash);
   _sections = new Lazy<Dictionary<string, List<string>>>(ReadFile);
 }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:7,代码来源:FileWithSections.cs


示例9: ReadFile

        private FileContents ReadFile(FullPath fullName)
        {
            try {
            var fileInfo = new SlimFileInfo(fullName);
            const int trailingByteCount = 2;
            var block = NativeFile.ReadFileNulTerminated(fileInfo, trailingByteCount);
            var contentsByteCount = (int)block.ByteLength - trailingByteCount; // Padding added by ReadFileNulTerminated
            var kind = NativeMethods.Text_GetKind(block.Pointer, contentsByteCount);

            switch (kind) {
              case NativeMethods.TextKind.Ascii:
            return new AsciiFileContents(new FileContentsMemory(block, 0, contentsByteCount), fileInfo.LastWriteTimeUtc);

              case NativeMethods.TextKind.AsciiWithUtf8Bom:
            const int utf8BomSize = 3;
            return new AsciiFileContents(new FileContentsMemory(block, utf8BomSize, contentsByteCount - utf8BomSize), fileInfo.LastWriteTimeUtc);

              case NativeMethods.TextKind.Utf8WithBom:
            var utf16Block = Conversion.UTF8ToUnicode(block);
            block.Dispose();
            return new UTF16FileContents(new FileContentsMemory(utf16Block, 0, utf16Block.ByteLength), fileInfo.LastWriteTimeUtc);

              case NativeMethods.TextKind.Unknown:
              default:
            // TODO(rpaquay): Figure out a better way to detect encoding.
            //Logger.Log("Text Encoding of file \"{0}\" is not recognized.", fullName);
            return new AsciiFileContents(new FileContentsMemory(block, 0, contentsByteCount), fileInfo.LastWriteTimeUtc);
            //throw new NotImplementedException(string.Format("Text Encoding of file \"{0}\" is not recognized.", fullName));
            }
              }
              catch (Exception e) {
            Logger.LogException(e, "Error reading content of text file \"{0}\", skipping file.", fullName);
            return StringFileContents.Empty;
              }
        }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:35,代码来源:FileContentsFactory.cs


示例10: FindRootDirectory

    public DirectorySnapshot FindRootDirectory(FullPath rootPath) {
      var index = SortedArrayHelpers.BinarySearch(_snapshot.ProjectRoots, rootPath, ProjectRootComparer);
      if (index >= 0)
        return _snapshot.ProjectRoots[index].Directory;

      return null;
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:7,代码来源:FileSystemTreeSnapshotNameFactory.cs


示例11: CreateAbsoluteDirectoryName

    public DirectoryName CreateAbsoluteDirectoryName(FullPath rootPath) {
      var rootdirectory = FindRootDirectory(rootPath);
      if (rootdirectory != null)
        return rootdirectory.DirectoryName;

      return _previous.CreateAbsoluteDirectoryName(rootPath);
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:7,代码来源:FileSystemTreeSnapshotNameFactory.cs


示例12: AddDirectory

    private void AddDirectory(FullPath directory) {
      FileSystemWatcher watcher;
      lock (_watchersLock) {
        if (_pollingThread == null) {
          _pollingThread = new Thread(ThreadLoop) { IsBackground = true };
          _pollingThread.Start();
        }
        if (_watchers.TryGetValue(directory, out watcher))
          return;

        watcher = new FileSystemWatcher();
        _watchers.Add(directory, watcher);
      }

      Logger.LogInfo("Starting monitoring directory \"{0}\" for change notifications.", directory);
      watcher.Path = directory.Value;
      watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName;
      watcher.IncludeSubdirectories = true;
      watcher.InternalBufferSize = 50 * 1024; // 50KB sounds more reasonable than 8KB
      watcher.Changed += WatcherOnChanged;
      watcher.Created += WatcherOnCreated;
      watcher.Deleted += WatcherOnDeleted;
      watcher.Renamed += WatcherOnRenamed;
      watcher.Error += WatcherOnError;
      watcher.EnableRaisingEvents = true;
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:26,代码来源:DirectoryChangeWatcher.cs


示例13: GetProject

 public IProject GetProject(FullPath filename) {
   return _providers
     .Select(t => t.GetProjectFromAnyPath(filename))
     .Where(project => project != null)
     .OrderByDescending(p => p.RootPath.Value.Length)
     .FirstOrDefault();
 }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:7,代码来源:ProjectDiscovery.cs


示例14: Options

 public Options(FullPath fullPath)
 {
    
     Path = fullPath.RelativePath;
     Url = fullPath.Root.Url;
     ThumbnailsUrl = fullPath.Root.TmbUrl;
 }
开发者ID:hungud,项目名称:elFinder.Net,代码行数:7,代码来源:Options.cs


示例15: ApplyCodingStyle

    public bool ApplyCodingStyle(string filename) {
      var path = new FullPath(filename);
      var root = _chromiumDiscoveryProvider.GetEnlistmentRootFromFilename(path, x => x);
      if (root == default(FullPath))
        return false;

      return _applyCodingStyleResults.GetOrAdd(filename, (key) => ApplyCodingStyleWorker(root, key));
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:8,代码来源:ChromiumSourceFiles.cs


示例16: GetEnlistmentRoot

    public FullPath GetEnlistmentRoot(FullPath filename) {
      var directory = filename.Parent;
      if (!_fileSystem.DirectoryExists(directory))
        return default(FullPath);

      return EnumerateParents(filename)
        .FirstOrDefault(x => IsChromiumSourceDirectory(x, _chromiumEnlistmentFilePatterns));
    }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:8,代码来源:ChromiumDiscovery.cs


示例17: Project

 public Project(IConfigurationSectionProvider configurationSectionProvider, FullPath rootPath)
 {
     _rootPath = rootPath;
       _configurationToken = configurationSectionProvider.WhenUpdated();
       _directoryFilter = new DirectoryFilter(configurationSectionProvider);
       _fileFilter = new FileFilter(configurationSectionProvider);
       _searchableFilesFilter = new SearchableFilesFilter(configurationSectionProvider);
 }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:8,代码来源:Project.cs


示例18: IsChromiumSourceDirectory

 public static bool IsChromiumSourceDirectory(FullPath path, IPathPatternsFile chromiumEnlistmentPatterns)
 {
     // We need to ensure that all pattern lines are covered by at least one file/directory of |path|.
       IList<string> directories;
       IList<string> files;
       NativeFile.GetDirectoryEntries(path.Value, out directories, out files);
       return chromiumEnlistmentPatterns.GetPathMatcherLines()
     .All(item => MatchFileOrDirectory(item, directories, files));
 }
开发者ID:nick-chromium,项目名称:vs-chromium,代码行数:9,代码来源:ChromiumDiscovery.cs


示例19: PhpSourceFile

		public PhpSourceFile(FullPath root, FullPath fullPath)
		{
			root.EnsureNonEmpty("root");
			fullPath.EnsureNonEmpty("fullPath");

			this.fullPath = fullPath;
			this.relativePath = RelativePath.Empty;
			this.root = root;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:9,代码来源:PhpSourceFile.cs


示例20: ReadFileContents

 public FileContents ReadFileContents(FullPath path) {
   try {
     var fileInfo = _fileSystem.GetFileInfoSnapshot(path);
     return ReadFileContentsWorker(fileInfo);
   }
   catch (Exception e) {
     Logger.LogWarning(e, "Error reading content of text file \"{0}\", skipping file.", path);
     return BinaryFileContents.Empty;
   }
 }
开发者ID:mbbill,项目名称:vs-chromium,代码行数:10,代码来源:FileContentsFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Func类代码示例发布时间:2022-05-24
下一篇:
C# FullComment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap