/// <summary>
        /// Constructor for the scripting network service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="model"></param>
        /// <param name="diag"></param>
        public ScriptingNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.Sender       = sender;
            this.m_Model      = model;
            this.m_Diagnostic = model.ViewerState.Diagnostic;

            // Set up the change listeners
            this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleGenericChange));
            this.m_Diagnostic.Changed["ExecuteRemoteScript"].Add(this.m_GenericChangeDispatcher.Dispatcher);
        }
        /// <summary>
        /// Constructor for the synchronization network service
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="model"></param>
        /// <param name="diag"></param>
        public SynchronizationNetworkService(SendingQueue sender, PresenterModel model)
        {
            this.Sender       = sender;
            this.m_Model      = model;
            this.m_Diagnostic = model.ViewerState.Diagnostic;

            // Set up the change listeners
            this.m_ServerChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleServerStateChange));
            this.m_Diagnostic.Changed["ServerState"].Add(this.m_ServerChangeDispatcher.Dispatcher);
            this.m_ClientChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleClientStateChange));
            this.m_Diagnostic.Changed["ClientState"].Add(this.m_ClientChangeDispatcher.Dispatcher);

            this.m_Timer          = new System.Windows.Forms.Timer();
            this.m_Timer.Interval = 5000;
            this.m_Timer.Tick    += new EventHandler(this.OnTimerTick);
        }
示例#3
0
        public async Task RoutesToTypeAndMethodUsingMvcComplexObjectBinding()
        {
            var diagnostic = new DiagnosticModel
            {
                A = "A", B = 1.1f, Recurse = new DiagnosticModel {
                    A = "R.A", B = 1.2f
                }
            };
            var query    = "?a=-1&diagnostic.A=A&diagnostic.B=1.1&diagnostic.Recurse.A=R.A&diagnostic.Recurse.B=1.2";
            var url      = "/ComponentAsServiceDiagnostics/BindComplexObject" + query;
            var expected = new ComponentAsServiceDiagnostics().BindComplexObject(-1, diagnostic);

            var stringResult = await(await client.GetAsync(url)).Content.ReadAsStringAsync();

            Console.WriteLine(stringResult);
            stringResult.ShouldBe(expected);
        }
示例#4
0
        public async Task RoutesToTypeAndMethodUsingMvcComplexObjectBindingConfoundedByIgnoringCase()
        {
            var misdiagnostic = new DiagnosticModel
            {
                A = "-1", B = 1.1f, Recurse = new DiagnosticModel {
                    A = "R.A", B = 1.2f
                }
            };

            var query = "?a=-1&A=A&B=1.1&Recurse.A=R.A&Recurse.B=1.2";
            var url   = "/ComponentAsServiceDiagnostics/BindComplexObject" + query;

            var expected = new ComponentAsServiceDiagnostics().BindComplexObject(-1, misdiagnostic);

            var stringResult = await(await client.GetAsync(url)).Content.ReadAsStringAsync();

            Console.WriteLine(stringResult);
            stringResult.ShouldBe(expected, "Expected MVC binding to bind A=-1 instead of A=A");
        }
示例#5
0
        public async Task AppliesMvcModelBinding(string url)
        {
            var expected = new DiagnosticModel
            {
                A       = "AValue",
                B       = 1.1f,
                Recurse = new DiagnosticModel
                {
                    A       = "diagnosticRecurse.AValue",
                    Recurse = new DiagnosticModel
                    {
                        B = 2.2f
                    }
                }
            };

            var stringResult = await(await client.GetAsync(url)).Content.ReadAsStringAsync();

            console.WriteLine(stringResult);

            stringResult.ShouldBe(new ComponentAsServiceDiagnostics().BindComplexObject(9, expected));
        }