public TeamManagement() { this.InitializeComponent(); Teams = new DispatchingCollection<ObservableCollection<Components.Person.Team>, Components.Person.Team>(GwupeClientAppContext.CurrentAppContext.TeamManager.Teams, Dispatcher); _dataContext = new TeamManagementData(this); _uiHelper = new UiHelper(Dispatcher,Disabler,null,null); TeamList.ItemContainerStyle.Setters.Add(new EventSetter(ListBoxItem.SelectedEvent, new RoutedEventHandler(TeamSelected))); DataContext = _dataContext; GwupeClientAppContext.CurrentAppContext.TeamManager.Teams.CollectionChanged += TeamsOnCollectionChanged; }
public override void Execute(object parameter) { var mainIcon = parameter as TaskbarIcon; var mainWindow = GetTaskbarWindow(mainIcon) as MainWindow; var menuitem = mainWindow?.MainIcon?.ContextMenu?.Items[0] as MenuItem; var launchWithWindows = WindowsHelper.ToggleStartup(); if (launchWithWindows != null) { UiHelper.UpdateUiAndTaskbarIcon(mainWindow, menuitem, (bool)launchWithWindows); } else { mainIcon?.ShowBalloonTip("Smite Mixer Idler", "An error occurred when trying to interact with the registry, unable to set launch with windows setting.", BalloonIcon.Info); } }
/// <summary> /// 生成管道 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAggrBuilder_Click(object sender, EventArgs e) { if (cmbViewOn.SelectedIndex == -1) { //必须先选中Collection return; } RuntimeMongoDbContext.SetCurrentCollection(cmbViewOn.Text); var frmAggregationBuilder = new FrmStageBuilder(); UIAssistant.OpenModalForm(frmAggregationBuilder, false, true); foreach (var item in frmAggregationBuilder.Aggregation) { stages.Add(item); } UiHelper.FillDataToTreeView("stages", trvNewStage, stages.Values.ToList().Select(x => (BsonDocument)x).ToList(), 0); }
private void DrawLeftExpandedSettingsColumn(Rect region, [NotNull] ITableItem <PawnKindItem> item) { (Rect karmaLabel, Rect karmaField) = new Rect(0f, 0f, region.width, RowLineHeight).Split(0.6f); UiHelper.Label(karmaLabel, _karmaTypeText); if (Widgets.ButtonText(karmaField, item.Data.Data.KarmaType == null ? _defaultKarmaTypeText : item.Data.Data.KarmaType.ToString())) { Find.WindowStack.Add( new FloatMenu(ToolkitUtils.Data.KarmaTypes.Values.Select(i => new FloatMenuOption(i.ToString(), () => item.Data.Data.KarmaType = i)).ToList()) ); } if (item.Data.Data.KarmaType != null && UiHelper.FieldButton(karmaLabel, Textures.Reset, _resetPawnKarmaTooltip)) { item.Data.Data.KarmaType = null; } }
private void CheckLogin(bool ignoreServerState = false) { if (!ignoreServerState && Application.SignalRClient.IsDisconnected) { return; } if (!AuthenticationManager.IsLoggedIn) { UiHelper.ShowForm <CtrlNumericKeyboard>(UiHelper.CreateTitle("Login"), this) .Configure(control => control.KeyboardLayout = NumericKeyboardLayout.Pin) .OnConfirm(PerformLogin) .SetTitleBar(true, true) .ApplyTheme(_theme) .Show(); } }
private void DrawGlobalAddPriceField(Rect canvas) { var buffer = _globalAddCost.ToString(); Widgets.Label(canvas.LeftHalf(), _addCostText); Widgets.TextFieldNumeric(canvas.RightHalf(), ref _globalAddCost, ref buffer); if (!UiHelper.DoneButton(canvas.RightHalf())) { return; } foreach (TableSettingsItem <TraitItem> trait in _worker.Data.Where(i => !i.IsHidden)) { trait.Data.CostToAdd = _globalAddCost; } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); MouseMoved = true; if (e.LeftButton != MouseButtonState.Pressed || IsSelecting || UiHelper.IsMouseOverScrollbar(this, e.GetPosition(this))) { return; } var data = new DataObject(SelectedItems); data.SetData(typeof(IList), SelectedItems); DragDrop.DoDragDrop(this, data, DragDropEffects.Copy); }
private async void UserPrevItem_OnLoaded(object sender, RoutedEventArgs e) { var(avatar, thumbnails) = GetUserPrevImageControls(sender); var dataContext = sender.GetDataContext <User>(); UiHelper.SetImageSource(avatar, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Avatar, dataContext.Name)); var counter = 0; foreach (var thumbnail in thumbnails) { if (counter < dataContext.Thumbnails.Length) { UiHelper.SetImageSource(thumbnail, await PixivEx.GetAndCreateOrLoadFromCacheInternal(dataContext.Thumbnails[counter], $"{dataContext.Id}", counter++)); } } }
/// <summary> /// 全文检索功能 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSearch_Click(object sender, EventArgs e) { var result = QueryHelper.SearchText(txtKey.Text, (int)NUDLimit.Value, (cmbLanguage.SelectedIndex == 0) ? "" : cmbLanguage.Text); //返回数限制 try { UiHelper.FillDataToTreeView("Text Search Result", trvResult, result, 0); MessageBox.Show("找到符合条件的结果数:" + result.Count()); //cmdSave.Enabled = true; } catch (Exception ex) { Utility.ExceptionDeal(ex, "请确保具有 Text 类型的索引"); } }
public void Draw(Rect canvas) { (Rect label, Rect field) = canvas.Split(0.75f); UiHelper.Label(label, _techLevelText); (Rect comp, Rect tech) = field.Split(0.3f); if (Widgets.ButtonText(comp, _comparison.AsOperator())) { Find.WindowStack.Add(new FloatMenu(_comparisonOptions)); } if (Widgets.ButtonText(tech, $"TechLevel_{_techLevel}".TranslateSimple().CapitalizeFirst())) { Find.WindowStack.Add(new FloatMenu(_techLevelOptions)); } }
public ServerMenu(Client client, Menu parent = null) : base("Manage Server", parent) { var gameType = new MenuItem(client, this, "Set Game Type", Constants.AceGameType); gameType.Activate += async() => { var text = await UiHelper.PromptTextInput(controller : client.Menu); if (string.IsNullOrEmpty(text)) { return; } BaseScript.TriggerServerEvent("HyperAdmin.SetGameType", text); }; Add(gameType); var mapName = new MenuItem(client, this, "Set Map Name", Constants.AceMapName); mapName.Activate += async() => { var text = await UiHelper.PromptTextInput(controller : client.Menu); if (string.IsNullOrEmpty(text)) { return; } BaseScript.TriggerServerEvent("HyperAdmin.SetMapName", text); }; Add(mapName); Add(new MenuItemSubMenu(client, this, new ResourceListMenu(client, this), "Manage Resources")); var lookup = new MenuItem(client, this, "Lookup Ban by Identifier", Constants.AceAdminBan); lookup.Activate += async() => { var inp = await UiHelper.PromptTextInput(_lastLookup, controller : client.Menu); if (string.IsNullOrEmpty(inp)) { return; } _lastLookup = inp; BaseScript.TriggerServerEvent("HyperAdmin.LookupBan", inp); }; Add(lookup); new BanLookupMenu(client, this); }
private void cmdCreateValidation_Click(object sender, EventArgs e) { try { var frmInsertDoc = new frmCreateDocument(); UIAssistant.OpenModalForm(frmInsertDoc, false, true); ValidationDoc = frmInsertDoc.mBsonDocument; if (ValidationDoc != null) { UiHelper.FillDataToTreeView("Validation", trvValidationDoc, frmInsertDoc.mBsonDocument); } } catch (Exception ex) { Utility.ExceptionDeal(ex); } }
private async void BrowsingHistoryMainImage_OnLoaded(object sender, RoutedEventArgs e) { var browsing = sender.GetDataContext <BrowsingHistory>(); var img = (Image)sender; if (browsing.IsReferToUser) { img.Effect = new BlurEffect { KernelType = KernelType.Gaussian, Radius = 50, RenderingBias = RenderingBias.Quality } } ; UiHelper.SetImageSource(img, await PixivIO.FromUrl(browsing.BrowseObjectThumbnail)); }
private void DrawHealthReport(Rect region, [NotNull] HealthReport report, bool alternate = false) { var iconRect = new Rect(0f, 0f, 16f, region.height); var closeRect = new Rect(region.x + region.width - 16f, 0f, 16f, region.height); var messageRect = new Rect(iconRect.x + iconRect.width + 2f, 0f, region.width - iconRect.width - closeRect.width - 4f, region.height); if (alternate) { Widgets.DrawLightHighlight(region); } Widgets.DrawLightHighlight(iconRect); Texture2D texture = GetTextureFor(report.Type); Color color = GetColorFor(report.Type); string iconTooltip = GetTooltipFor(report.Type); if (texture != null) { UiHelper.Icon(iconRect, texture, color); iconRect.TipRegion(iconTooltip); } UiHelper.Label(messageRect, report.Message, color, TextAnchor.MiddleLeft, GameFont.Small); if (!Mouse.IsOver(messageRect)) { report.OccurredAtString = GetTextString(DateTime.Now - report.OccurredAt); } messageRect.TipRegion("TKUtils.MainTabTooltips.Report".LocalizeKeyed(report.Reporter, report.OccurredAtString)); if (!report.Stacktrace.NullOrEmpty() && messageRect.LeftClicked()) { GUIUtility.systemCopyBuffer = report.Stacktrace; } UiHelper.Icon(closeRect, Widgets.CheckboxOffTex, Color.red); closeRect.TipRegion(_closeTooltip); if (closeRect.LeftClicked()) { Data.RemoveHealthReport(report); } }
public CustomCellConditionsEditor() { InitializeComponent(); lblStyleDetails.Text = Localization.StyleDetails_Label; lblStyles.Text = Localization.Styles_Label; DescriptorsList.SelectionChanged += new EventHandler <SelectionChangedEventArgs <CellConditionsDescriptor> >(DescriptorsList_SelectionChanged); DescriptorDetails.EditEnd += new EventHandler(DescriptorDetails_EditEnd); AddButton = new RanetToolBarButton(); AddButton.Content = UiHelper.CreateIcon(UriResources.Images.New16); AddButton.Click += new RoutedEventHandler(m_AddButton_Click); ToolTipService.SetToolTip(AddButton, Localization.Toolbar_NewButton_ToolTip); ToolBar.AddItem(AddButton); DeleteButton = new RanetToolBarButton(); DeleteButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveCross16); DeleteButton.Click += new RoutedEventHandler(m_DeleteButton_Click); DeleteButton.IsEnabled = false; ToolTipService.SetToolTip(DeleteButton, Localization.Toolbar_DeleteButton_ToolTip); ToolBar.AddItem(DeleteButton); DeleteAllButton = new RanetToolBarButton(); DeleteAllButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16); DeleteAllButton.Click += new RoutedEventHandler(m_DeleteAllButton_Click); DeleteAllButton.IsEnabled = false; ToolTipService.SetToolTip(DeleteAllButton, Localization.Toolbar_DeleteAllButton_ToolTip); ToolBar.AddItem(DeleteAllButton); m_ImportButton = new RanetToolBarButton(); m_ImportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16); m_ImportButton.Click += new RoutedEventHandler(m_ImportButton_Click); ToolTipService.SetToolTip(m_ImportButton, Localization.LoadSettings_ToolTip); ToolBar.AddItem(m_ImportButton); m_ExportButton = new RanetToolBarButton(); m_ExportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16); m_ExportButton.Click += new RoutedEventHandler(m_ExportButton_Click); ToolTipService.SetToolTip(m_ExportButton, Localization.SaveSettings_ToolTip); ToolBar.AddItem(m_ExportButton); DescriptorsList.DeleteAllButton_IsEnabledChanged += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteAllButton_IsEnabledChanged); DescriptorsList.DeleteButton_IsEnabledChanged += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteButton_IsEnabledChanged); }
public async Task LoadAllFiles() { var config = dataTbls.config; var directory = config.file_directory_preload; string[] fileNames; try { fileNames = Directory.GetFiles(directory); } catch (Exception ex) { UiHelper.PopUpMessage(ex.Message); return; } var dbTypes = new List <string>(); string dbTypeCSV; var allTasks = new List <Task <DataOptions> >(); foreach (string fileName in fileNames.Where(x => x.EndsWith(Defs.dbFileExtension))) { allTasks.Add(Task.Run(() => OpenDbWithFileName(fileName))); } foreach (string fileName in fileNames.Where(x => x.EndsWith(Defs.textFileExtension))) { dbTypes.Add(OpenMsbtWithFileName(fileName)); } while (allTasks.Any <Task <DataOptions> >()) { var task = await Task.WhenAny(allTasks); allTasks.Remove(task); dbTypes.AddRange(AddResultsToDataTbls(await task)); } dbTypeCSV = UiHelper.ListToCSV(dbTypes); watch.Stop(); if (fileNames.Length > 0) { UiHelper.SetInformativeLabel(ref labelInformative, $"Loaded files: {dbTypeCSV} | Took {watch.ElapsedMilliseconds} milli-seconds."); } }
private void AddCastTimeTextNode(AtkUnitBase *unit, AtkTextNode *cloneTextNode, bool visible = false) { var textNode = (AtkTextNode *)GetNodeById(unit, TargetCastNodeId); if (textNode == null) { textNode = UiHelper.CloneNode(cloneTextNode); textNode->AtkResNode.NodeID = TargetCastNodeId; var newStrPtr = Common.Alloc(512); textNode->NodeText.StringPtr = (byte *)newStrPtr; textNode->NodeText.BufSize = 512; textNode->SetText(""); UiHelper.ExpandNodeList(unit, 1); unit->UldManager.NodeList[unit->UldManager.NodeListCount++] = (AtkResNode *)textNode; var nextNode = (AtkResNode *)cloneTextNode; while (nextNode->PrevSiblingNode != null) { nextNode = nextNode->PrevSiblingNode; } textNode->AtkResNode.ParentNode = nextNode->ParentNode; textNode->AtkResNode.ChildNode = null; textNode->AtkResNode.NextSiblingNode = nextNode; textNode->AtkResNode.PrevSiblingNode = null; nextNode->PrevSiblingNode = (AtkResNode *)textNode; nextNode->ParentNode->ChildCount += 1; } if (!visible) { UiHelper.Hide(textNode); } else { textNode->AlignmentFontType = (byte)(0x26 + (byte)LoadedConfig.CastTimeAlignment); textNode->AtkResNode.Height = (ushort)LoadedConfig.TimerOffset; //UiHelper.SetPosition(textNode, PluginConfig.UiAdjustments.ShiftTargetCastBarText.CastTimeOffsetX, // PluginConfig.UiAdjustments.ShiftTargetCastBarText.CastTimeOffsetY); //UiHelper.SetSize(textNode, cloneTextNode->AtkResNode.Width, cloneTextNode->AtkResNode.Height); textNode->FontSize = 15;//(byte) PluginConfig.UiAdjustments.ShiftTargetCastBarText.CastTimeFontSize; textNode->SetText(GetTargetCastTime().ToString("00.00")); UiHelper.Show(textNode); } }
protected override Result Action() { sn = ""; ScanFinish = false; Result <string> re; try { IScanner scanner = Hardware.Instance.scanner(ScannerId); bool manual = scanner.GetType().Name.ToLower().Contains("manual"); if (!manual) { re = scanner.Trigger(); } else { scanner.SnRecieved -= Scanner_SnRecieved; scanner.SnRecieved += Scanner_SnRecieved; UiHelper.ShowInfo("等待手动扫码"); string msg = ScannerId + "扫码失败"; if (ScanFinish) { msg = ScannerId + "扫码成功:" + sn; } re = new Result <string>(sn, ScanFinish, msg); } if (re.IsSuccess) { Output.OutputData(myNode.Document.Name, ScannerId, re.Content); Log.Run(LogLevel.Info, re.Message); return(new Result <string>(sn, ScanFinish, ScannerId + "扫码成功:" + sn)); } else { Log.Run(LogLevel.Error, re.Message); } return(re); } catch (Exception e) { Log.Run(LogLevel.Error, e.Message, e); //UiHelper.ShowError(e.Message); return(new Result(e.Message)); } }
public override void EditBulletins(IEnumerable <BulletinPackage> packages) { DCT.Execute(d => { { var fieldValueContainer = FieldValueContainerList.Get(Uid); var accessContainer = AccessContainerList.Get(Uid); foreach (var bulletin in packages) { var name = bulletin.ValueFields["Название объявления"]; UiHelper.UpdateObjectState($"Bulletin {name}, state = {bulletin.State}"); UiHelper.UpdateActionState("Попытка авторизоваться"); if (accessContainer.TryAuth(bulletin.Access)) { UiHelper.UpdateActionState("Ожидание прогрузки страницы"); Thread.Sleep(2000); Tools.WebWorker.NavigatePage(Path.Combine(bulletin.Url, "edit")); UiHelper.UpdateActionState("Установка значений"); Thread.Sleep(1000); SetValueFields(bulletin, fieldValueContainer); Thread.Sleep(1000); ContinueAddOrEdit(EnumHelper.GetValue <BulletinState>(bulletin.State)); Thread.Sleep(1000); Publicate(bulletin); } } } { foreach (var b in packages) { b.State = (int)BulletinState.OnModeration; var name = b.ValueFields["Название объявления"]; UiHelper.UpdateObjectState($"Bulletin {name}, state = {b.State}"); Thread.Sleep(1000); } UiHelper.UpdateActionState("Отправка коллбека"); Thread.Sleep(1000); } }); }
public override void GetBulletinDetails(IEnumerable <BulletinPackage> packages) { UiHelper.UpdateWorkState("Выгрузка полей для списка буллетинов"); DCT.Execute(d => { { var fieldValueContainer = FieldValueContainerList.Get(Uid); var accessContainer = AccessContainerList.Get(Uid); var accessCollection = packages.Cast <BulletinPackage>().Where(q => q.Access != null).GroupBy(q => q.Access.Login).Select(q => new { Access = q.Key, Collection = q.ToList() }).ToList(); foreach (var a in accessCollection) { UiHelper.UpdateObjectState($"Access {a.Access}"); var bulletins = a.Collection; foreach (var bulletin in bulletins) { UiHelper.UpdateActionState("Попытка авторизоваться"); Thread.Sleep(2000); if (accessContainer.TryAuth(bulletin.Access)) { Thread.Sleep(1000); var url = Path.Combine(bulletin.Url, "edit"); UiHelper.UpdateActionState($"Переход на страницу {url}"); Thread.Sleep(2000); var values = new Dictionary <string, string>(); foreach (var pair in bulletin.AccessFields) { var v = fieldValueContainer.GetFieldValue(bulletin.AccessFields, pair.Key); values.Add(pair.Key, v); } bulletin.ValueFields = values; bulletin.State = (int)CheckBulletinState(bulletin.Url); } } } } { UiHelper.UpdateActionState("Отправка коллбека"); Thread.Sleep(1000); } }); }
public override void OnShow(object param) { var arg = (Argument)param; // Show Name of Room NameInput.text = arg.CurrentRoomName ?? ""; // Clear Room List foreach (var room in _roomItems) { GameObject.Destroy(room); } _roomItems.Clear(); // Show Room List var y = 0f; foreach (var roomName in arg.RoomList) { var goItem = UiHelper.AddChild(RoomList.content.gameObject, RoomListTemplate); goItem.GetComponent <Text>().text = roomName; var rt = goItem.GetComponent <RectTransform>(); var posy = rt.localPosition.y - y; rt.localPosition = new Vector3(rt.localPosition.x, posy, rt.localPosition.z); y += rt.rect.height; var localRoomName = roomName; var trigger = new EventTrigger.TriggerEvent(); trigger.AddListener(_ => OnRoomItemClick(localRoomName)); var entry = new EventTrigger.Entry { callback = trigger, eventID = EventTriggerType.PointerClick }; goItem.GetComponent <EventTrigger>().triggers.Add(entry); goItem.SetActive(true); _roomItems.Add(goItem); } RoomList.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, y); RoomListTemplate.SetActive(false); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { if (lstPersons.SelectedItems.Count == 0) { return; } var person = (Person)lstPersons.SelectedItems[0]; var f = new FrmEditPerson(person) { Title = "Редактивароние персоны" }; if (f.ShowDialog() != true) { return; } UiHelper.RefreshCollection(lstPersons.ItemsSource); }
private async void btnPay_Click(object sender, EventArgs e) { try { var result = UiHelper.ShowConfirmation($"Esti sigur ca vrei sa inchizi masa {_order.Table?.Name}?", MessageType.Info, $"Comanda {_order.Number}", ParentForm); if(result != DialogResult.Yes) return; await Application.Api(ParentForm.LoadingState).Order.Pay(_order); await BackToTables(); } catch (Exception exception) { GlobalHandler.Catch(exception, ParentForm); } }
void ContinueAddOrEdit(BulletinState state) { DCT.Execute(d => { if (state == BulletinState.Edited) { UiHelper.UpdateActionState("Выбор \"Продолжить без пакет\""); } else if (state == BulletinState.WaitPublication || state == BulletinState.WaitRepublication) { UiHelper.UpdateActionState("Выбор \"Продолжить с пакетом «Обычная продажа»\""); } else { UiHelper.UpdateActionState("Выбор \"Продолжить\""); } }); }
/* static void WebControl_LoginRequest(object sender, LoginRequestEventArgs e) { * // We are on UI thread here, so we can't use MetroDialog for this.. * var info = * new WpfDialogManager(new CustomWindowManager()).UserNamePasswordDialog( * "Please enter username and password", e.Info.RequestURL); * if (!info.Item3.GetValueOrDefault()) { * e.Cancel = true; * return; * } * e.Username = info.Item1; * e.Password = info.Item2; * e.Handled = EventHandling.Modal; * }*/ /* static void WebControlOnLoadingFrameFailed(object sender, * LoadingFrameFailedEventArgs loadingFrameFailedEventArgs) { * var wb = (WebControl) sender; * if (loadingFrameFailedEventArgs.IsMainFrame && loadingFrameFailedEventArgs.ErrorCode != NetError.ABORTED) { * wb.LoadHTML(GetFailedHtml(loadingFrameFailedEventArgs.ErrorCode, * loadingFrameFailedEventArgs.ErrorDescription)); * } * } * * static string GetFailedHtml(NetError errorCode, string errorDescription) { * return * string.Format( * "<html><head></head><body><div><h3>Failed loading, please confirm internet connected</h3></div><br /><p>Code: {0}<br />Description: {1}</p></body></html>", * errorCode, errorDescription); * }*/ static void WebControlOnLoadingFrameComplete(object sender, FrameLoadEndEventArgs frameLoadEndEventArgs) { // Executing JS in about:blank will lock up the browser if (!frameLoadEndEventArgs.Frame.IsMain || frameLoadEndEventArgs.Url == "about:blank") { return; } var webControl = (ChromiumWebBrowser)sender; UiHelper.TryOnUiThread(() => { if (GetEnableAutoHeight(webControl)) { SetHeightFromDocument(webControl); } }); }
public static bool ProcessPage(IWebDriver driver) { var searchString = "To proceed with your evaluation"; if (driver.PageSource.ToLower().Contains(searchString.ToLower())) { //Driver.Navigate().Refresh(); //((IJavaScriptExecutor) Driver).ExecuteScript("javascript:reloadPage();"); UiHelper.FindElementByPartialHref(driver, "a", "javascript:reloadPage()").Click(); Cnt++; return(true); } else { return(false); } }
private void ButtonSave_Click(object sender, EventArgs e) { try { if (UiHelper.AskUser("To save?") == false) { return; } hardware.hardwares = new List <CommunicationBase>(bingding); //Configuration.SaveConfig(nameof(hardware.hardwares), hardware.hardwares); hardware.SaveConfig(); //hardware.LoadConfig(); } catch (Exception ex) { UiHelper.ShowException(ex); } }
private void ButtonAdd_Click(object sender, EventArgs e) { try { bingding.Add(new CommunicationBase() { HardwareId = "Scanner", Kind = "M120", Mode = "SocketClient", ParamStr = "127.0.0.1", ParamInt = 8080 }); } catch (Exception ex) { UiHelper.ShowException(ex); } }
private void SaveAsFile_Click(object sender, EventArgs e) { var saveDialog = new SaveFileDialog() { Title = String.Format("Save Spirit Battles"), Filter = "PRC|*.prc*", FileName = dataTbls.config.file_name_encr, InitialDirectory = dataTbls.config.file_directory }; var result = saveDialog.ShowDialog(); if (!result.Equals(DialogResult.Cancel) && !String.IsNullOrWhiteSpace(saveDialog?.FileName)) { dataTbls.Save(saveDialog.FileName); UiHelper.SetInformativeLabel(ref labelInformative, $"File saved."); } }
private protected void DrawSortableHeaderIcon() { switch (_sortKey) { case SortKey.Name: UiHelper.SortIndicator(NameHeaderRect, _sortOrder); return; case SortKey.Price: UiHelper.SortIndicator(PriceHeaderRect, _sortOrder); return; default: return; } }
protected override async void OnClick() { try { PatcherService.ChangeEnableState(this, false); if (_workingEvent.WaitOne(0) && !CancelEvent.WaitOne(0)) { Label = "Отмена..."; CancelEvent.Set(); return; } string label = Label; try { BeginProcess(); await DoAction(); if (CancelEvent.WaitOne(0)) { EndProcessError(); } else { EndProcessSuccess(); } } finally { _workingEvent.Reset(); CancelEvent.Reset(); Label = label; } } catch (Exception ex) { UiHelper.ShowError(this, ex); EndProcessError(); } finally { PatcherService.ChangeEnableState(this, true); } }
protected void InitGwupeModalUserControl(ContentPresenter disablerContentPresenter, TextBlock statusTextBlock, TextBlock errorTextBlock) { _uiHelper = new UiHelper(Dispatcher, disablerContentPresenter, null, errorTextBlock); }
protected void InitGwupeDataCaptureForm(ContentPresenter disablerContentPresenter, TextBlock statusTextBlock, TextBlock errorTextBlock) { _uiHelper = new UiHelper(Dispatcher, disablerContentPresenter, null, errorTextBlock); }