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" } }); }
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); }
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" } } } ; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("Value2", GetValues2); Remote.AddStore("Value3", GetValues3); }
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); }
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); }
/// <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; }
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); }
/// <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); }
public void SafeGetNullableGuidFromStringTest2() { var sg = new DextopConfig() { { "Key", null } }; Guid? result; Assert.AreEqual(false, sg.TryGet("Key", out result)); Assert.AreEqual(result, null); }
/// <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; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("Value2", GetValues2); Remote.AddStore("Value3", GetValues3); }
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); }
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"; }
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" } }); }
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); }
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); }
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"; }
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 }; }
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"}, }); }
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 }; }
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" }, }); }
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); }
/// <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; }
/// <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)); }
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 }
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 }; }
public void SafeGetNullableGuidFromStringTest2() { var sg = new DextopConfig() { { "Key", null } }; Guid?result; Assert.AreEqual(false, sg.TryGet("Key", out result)); Assert.AreEqual(result, null); }
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 }; }
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 }
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)" }, }); }
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); }
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" }; }
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" }; }
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); }
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); }
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); 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); }
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" }; }
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; }
/// <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); }
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)); } }
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)" }, }); }
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" }; }
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" }; }
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)); } }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("model", new Crud(), Remote.IsClientInitiated ? "store" : null); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.RemoteHostType = "Showcase.demos.RemotingCallbacksWindow"; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.RemoteHostType = "Showcase.demos.LiveGridWindow"; Remote.AddLiveStore("model", store); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.RemoteHostType = "Showcase.demos.TreeWindow"; Remote.OnProcessAjaxRequest += ProcessAjaxRequest; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("model", Read); }
/// <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; }
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; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.RemoteHostType = "Showcase.demos.GroupedGridHeadersWindow"; Remote.AddStore <MarketDepth>("model", new Crud()); }
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()); }
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; } }