static void Main() { c__wpf_tuto_rest.ApplicationName = "wpf_tuto_rest"; Sybase.PowerBuilder.PBSessionBase.HasPBExtensions = false; Sybase.PowerBuilder.PBSessionBase.MainAssembly = System.Reflection.Assembly.GetExecutingAssembly(); Sybase.PowerBuilder.WPF.PBSession.AssemblyList = @"wpf_tuto_rest.resource.dll"; Sybase.PowerBuilder.WPF.PBSession session = Sybase.PowerBuilder.WPF.PBSession.CreateSession( typeof(c__wpf_tuto_rest), @"wpf_tuto_rest.pblx;l_rest_client.pblx"); c__wpf_tuto_rest.GetCurrentApplication().wpf_tuto_rest = c__wpf_tuto_rest.GetCurrentApplication(); InitAssemblyInfo(); PBGlobalDefinitions_wpf_tuto_rest.InitUninitVariables(); session.RunWPFApp(); }
public static void InitSession(Sybase.PowerBuilder.IPBSession session) { _oldSession = Sybase.PowerBuilder.WPF.PBSession.CurrentSession; Sybase.PowerBuilder.WPF.PBSession.CurrentSession = (Sybase.PowerBuilder.WPF.PBSession)session; Sybase.PowerBuilder.PBSessionBase.MainAssembly = _newAssembly; c__webapiproxy_app.ApplicationName = _newAppName; Sybase.PowerBuilder.PBSessionBase.HasPBExtensions = _newHasExt; }
public static void InitAssembly() { try { if(_session != null) { InitSession(_session); return; } _oldAssembly = Sybase.PowerBuilder.PBSessionBase.MainAssembly; _oldAppName = c__webapiproxy_app.ApplicationName; _oldHasExt = Sybase.PowerBuilder.PBSessionBase.HasPBExtensions; _oldSession = Sybase.PowerBuilder.WPF.PBSession.CurrentSession; c__webapiproxy_app.ApplicationName = "webapiproxy_app"; Sybase.PowerBuilder.PBSessionBase.HasPBExtensions = false; Sybase.PowerBuilder.PBSessionBase.MainAssembly = System.Reflection.Assembly.GetExecutingAssembly(); _session = Sybase.PowerBuilder.WPF.PBSession.CreateSession( typeof(c__webapiproxy_app), @"webapiproxy.pblx"); c__webapiproxy_app.GetCurrentApplication(); _newAssembly = Sybase.PowerBuilder.PBSessionBase.MainAssembly; _newAppName = c__webapiproxy_app.ApplicationName; _newHasExt = Sybase.PowerBuilder.PBSessionBase.HasPBExtensions; } catch(System.Exception e) { System.Windows.Forms.MessageBox.Show(e.ToString()); } }