Example #1
0
        public override Result Call(DoHandler action, Mnemonic context, IRuntime runtime)
        {
            if (!_visible)
            {
                if (_form.InvokeRequired)
                {
                    _form.Invoke((MethodInvoker)(() => { _form.Visible = true; }));
                }
                else
                {
                    _form.Visible = true;
                }

                _visible = true;
            }

            return(base.Call(action, context, runtime));
        }
Example #2
0
        public SEAContext(out bool success)
        {
            doCallback     = new DoHandler(Do);
            dataManager    = new SEADataManager();
            sessionManager = new SEASessionManager();
            UpdateAfterSimulationCallback = new Action(sessionManager.UpdateAfterSimulation);

            if (dataManager.Init(doCallback))
            {
                SEAUtilities.Logging.Static.WriteLine("SEA Listening Start");
                success = true;
            }
            else
            {
                SEAUtilities.Logging.Static.WriteLine("SEA Listening Start Error");
                success = false;
            }

            #region Algorithms

            algorithms = new Dictionary <uint, Algorithm>()
            {
                { 1, new Algorithm(GetCubeGrids) },
                { 2, new Algorithm(GetAvalibleBlocks) },
                { 3, new Algorithm(GetGroupBlocks) },

                { 10, new Algorithm(GetBlockProperties) },
                { 11, new Algorithm(GetBlockPropertiesBool) },
                { 12, new Algorithm(GetBlockPropertiesFloat) },
                { 13, new Algorithm(GetBlockActons) },

                { 21, new Algorithm(GetValueBool) },
                { 22, new Algorithm(GetValueFloat) },

                { 31, new Algorithm(SetValueBool) },
                { 32, new Algorithm(SetValueFloat) },
                { 33, new Algorithm(SetBlockAction) },
            };
            #endregion
        }
Example #3
0
        protected void Add(string methodName, DoHandler action, params string[] arguments)
        {
            var m = new Method
            {
                Code = new List <Mnemonic>
                {
                    new LibraryCall(this, action)
                },
                ArgumentList = new List <string>()
            };

            if (arguments != null && arguments.Any())
            {
                m.ArgumentList.AddRange(arguments.ToList());
            }

            _methods.Add(new KeyValuePair <MethodPointer, Method>(new MethodPointer
            {
                Name      = methodName,
                NameSpace = Name
            }, m));
        }
Example #4
0
 public CheckPathTimeout(DoHandler d)
 {
     this.mTimeoutObject = new ManualResetEvent(true);
     this.Do             = d;
 }
Example #5
0
 public virtual void Do(DoHandler handler)
 {
     Begin();
     handler();
     End();
 }
Example #6
0
 public LibraryCall(ILibrary library, DoHandler action) : base(null)
 {
     _library = library;
     _action  = action;
 }
Example #7
0
 public virtual Result Call(DoHandler action, Mnemonic context, IRuntime runtime)
 {
     return(action(context, runtime));
 }