public void Attach(ITextEncodingDialog dlg) { this.dlg = dlg; dlg.EncodingList.AddItems( Encoding.GetEncodings() .OrderBy(e => e.DisplayName) .Select(e => new ListOption( string.Format("{0} - {1}", e.DisplayName, e.Name), e.Name))); }
public void Attach(ITextEncodingDialog dlg) { this.dlg = dlg; dlg.EncodingList.AddItems( Encoding.GetEncodings() .OrderBy(e => e.DisplayName) .Select(e => new ListOption { Text = string.Format("{0} - {1}", e.DisplayName, e.Name), Value = e.Name })) ; }
public bool ChooseTextEncoding() { var dlgFactory = services.RequireService <IDialogFactory>(); var uiSvc = services.RequireService <IDecompilerShellUiService>(); using (ITextEncodingDialog dlg = dlgFactory.CreateTextEncodingDialog()) { if (uiSvc.ShowModalDialog(dlg) == Gui.DialogResult.OK) { var enc = dlg.GetSelectedTextEncoding(); program.User.TextEncoding = enc; this.codeView.RecomputeLayout(); } } return(true); }