Пример #1
0
 /// <summary>
 /// Creates a new LuaEnvironment without initializing the state, for use with a derived type.
 /// </summary>
 protected LuaEnvironmentNet()
 {
     _compiler = new CodeCompiler();
     _parser   = new PlainParser();
     _runtime  = LuaRuntimeNet.Create(this);
     Settings  = new LuaSettings().AsReadOnly();
     _globals  = new LuaValues.LuaTable();
     _modules  = new ModuleBinder();
 }
Пример #2
0
 /// <summary>Registers the module bindings for the current library</summary>
 /// <param name="moduleBinder">The module binder.</param>
 /// <returns>The <see cref="IEnumerable{T}"/>.</returns>
 public override IEnumerable <ModuleBinding> GetModuleBindings(IModuleBinder moduleBinder)
 {
     return(new[]
     {
         moduleBinder.RegisterModule <ChatModel>(
             ChatModel.MODULENAME,
             ChatMapper.MapChatModule)
     });
 }
Пример #3
0
 /// <summary>Registers the module bindings for the current library</summary>
 /// <param name="moduleBinder">The module binder.</param>
 /// <returns>The <see cref="IEnumerable{T}"/>.</returns>
 public override IEnumerable <ModuleBinding> GetModuleBindings(IModuleBinder moduleBinder)
 {
     return(new[]
     {
         moduleBinder.RegisterModule <HelloWorldModule>(
             HelloWorldModule.ModuleName,
             HelloWorldModuleMapper.MapHelloWorldModule)
     });
 }
Пример #4
0
        /// <summary>
        /// Creates a new environment with the given settings.
        /// </summary>
        /// <param name="settings">The settings to give the Environment.</param>
        /// <exception cref="System.ArgumentNullException">If settings is null.</exception>
        public LuaEnvironmentNet(LuaSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            _globals  = new LuaTable();
            _runtime  = LuaRuntimeNet.Create(this);
            _compiler = new CodeCompiler();
            _parser   = new PlainParser();
            _modules  = new ModuleBinder();

            Settings = settings.AsReadOnly();

            // initialize the global variables.
            LuaStaticLibraries.Initialize(this);
            _initializeTypes();
        }
Пример #5
0
        public Modules(IPointsList modulePoints, IModuleBinder binder)
        {
            /*
             * This class will contain the main program control for creating assemblies,
             * placing them, bookkeeping, etc.  The IoC container should only be used
             * from this class.  Classes below this one in the hierarchy should not know
             * about the container.
             *
             * Modules is a collection of Module.  Modules also holds top level objects
             * like the master layout part for the assembly we are constructing.  Each
             * Module has a collection of ModuleObject.  ModuleObject is any
             * bindable object at the Module level.  All objects to be bound get
             * their own binder, and they are responsible for setting the IObjectBinder's
             * ContextData and ContextManager.  This is a Tuple<int, int>, where Item1 is
             * the Module ID, and Item2 is the ConstraintId.
             *
             * ContextData will be the lexicographical order of operations for the whole
             * collection of module.  Its contents will vary with the number of
             * input constraints per Module.  Because we have to create and keep
             * track of very disparate types of objecs, this ordering has to be somewhat
             * by convention:
             *
             * Modules...............ContextData = <0,0-N>.....Item1 = 0 for top level objects
             * Module.............ContextData = <1-M,0-P>...<ModuleId, ObjectId>
             *    ModuleObject....ContetxData = <1-M,0-P>...Same as Module level objects
             */
            _binder = binder;
            _binder.ContextData.Context = new Tuple <int, int>(0, 0);
            _binder.ContextManager.BindingContextManager = PersistenceManager.ActiveDocument.ReferenceKeyManager;
            _modulePoints = modulePoints;

            //_modulePoints.PropertyChanged += _modulePoints_PropertyChanged;

            //if (ModulePoints.IsDirty)
            //{
            //   CreateModuleCollection(modulePoints);
            //}
            CreateModuleCollection(modulePoints);
        }
Пример #6
0
 public ModuleObject(IModuleBinder binder)
 {
     Binder = binder;
 }
Пример #7
0
 public ModuleObject(IModuleBinder binder)
 {
     Binder = binder;   
 }
Пример #8
0
 /// <summary>
 /// Creates a new LuaEnvironment without initializing the state,
 /// for use with a derrived type.
 /// </summary>
 protected LuaEnvironmentNet()
 {
     this._compiler = new CodeCompiler();
     this._parser = new PlainParser();
     this._runtime = LuaRuntimeNet.Create(this);
     this.Settings = new LuaSettings().AsReadOnly();
     this._globals = new LuaValues.LuaTable();
     this._modules = new ModuleBinder();
 }
Пример #9
0
        /// <summary>
        /// Creates a new environment with the given settings.
        /// </summary>
        /// <param name="settings">The settings to give the Environment.</param>
        /// <exception cref="System.ArgumentNullException">If settings is null.</exception>
        public LuaEnvironmentNet(LuaSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            this._globals = new LuaValues.LuaTable();
            this._runtime = LuaRuntimeNet.Create(this);
            this._compiler = new CodeCompiler();
            this._parser = new PlainParser();
            this._modules = new ModuleBinder();

            this.Settings = settings.AsReadOnly();

            // initialize the global variables.
            LuaStaticLibraries.Initialize(this);
            InitializeTypes();
        }
Пример #10
0
            ILuaValue require(string name)
            {
                IModuleBinder bind = ((ILuaEnvironmentNet)E_).ModuleBinder;

                return(bind.Load(E_, name));
            }