/////////////////////////////////////////////////////////////////////////////
        public static void AddFilesToProject( InputFile srcFile, IEnumerable<string> resultFiles, IExtSvcProvider service )
        {
            // ******
            var allPossibleFiles = GetPossibleFileNames( srcFile, resultFiles );
            var filesThatExist = DiscoverGeneratedFiles( srcFile, resultFiles );
            var filesThatDontExist = allPossibleFiles.Except( filesThatExist );

            // ******
            service.AddFilesToProject( filesThatExist );
            service.RemoveFilesFromProject( filesThatDontExist );

            //// ******
            //var sb = new StringBuilder { };
            //
            //sb.Append( "Files that are in, or have just been added to project:\r\n" );
            //foreach( var name in filesThatExist ) {
            //	sb.AppendFormat( "  {0}\r\n", name );
            //}
            //
            //sb.Append( "Files that have been removed from the project:\r\n" );
            //foreach( var name in filesThatDontExist ) {
            //	sb.AppendFormat( "  {0}\r\n", name );
            //}
            //
            //// ******
            //return sb.ToString();
        }
Пример #2
0
 /////////////////////////////////////////////////////////////////////////////
 public Replace( IExtSvcProvider reporter, string basePath, ERCommand erCmd )
 {
     this.reporter = reporter;
     this.basePath = basePath;
     //this.erCmd = erCmd;
     this.cmdLineArgs = erCmd.CmdLine;
 }
Пример #3
0
		/////////////////////////////////////////////////////////////////////////////

		public ERules( string startPath, IExtSvcProvider service )
		{
			this.service = service;
			//this.Report = report;
			Initialize( startPath );
		}
Пример #4
0
		/////////////////////////////////////////////////////////////////////////////

		public void AssureData( IExtSvcProvider reporter, string fileName )
		{
			Id = Id?.Trim().ToLower() ?? string.Empty;
			OutputExtension = OutputExtension.AssureLeadingDot();
			FilePatternRx = FilePatternRx?.Trim() ?? string.Empty;
			RunNext = RunNext?.Trim() ?? string.Empty;
			if( null == Commands ) {
				Commands = new List<ERCommand> { };
			}
			else {
				Commands.ForEach( erCmd => erCmd.AssureData( reporter, fileName ) );
			}
		}
Пример #5
0
		/////////////////////////////////////////////////////////////////////////////

		public void AssureData( IExtSvcProvider service, string fileName )
		{
			ExecutableName = ExecutableName?.Trim() ?? string.Empty;
			SaveExtension = SaveExtension.AssureLeadingDot();
			if( null == CmdLine ) {
				CmdLine = new List<string> { };
			}


			//
			// Action, ActionEnum
			//
			ActionEnum ae;
			if( Enum.TryParse<ActionEnum>( Action, true, out ae ) ) {
				ActionEnum = ae;
			}
			else {
				service.SendWarning( fileName, $"\"{Action ?? ""}\" is not a valid action name, using \"Default\"", -1, -1 );
			}
		}
Пример #6
0
		/////////////////////////////////////////////////////////////////////////////

		public RunOne( InputFile inputFile, IExtSvcProvider service )
		{
			this.input = inputFile;
			this.service = service;
		}