/// <summary>
		/// CTOR.
		/// </summary>
		/// <exception cref="ArgumentNullException">Throws when args is null.</exception>
		/// <param name="args">ScanArgs. Cannot be null.</param>
		public ScanJob(ScanArgs args)
		{
			if(args==null)
				throw new ArgumentNullException("args");

			_args		= args;
			_scancount	= 0;
			_vircount	= 0;

			_agent = new ClamdStreamAgent(args.Host, args.Port, args.Verbose);
			_agent.ItemScanCompleted += new ScanCompletedEventHandler(_agent_ItemScanCompleted);
			_agent.VirusFound		 += new ScanCompletedEventHandler(_agent_VirusFound);
		}
Example #2
0
        /// <summary>
        /// CTOR.
        /// </summary>
        /// <exception cref="ArgumentNullException">Throws when args is null.</exception>
        /// <param name="args">ScanArgs. Cannot be null.</param>
        public ScanJob(ScanArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            _args      = args;
            _scancount = 0;
            _vircount  = 0;

            _agent = new ClamdStreamAgent(args.Host, args.Port, args.Verbose);
            _agent.ItemScanCompleted += new ScanCompletedEventHandler(_agent_ItemScanCompleted);
            _agent.VirusFound        += new ScanCompletedEventHandler(_agent_VirusFound);
        }
Example #3
0
        /// <summary>
        /// Writes the console client version and _agent version to the console standard out.
        /// </summary>
        /// <param name="agent">IVirusScanAgent instance to call Version upon.</param>
        public static void WriteVersion(IVirusScanAgent agent)
        {
            string title = null, version;

            Assembly assembly = Assembly.GetEntryAssembly();

            version = assembly.GetName().Version.ToString();
            object[] titles = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), true);
            if (titles.Length > 0)
            {
                title = ((AssemblyTitleAttribute)titles[0]).Title;
            }

            Console.WriteLine(string.Format(CultureInfo.CurrentCulture, ResourceManagers.Strings.GetString(STR_WRITE_VERSION), title, version));
            Console.WriteLine(agent.Version);
            Console.WriteLine();
        }
		/// <summary>
		/// Writes the console client version and _agent version to the console standard out.
		/// </summary>
		/// <param name="agent">IVirusScanAgent instance to call Version upon.</param>
		public static void WriteVersion(IVirusScanAgent agent)
		{
			string title=null, version;
		
			Assembly assembly = Assembly.GetEntryAssembly();
	
			version = assembly.GetName().Version.ToString();
			object[] titles = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute),true);
			if(titles.Length>0)
				title = ((AssemblyTitleAttribute)titles[0]).Title;

			Console.WriteLine( string.Format(CultureInfo.CurrentCulture, ResourceManagers.Strings.GetString( STR_WRITE_VERSION ), title, version) );
			Console.WriteLine( agent.Version );
			Console.WriteLine();
		}