예제 #1
0
        protected ObjectVariable AddObjectVariable(IIndexReferencer variable)
        {
            // Create an ObjectVariable
            ObjectVariable createdObjectVariable = new ObjectVariable(variable);

            // Add the ObjectVariable to the ObjectVariables list. This will assign the variable a stack when WorkshopInit executes.
            ObjectVariables.Add(createdObjectVariable);
            // Copy the variable to the serve object scope. This allows the variable to be accessed when doing className.variableName.
            serveObjectScope.CopyVariable(variable);
            // Return the created ObjectVariable.
            return(createdObjectVariable);
        }
예제 #2
0
        /// <summary>Creates an ObjectVariable and adds it to the object scope.</summary>
        public ObjectVariable AddObjectVariable(IVariableInstance variableInstance)
        {
            // Add the variable to the object scope.
            ObjectScope.AddNativeVariable(variableInstance);

            // Create the ObjectVariable.
            var result = new ObjectVariable(WorkingInstance, variableInstance);

            // Add it to the list.
            _objectVariables.Add(result);
            return(result);
        }