Esempio n. 1
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            var crud = new Crud();

            crud.Create(new[] { new GridModel {
                                    Name       = "Player 1",
                                    Age        = 30,
                                    Basketball = true,
                                    Football   = true,
                                    Gender     = Gender.Male,
                                    Height     = 180,
                                    Weight     = 100
                                }, new GridModel {
                                    Name       = "Player 2",
                                    Age        = 29,
                                    Basketball = true,
                                    Football   = true,
                                    Gender     = Gender.Male,
                                    Height     = 175,
                                    Weight     = 90
                                } });
            Remote.AddStore("model", crud);
            Remote.AddLookupData("Gender", new[] {
                new object[] { Gender.Male, "Male" },
                new object[] { Gender.Female, "Female" }
            });
        }
Esempio n. 2
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.RemoteHostType = "Showcase.Session";

            config["aboutPageUrl"] = DextopUtil.AbsolutePath("source/About.html?cb=" + DateTime.Now.Ticks);
        }
Esempio n. 3
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.RemoteHostType = "Showcase.demos.GridEditorsWindow";
            Remote.AddStore("model", new Crud());
            Remote.AddLookupData("Lookup", new[] {
                new object[] { Lookup.L1, "Item 1" },
                new object[] { Lookup.L2, "Item 2" },
                new object[] { Lookup.L3, "Item 3" },
            });
            Remote.AddStore("RemoteLookup", RemoteLookup);

            if (remoteData == null)
            {
                remoteData = new List <RemoteLookupModel>
                {
                    new RemoteLookupModel {
                        Code = "USA", Description = "United States of America"
                    },
                    new RemoteLookupModel {
                        Code = "BIH", Description = "Bosnia and Herzegowina"
                    },
                    new RemoteLookupModel {
                        Code = "CRO", Description = "Croatia"
                    },
                    new RemoteLookupModel {
                        Code = "SRB", Description = "Serbia"
                    },
                    new RemoteLookupModel {
                        Code = "CHN", Description = "China"
                    }
                }
            }
            ;
        }
Esempio n. 4
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            Remote.AddStore("Value2", GetValues2);
            Remote.AddStore("Value3", GetValues3);
        }
Esempio n. 5
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.RemoteHostType = "Showcase.Session";

			config["aboutPageUrl"] = DextopUtil.AbsolutePath("source/About.html?cb=" + DateTime.Now.Ticks);            
        }
Esempio n. 6
0
        public bool Match(string[] elements, out DextopConfig matchedParams)
        {
            matchedParams = null;
            if (elements.Length != routeParts.Length)
            {
                return(false);
            }
            matchedParams = new DextopConfig();

            for (var i = 0; i < elements.Length; i++)
            {
                String name;
                if (String.Compare(elements[i], routeParts[i], true) == 0)
                {
                    continue;
                }

                if (!IsPlaceholder(routeParts[i], out name))
                {
                    return(false);
                }

                matchedParams[name] = elements[i];
            }
            return(true);
        }
Esempio n. 7
0
		/// <summary>
		/// Initializes the remotable object.
		/// </summary>
		/// <param name="remote">Remote object used for communication with the client-side object.</param>
		/// <param name="config">Configuration of the object to be created on the client side.</param>
        public void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            Remote = remote;
            Remote.RemoteHostType = "Dextop.data.Proxy";
            config["model"] = meta.ModelName;
            config["reader"] = serializer.Type;
            config["writer"] = serializer.Type;
        }
Esempio n. 8
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     var crud = new DextopMemoryDataProxy<Model, int>(a => a.Id, (lastId) => { return ++lastId; }) {
          Paging = true
     };
     Remote.AddStore("model", crud);
 }
Esempio n. 9
0
 /// <summary>
 /// Register session within the module. Module can optionaly create a remotable object associated with the session.
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 protected internal override Remoting.IDextopRemotable RegisterSession(DextopSession session)
 {
     var config = new DextopConfig();
     config.Add("url", DextopUtil.AbsolutePath(DextopUtil.CombinePaths(base.VirtualPath, "soundmanager2/swf")));
     if (sounds != null)
         config.Add("sounds", sounds);
     return new DextopRemotableConfig("Dextop.modules.SoundModule", config);
 }
Esempio n. 10
0
        public void SafeGetNullableGuidFromStringTest2()
        {            
            var sg = new DextopConfig() { { "Key", null } };

            Guid? result;
            Assert.AreEqual(false, sg.TryGet("Key", out result));
            Assert.AreEqual(result, null);
        }
Esempio n. 11
0
 /// <summary>
 /// Initializes the remotable object.
 /// </summary>
 /// <param name="remote">Remote object used for communication with the client-side object.</param>
 /// <param name="config">Configuration of the object to be created on the client side.</param>
 public void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     Remote = remote;
     Remote.RemoteHostType = "Dextop.data.Proxy";
     config["model"]       = meta.ModelName;
     config["reader"]      = serializer.Type;
     config["writer"]      = serializer.Type;
 }
Esempio n. 12
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            Remote.AddStore("Value2", GetValues2);
            Remote.AddStore("Value3", GetValues3);

        }
Esempio n. 13
0
        public void SafeGetGuidTest()
        {
            var v = Guid.NewGuid();
            var sg = new DextopConfig() { { "Key", v } };

            Guid result;
            Assert.AreEqual(true, sg.TryGet("Key", out result));
            Assert.AreEqual(result, v);
        }
Esempio n. 14
0
		public override void InitRemotable(DextopRemote remote, DextopConfig config)
		{
			base.InitRemotable(remote, config);			
			config["title"] = "Simple Window";
			config["html"] = "This is a simple window with html content from the server...";
			config["width"] = 500;
			config["height"] = 300;
			Remote.RemoteHostType = "Dextop.Window";
		}
Esempio n. 15
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.AddStore("model", new Crud());
     Remote.AddLookupData("Gender", new[] {
         new object[] { Gender.Male, "Male" },
         new object[] { Gender.Female, "Female" }
     });
 }
Esempio n. 16
0
        public void SafeGetNullableGuidFromStringTest()
        {
            var v = Guid.NewGuid();
            var sg = new DextopConfig() { { "Key", v.ToString() } };

            Guid? result;
            Assert.AreEqual(true, sg.TryGet("Key", out result));
            Assert.AreEqual(result, v);
        }
Esempio n. 17
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
			var rand = new Random();
			data = new List<GridModel>();
			for (var i = 0; i<5000; i++)
				data.Add(new GridModel { Id = i, Name = "Item " + i, Value = rand.Next(1000, 2000) });
			Remote.AddStore("model", Read);
        }
Esempio n. 18
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     config["title"]       = "Simple Window";
     config["html"]        = "This is a simple window with html content from the server...";
     config["width"]       = 500;
     config["height"]      = 300;
     Remote.RemoteHostType = "Dextop.Window";
 }
Esempio n. 19
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     config["data"] = new ComplexForm
     {
         Time = DateTime.Now.TimeOfDay,
         Number = 2,
         Date = DateTime.Today
     };
 }
Esempio n. 20
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);          
     Remote.RemoteHostType = "Showcase.demos.LiveGridWindow";
     Remote.AddLiveStore("model", store);
     Remote.AddLookupData("Type", new [] {
         new object[] { Type.Security, "Security"},
         new object[] { Type.Bond, "Bond"},
     });
 }
Esempio n. 21
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     config["data"] = new ComplexForm
     {
         Time   = DateTime.Now.TimeOfDay,
         Number = 2,
         Date   = DateTime.Today
     };
 }
Esempio n. 22
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.RemoteHostType = "Showcase.demos.LiveGridWindow";
     Remote.AddLiveStore("model", store);
     Remote.AddLookupData("Type", new [] {
         new object[] { Type.Security, "Security" },
         new object[] { Type.Bond, "Bond" },
     });
 }
Esempio n. 23
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            var crud = new DextopMemoryDataProxy <Model, int>(a => a.Id, (lastId) => { return(++lastId); })
            {
                Paging = true
            };

            Remote.AddStore("model", crud);
        }
Esempio n. 24
0
		/// <summary>
		/// Initializes the remotable object.
		/// </summary>
		/// <param name="remote">Remote object used for communication with the client-side object.</param>
		/// <param name="config">Configuration of the object to be created on the client side.</param>
		public void InitRemotable(DextopRemote remote, DextopConfig config)
		{
			Remote = remote;
			if (Config != null)
			{
				config.Apply(Config);
				Config = null;
			}

			remote.RemoteHostType = RemoteHostType;
		}
Esempio n. 25
0
        /// <summary>
        /// Register session within the module. Module can optionaly create a remotable object associated with the session.
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        protected internal override Remoting.IDextopRemotable RegisterSession(DextopSession session)
        {
            var config = new DextopConfig();

            config.Add("url", DextopUtil.AbsolutePath(DextopUtil.CombinePaths(base.VirtualPath, "soundmanager2/swf")));
            if (sounds != null)
            {
                config.Add("sounds", sounds);
            }
            return(new DextopRemotableConfig("Dextop.modules.SoundModule", config));
        }
Esempio n. 26
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.RemoteHostType = "Showcase.demos.LiveChartWindow";
            Remote.AddLiveStore("model", store);

#if DEBUG
            timer = new Timer(OnTimer, null, 100, 300);
#else
            timer = new Timer(OnTimer, null, 100, 2000);
#endif
        }
Esempio n. 27
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     config["data"] = new Form
     {
         R1 = "B",
         R2 = 0,
         R3 = 2,
         R4 = 3,
         R5 = 1
     };
 }
Esempio n. 28
0
        public void SafeGetNullableGuidFromStringTest2()
        {
            var sg = new DextopConfig()
            {
                { "Key", null }
            };

            Guid?result;

            Assert.AreEqual(false, sg.TryGet("Key", out result));
            Assert.AreEqual(result, null);
        }
Esempio n. 29
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     config["data"] = new Form
     {
         R1 = "B",
         R2 = 0,
         R3 = 2,
         R4 = 3,
         R5 = 1
     };
 }
Esempio n. 30
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.RemoteHostType = "Showcase.demos.LiveChartWindow";
            Remote.AddLiveStore("model", store);

#if DEBUG
            timer = new Timer(OnTimer, null, 100, 300);
#else
            timer = new Timer(OnTimer, null, 100, 2000);            
#endif
        }
Esempio n. 31
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.OnProcessAjaxRequest = RenderReport;
     Remote.AddStore("reports", new[] {
         new ReportType { ReportId = "GdpByYear", Title = "GDP By Year" },
         new ReportType { ReportId = "GdpByCountry", Title = "GDP By Country" },
         new ReportType { ReportId = "BiggestCountries", Title = "Biggest Countries" },
         new ReportType { ReportId = "FastestGrowingCountries", Title = "Fastest Growing Countries" },
         new ReportType { ReportId = "BestCountries", Title = "Best Countries (GNI per Capita)" },
     });
 }
Esempio n. 32
0
        public void SafeGetGuidTest()
        {
            var v  = Guid.NewGuid();
            var sg = new DextopConfig()
            {
                { "Key", v }
            };

            Guid result;

            Assert.AreEqual(true, sg.TryGet("Key", out result));
            Assert.AreEqual(result, v);
        }
Esempio n. 33
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            Remote.AddStore("RemoteLookup", RemoteLookup);

            config["data"] = new Form
            {
                RemoteLookup2           = "Blue",
                RemoteLookup            = "Red",
                RemoteLookupDescription = "Code Red"
            };
        }
Esempio n. 34
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

			Remote.AddStore("RemoteLookup", RemoteLookup);

            config["data"] = new Form
            {
                RemoteLookup2 = "Blue",
                RemoteLookup = "Red",
                RemoteLookupDescription = "Code Red"
            };
        }
Esempio n. 35
0
        public void SafeGetNullableGuidFromStringTest()
        {
            var v  = Guid.NewGuid();
            var sg = new DextopConfig()
            {
                { "Key", v.ToString() }
            };

            Guid?result;

            Assert.AreEqual(true, sg.TryGet("Key", out result));
            Assert.AreEqual(result, v);
        }
Esempio n. 36
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            var rand = new Random();

            data = new List <GridModel>();
            for (var i = 0; i < 5000; i++)
            {
                data.Add(new GridModel {
                    Id = i, Name = "Item " + i, Value = rand.Next(1000, 2000)
                });
            }
            Remote.AddStore("model", Read);
        }
Esempio n. 37
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.AddStore("model", Load);
            Remote.AddStore("history", LoadHistory);
            Remote.AddLookupData("Currency", CurrencyDataProvider.GetCurrencyList().Rates.Select(a => new Object[] {
                a.ISOCode,
                String.Format("{0} ({1})", a.Currency, a.ISOCode)
            }).ToArray());

            config["convertData"] = new ConvertForm
            {
                Amount = 100,
                Currency = "EUR"
            };
        }
Esempio n. 38
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
            Remote.AddStore("model", Load);
            Remote.AddStore("history", LoadHistory);
            Remote.AddLookupData("Currency", CurrencyDataProvider.GetCurrencyList().Rates.Select(a => new Object[] {
                a.ISOCode,
                String.Format("{0} ({1})", a.Currency, a.ISOCode)
            }).ToArray());

            config["convertData"] = new ConvertForm
            {
                Amount   = 100,
                Currency = "EUR"
            };
        }
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            var crud = new Crud();

            crud.Create(new[] { new GridModel {
                                    Name   = "John Doe",
                                    Age    = 24,
                                    Gender = Gender.Male,
                                    Height = 183
                                }, new GridModel {
                                    Name       = "Jane Doe",
                                    Age        = 25,
                                    Basketball = true,
                                    Volleyball = true,
                                    Gender     = Gender.Female,
                                    Height     = 165
                                }, new GridModel {
                                    Name     = "John Wayne",
                                    Age      = 72,
                                    Football = true,
                                    Gender   = Gender.Male,
                                    Height   = 180
                                }, new GridModel {
                                    Name       = "Laura Palmer",
                                    Age        = 70,
                                    Basketball = true,
                                    Football   = true,
                                    Gender     = Gender.Female,
                                    Height     = 172
                                }, new GridModel {
                                    Name       = "Mariah Carrey",
                                    Age        = 43,
                                    Basketball = true,
                                    Football   = true,
                                    Volleyball = true,
                                    Gender     = Gender.Female,
                                    Height     = 170
                                } });
            Remote.AddStore("model", crud);
            Remote.AddLookupData("Gender", new[] {
                new object[] { Gender.Male, "Male" },
                new object[] { Gender.Female, "Female" }
            });
        }
        private bool MatchRoutes(string alias, out string typeName, out DextopConfig config)
        {
            var elements = DextopRoute.GetRouteElements(alias);

            foreach (var route in Routes.Values)
            {
                if (route.Route.Match(elements, out config))
                {
                    typeName = route.TypeName;
                    return(true);
                }
            }


            typeName = null;
            config   = null;
            return(false);
        }
Esempio n. 41
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            Remote.AddLookupData("Lookup", new[] {
                new object[] { "1", "Item 1" },
                new object[] { "2", "Item 2" },
            });

            Remote.AddStore("RemoteLookup", RemoteLookup);

            config["data"] = new Form
            {
                RemoteLookup2 = "Blue",
                RemoteLookup = "Red",
                RemoteLookupDescription = "Code Red"
            };
        }
Esempio n. 42
0
        public bool Match(string[] elements, out DextopConfig matchedParams)
        {
            matchedParams = null;
            if (elements.Length != routeParts.Length)
                return false;
            matchedParams = new DextopConfig();

            for (var i = 0; i < elements.Length; i++)
            {
                String name;
                if (String.Compare(elements[i], routeParts[i], true) == 0)
                    continue;

                if (!IsPlaceholder(routeParts[i], out name))
                    return false;

                matchedParams[name] = elements[i];
            }
            return true;
        }
Esempio n. 43
0
		/// <summary>
		/// Initializes the remotable object.
		/// </summary>
		/// <param name="remote">Remote object used for communication with the client-side object.</param>
		/// <param name="config">Configuration of the object to be created on the client side.</param>
		public virtual void InitRemotable(DextopRemote remote, DextopConfig config)
		{
			Remote = remote;
			config.Add("direct", GetDirectConfig());

            var appPath = DextopEnvironment.VirtualAppPath;
            if (!appPath.EndsWith("/"))
                appPath += "/";

            config.Add("virtualAppPath", appPath);

			DextopConfig modules = new DextopConfig();
			foreach (var m in DextopApplication.GetModules())
			{
				var r = m.RegisterSession(this);
				if (r != null)
					modules.Add(m.ModuleName, Remote.TrackRemotableComponent(r));
			}
			if (modules.Count > 0)
				config.Add("modules", modules);
		}
Esempio n. 44
0
 public void ScopedResolutionWorks()
 {
     var cb = new ContainerBuilder();
     cb.RegisterModule(new DextopApiAutofacModule());
     cb.RegisterType<TestController1>();
     cb.RegisterType<TestController2>();
     cb.RegisterType<TestController3>();
     cb.RegisterType<TestController4>();
     using (var c = cb.Build())
     {
         var f = c.Resolve<DextopApiContext>();
         var args = new DextopConfig();
         args["a"] = 5;
         args["b"] = "5";
         args["g"] = Guid.NewGuid().ToString();
         f.Scope = args;
         var controller1 = f.ResolveScoped(typeof(TestController1));
         var controller2 = f.ResolveScoped(typeof(TestController2));
         var controller3 = f.ResolveScoped(typeof(TestController3));
         var controller4 = f.ResolveScoped(typeof(TestController4));
     }
 }
Esempio n. 45
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.OnProcessAjaxRequest = RenderReport;
     Remote.AddStore("reports", new[] {
         new ReportType {
             ReportId = "GdpByYear", Title = "GDP By Year"
         },
         new ReportType {
             ReportId = "GdpByCountry", Title = "GDP By Country"
         },
         new ReportType {
             ReportId = "BiggestCountries", Title = "Biggest Countries"
         },
         new ReportType {
             ReportId = "FastestGrowingCountries", Title = "Fastest Growing Countries"
         },
         new ReportType {
             ReportId = "BestCountries", Title = "Best Countries (GNI per Capita)"
         },
     });
 }
Esempio n. 46
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

			Remote.AddLookupData("Lookup", new[] {
				new object[] { "1", "Item 1" },
				new object[] { "2", "Item 2" },
			});

			Remote.AddStore("RemoteLookup", RemoteLookup);

			config["data"] = new Form
			{
				Date = DateTime.Today,
				Time = DateTime.Now.TimeOfDay,
				Checkbox = true,
				Text = "Some text",
				TextArea = "Some multiline\r\ntext",
				Lookup = "2",
				RemoteLookup = "Red",
				RemoteLookupDescription = "Code Red"
			};
        }
Esempio n. 47
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);

            Remote.AddLookupData("Lookup", new[] {
                new object[] { "1", "Item 1" },
                new object[] { "2", "Item 2" },
            });

            Remote.AddStore("RemoteLookup", RemoteLookup);

            config["data"] = new Form
            {
                Date                    = DateTime.Today,
                Time                    = DateTime.Now.TimeOfDay,
                Checkbox                = true,
                Text                    = "Some text",
                TextArea                = "Some multiline\r\ntext",
                Lookup                  = "2",
                RemoteLookup            = "Red",
                RemoteLookupDescription = "Code Red"
            };
        }
Esempio n. 48
0
        public void ScopedResolutionWorks()
        {
            var cb = new ContainerBuilder();

            cb.RegisterModule(new DextopApiAutofacModule());
            cb.RegisterType <TestController1>();
            cb.RegisterType <TestController2>();
            cb.RegisterType <TestController3>();
            cb.RegisterType <TestController4>();
            using (var c = cb.Build())
            {
                var f    = c.Resolve <DextopApiContext>();
                var args = new DextopConfig();
                args["a"] = 5;
                args["b"] = "5";
                args["g"] = Guid.NewGuid().ToString();
                f.Scope   = args;
                var controller1 = f.ResolveScoped(typeof(TestController1));
                var controller2 = f.ResolveScoped(typeof(TestController2));
                var controller3 = f.ResolveScoped(typeof(TestController3));
                var controller4 = f.ResolveScoped(typeof(TestController4));
            }
        }
Esempio n. 49
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.AddStore("model", new Crud(), Remote.IsClientInitiated ? "store" : null);
 }
Esempio n. 50
0
        public override void InitRemotable(DextopRemote remote, DextopConfig config)
        {
            base.InitRemotable(remote, config);
			Remote.RemoteHostType = "Showcase.demos.RemotingCallbacksWindow";            
        }
Esempio n. 51
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.RemoteHostType = "Showcase.demos.LiveGridWindow";
     Remote.AddLiveStore("model", store);
 }
Esempio n. 52
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.RemoteHostType = "Showcase.demos.TreeWindow";
     Remote.OnProcessAjaxRequest += ProcessAjaxRequest;
 }
Esempio n. 53
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.AddStore("model", Read);
 }
Esempio n. 54
0
 /// <summary>
 /// Initializes the remotable object.
 /// </summary>
 /// <param name="remote">Remote object used for communication with the client-side object.</param>
 /// <param name="config">Configuration of the object to be created on the client side.</param>
 public void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     Remote = remote;
     remote.RemoteHostType = "Dextop.data.LiveStore";
     config["model"] = meta.ModelName;
 }
Esempio n. 55
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.AddStore("model", Load);
 }
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.OnMapRemotingException = MapException;
 }
Esempio n. 57
0
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.RemoteHostType = "Showcase.demos.GroupedGridHeadersWindow";
     Remote.AddStore <MarketDepth>("model", new Crud());
 }
Esempio n. 58
0
 RemoteInstantiationWindow(DextopConfig config)
 {
 }
 public override void InitRemotable(DextopRemote remote, DextopConfig config)
 {
     base.InitRemotable(remote, config);
     Remote.RemoteHostType = "Showcase.demos.ModelValidationGridWindow";
     Remote.AddStore <ValidationGridModel>("validationmodel", new ValidationCrud());
 }
Esempio n. 60
0
        internal DextopConfig Register(DextopRemote parent, IDextopRemotable remotable, String remoteId = null, bool subRemote = true)
        {
            if (remotable == null)
                throw new ArgumentNullException("remotable");

            bool isClientInitiated;

            if (remoteId == null)
            {
                remoteId = Interlocked.Increment(ref nextRemoteId).ToString();
                isClientInitiated = parent!=null && parent.IsClientInitiated;
            }
            else if (subRemote)
            {
                if (parent == null)
                    throw new DextopInternalException();
                remoteId = parent.RemoteId + '.' + remoteId;
                isClientInitiated = parent.IsClientInitiated;
            }
            else
                isClientInitiated = true;

            var context = new RemotableContext
            {
                Remotable = remotable
            };

            var remote = new DextopRemote(Context, remoteId, isClientInitiated);           

			var clientTypeName = DextopApplication.MapTypeName(remotable.GetType());

            try
            {
                var config = new DextopConfig();
                remotable.InitRemotable(remote, config);

                if (!remote.IsClientInitiated)
                {
                    DextopConfig remoteProxyConfig;
					var remoteTypeName = remote.RemoteHostType ?? clientTypeName;
                    if (remoteTypeName != null)
                    {
                        config.Add("alias", remoteTypeName);
                        remoteProxyConfig = new DextopConfig();
                        config.Add("remote", remoteProxyConfig);
                    }
                    else
                    {
                        remoteProxyConfig = config;
                    }
                    remoteProxyConfig.Add("remoteId", remoteId);
					remoteProxyConfig.Add("alias", DextopUtil.GetRemotingProxyTypeName(clientTypeName));
                    if (remote.componentsConfig != null)
                    {
                        remoteProxyConfig.Add("components", remote.componentsConfig);

                        //config not needed anymore - free memory
                        remote.componentsConfig = null;
                    }
                }

                if (!remotables.TryAdd(remoteId, context))
                    throw new DextopInternalException();

                return config;
            }
            catch
            {
                remote.Dispose();
                remotable.Dispose();
                throw;
            }

        }