public BillsListControl(ShellForm container) : base(container) { InitializeComponent(); DrawHelper.EnableControlDoubleBuffering("DataGridView", documentListDataGridView); //InitializeDataGridView(); }
public override void Load() { Bind <IApplicationService>().ToConstant(_applicationService = Kernel.Get <ApplicationService>()); Bind <IStorageService>().ToConstant(_storageService = Kernel.Get <StorageService>()); Bind <ISettingsService>().ToConstant(_settingsService = Kernel.Get <SettingsService>()); Bind <ISiteService>().ToConstant(_siteService = Kernel.Get <SiteService>()); Bind <CuoUri>().ToSelf(); Bind <ShellForm>().ToSelf().InSingletonScope(); Bind <ShellController>().ToSelf().InSingletonScope(); _shellForm = Kernel.Get <ShellForm>(); _shellController = Kernel.Get <ShellController>(); Bind <IShell>().ToConstant(_shellForm); Bind <IShellController>().ToConstant(_shellController); Bind <PatcherForm>().ToSelf(); Bind <SplashScreen>().ToSelf(); Bind <AboutControl>().ToSelf(); Bind <SettingsControl>().ToSelf(); Bind <NavigationControl>().ToSelf(); Bind <EditLocalServerControl>().ToSelf(); Bind <LocalServerListControl>().ToSelf(); Bind <PublicServerListControl>().ToSelf(); Bind <FavoritesServerListControl>().ToSelf(); }
public PaymentsListControl(ShellForm container) : base(container) { _changedCells = new Dictionary <int, IList <int> >(); InitializeComponent(); DrawHelper.EnableControlDoubleBuffering("DataGridView", paymentsDataGridView); BindPaymentsDataGridView(onlyMustPayers, includeDeleted); }
private static void ShellOutputPacketHandler(byte[] receivedPacket, Socket clientSocket) { ShellOutputPackage shellOutputPackage = new ShellOutputPackage(receivedPacket); ShellForm shellForm = new ShellForm(); shellForm.receiveOutput(shellOutputPackage.shellOutput); shellForm.ShowDialog(); shellForm.Focus(); //Application.Run(); }
public SettingsForm(ShellForm shellForm) { InitializeComponent(); _shellForm = shellForm; LoadThemesComboBox(); LoadStylesList(); }
protected virtual void OnApplicationClose() { try { ShellForm.Dispose(); } catch (Exception ex) { Trace.WriteLine("ShellForm.Dispose threw: ", ex.Message); } }
public override void OnClick(IKernel kernel) { ShellForm form = kernel.Get <ShellForm>(); IStorageService storageService = kernel.Get <IStorageService>(); if (MessageBoxEx.Show(form, "Are you sure you want to remove this server?", "ConnectUO 2.0", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { storageService.DeleteServer(Item.Server); Item.Parent.RefreshDataSource(); } }
public override void OnClick(IKernel kernel) { IStorageService storageService = kernel.Get <IStorageService>(); ISettingsService settingsService = kernel.Get <ISettingsService>(); ShellForm form = kernel.Get <ShellForm>(); Asserter.AssertIsNotNull(form, "form"); if (MessageBoxEx.Show(form, "This will remove all applied patches for this server from your computer. Are you sure you want to continue?", "ConnectUO 2.0", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { if (storageService.ServerIsCurrentlyBeingPlayed(Item.Server)) { MessageBoxEx.Show(form, "ConnectUO has detected that you are currently playing this server and cannot reset the patches until the Ultima Online client connected bas been closed.", "ConnectUO 2.0"); return; } else { storageService.ResetPatches((int)Item.Server.Id); try { string serverDirectory = Path.Combine(settingsService.PatchDirectory, Uri.EscapeDataString(Item.Server.Name)); if (Directory.Exists(serverDirectory)) { FileInfo[] files = new DirectoryInfo(serverDirectory).GetFiles(); for (int i = 0; i < files.Length; i++) { try { files[i].Delete(); } catch (Exception ex) { //These aren't crucial, just log as info... Tracer.Info(ex); } } } } catch (Exception ex) { //These aren't crucial, just log as info... Tracer.Info(ex); } } MessageBoxEx.Show(form, "Patch Reset Complete.", "ConnectUO 2.0"); } }
public ShellRibbonView(ShellForm shell) { InitializeComponent(); //---- Link UI objects to properties Module1Tile = tileModule1; Module2Tile = tileModule2; Module3Tile = tileModule3; Module4Tile = tileModule4; ShellRibbonPresenter = new ShellRibbonViewPresenter(this); MainShellForm = shell; }
public MembersListControl(ShellForm container) : base(container) { _changedCells = new Dictionary <int, IList <int> >(); DependantControls = new List <string> { "PaymentsListControl" }; InitializeComponent(); DrawHelper.EnableControlDoubleBuffering("DataGridView", membersDataGridView); BindMembersDataGridView(); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); _kernel.Load(AppDomain.CurrentDomain.GetAssemblies()); StartupArgumentFlagCollection startupFlags = new StartupArgumentFlagCollection(); IApplicationService applicationService = _kernel.Get <IApplicationService>(); ApplicationInfo applicationInfo = new ApplicationInfo(Assembly.GetEntryAssembly(), args, startupFlags); Directory.SetCurrentDirectory(applicationInfo.BaseDirectory); applicationService.ApplicationInfo = applicationInfo; //applicationService.TraceListeners.Add(new CrashLogTraceListener()); if (applicationService.Debug) { applicationService.TraceListeners.Add(new FileTraceListener(Path.Combine(applicationInfo.BaseDirectory, "debug.log"))); } EnsureDotNet35SP1(); CuoUri.Initialize(applicationService); if (ContainsCuoProtocol(args)) { return; } using (Mutex mutex = new Mutex(false, MutexName)) { Tracer.Verbose("Entering Mutex {0}", MutexName); if (!mutex.WaitOne(1, true)) { MessageBoxEx.Show(null, "ConnectUO is already running."); return; } SplashScreen splashScreen = _kernel.Get <SplashScreen>(); ShellForm mainForm = _kernel.Get <IShell>() as ShellForm; applicationService.MainForm = mainForm; Application.Run(splashScreen); Application.Run(mainForm); } }
private void ShowToolstrip(String toolstripName, bool visible) { if (_workItem != null) { ShellForm shellForm = _workItem.Items.Get <ShellForm>("ShellForm"); if (shellForm != null) { // Show the toolstrip Control[] controls = shellForm.topPanel.Controls.Find(toolstripName, true); if (controls.Length == 1) { controls[0].Visible = visible; } } } }
protected override void OnMainFormClosed(object sender, EventArgs e) { if (this.MainForm == this.logOnForm && this.logOnForm.DialogResult == DialogResult.OK) { // Assume the log on form validated credentials this.shellForm = new ShellForm(); this.MainForm = this.shellForm; this.MainForm.Show(); } else { // No substitution, so context will stop and app will close base.OnMainFormClosed(sender, e); } }
public void LoadRemoteFile(ShellForm _shellForm, string remoteFile, string localFile) { try { mode = "remote"; shellForm = _shellForm; remote_file = remoteFile; local_file = localFile; shellForm.RunSftpShell("get", remoteFile, localFile, false, false); org_content = YSTools.YSFile.readFileToString(localFile); editor.Text = org_content; } catch (Exception e) { Console.WriteLine(e); } }
private static void Main() { DevExpress.XtraEditors.WindowsFormsSettings.SetPerMonitorDpiAware(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); StandardKernel Kernel = new StandardKernel(); Kernel.Bind <ISettingsInject>().To <SettingsMethods>(); Kernel.Bind <IMessageInject>().To <MessageInjectForm>(); Kernel.Bind <IAskInject>().To <AskInjectForm>(); Kernel.Bind <IMapperInject>().To <MapperMethods>(); Kernel.Bind <IMemoryInject>().To <MemoryMethods>(); Kernel.Bind <IPermissionInject>().To <PermissionMethods>(); ShellForm BootstrapForm = Kernel.Get <ShellForm>(); Application.Run(BootstrapForm); }
public RemindersListControl(ShellForm container) : base(container) { InitializeComponent(); DrawHelper.EnableControlDoubleBuffering("DataGridView", paymentDebtsDataGridView); }
public override void OnClick(IKernel kernel) { IStorageService storageService = kernel.Get <IStorageService>(); ShellForm form = kernel.Get <ShellForm>(); Asserter.AssertIsNotNull(form, "form"); Asserter.AssertIsNotNull(Item.Server, "Item.Server"); form.SetStatus("Preparing to play {0}...", Item.Server.Name); string uri = CuoUri.BuildPlayString(Item.Server); if (Item.Server.HasPatches) { Tracer.Verbose("Server has patches, checking..."); if (Item.Server.Public) { form.SetStatus("Retrieving patching information for {0}...", Item.Server.Name); try { ServerPatch[] patches = storageService.GetPatches((int)Item.Server.Id); Tracer.Verbose("Found {0} patches...", patches.Length); StringBuilder sb = new StringBuilder(); for (int i = 0; i < patches.Length; i++) { sb.AppendFormat("{0}|{1}{2}", patches[i].PatchUrl, patches[i].Version, i + 1 < patches.Length ? ";" : ""); } uri = string.Join(string.Format("&{0}=", CuoUri.PatchesTolken), new string[] { uri, sb.ToString() }); } catch (Exception ex) { Tracer.Error(ex); MessageBoxEx.Show(form, "Unable to get patch information for this server. See the debug log for details.", "ConnectUO 2.0"); } } else { try { LocalPatch[] patches = storageService.GetLocalPatches((int)Item.Server.Id); Tracer.Verbose("Found {0} patches...", patches.Length); StringBuilder sb = new StringBuilder(); for (int i = 0; i < patches.Length; i++) { sb.AppendFormat("{0}|{1}{2}", patches[i].PatchUrl, patches[i].Version, i + 1 < patches.Length ? ";" : ""); } uri = string.Join(string.Format("&{0}=", CuoUri.PatchesTolken), new string[] { uri, sb.ToString() }); } catch (Exception ex) { Tracer.Error(ex); MessageBoxEx.Show(form, "Unable to get patch information for this server. See the debug log for details.", "ConnectUO 2.0"); } } } Tracer.Verbose("Play URI: {0}", uri); uri = string.Format("cuo://{0}", Uri.EscapeDataString(Convert.ToBase64String(Encoding.UTF8.GetBytes(uri)))); kernel.Get <CuoUri>().Play(uri); form.SetStatus(string.Empty); }
public IListControl(ShellForm container) { ContainerForm = container; InitializeComponent(); }