当前位置: 首页>>代码示例>>C#>>正文


C# Bjd.Kernel类代码示例

本文整理汇总了C#中Bjd.Kernel的典型用法代码示例。如果您正苦于以下问题:C# Kernel类的具体用法?C# Kernel怎么用?C# Kernel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Kernel类属于Bjd命名空间,在下文中一共展示了Kernel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BeforeClass

 public static void BeforeClass()
 {
     //設定ファイルの退避と上書き
     _op = new TmpOption("WebServerTest","WebServerTest.ini");
     var _kernel = new Kernel();
     option = _kernel.ListOption.Get("Web-localhost:88");
 }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:7,代码来源:EnvTest.cs

示例2: Option

        public Option(Kernel kernel, string path, string nameTag)
            : base(kernel.IsJp(), path, nameTag)
        {
            var key = "useServer";
            Add(new OneVal(key, false, Crlf.Nextline,new CtrlCheckBox(Lang.Value(key))));

            var pageList = new List<OnePage>();
            key = "Basic";
            pageList.Add(Page1(key, Lang.Value(key), kernel));
            key = "ESMTP";
            pageList.Add(Page2(key, Lang.Value(key), kernel));
            key = "Relay";
            pageList.Add(Page3(key, Lang.Value(key), kernel));
            key = "Queue";
            pageList.Add(Page4(key, Lang.Value(key), kernel));
            key = "Host";
            pageList.Add(Page5(key, Lang.Value(key), kernel));
            key = "Heda";
            pageList.Add(Page6(key, Lang.Value(key), kernel));
            key = "Aliases";
            pageList.Add(Page7(key, Lang.Value(key), kernel));
            key = "AutoReception";
            pageList.Add(Page8(key, Lang.Value(key), kernel));
            pageList.Add(PageAcl());
            Add(new OneVal("tab", null, Crlf.Nextline, new CtrlTabPage("tabPage", pageList)));

            Read(kernel.IniDb); // レジストリからの読み込み
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:28,代码来源:Option.cs

示例3: Dlg

        public Dlg(Kernel kernel, string nameTag, Object obj, string caption)
            : base(kernel, nameTag, obj, caption)
        {
            //リストビューの作成
            _listView = new ListView{
                Dock = DockStyle.Fill,
                FullRowSelect = true,
                HideSelection = false,
                View = System.Windows.Forms.View.Details
            };
            _listView.Columns.Add("Status");
            _listView.Columns.Add("Ip");
            _listView.Columns.Add("MacAppointment");
            _listView.Columns.Add("Mac");
            _listView.Columns.Add("Date");
            _listView.Columns[0].Width = 120;
            _listView.Columns[1].Width = 120;
            _listView.Columns[2].Width = 100;
            _listView.Columns[3].Width = 250;
            _listView.Columns[4].Width = 350;
            //メインコントロールの追加
            AddControl(_listView);

            ToolStripMenuItem menuFile = AddMenu(null, null, kernel.IsJp() ? "ファイル(&F)" : "&File", Keys.None);
            Add2(menuFile, FuncRefresh, kernel.IsJp() ? "最新の状態に更新する(&R)" : "&Refresh", Keys.F5);
            AddMenu(menuFile, null, "-", Keys.None);
            AddMenu(menuFile, FuncClose, kernel.IsJp() ? "閉じる(&C)" : "&Close", Keys.None);

            FuncRefresh();//最新の状態に更新する
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:30,代码来源:Dlg.cs

示例4: SetUp

        public void SetUp()
        {
            const string mlName = "1ban";
            var domainList = new List<string>{ "example.com" };
            //var tsDir = new TsDir();
            var kernel = new Kernel();
            var logger = new Logger();
            var manageDir = TestUtil.GetTmpDir("TestDir");

            _tsMailSave = new TsMailSave();//MailSaveのモックオブジェクト

            var memberList = new Dat(new[] { CtrlType.TextBox, CtrlType.TextBox, CtrlType.CheckBox, CtrlType.CheckBox, CtrlType.CheckBox, CtrlType.TextBox });
            memberList.Add(true, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "USER1", "[email protected]", false, true, true, "")); //一般・読者・投稿
            memberList.Add(true, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "USER2", "[email protected]", false, true, false, ""));//一般・読者・×
            memberList.Add(true, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "USER3", "[email protected]", false, false, true, ""));//一般・×・投稿
            memberList.Add(true, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "ADMIN", "[email protected]", true, false, true, "123"));//管理者・×・投稿
            memberList.Add(true, string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", "ADMIN2", "[email protected]", true, true, true, "456"));//管理者・読者・投稿
            var docs = (from object o in Enum.GetValues(typeof(MlDocKind)) select "").ToList();
            const int maxSummary = 10;
            const int getMax = 10;
            const bool autoRegistration = true;
            const int titleKind = 5;
            var mlOption = new MlOption(maxSummary, getMax, autoRegistration, titleKind, docs, manageDir, memberList);

            _ml = new Ml(kernel, logger, _tsMailSave, mlOption, mlName, domainList);
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:26,代码来源:MlSummaryTest.cs

示例5: MlUsers

 //通常のコンストラクタ
 public MlUsers(Kernel kernel, Logger logger, OneOption op)
 {
     this.kernel = kernel;
     this.logger = logger;
     this.op = op;
     Init((Dat)op.GetValue("memberList"));//初期化
 }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:8,代码来源:MlUsers.cs

示例6: Page1

        private OnePage Page1(string name, string title, Kernel kernel)
        {
            var onePage = new OnePage(name, title);

            onePage.Add(CreateServerOption(ProtocolKind.Udp, 53, 10, 30)); //サーバ基本設定

            var key = "rootCache";
            onePage.Add(new OneVal(key, "named.ca", Crlf.Nextline, new CtrlTextBox(Lang.Value(key), 30)));
            key = "useRD";
            onePage.Add(new OneVal(key, true, Crlf.Nextline, new CtrlCheckBox(Lang.Value(key))));

            var list = new ListVal();
            key = "soaMail";
            list.Add(new OneVal(key, "postmaster", Crlf.Nextline, new CtrlTextBox(Lang.Value(key), 30)));
            key = "soaSerial";
            list.Add(new OneVal(key, 1, Crlf.Nextline, new CtrlInt(Lang.Value(key), 5)));
            key = "soaRefresh";
            list.Add(new OneVal(key, 3600, Crlf.Contonie, new CtrlInt(Lang.Value(key), 5)));
            key = "soaRetry";
            list.Add(new OneVal(key, 300, Crlf.Nextline, new CtrlInt(Lang.Value(key), 5)));
            key = "soaExpire";
            list.Add(new OneVal(key, 360000, Crlf.Contonie, new CtrlInt(Lang.Value(key), 5)));
            key = "soaMinimum";
            list.Add(new OneVal(key, 3600, Crlf.Nextline, new CtrlInt(Lang.Value(key), 5)));
            key = "GroupSoa";
            onePage.Add(new OneVal(key, null, Crlf.Nextline, new CtrlGroup(Lang.Value(key), list)));

            return onePage;
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:29,代码来源:Option.cs

示例7: Ml

        public Ml(Kernel kernel, Logger logger, MailSave mailSave, MlOption mlOption,string mlName,List<string>domainList)
        {
            Status = false;

            _kernel = kernel;
            _logger = logger;
            _mlName = mlName;
            //_mlOption = mlOption;

            _mlMailDb = new MlMailDb(logger, mlOption.ManageDir, mlName);
            if (!_mlMailDb.Status) {
                return;//初期化中断
            }

            _mlAddr = new MlAddr(mlName, domainList);
            _mlUserList = new MlUserList(mlOption.MemberList);
            _mlSender = new MlSender(mailSave, logger);
            var mlSubject = new MlSubject(mlOption.TitleKind, mlName);
            _mlDevivery = new MlDelivery(mailSave, logger,_mlUserList, _mlAddr, _mlMailDb, mlSubject, mlOption.Docs,mlOption.MaxGet);
            _mlCreator2 = new MlCreator(_mlAddr,mlOption.Docs);
            _autoRegistration = mlOption.AutoRegistration;
            const double effectiveMsec = 120 * 1000; //有効時間120秒
            _mlSubscribeDb = new MlSubscribeDb(mlOption.ManageDir, mlName, effectiveMsec);//confirm文字列データベース
            if (!_mlMailDb.Status) {
                return;//初期化中断
            }
            Status = true;//ステータス
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:28,代码来源:Ml.cs

示例8: Cache

        public Cache(Kernel kernel, Logger logger, Conf conf)
            : base(logger)
        {
            this.logger = logger;
            //_oneOption = oneOption;
            _conf = conf;
            _useCache = (bool)conf.Get("useCache");

            if (!_useCache)
                return;

            _expires = (int)conf.Get("expires");
            _maxSize = (int)conf.Get("maxSize");
            _diskSize = (int)conf.Get("diskSize");
            _memorySize = (int)conf.Get("memorySize");

            //�L���b�V���Ώۃ��X�g
            _cacheTargetHost = new CacheTarget((Dat)conf.Get("cacheHost"), (int)conf.Get("enableHost"));
            _cacheTargetExt = new CacheTarget((Dat)conf.Get("cacheExt"), (int)conf.Get("enableExt"));

            //�f�B�X�N�L���b�V��
            var cacheDir = (string)conf.Get("cacheDir");//�L���b�V����ۑ�����f�B���N�g��
            if (cacheDir == "" || !Directory.Exists(cacheDir)) {
                logger.Set(LogKind.Error, null, 15, string.Format("dir = {0}", cacheDir));
                _diskSize = 0;
            }
            if (_diskSize != 0) {
                _diskCache = new DiskCache(cacheDir, logger);
            }

            if (_memorySize != 0)//�������L���b�V��
                _memoryCache = new MemoryCache(logger);
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:33,代码来源:Cache.cs

示例9: DataThread

        //サーバ側若しくはクライアント側どちらかのSockTcpは、Listen状態で生成が終わっている
        //そして、その接続の待ち受け開始は、このクラスの中で行われる
        //接続が完了した後、反対側のサーバ(Ip,port)へ、コネクトする
        public DataThread(Kernel kernel, Logger logger, int clientPort, int serverPort, Ip bindAddr, Ip ip, int port, int timeout)
        {
            _kernel = kernel;
            _logger = logger;

            _timeout = timeout;

            _ip = ip;
            _port = port;

            _sock[CS.Client] = null;
            _sock[CS.Server] = null;

            if (serverPort != 0) { //サーバ側がListen状態の場合 PASV
                _sock[CS.Server] = SockServer.CreateConnection(kernel,bindAddr,serverPort,null,this);
                if (_sock[CS.Server] == null)
                    return;
            } else if (clientPort != 0) { //クライアント側がListen状態の場合 PORT
                _sock[CS.Client] = SockServer.CreateConnection(kernel,bindAddr, clientPort, null,this);
                if (_sock[CS.Client] == null)
                    return;
            }
            //パイプスレッドの生成
            _t = new Thread(Pipe) {
                IsBackground = true
            };
            _t.Start();
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:31,代码来源:DataThread.cs

示例10: Server

        WebDavDb _webDavDb; //WevDAVのDethプロパテイを管理するクラス

        #endregion Fields

        #region Constructors

        //通常のServerThreadの子クラスと違い、オプションはリストで受け取る
        //親クラスは、そのリストの0番目のオブジェクトで初期化する
        //コンストラクタ
        public Server(Kernel kernel,Conf conf,OneBind oneBind)
            : base(kernel, conf,oneBind)
        {
            //同一ポートで待ち受けている仮想サーバのオプションをすべてリストする
            WebOptionList = new List<OneOption>();
            foreach (var o in kernel.ListOption) {
                if (o.NameTag.IndexOf("Web-") == 0) {
                    if((int)o.GetValue("port") == (int)Conf.Get("port")){
                        WebOptionList.Add(o);
                    }
                }
            }
            //WebDAVリストの初期化
            foreach (var o in WebOptionList) {
                if(o.UseServer) {
                    _webDavDbList.Add(new WebDavDb(kernel,NameTag));
                }
            }
            _webDavDb = _webDavDbList[0];

            //Ver5.1.2「Cgiパス」「WebDAVパス」「別名」のオプションの修正
            var tagList = new List<string> { "cgiPath", "webDavPath", "aliaseList" };
            foreach(string tag in tagList) {
                var dat = (Dat)Conf.Get(tag);
                var changed = false;
                foreach(var o in dat) {
                    var str = o.StrList[0];
                    if(str[0] != '/') {
                        changed = true;
                        str = '/' + str;
                    }
                    if(str.Length > 1 && str[str.Length - 1] != '/') {
                        changed = true;
                        str = str + '/';
                    }
                    o.StrList[0] = str;
                }
                if(changed)
                    Conf.Set(tag, dat);
            }

            //当初、opBase及びloggerは、weboptionList[0]で暫定的に初期化される
            var protocol = (int)Conf.Get("protocol");
            if (protocol==1) {//HTTPS
                var op = kernel.ListOption.Get("VirtualHost");
                var privateKeyPassword = (string)op.GetValue("privateKeyPassword");
                var certificate = (string)op.GetValue("certificate");

                //サーバ用SSLの初期化
                ssl = new Ssl(Logger, certificate, privateKeyPassword);
            }

            var useAutoAcl = (bool)Conf.Get("useAutoAcl");// ACL拒否リストへ自動追加する
            if (useAutoAcl) {
                const int max = 1; //発生回数
                const int sec = 120; // 対象期間(秒)
                _attackDb = new AttackDb(sec, max);
            }
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:68,代码来源:Server.cs

示例11: TsMlDb

 public TsMlDb(Kernel kernel, string tmpDir)
     : base(kernel, null, tmpDir)
 {
     this.tmpDir = tmpDir;
     for (int i = 0; i < 300; i++) {
         Clear(i);
     }
 }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:8,代码来源:TsMlDb.cs

示例12: SetUp

 public void SetUp()
 {
     //設定ファイルの退避と上書き
     _op = new TmpOption("BJDTest","MailBoxTest.ini");
     var kernel = new Kernel();
     var oneOption = new OptionMailBox(kernel,"");
     _conf = new Conf(oneOption);
 }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:8,代码来源:MailBoxTest2.cs

示例13: PasswordDlg

        public PasswordDlg(Kernel kernel)
        {
            InitializeComponent();
            _kernel = kernel;

            label1.Text = (kernel.IsJp()) ? "�p�X���[�h����͂��Ă�������" : "Login password";
            buttonCancel.Text = (kernel.IsJp()) ? "�L�����Z��" : "Cancel";
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:8,代码来源:PasswordDlg.cs

示例14: DateTime

        DateTime _dt = new DateTime(0); //最終処理時間

        #endregion Fields

        #region Constructors

        public OneFetchJob(Kernel kernel, MailSave mailSave,String domainName,OneFetch oneFetch, int timeout, int sizeLimit)
        {
            _kernel = kernel;
            _mailSave = mailSave;
            _domainName = domainName;
            _oneFetch = oneFetch;
            _timeout = timeout;
            _sizeLimit = sizeLimit;
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:15,代码来源:OneFetchJob.cs

示例15: OptionMl

        public OptionMl(Kernel kernel, string path, string nameTag)
            : base(kernel.IsJp(), path, nameTag)
        {
            var pageList = new List<OnePage>();
            var key = "Mailing List";
            pageList.Add(Page1(key, Lang.Value(key), kernel));
            Add(new OneVal("tab", null, Crlf.Nextline, new CtrlTabPage("tabPage", pageList)));

            Read(kernel.IniDb); // レジストリからの読み込み
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:10,代码来源:OptionMl.cs


注:本文中的Bjd.Kernel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。