/// <summary> /// Create a new interchange format processor. /// </summary> /// <param name="fileInInfo">Source code to be filed in.</param> /// <param name="sourceCodeReader">Text reader containing the source code.</param> /// <param name="fileInProcessor">File-in processor that will be notified about each filed-in element.</param> /// <param name="versionServicesMap">Map between interchange versions and interchange-version-services.</param> public InterchangeFormatProcessor(FileInInformation fileInInfo, TextReader sourceCodeReader, IInterchangeFileInProcessor fileInProcessor, IDictionary <string, InterchangeVersionService> versionServicesMap) { if (fileInInfo == null) { throw new ArgumentNullException("fileInInfo"); } if (sourceCodeReader == null) { throw new ArgumentNullException("sourceCodeReader"); } if (fileInProcessor == null) { throw new ArgumentNullException("fileInProcessor"); } if (versionServicesMap == null) { throw new ArgumentNullException("versionServicesMap"); } this.FileInInformation = fileInInfo; this.ErrorSink = fileInInfo.ErrorSink; this.Reader = sourceCodeReader; this.FileInProcessor = fileInProcessor; this.VersionServicesMap = versionServicesMap; this.SourcePosition = SourceLocation.Invalid; }
public void Install(FileInInformation fileIn) { if (fileIn == null) { throw new ArgumentNullException(); } this.Install(new FileInInformation[] { fileIn }); }
public InterchangeInstallerContext Read(FileInInformation fileIn) { if (fileIn == null) { throw new ArgumentNullException(); } return(this.Read(new FileInInformation[] { fileIn })); }
public void AddInstallError(string installErrorMessage, ISourceReference sourceReference) { if (sourceReference == null) { throw new ArgumentNullException("sourceReference"); } FileInInformation sourceObject = sourceReference.Service.SourceObject as FileInInformation; #if DEBUG System.Diagnostics.Debug.Assert(sourceObject != null); #endif if (sourceObject.ErrorSink == null) { return; } sourceObject.ErrorSink.AddInstallError(sourceReference.StartPosition, sourceReference.StopPosition, installErrorMessage); }