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


C# FileInRevision.GetFileContents方法代码示例

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


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

示例1: Find2WayDifferences

		public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
		{
			var diffReports = new List<IChangeReport>(1);

			// The only relevant change to report is the version number.
			var childData = child.GetFileContents(repository);
			var splitData = SplitData(childData);
			var childModelNumber = Int32.Parse(splitData[1]);
			if (parent == null)
			{
				diffReports.Add(new FieldWorksModelVersionAdditionChangeReport(child, childModelNumber));
			}
			else
			{
				var parentData = parent.GetFileContents(repository);
				splitData = SplitData(parentData);
				var parentModelNumber = Int32.Parse(splitData[1]);
				if (parentModelNumber != childModelNumber)
					diffReports.Add(new FieldWorksModelVersionUpdatedReport(parent, child, parentModelNumber, childModelNumber));
				else
					throw new InvalidOperationException("The version number has downgraded");
			}

			return diffReports;
		}
开发者ID:gmartin7,项目名称:flexbridge,代码行数:25,代码来源:ModelVersionFileTypeHandlerStrategy.cs

示例2: GetDataFromRevision

		internal static Dictionary<string, byte[]> GetDataFromRevision(FileInRevision revision, HgRepository repository)
		{
			var doc = XDocument.Parse(revision.GetFileContents(repository));
			var data = doc.Root.Elements("layout")
				.ToDictionary(layoutElement =>
							  layoutElement.Attribute("class").Value + layoutElement.Attribute("type").Value + layoutElement.Attribute("name").Value,
							  layoutElement => SharedConstants.Utf8.GetBytes(layoutElement.ToString()));

			var layoutTypeElement = doc.Root.Element("layoutType");
			if (layoutTypeElement != null)
				data.Add("layoutType", SharedConstants.Utf8.GetBytes(doc.Root.Element("layoutType").ToString()));

			return data;
		}
开发者ID:gmartin7,项目名称:flexbridge,代码行数:14,代码来源:CustomLayoutDataCollectorMethod.cs

示例3: CreateFromFileInRevision

 public static Lift2WayDiffer CreateFromFileInRevision(IMergeStrategy mergeStrategy, FileInRevision parent, FileInRevision child, IMergeEventListener eventListener, HgRepository repository)
 {
     return new Lift2WayDiffer(mergeStrategy, parent.GetFileContents(repository), child.GetFileContents(repository), eventListener, parent, child);
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:4,代码来源:LiftDiffer.cs

示例4: Find2WayDifferences

 public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
 {
     yield return new TextEditChangeReport(parent, child, parent.GetFileContents(repository), child.GetFileContents(repository));
 }
开发者ID:sillsdev,项目名称:chack,代码行数:4,代码来源:TextFileTypeHandler.cs


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