Beispiel #1
0
        public override bool CanActionBeLinked(TaskID act)
        {
            HandlerMethodID hid = act as HandlerMethodID;

            if (hid != null)
            {
                return(hid.ActionId == this.MethodId);
            }
            if (act.Action != null)
            {
                DataTypePointer dtp = act.Action.ActionMethod.Owner as DataTypePointer;
                if (dtp != null)
                {
                    return(false);
                }
                ClassPointer cpr = this.RootPointer.GetExternalExecuterClass(act.Action);
                if (cpr != null)
                {
                    return(false);
                }
                CustomMethodPointer cmp = act.Action.ActionMethod as CustomMethodPointer;
                if (cmp != null)
                {
                    if (cmp.MemberId == MethodId)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #2
0
        public override void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            base.OnReadFromXmlNode(serializer, node);
            PropertyId      = XmlUtil.GetAttributeUInt(node, XMLATTR_PropertyId);
            PropertyClassId = XmlUtil.GetAttributeUInt(node, XmlTags.XMLATT_ClassID);
            XmlObjectReader reader = (XmlObjectReader)serializer;

            if (PropertyClassId == 0)
            {
                PropertyClassId = reader.ObjectList.ClassId;
            }
            ClassPointer root = ClassPointer.CreateClassPointer(PropertyClassId, reader.ObjectList.Project);

            PropertyClass mc = root.GetCustomPropertyById(PropertyId);

            if (mc == null)
            {
                MathNode.LogError(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                "Property {0} not found in class {1}", PropertyId, root.ClassId));
            }
            else
            {
                _property = mc;
            }
        }
Beispiel #3
0
 public override void GetActionsUseLocalVariable(List <UInt32> usedBranches, UInt32 varId, Dictionary <UInt32, IAction> actions)
 {
     if (usedBranches.Contains(this.BranchId))
     {
         return;
     }
     usedBranches.Add(this.BranchId);
     if (_actionList != null)
     {
         for (int k = 0; k < _actionList.Count; k++)
         {
             if (_actionList[k].Action == null)
             {
                 IAction a = this.ActionsHolder.GetActionInstance(_actionList[k].ActionId);
                 if (a == null)
                 {
                 }
                 else
                 {
                     _actionList[k].Action = a;
                 }
             }
             if (_actionList[k].Action != null)
             {
                 if (!actions.ContainsKey(_actionList[k].Action.ActionId))
                 {
                     if (ClassPointer.IsRelatedAction(varId, _actionList[k].Action.CurrentXmlData))
                     {
                         actions.Add(_actionList[k].Action.ActionId, _actionList[k].Action);
                     }
                 }
             }
         }
     }
 }
Beispiel #4
0
 public override bool CanActionBeLinked(TaskID act)
 {
     if (act.Action != null)
     {
         ClassPointer cpr = this.RootPointer.GetExternalExecuterClass(act.Action);
         if (cpr != null)
         {
             return(false);
         }
         DataTypePointer dtp = act.Action.ActionMethod.Owner as DataTypePointer;
         if (dtp != null)
         {
             return(false);
         }
         SetterPointer sp = act.Action.ActionMethod as SetterPointer;
         if (sp != null)
         {
             CustomPropertyPointer cpp = sp.SetProperty as CustomPropertyPointer;
             if (cpp != null)
             {
                 return(cpp.MemberId == this.PropertyId);
             }
         }
     }
     return(false);
 }
Beispiel #5
0
        public override bool CanActionBeLinked(TaskID act)
        {
            if (act.Action == null)
            {
                act.LoadActionInstance(this.RootPointer);
            }
            ActionAttachEvent aae = act.Action as ActionAttachEvent;

            if (aae != null)
            {
                return(aae.ExecuterMemberId == ActionExecuterId);
            }
            if (act.Action != null && act.Action.ActionMethod != null)
            {
                ClassPointer cpr = this.RootPointer.GetExternalExecuterClass(act.Action);
                if (cpr != null)
                {
                    return(false);
                }
                DataTypePointer dtp = act.Action.ActionMethod.Owner as DataTypePointer;
                if (dtp != null)
                {
                    return(false);
                }
                CustomMethodPointer cp = act.Action.ActionMethod as CustomMethodPointer;
                if (cp != null)
                {
                    if (cp.ClassId != act.ClassId)
                    {
                        if (act.Action.ExecuterMemberId == ActionExecuterId)
                        {
                            return(true);
                        }
                    }
                }
                else
                {
                    SetterPointer sp = act.Action.ActionMethod as SetterPointer;
                    if (sp != null)
                    {
                        CustomPropertyPointer cpp = sp.SetProperty as CustomPropertyPointer;
                        if (cpp == null || cpp.ClassId != act.ClassId)
                        {
                            if (act.Action.ExecuterMemberId == ActionExecuterId)
                            {
                                return(true);
                            }
                        }
                    }
                    else
                    {
                        if (act.Action.ExecuterMemberId == ActionExecuterId)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
        public void GetParameters(string projectFile, string classFile)
        {
            bool          loadedHere = false;
            LimnorProject _project   = new LimnorProject(projectFile);
            XmlDocument   doc        = new XmlDocument();

            doc.Load(classFile);
            UInt32       classId         = XmlUtil.GetAttributeUInt(doc.DocumentElement, XmlTags.XMLATT_ClassID);
            ClassPointer appClassPointer = _project.GetTypedData <ClassPointer>(classId);

            if (appClassPointer == null)
            {
                loadedHere      = true;
                appClassPointer = ClassPointer.CreateClassPointer(_project, doc.DocumentElement);
            }
            if (appClassPointer.ObjectList.Count == 0)
            {
                appClassPointer.ObjectList.LoadObjects();
            }
            _appCodeName = appClassPointer.CodeName;
            LimnorWebApp webapp = appClassPointer.ObjectInstance as LimnorWebApp;

            if (webapp != null)
            {
                _sessionVarCount = webapp.GlobalVariables.Count;
                if (webapp.GlobalVariables.Count > 0)
                {
                    Dictionary <string, string> sessionVars = new Dictionary <string, string>();
                    foreach (SessionVariable sv in webapp.GlobalVariables)
                    {
                        if (!sessionVars.ContainsKey(sv.Name))
                        {
                            if (!sv.Value.IsDefaultValue())
                            {
                                sessionVars.Add(sv.Name, sv.Value.GetValueString());
                            }
                        }
                    }
                    _sessionVarNames  = new string[sessionVars.Count];
                    _sessionVarValues = new string[sessionVars.Count];
                    int idx = 0;
                    foreach (KeyValuePair <string, string> kv in sessionVars)
                    {
                        _sessionVarNames[idx]  = kv.Key;
                        _sessionVarValues[idx] = kv.Value;
                        idx++;
                    }
                }
                _sessionTimeoutMinutes = webapp.GlobalVariableTimeout;
                if (_sessionTimeoutMinutes <= 0)
                {
                    _sessionTimeoutMinutes = 20;
                }
            }
            if (loadedHere)
            {
                _project.RemoveTypedData <ClassPointer>(classId);
            }
        }
Beispiel #7
0
 public JsMethodCompiler(MethodClass m, ClassPointer root, bool debug, Dictionary <string, StringCollection> formSubmissions, bool isPhp)
 {
     _mc              = m;
     _rootClassId     = root;
     _debug           = debug;
     _formSubmissions = formSubmissions;
     IsForPhp         = isPhp;
 }
 public MethodAction(ClassPointer owner)
     : base(owner)
 {
     this.ActionList = new BranchList(this);
     _actType        = EnumWebActionType.Unknown;
     _pointer        = new MethodActionPointer(this);
     ActionHolder    = owner;
 }
 public override void LoadActionData(ClassPointer pointer, List <UInt32> usedBraches)
 {
     if (_actionData == null)
     {
         _actionData = (ActionSubMethod)ActionsHolder.GetActionInstance(_actId.ActionId);
     }
     base.LoadActionData(pointer, usedBraches);
 }
 public TreeNodeDatabaseConnectionList(ClassPointer root)
     : base(false, root)
 {
     Text               = "Database Connections Used";
     ImageIndex         = TreeViewObjectExplorer.IMG_CONNECTS;
     SelectedImageIndex = TreeViewObjectExplorer.IMG_CONNECTS;
     this.Nodes.Add(new CLoader());
 }
 public override bool IsActionExecuter(IAction act, ClassPointer root)
 {
     if (act.ActionMethod is CustomMethodPointer)
     {
         return(act.ExecuterMemberId == this.ClassPointer.MemberId);
     }
     return(false);
 }
 public void LoadClassPointer(ClassPointer root)
 {
     if (root != _root)
     {
         _root = root;
         ReloadClassPointer();
     }
 }
Beispiel #13
0
        public void LoadActions(ClassPointer pointer)
        {
            List <UInt32> usedBraches = new List <UInt32>();

            foreach (ActionBranch ab in this)
            {
                ab.LoadActionData(pointer, usedBraches);
            }
        }
Beispiel #14
0
 public PropertyItemClassPointer(string key, Point location, IClass owner)
     : base(key, location, owner)
 {
     _pointer = owner.VariableCustomType;
     if (_pointer == null)
     {
         throw new DesignerException("null VariableCustomType creating PropertyItemClassPointer");
     }
 }
Beispiel #15
0
 public MethodDataTransfer(ClassPointer owner)
 {
     _rootClass = owner;
     if (_rootClass != null)
     {
         _prj     = _rootClass.Project;
         _classId = _rootClass.ClassId;
     }
 }
 public MethodItemClassPointer(string key, IClass owner, MethodClass method)
     : base(key, owner)
 {
     _method  = method;
     _pointer = owner.VariableCustomType;
     if (_pointer == null)
     {
         throw new DesignerException("VariableCustomType is null creating MethodItemClassPointer");
     }
 }
Beispiel #17
0
        private void addEventHandler(Type actionType)
        {
            EventPath ep = this.Parent as EventPath;

            if (ep != null)
            {
                ClassPointer root = ep.Panes.Loader.GetRootId();
                root.AddEventhandlerMethod(actionType, this.Event, 0, this.Bounds, this.FindForm());
            }
        }
Beispiel #18
0
 public MethodItemInterface(string key, IClass owner, InterfaceElementMethod method)
     : base(key, owner)
 {
     _method  = method;
     _pointer = owner.VariableCustomType;
     if (_pointer == null)
     {
         throw new DesignerException("VariableCustomType is null creating MethodItemInterface");
     }
 }
        private void mi_delete(object sender, EventArgs e)
        {
            EventPath ep = this.Parent as EventPath;

            if (ep != null)
            {
                ClassPointer root = ep.Panes.Loader.GetRootId();
                root.AskDeleteMethod(_method, this.FindForm());
            }
        }
        public override bool IsActionExecuter(TaskID tid, ClassPointer root)
        {
            HandlerMethodID hid = tid as HandlerMethodID;

            if (hid != null)
            {
                return(hid.ActionId == this.MethodId);
            }
            return(false);
        }
 public SeverStatePointer(ISourceValuePointer sv, ClassPointer root, EnumWebRunAt runAt)
     : this(sv.DataPassingCodeName, new DataTypePointer(typeof(string)), root, runAt)
 {
     _value = sv;
     _prop  = sv as IProperty;
     if (_prop != null)
     {
         _dataType = new DataTypePointer(_prop.ObjectType);
     }
 }
        public override bool IsActionExecuter(IAction act, ClassPointer root)
        {
            ClassPointer cp = root.GetExternalExecuterClass(act);

            if (cp != null)
            {
                return(cp.ClassId == this.ClassId);
            }
            return(false);
        }
        public override bool IsForThePointer(IObjectPointer pointer)
        {
            ClassPointer cp = pointer as ClassPointer;

            if (cp != null)
            {
                return(cp.ClassId == this.ClassId);
            }
            return(false);
        }
        public override void OnPostSerialize(ObjectIDmap objMap, XmlNode objectNode, bool saved, object serializer)
        {
            base.OnPostSerialize(objMap, objectNode, saved, serializer);
            MemberId = XmlUtility.XmlUtil.GetAttributeUInt(objectNode, XmlTags.XMLATT_memberId);
            //load attributes from base
            ClassPointer           root = objMap.GetTypedData <ClassPointer>();
            PropertyClassInherited p    = root.GetBaseProperty(this.Name, BaseClassId, BasePropertyId);

            CopyFromInherited(p);
        }
        public IClassPointer GetClassPointerFromCache(LimnorProject proj, UInt32 classId)
        {
            ClassPointer cp = proj.GetTypedData <ClassPointer>(classId);

            if (cp == null)
            {
                cp = ClassPointer.CreateClassPointer(classId, proj);
            }
            return(cp);
        }
 /// <summary>
 /// owner is a designer class for a custom interface
 /// </summary>
 /// <param name="owner"></param>
 public InterfacePointer(ClassPointer owner)
     : base(owner)
 {
     if (owner == null)
     {
         throw new DesignerException("owner as ClassPointer is null for InterfacePointer constructor");
     }
     _owner   = owner.Interface;
     _classId = owner.ClassId;
 }
Beispiel #27
0
        public override bool OnDeserialize(ClassPointer root, ILimnorDesigner designer)
        {
            HtmlElement_Base c = this.HtmlElement;

            if (c == null)
            {
                c = new HtmlElement_body(root);
            }
            Init(designer, c);
            return(true);
        }
Beispiel #28
0
 public PropertyItemClassPointer(string key, IClass owner, PropertyClass property)
     : base(key, owner)
 {
     _property = (PropertyClass)property.Clone();
     _property.SetHolder(owner);
     _pointer = owner.VariableCustomType;
     if (_pointer == null)
     {
         throw new DesignerException("null VariableCustomType creating PropertyItemClassPointer");
     }
 }
 public MethodActionForeach(ClassPointer owner, ActionSubMethodGlobal act)
     : base(owner)
 {
     act.ActionHolder = this;
     if (act.ActionId == 0)
     {
         act.ActionId = (UInt32)Guid.NewGuid().GetHashCode();
     }
     act.ActionType = this.RunAtServer ? EnumWebActionType.Server : EnumWebActionType.Client;
     this.ActionList.Add(new AB_SubMethodAction(act));
 }
 public ActionBranchParameterPointer(ActionBranchParameter p, ClassPointer root)
 {
     _parameter = p;
     if (p != null)
     {
         _parameterType = p.ObjectType;
     }
     _root         = root;
     ParameterName = p.Name;
     ParameterId   = p.ParameterID;
 }