コード例 #1
0
ファイル: Rule.TwoEstimate.cs プロジェクト: boriskos/DCF
 public TwoEstimate(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier, category)
 {
     m_ruleExecuter += new RuleExecuterDelegate(TwoEstimateMethod);
     m_ruleInitializer += new RuleExecuterDelegate(internalInit);
     Id = TwoEstimateStr;
 }
コード例 #2
0
ファイル: Rule.cs プロジェクト: boriskos/DCF
 public Rule(RuleExecuterDelegate executer, RuleExecuterDelegate initializer, IRuleSupplier ruleSupplier)
     : this(ruleSupplier)
 {
     if (executer == null) throw new ArgumentNullException("executer");
     m_ruleExecuter += executer;
     if (initializer != null) m_ruleInitializer += initializer;
 }
コード例 #3
0
ファイル: Rule.RepairKeySample.cs プロジェクト: boriskos/DCF
 public RepairKeySample(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier, category)
 {
     m_ruleExecuter += new RuleExecuterDelegate(SampleWithJoin);
     m_ruleInitializer += new RuleExecuterDelegate(internalInit);
     Id = "RepairKeySample";
     PrerequisiteRules = new List<DCF.Lib.Rule>();
 }
コード例 #4
0
ファイル: Rule.Majority.cs プロジェクト: boriskos/DCF
 public Majority(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier, category)
 {
     m_ruleInitializer += new RuleExecuterDelegate(internalInit);
     m_ruleExecuter += new RuleExecuterDelegate(MajorityFunc);
     Id = "MajorityRule";
     PrerequisiteRules = new List<Rule>(0);
 }
コード例 #5
0
ファイル: Rule.Cosine.cs プロジェクト: boriskos/DCF
 public Cosine(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier, category)
 {
     m_ruleExecuter += new RuleExecuterDelegate(CosineMethod);
     m_ruleInitializer += new RuleExecuterDelegate(internalInit);
     Id = CosineStr;
     InvolvedTables = new List<string>(new string[] { TableConstants.UserScores });
     AffectedTables = new List<string>();
 }
コード例 #6
0
        private void CreateInboundSPScript(IInboundRule[] ruleList)
        {
            string interfaceName  = Program.DeviceMgt.DeviceDirInfor.Header.Name;
            string fnameInstall   = Application.StartupPath + "\\" + RuleScript.InstallSP.FileName;
            string fnameUninstall = Application.StartupPath + "\\" + RuleScript.UninstallSP.FileName;

            Program.Log.Write("Creating install storage procedure script...");
            //using (StreamWriter sw = File.CreateText(fnameInstall))     // 20110706 OSQL & SQLMgmtStudio only support ASCII and UNICODE
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(GWDataDB.GetUseDataBaseSql());
                foreach (IInboundRule rule in ruleList)
                {
                    string strSql = RuleControl.GetInboundSP(interfaceName, rule);
                    sb.AppendLine(strSql);

                    IRuleSupplier supplier = rule as IRuleSupplier;
                    if (supplier != null)
                    {
                        string strSqlSupplied = supplier.GetInstallDBScript();
                        if (strSqlSupplied != null)
                        {
                            sb.AppendLine(strSqlSupplied);
                        }
                    }
                }
                //sw.Write(sb.ToString());
                File.WriteAllText(fnameInstall, sb.ToString(), Encoding.Unicode);
            }
            Program.Log.Write("Create install storage procedure script succeeded. " + fnameInstall);

            Program.Log.Write("Creating uninstall storage procedure script...");
            using (StreamWriter sw = File.CreateText(fnameUninstall))
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(GWDataDB.GetUseDataBaseSql());
                foreach (IInboundRule rule in ruleList)
                {
                    string strSql = RuleControl.GetInboundSPUninstall(interfaceName, rule);
                    sb.AppendLine(strSql);

                    IRuleSupplier supplier = rule as IRuleSupplier;
                    if (supplier != null)
                    {
                        string strSqlSupplied = supplier.GetUninstallDBScript();
                        if (strSqlSupplied != null)
                        {
                            sb.AppendLine(strSqlSupplied);
                        }
                    }
                }
                sw.Write(sb.ToString());
            }
            Program.Log.Write("Create uninstall storage procedure script succeeded. " + fnameUninstall);
        }
コード例 #7
0
 public MultipleAnswersSample(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier)
 {
     m_ruleExecuter += new RuleExecuterDelegate(SampleWithJoin);
     m_ruleInitializer += new RuleExecuterDelegate(internalInit);
     Id = "MultipleAnswersSample";
     InvolvedTables = new List<string>();
     AffectedTables = new List<string>();
     PrerequisiteRules = new List<DCF.Lib.Rule>();
     Category = category;
 }
コード例 #8
0
ファイル: Rule.cs プロジェクト: boriskos/DCF
 public Rule(IRuleSupplier ruleSupplier)
 {
     RuleType = RuleTypeEnum.System;
     Persistent = true;
     Id = Guid.NewGuid().ToString();
     Probability = 1;
     InvolvedTables = null;
     AffectedTables = null;
     PrerequisiteRules = null;
     Precedence = PresedenceEnum.None;
     PrecedencePriority = 0;
     RuleSupplier = ruleSupplier;
 }
コード例 #9
0
        public DanielConvergence(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier)
            : base(sqlUtils, ruleSupplier)
        {
            this.AffectedTables = new List<string>();
            this.Id = "DanielConvergence";
            this.InvolvedTables = new List<string>() { TableConstants.UserScores };
            this.PrerequisiteRules = new List<DCF.Lib.Rule>();
            this.RuleType = RuleTypeEnum.System;

            this.m_ruleExecuter += new RuleExecuterDelegate(CosineConverged_m_ruleExecuter);
            this.m_ruleInitializer += new RuleExecuterDelegate(CosineConverged_m_ruleInitializer);

            // initialize the threshold
            m_ConvergenceThreshold = CleaningConfiguration.Instance.ConversionDelta;
            // initialize convergence count - number of good samples in a row that need to be good in order to decide converence
            m_ConvergenceSamplesCount = CleaningConfiguration.Instance.ConversionSamplesCount;
        }
コード例 #10
0
ファイル: DcfRule.cs プロジェクト: boriskos/DCF
 public DcfRule(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier)
 {
     Category = category;
 }
コード例 #11
0
 public SingleIterationSingleAnswersRule(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier, string category)
     : base(sqlUtils, ruleSupplier, category)
 {
 }
コード例 #12
0
ファイル: XmlMySqlRule.cs プロジェクト: boriskos/DCF
 public XmlMySqlRule(MySqlUtils utils, IRuleSupplier ruleSupplier)
     : base(utils, ruleSupplier)
 {
     m_ruleExecuter += new RuleExecuterDelegate(XmlMySqlRuleExecuter);
     m_ruleInitializer += new RuleExecuterDelegate(XmlMySqlRuleInitializer);
 }
コード例 #13
0
ファイル: RuleTestMaxIteration.cs プロジェクト: boriskos/DCF
 public RuleTestMaxIteration(IRuleSupplier ruleSupplier)
     : base(ruleSupplier)
 {
     m_ruleExecuter += new RuleExecuterDelegate(RuleTestMaxIteration_m_ruleExecuter);
     this.Id = "RuleTestMaxIteration";
 }
コード例 #14
0
ファイル: CleansingManager.cs プロジェクト: boriskos/DCF
 public CleansingManager(IRuleSupplier ruleSupplier)
 {
     m_ruleSupplier = ruleSupplier;
 }
コード例 #15
0
ファイル: MySqlRule.cs プロジェクト: boriskos/DCF
 protected MySqlRule(MySqlUtils sqlUtils, IRuleSupplier ruleSupplier)
     : base(ruleSupplier)
 {
     SqlUtils = sqlUtils;
 }