/// <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 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; }
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.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" }; }
/// <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); }
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; } }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); config["appPath"] = HttpRuntime.AppDomainAppVirtualPath.TrimEnd('/'); config["versionNumber"] = Pecunia.Services.AssemblyService.GetVersionNumber(); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("model", Load); }
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; } }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("model", new Codaxy.Dextop.Data.DextopMemoryDataProxy<User, int>(a=>a.Id, (id) => { return ++id; })); }
/// <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; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); config["appPath"] = HttpRuntime.AppDomainAppVirtualPath.TrimEnd('/'); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.OnProcessAjaxRequest = ProcessAjaxRequest; }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.RemoteHostType = "Codaxy.Dox.SimpleWindow"; }