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


C# FullPath类代码示例

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


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


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