Пример #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);
 }