public LogicRulePreChain(int pri, ILogicRule mr, ISettingDelegate[] reqs)
 {
     this.d = reqs;
     this.c = pri;
     this.a = mr;
     this.b = new MyList <ILogicRule>(100);
 }
Example #2
0
        Type LogicRuleObjectType(ILogicRule logicRule)
        {
            var typesInfo = _module.Application.TypesInfo;
            var type      = _modelLogics.Where(logicWrapper => logicWrapper.RuleType.IsInstanceOfType(logicRule)).Select(wrapper => wrapper.RuleType).First();

            return(typesInfo.FindTypeInfo <LogicRule>().Descendants.Single(info => !info.Type.IsAbstract && type.IsAssignableFrom(info.Type)).Type);
        }
 public LogicRulePreChain(int pri, ILogicRule mr, ISettingDelegate[] reqs, params ILogicRule[] pr)
 {
     this.d = reqs;
     this.c = pri;
     this.a = mr;
     this.b = new MyList <ILogicRule>(100);
     foreach (ILogicRule rule in pr)
     {
         this.b.Add(rule);
     }
 }
Example #4
0
 public static void a(ILogicRule A_0)
 {
     if (A_0 != null)
     {
         dm.b("VTank", "Macro Action", A_0.FriendlyName);
     }
     else
     {
         dm.b("VTank", "Macro Action", "[None]");
     }
 }
Example #5
0
 public bool AddLogicRuleAfterSentinel(ILogicRule lr, string sentmarker)
 {
     for (int i = 0; i < this.l.Count; i++)
     {
         LogicRuleSentinel sentinel = this.l[i] as LogicRuleSentinel;
         if ((sentinel != null) && (sentinel.Marker == sentmarker))
         {
             this.l.Insert(i + 1, lr);
             return(true);
         }
     }
     return(false);
 }
Example #6
0
 protected LogicRule(ILogicRule logicRule) {
     ExecutionContextGroup=logicRule.ExecutionContextGroup;
     Description=logicRule.Description;
     FrameTemplateContext = logicRule.FrameTemplateContext;
     ID = logicRule.Id;
     Index = logicRule.Index;
     IsRootView = logicRule.IsRootView;
     Nesting = logicRule.Nesting;
     TypeInfo = logicRule.TypeInfo;
     View = logicRule.View;
     ViewType = logicRule.ViewType;
     ViewContextGroup = logicRule.ViewContextGroup;
     FrameTemplateContextGroup=logicRule.FrameTemplateContextGroup;
 }
        protected LogicRulePermissionRequest(string operation,ILogicRule logicRule) : base(operation) {
            Description = logicRule.Description;
            ExecutionContextGroup = logicRule.ExecutionContextGroup;
            FrameTemplateContext = logicRule.FrameTemplateContext;
            FrameTemplateContextGroup = logicRule.FrameTemplateContextGroup;
            ID = logicRule.Id;
            Index = logicRule.Index;
            IsRootView = logicRule.IsRootView;
            Nesting = logicRule.Nesting;
            ((ILogicRule)this).View = logicRule.View;
            ViewContextGroup = logicRule.ViewContextGroup;
            ViewEditMode = logicRule.ViewEditMode;
            ViewType = logicRule.ViewType;

        }
Example #8
0
 protected LogicRulePermissionRequest(string operation, ILogicRule logicRule) : base(operation)
 {
     Description               = logicRule.Description;
     ExecutionContextGroup     = logicRule.ExecutionContextGroup;
     FrameTemplateContext      = logicRule.FrameTemplateContext;
     FrameTemplateContextGroup = logicRule.FrameTemplateContextGroup;
     ID         = logicRule.Id;
     Index      = logicRule.Index;
     IsRootView = logicRule.IsRootView;
     Nesting    = logicRule.Nesting;
     ((ILogicRule)this).View = logicRule.View;
     ViewContextGroup        = logicRule.ViewContextGroup;
     ViewEditMode            = logicRule.ViewEditMode;
     ViewType = logicRule.ViewType;
 }
Example #9
0
 protected LogicRule(ILogicRule logicRule)
 {
     ExecutionContextGroup = logicRule.ExecutionContextGroup;
     Description           = logicRule.Description;
     FrameTemplateContext  = logicRule.FrameTemplateContext;
     ID                        = logicRule.Id;
     Index                     = logicRule.Index;
     IsRootView                = logicRule.IsRootView;
     Nesting                   = logicRule.Nesting;
     TypeInfo                  = logicRule.TypeInfo;
     View                      = logicRule.View;
     ViewType                  = logicRule.ViewType;
     ViewEditMode              = logicRule.ViewEditMode;
     ViewContextGroup          = logicRule.ViewContextGroup;
     FrameTemplateContextGroup = logicRule.FrameTemplateContextGroup;
 }
 public void Dispose()
 {
     if (!this.e)
     {
         this.e = true;
         GC.SuppressFinalize(this);
         if (this.a != null)
         {
             this.a.Dispose();
             this.a = null;
         }
         foreach (ILogicRule rule in this.b)
         {
             rule.Dispose();
         }
         this.b.Clear();
     }
 }
Example #11
0
 public static ITypeInfo Get_TypeInfo(ILogicRule modelNode)
 {
     return(((IModelLogicRule)modelNode).ModelClass.TypeInfo);
 }
Example #12
0
 public static string Get_ExecutionContextGroup(ILogicRule modelNode)
 {
     return(DefaultExecutionContextGroup);
 }
Example #13
0
 protected LogicRule(ILogicRule logicRule){
     _logicRule = logicRule;
 }
Example #14
0
 public static string Get_ExecutionContextGroup(ILogicRule modelNode)
 {
     return(LogicDefaultGroupContextNodeUpdater.Default);
 }
Example #15
0
 public static ITypeInfo Get_TypeInfo(ILogicRule modelNode) {
     return ((IModelLogicRule)modelNode).ModelClass.TypeInfo;
 }
Example #16
0
 public void AddLogicRule_MacroDisabled(int pPos, ILogicRule lr)
 {
     this.m.Insert(pPos, lr);
 }
Example #17
0
 public void AddLogicRule_MacroDisabled(ILogicRule lr)
 {
     this.m.Add(lr);
 }
Example #18
0
 public void AddLogicRule(int pPos, ILogicRule lr)
 {
     this.l.Insert(pPos, lr);
 }
Example #19
0
 public void AddLogicRule(ILogicRule lr)
 {
     this.l.Add(lr);
 }
 public static string Get_ExecutionContextGroup(ILogicRule modelNode) {
     return LogicDefaultGroupContextNodeUpdater<IModelLogic,IModelNode>.Default;
 }
Example #21
0
 Type LogicRuleObjectType(ILogicRule logicRule) {
     var typesInfo = _module.Application.TypesInfo;
     var type = _modelLogics.Where(logicWrapper => logicWrapper.RuleType.IsInstanceOfType(logicRule)).Select(wrapper => wrapper.RuleType).First();
     return typesInfo.FindTypeInfo<LogicRule>().Descendants.Single(info => !info.Type.IsAbstract&&type.IsAssignableFrom(info.Type)).Type;
 }
Example #22
0
        private void a(MyList <ILogicRule> A_0, MyList <ILogicRule> A_1)
        {
            try
            {
                if (!PluginCore.cq.n.k)
                {
                    fj.b("!!!! Evaluate Meta Rules");
                    if (PluginCore.cq.n.b && er.j("EnableMeta"))
                    {
                        [email protected]();
                        a2.e();
                    }
                    fj.a("!!!! Evaluate Meta Rules", 20.0);
                }
                if (A_1 != null)
                {
                    fj.b("!!!! Evaluate Always Rules");
                    foreach (ILogicRule rule in A_1)
                    {
                        if (rule.ValidNow)
                        {
                            rule.Running = true;
                        }
                        else
                        {
                            rule.Running = false;
                        }
                    }
                    fj.a("!!!! Evaluate Always Rules", 20.0);
                }
                if (PluginCore.cq.n.k)
                {
                    return;
                }
                PluginCore.cq.n.a("----------- Primary logic loop started (" + A_0.Count.ToString() + " rules) -----------", e8.b);
                fj.b("Primary logic loop");
                ILogicRule rule2 = null;
                fj.b("!!!! Logic loop - find valid rule");
                foreach (ILogicRule rule3 in A_0)
                {
                    string str = "!!!! Logic loop - validnow - " + rule3.FriendlyName;
                    fj.b(str);
                    bool validNow = rule3.ValidNow;
                    fj.a(str, 20.0);
                    if (validNow)
                    {
                        PluginCore.cq.n.a("Picked " + rule3.FriendlyName + " P: " + rule3.Priority.ToString() + "   I=" + PluginCore.cq.n.n.b(ActionLockType.ItemUse).ToString() + ", N=" + PluginCore.cq.n.n.b(ActionLockType.Navigation).ToString() + ", S=" + PluginCore.cq.n.n.b(ActionLockType.Salvage).ToString(), e8.b);
                        rule2             = rule3;
                        PluginCore.cq.n.q = rule3.Priority;
                        goto Label_031D;
                    }
                }
                PluginCore.cq.n.a("All rules inactive.   I=" + PluginCore.cq.n.n.b(ActionLockType.ItemUse).ToString() + ", N=" + PluginCore.cq.n.n.b(ActionLockType.Navigation).ToString() + ", S=" + PluginCore.cq.n.n.b(ActionLockType.Salvage).ToString(), e8.b);
                PluginCore.cq.n.q = 0;
Label_031D:
                fj.a("!!!! Logic loop - find valid rule", 20.0);
                fj.b("!!!! Logic loop - clear rules");
                foreach (ILogicRule rule4 in A_0)
                {
                    if (rule4 != rule2)
                    {
                        rule4.Running = false;
                    }
                }
                fj.a("!!!! Logic loop - clear rules", 20.0);
                if (rule2 != null)
                {
                    string str2 = "!!!! Logic loop - activate rule " + rule2.FriendlyName;
                    fj.b(str2);
                    rule2.Running = true;
                    fj.a(str2, 20.0);
                }
                this.h = rule2;
                l.a(rule2);
                fj.a("Primary logic loop");
            }
            catch (Exception exception)
            {
                ad.a(exception);
            }
            finally
            {
                DateTimeOffset now  = DateTimeOffset.Now;
                TimeSpan       span = (TimeSpan)(now - this.d);
                if (span.TotalSeconds > 30.0)
                {
                    this.d = now;
                    string str3 = "!!!! Logic finally - forcegc F";
                    fj.b(str3);
                    GC.WaitForPendingFinalizers();
                    GC.Collect();
                    fj.a(str3, 80.0);
                }
            }
        }
Example #23
0
 public static string Get_ExecutionContextGroup(ILogicRule modelNode) {
     return DefaultExecutionContextGroup;
 }
Example #24
0
 public bool RemoveLogicRule(ILogicRule lr)
 {
     return(this.l.Remove(lr));
 }