Ejemplo n.º 1
0
        public variableClass variableGetAHK(variableClass context)
        {
            var scope = (IndexedNode)context.extraInfo;

            context.extraInfo = scope.Variables[context.variableName];
            return(context);
        }
Ejemplo n.º 2
0
        object scopeAssemblyVariable(object scope, variableClass v)
        {
            if (scope is IndexedNode ind)
            {
                if (v.extraInfo != null)
                {
                    return(((VariableValue)v.extraInfo).Value);
                }
                else if (assemblyMap.Type.Exists(v.variableName))
                {
                    return(assemblyMap.Type[v.variableName]);
                }
            }

            else if (scope is Type t)
            {
                return(t.GetNestedTypes()
                       .Where(i => i.Name.ToLower() == v.variableName.ToLower())?.First());
            }
            else             //for instance of type
            {
                return(scope.GetType().GetFields()
                       .Where(i => i.Name.ToLower() == v.variableName.ToLower())?.First());
            }

            return(null);
        }
Ejemplo n.º 3
0
        public override variableClass variable(variableClass context)
        {
            switch (context.extraInfo)
            {
            case IndexedNode o:
                return(variableGetAHK(context));

            case null:
                context.extraInfo = indexed;
                return(variableGetAHK(context));
            }

            return(null);
        }
Ejemplo n.º 4
0
 IndexedNode scopeAHKVariable(IndexedNode scope, variableClass v)
 {
     if (scope.Variables.Exists(v.variableName))
     {
         variable(v);
         if (((VariableValue)v.extraInfo).Value is IndexedNode ind)
         {
             return(ind);
         }
         return(null);
         // if v.extraInfo is instance of a type, it will be resolved in scopeAssemblyVariable
     }
     else if (scope.Classes.Exists(v.variableName))
     {
         var newScope = scope.Classes[v.variableName];
         if (!autoExecuted.ContainsKey(newScope) || !autoExecuted[newScope])
         {
             autoExec(newScope);
             autoExecuted[newScope] = true;
         }
         return(newScope);
     }
     return(null);
 }
Ejemplo n.º 5
0
 public virtual string variable(variableClass context)
 {
     return(context.defaultValue);
 }