Versions/VersionChecker.cs

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.IO;
using ComLib.Application;
using ComLib.Arguments;

namespace ComLib.VersionCheck
{
    public class VersionChecker : App
    {
        #region Private data
        private VersionContext _ctx;
        private DataTable _errors;
        private IDictionary<string, Func<VersionDefItem, BoolMessageItem<VersionDefItem>>> _handlerMap;
        private Action<BoolMessageItem<VersionDefItem>> _notifyCallback;
        private BoolMessageItem _checkResult;
        #endregion


        /// <summary>
        /// Create using arguments, version definition, config settings.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        /// <param name="ctx">Version Definition context</param>
        /// <param name="checkResultHandler">Callback</param>
        public VersionChecker(Action<BoolMessageItem<VersionDefItem>> checkResultHandler)
        {
            _errors = new DataTable();
            _handlerMap = new Dictionary<string, Func<VersionDefItem, BoolMessageItem<VersionDefItem>>>();            
            _notifyCallback = checkResultHandler;
        }


        /// <summary>
        /// Check the result.
        /// </summary>
        public BoolMessageItem Result { get { return _checkResult; } }


        /// <summary>
        /// Get the list of arguments that are supported.
        /// Type sojara.commodities.exe --help to display all the options.
        /// </summary>
        /// <returns></returns>
        public override List<ArgAttribute> OptionsSupported
        {
            get
            {
                List<ArgAttribute> options = new List<ArgAttribute>()
                {           
                    new ArgAttribute("name",    "Name representing this check", typeof(string), true, "", "ComJane_1.1.3, LimMds_1.3"),
                    new ArgAttribute("definition", "Path to xml definition file", typeof(string), true, "", @"CommoditiesJane_1.1.3.xml"),
                    new ArgAttribute("email",    "The person/group to send email to.", typeof(string), false, "",  "kishore.reddy@credit-suisse.com"),
                    new ArgAttribute("filter",    "List of file extensions to include", typeof(string), false, "xml,dll", "xml,dll,config,exe"),
                    new ArgAttribute("pause",   false, "Pause sojara for debugging", typeof(bool), false, false, false, true, "true|false")                    
后面还有 250 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。