예제 #1
0
        /// <summary>
        /// ImportAll Method
        /// </summary>
        /// <remarks>
        /// Import all variables of the scope into this scope.
        /// </remarks>
        public void ImportAll(PyScope scope)
        {
            int result = Runtime.PyDict_Update(variables, scope.variables);

            if (result < 0)
            {
                throw new PythonException();
            }
        }
예제 #2
0
        /// <summary>
        /// ImportAll Method
        /// </summary>
        /// <remarks>
        /// Import all variables of the scope into this scope.
        /// </remarks>
        public void ImportAll(PyScope scope)
        {
            int result = Runtime.PyDict_Update(VarsRef, scope.VarsRef);

            if (result < 0)
            {
                throw new PythonException();
            }
        }
예제 #3
0
 /// <summary>
 /// Remove Method
 /// </summary>
 /// <remarks>
 /// remove the scope from this manager.
 /// </remarks>
 public void Remove(PyScope scope)
 {
     NamedScopes.Remove(scope.Name);
 }
예제 #4
0
 /// <summary>
 /// Get Method
 /// </summary>
 /// <remarks>
 /// Try to find the scope in this manager.
 /// </remarks>
 public bool TryGet(string name, out PyScope scope)
 {
     return(NamedScopes.TryGetValue(name, out scope));
 }
예제 #5
0
 /// <summary>
 /// Import method
 /// </summary>
 /// <remarks>
 /// Import a scope as a variable of given name.
 /// </remarks>
 public void Import(PyScope scope, string asname)
 {
     this.Set(asname, scope.obj);
 }
예제 #6
0
 /// <summary>
 /// Import method
 /// </summary>
 /// <remarks>
 /// Import a scope as a variable of given name.
 /// </remarks>
 public void Import(PyScope scope, string asname)
 {
     this.SetPyValue(asname, scope.obj.Handle);
 }