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

C# IFileReference类代码示例

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

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



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

示例1: GetSyncAction

        public SyncAction GetSyncAction(string targetName, int syncPointId, IFileReference currentFileVersion, IFileReference newFileVersion)
        {
            if (m_FileReferenceComparer.Equals(currentFileVersion, newFileVersion))
            {
                return null;
            }

            if (currentFileVersion != null)
            {
                if (newFileVersion == null)
                {
                    return SyncAction.CreateRemoveFileSyncAction(targetName, SyncActionState.Queued, syncPointId, currentFileVersion);
                }
                else
                {
                    return SyncAction.CreateReplaceFileSyncAction(targetName, SyncActionState.Queued, syncPointId, currentFileVersion, newFileVersion);
                }
            }
            else
            {
                if (newFileVersion != null)
                {
                    return SyncAction.CreateAddFileSyncAction(targetName, SyncActionState.Queued, syncPointId, newFileVersion);
                }
                else
                {
                    throw new InvalidOperationException();
                }
            }
        }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:30,代码来源:SyncActionFactory.cs


示例2: CsvTableDataLoader

 /// <summary>
 ///     Initializes a new instance of the <see cref="CsvTableDataLoader" /> class.
 /// </summary>
 /// <param name="file"> The file reference to the CSV file. </param>
 /// <param name="table"> The metadata of the requested table. </param>
 public CsvTableDataLoader(IFileReference file, TableDescription table) 
     : base(table)
 {
     // TODO: Constructor injection
     this.valueConverter = new CsvValueConverter();
     this.file = file;
 }
开发者ID:DeadlyEmbrace,项目名称:effort,代码行数:12,代码来源:CsvTableDataLoader.cs


示例3: Format

        public Sample Format(IFileReference file, string languageClass = null)
        {
            var snippet = new Sample(file.Path){
                Language = languageClass ?? "lang-" + Path.GetExtension(file.Path).Replace(".", "")
            };

            file.ReadContents(stream =>
            {
                using (var reader = new StreamReader(stream))
                {
                    int lineNumber = 0;

                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        lineNumber++;

                        if (line.Contains(Samples.SAMPLE) || line.Contains(Samples.END))
                        {
                            snippet.Append(string.Empty, lineNumber);
                        }
                        else
                        {
                            snippet.Append(line, lineNumber);
                        }
                    }
                }
            });



            return snippet;
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:33,代码来源:CodeFormatter.cs


示例4: FileByteTarget

 /// <summary>
 /// Initializes an instance of <see cref="FileByteTarget"/>.
 /// </summary>
 /// <param name="file"></param>
 public FileByteTarget(IFileReference file)
 {
     _file = file;
     _stream = _file.OpenWrite();
     _endian = Endian.LocalMachine;
     _writer = EndianBinaryWriter.Create(_stream, _endian);
     _lock = new object();
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:12,代码来源:FileByteTarget.cs


示例5: Delete

 /// <summary>
 /// Delete the specified temporary file.
 /// </summary>
 /// <param name="file"></param>
 public static void Delete(IFileReference file)
 {
     if (!file.IsTempFile)
     {
         throw new DicomIoException("Only temporary files should be removed through this operation.");
     }
     Instance.DeletePrivate(file);
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:12,代码来源:TemporaryFileRemover.cs


示例6: TryResolveConflict

        bool TryResolveConflict(ChangeGraphBuilder changeGraphBuilder, IMultiFileSystemHistoryService historyService, ConflictInfo conflict, out IFileReference resolved)
        {
            var graph = changeGraphBuilder.GetChangeGraphs(GetDiff(historyService, conflict)).Single();

            var sinks = graph.GetSinks().ToArray();

            return TryResolveConflict(sinks, out resolved);
        }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:8,代码来源:ConflictResolverBase.cs


示例7: Change

        public Change(ChangeType type, IFileReference fromFile, IFileReference toFile)
        {
            AssertIsValidChange(type, fromFile, toFile);
            AssertPathsAreEqual(fromFile, toFile);

            Type = type;
            FromVersion = fromFile;
            ToVersion = toFile;
        }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:9,代码来源:Change.cs


示例8: ManagedResource

        /// <summary>
        /// <paramref name="streamProvider"/> streamProvider callers will dispose result after use.
        /// <paramref name="streamProvider"/> and <paramref name="fileReference"/> are mutually exclusive.
        /// </summary>
        internal ManagedResource(string name, bool isPublic, Func<Stream> streamProvider, IFileReference fileReference, uint offset)
        {
            Debug.Assert(streamProvider == null ^ fileReference == null);

            _streamProvider = streamProvider;
            _name = name;
            _fileReference = fileReference;
            _offset = offset;
            _isPublic = isPublic;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:14,代码来源:ManagedResource.cs


示例9: AssertIsValidAddedChange

 void AssertIsValidAddedChange(IFileReference fromFile, IFileReference toFile)
 {
     if (fromFile != null)
     {
         throw new ArgumentException($"{nameof(fromFile)} must be null for ChangeType {ChangeType.Added}", nameof(fromFile));
     }
     if (toFile == null)
     {
         throw new ArgumentNullException(nameof(toFile));
     }
 }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:11,代码来源:Change.cs


示例10: FileByteSource

        public FileByteSource(IFileReference file)
        {
            _file = file;
            _stream = _file.OpenRead();
            _endian = Endian.LocalMachine;
            _reader = EndianBinaryReader.Create(_stream, _endian);
            _mark = 0;

            _largeObjectSize = 64 * 1024;

            _milestones = new Stack<long>();
            _lock = new object();
        }
开发者ID:GMZ,项目名称:fo-dicom,代码行数:13,代码来源:FileByteSource.cs


示例11: SyncAction

 public SyncAction(ChangeType type, IFileReference fromVersion, IFileReference toVersion,  Guid id, string target, SyncActionState state, int syncPointId)
     : base(type, fromVersion, toVersion)
 {
     if (syncPointId <= 0)
     {
         throw new ArgumentOutOfRangeException(nameof(syncPointId), "Id must be a positive integer");
     }
     
     this.Target = target;
     this.Id = id;
     this.State = state;
     this.SyncPointId = syncPointId;
 }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:13,代码来源:SyncAction.cs


示例12: TryResolveConflict

        protected override bool TryResolveConflict(IEnumerable<IFileReference> versions, out IFileReference resolvedVersion)
        {
            var containsMultipleItems = versions.Skip(1).Any();

            if (containsMultipleItems)
            {
                resolvedVersion = null;
                return false;
            }
            else
            {
                resolvedVersion = versions.Single();
                return true;
            }
        }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:15,代码来源:SimpleConflictResolver.cs


示例13: AssertIsValidChange

 void AssertIsValidChange(ChangeType type, IFileReference fromFile, IFileReference toFile)
 {
     switch (type)
     {
         case ChangeType.Added:
             AssertIsValidAddedChange(fromFile, toFile);
             break;
         case ChangeType.Deleted:
             AssertIsValidDeletedChange(fromFile, toFile);
             break;
         case ChangeType.Modified:
             AssertIsValidModifiedChange(fromFile, toFile);
             break;
         default:
             throw new ArgumentOutOfRangeException(nameof(type), type, null);
     }
 }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:17,代码来源:Change.cs


示例14: Equals

        public bool Equals(IFileReference other)
        {
            if (other == null)
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }


            return StringComparer.InvariantCultureIgnoreCase.Equals(this.Path, other.Path) &&
                   LastWriteTime == other.LastWriteTime &&
                   Length == other.Length;            
        }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:17,代码来源:FileReference.cs


示例15: Visit

 /// <summary>
 /// Performs some computation with the given file reference.
 /// </summary>
 public void Visit(IFileReference fileReference)
 {
     if (fileReference.FileName.Value.IndexOfAny(badPosixNameChars) > 0)
       this.ReportError(MetadataError.NotPosixAssemblyName, fileReference, fileReference.FileName.Value);
     if (fileReference.FileName.UniqueKeyIgnoringCase == this.validator.currentModule.ModuleName.UniqueKeyIgnoringCase)
       this.ReportError(MetadataError.SelfReference, fileReference);
 }
开发者ID:rasiths,项目名称:visual-profiler,代码行数:10,代码来源:Validator.cs


示例16: RecordFileReference

 protected override void RecordFileReference(IFileReference fileReference)
 {
     this.metadataWriter.GetFileRefIndex(fileReference);
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:4,代码来源:ReferenceIndexer.cs


示例17: Visit

 /// <summary>
 /// Performs some computation with the given file reference.
 /// </summary>
 public virtual void Visit(IFileReference fileReference)
 {
 }
开发者ID:rasiths,项目名称:visual-profiler,代码行数:6,代码来源:Visitors.cs


示例18: TraverseChildren

 /// <summary>
 /// Traverses the children of the file reference.
 /// </summary>
 public virtual void TraverseChildren(IFileReference fileReference)
 {
     Contract.Requires(fileReference != null);
       //no children
 }
开发者ID:rasiths,项目名称:visual-profiler,代码行数:8,代码来源:Visitors.cs


示例19: Traverse

 /// <summary>
 /// Traverses the file reference.
 /// </summary>
 public void Traverse(IFileReference fileReference)
 {
     Contract.Requires(fileReference != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(fileReference);
       if (this.stopTraversal) return;
       this.TraverseChildren(fileReference);
       if (this.stopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(fileReference);
 }
开发者ID:rasiths,项目名称:visual-profiler,代码行数:12,代码来源:Visitors.cs


示例20: CreateReplaceFileSyncAction

 public static SyncAction CreateReplaceFileSyncAction(string target, SyncActionState state, int syncPointId, IFileReference oldVersion, IFileReference newVersion)
 {
     return new SyncAction(ChangeType.Modified, oldVersion, newVersion, Guid.NewGuid(), target, state, syncPointId);
 }
开发者ID:ap0llo,项目名称:SyncTool,代码行数:4,代码来源:SyncAction.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IFileService类代码示例发布时间:2022-05-24
下一篇:
C# IFileReader类代码示例发布时间: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