Beispiel #1
0
		private void writeFile(CodeFile file)
		{
			if (shouldSkipFile(file))
				return;

			var text = CodeFormatter.Format(file.GetFileContents());
			var writeFile = true;
			if (File.Exists(file.FullPath))
			{
				var existingText = File.ReadAllText(file.FullPath);
				if (text == existingText)
				{
					Vs.Helper.Log.Add(LogEntry.Info("no changes {0}", file.PathToProject));
					writeFile = false;
				}
				else
				{
					checkOutFiles(file.FullPath);
				}
			}

			if (!writeFile)
				return;

			ProjectFacade.writeFileToFileSystem(file, text);

			if (Contains(file.PathToProject))
				return;
			Project.AddItem(file.VisualStudioItemTypeNode, file.PathToProject);
			filesToAddToSourceControl.Add(file.FullPath);
		}