Here are the examples of the csharp api System.Windows.Forms.Form.ShowDialog() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
513 Examples
19
Source : SmartForm.cs
with GNU General Public License v3.0
from Gavin-Huang
with GNU General Public License v3.0
from Gavin-Huang
public DialogResult OpenNewInputFormDidlog(SmartForm SonForm, Direction d)
{
SonForm.direc = d;
this.EventLocationChanged += SonForm.form_EventLocationChanged;
TellRightPoint();
Form Son = (Form)SonForm;
SonForm.TopLevel = true;
SonForm.TopMost = true;
Son.Owner = this;
SonForm.IsClosedGoback = false;
return Son.ShowDialog();
}
19
Source : SmartForm.cs
with GNU General Public License v3.0
from Gavin-Huang
with GNU General Public License v3.0
from Gavin-Huang
public DialogResult OpenNewFormDidlog(SmartForm SonForm,Direction d)
{
SonForm.direc = d;
this.EventLocationChanged += SonForm.form_EventLocationChanged;
TellRightPoint();
Form Son = (Form)SonForm;
Son.Owner = this;
this.Enabled = false;
return Son.ShowDialog();
}
19
Source : GuiHelper.cs
with MIT License
from gellin
with MIT License
from gellin
public static string RenameFileDialog(string oldFileName, string windowreplacedle)
{
Form prompt = BuildForm(windowreplacedle, 500, 150);
Label textLabel = new Label {
Left = 50,
Top = 20,
Text = oldFileName,
Width = 400
};
TextBox textBox = new TextBox {
Left = 50,
Top = 50,
Width = 400
};
Button cancel = new Button {
Text = "Cancel",
Left = 300,
Width = 100,
Top = 70,
DialogResult = DialogResult.Cancel
};
Button confirmation = new Button {
Text = "Ok",
Left = 400,
Width = 50,
Top = 70,
DialogResult = DialogResult.OK
};
confirmation.Click += (sender, e) => { prompt.Close(); };
cancel.Click += (sender, e) => { prompt.Close(); };
prompt.Controls.Add(textLabel);
prompt.Controls.Add(confirmation);
prompt.Controls.Add(textBox);
prompt.Controls.Add(cancel);
prompt.AcceptButton = confirmation;
return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : string.Empty;
}
19
Source : GuiHelper.cs
with MIT License
from gellin
with MIT License
from gellin
public static string RichTextBoxEvalEditor(string windowreplacedle, string text, ref bool showResponse)
{
Form prompt = BuildForm(windowreplacedle, 500, 520);
RichTextBox richTextBox = new RichTextBox {
Left = 10,
Top = 10,
Width = 470,
Height = 440,
Text = text
};
Button confirmation = new Button {
Text = "Ok",
Left = 380,
Width = 100,
Top = 455,
DialogResult = DialogResult.OK,
Anchor = AnchorStyles.Right | AnchorStyles.Bottom
};
CheckBox chkbxShowResponse = new CheckBox {
Text = "Show Response",
Left = 25,
Top = 455,
Checked = showResponse,
Anchor = AnchorStyles.Left | AnchorStyles.Bottom
};
bool chkboxResult = showResponse;
chkbxShowResponse.CheckedChanged += (sender, e) => { chkboxResult = chkbxShowResponse.Checked; };
richTextBox.WordWrap = false;
richTextBox.ScrollBars = RichTextBoxScrollBars.Vertical | RichTextBoxScrollBars.Horizontal;
richTextBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
prompt.Controls.Add(richTextBox);
prompt.Controls.Add(confirmation);
prompt.Controls.Add(chkbxShowResponse);
string result = prompt.ShowDialog() == DialogResult.OK ? richTextBox.Text : string.Empty;
confirmation.Click += (sender, e) => { prompt.Close(); };
showResponse = chkboxResult;
return result;
}
19
Source : GuiHelper.cs
with MIT License
from gellin
with MIT License
from gellin
public static string UserAgentSwitcher(string currentUserAgent, string windowreplacedle)
{
Form prompt = BuildForm(windowreplacedle, 500, 150);
Label textLabel = new Label {
Left = 17,
Top = 20,
Text = currentUserAgent,
Width = 450
};
TextBox textBox = new TextBox {
Left = 17,
Top = 50,
Width = 450
};
Button cancel = new Button {
Text = "Cancel",
Left = 200,
Width = 100,
Top = 80,
DialogResult = DialogResult.Cancel
};
Button randomize = new Button {
Text = "Random",
Left = 300,
Width = 100,
Top = 80,
};
Button confirmation = new Button {
Text = "Ok",
Left = 400,
Width = 50,
Top = 80,
DialogResult = DialogResult.OK
};
randomize.Click += (sender, e) =>
{
int randomUserAgentDictIndex = Helper.RandomDictionaryValue(WebRequestHelper.commonUseragents);
textBox.Text = WebRequestHelper.commonUseragents[randomUserAgentDictIndex];
};
cancel.Click += (sender, e) => { prompt.Close(); };
confirmation.Click += (sender, e) => { prompt.Close(); };
prompt.Controls.Add(confirmation);
prompt.Controls.Add(randomize);
prompt.Controls.Add(textLabel);
prompt.Controls.Add(textBox);
prompt.Controls.Add(cancel);
prompt.AcceptButton = confirmation;
return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : string.Empty;
}
19
Source : ColumnSelectionForm.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
public void OpenOn(ObjectListView olv, View view)
{
if (view != View.Details && view != View.Tile)
return;
this.InitializeForm(olv, view);
if (this.ShowDialog() == DialogResult.OK)
this.ProcessOK(olv, view);
}
19
Source : ColumnSelectionForm.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
public void OpenOn(ObjectListView olv, View view)
{
if (view != View.Details && view != View.Tile)
return;
this.InitializeForm(olv, view);
if (this.ShowDialog() == DialogResult.OK)
this.Apply(olv, view);
}
19
Source : ErrorDialog.cs
with Apache License 2.0
from GoogleCloudPlatform
with Apache License 2.0
from GoogleCloudPlatform
public static void Show(Exception e)
{
new ErrorDialog(e).ShowDialog();
}
19
Source : SaveCloseDialog.cs
with GNU General Public License v3.0
from Gota7
with GNU General Public License v3.0
from Gota7
public int getValue() {
this.ShowDialog();
return returnValue;
}
19
Source : NumberSelectionDialog.cs
with GNU General Public License v3.0
from Gota7
with GNU General Public License v3.0
from Gota7
public int getValue() {
this.ShowDialog();
return returnValue;
}
19
Source : InputBox.cs
with GNU General Public License v3.0
from greatcodeeer
with GNU General Public License v3.0
from greatcodeeer
public static string ShowInputBox(string replacedle, string keyInfo, string DefaultInput = null, bool UsePreplacedwordForm = false)
{
InputBox inputbox = new InputBox(DefaultInput, UsePreplacedwordForm);
inputbox.Text = replacedle;
inputbox.TopMost = true;
if (keyInfo.Trim() != string.Empty)
{
inputbox.lblInfo.Text = keyInfo;
}
inputbox.ShowDialog();
return inputbox.txtData.Text;
}
19
Source : DowngradeTool.cs
with GNU General Public License v3.0
from gregstein
with GNU General Public License v3.0
from gregstein
private static DialogResult ShowInputDialog(ref string input)
{
System.Drawing.Size size = new System.Drawing.Size(200, 70);
Form inputBox = new Form();
inputBox.StartPosition = FormStartPosition.CenterScreen;
inputBox.TopMost = true;
inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
inputBox.ClientSize = size;
inputBox.Text = "Steam Guard Code!";
System.Windows.Forms.TextBox textBox = new TextBox();
textBox.Size = new System.Drawing.Size(size.Width - 10, 23);
textBox.Location = new System.Drawing.Point(5, 5);
textBox.Text = input;
inputBox.Controls.Add(textBox);
Button okButton = new Button();
okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
okButton.Name = "okButton";
okButton.Size = new System.Drawing.Size(75, 23);
okButton.Text = "&OK";
okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39);
inputBox.Controls.Add(okButton);
Button cancelButton = new Button();
cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
cancelButton.Name = "cancelButton";
cancelButton.Size = new System.Drawing.Size(75, 23);
cancelButton.Text = "&Cancel";
cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39);
inputBox.Controls.Add(cancelButton);
inputBox.AcceptButton = okButton;
inputBox.CancelButton = cancelButton;
DialogResult result = inputBox.ShowDialog();
input = textBox.Text;
return result;
}
19
Source : AlertSetupForm.cs
with Apache License 2.0
from grigory-lobkov
with Apache License 2.0
from grigory-lobkov
public new void Show()
{
ShowDialog();
}
19
Source : CustomKeywordForm.cs
with GNU General Public License v3.0
from guest-nico
with GNU General Public License v3.0
from guest-nico
void CustomListCellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex != 3) return;
if (customKwListDataSource[e.RowIndex].type != "条件の入れ子") return;
var f = new CustomKeywordForm(fontSize, false, customKwListDataSource[e.RowIndex].cki);
f.ShowDialog();
if (f.ret == null) return;
customKwListDataSource[e.RowIndex].cki = f.ret;
infoLabel.Text = JToken.FromObject(f.ret).ToString(Formatting.None);
//customKwListDataSource[e.RowIndex].str =
// JToken.FromObject(f.ret).ToString(Formatting.None);
}
19
Source : CustomKeywordForm.cs
with GNU General Public License v3.0
from guest-nico
with GNU General Public License v3.0
from guest-nico
void CustomListCellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex != 3) return;
if (customKwListDataSource[e.RowIndex].type != "条件の入れ子") return;
var f = new CustomKeywordForm(false, customKwListDataSource[e.RowIndex].cki);
f.ShowDialog();
if (f.ret == null) return;
customKwListDataSource[e.RowIndex].cki = f.ret;
infoLabel.Text = JToken.FromObject(f.ret).ToString(Formatting.None);
//customKwListDataSource[e.RowIndex].str =
// JToken.FromObject(f.ret).ToString(Formatting.None);
}
19
Source : Program.cs
with Apache License 2.0
from haifengat
with Apache License 2.0
from haifengat
[STAThread]
static void Main(string[] args)
{
_errLog = "err_" + Application.ProductName + ".log";
var ver = new Version(Application.ProductVersion);
Console.replacedle = $"AT {ver.Major}.{ver.MajorRevision}";
DisableCloseButton(Console.replacedle);
//Application.Run(new Form1() { Text = Console.replacedle });
//你在主线程捕获全部异常就行,如下代码:
//WINFORM未处理异常之捕获
//处理未捕获的异常
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
//处理UI线程异常
Application.ThreadException += Application_ThreadException;
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
//定时启动
//取日历判断是否应该启动->加载plat->填写前置帐号密码等参数->登录->判断登录是否成功->已加载的所有策略点"加载"->委托(与上次状态相同)
Plat plat = null;
if (args.Length > 0)
plat = new Plat(args[0]);
else
//plat = new Plat();
plat = new Plat("service.haifengat.com:15555");
//Console.WriteLine("params data service address ip:port");
plat.Dock = DockStyle.Fill;
using (Form f = new Form
{
Height = plat.Height,
Width = plat.Width,
Icon = Properties.Resources.HF
})
{
f.Controls.Add(plat);
f.ShowDialog();
f.Close();
}
Environment.Exit(0); //正常关闭
}
19
Source : frmGridAccountant.cs
with BSD 3-Clause "New" or "Revised" License
from HalcyonGrid
with BSD 3-Clause "New" or "Revised" License
from HalcyonGrid
[STAThread]
static void Main()
{
frmGridAccountant frm = new frmGridAccountant();
frm.ShowDialog();
}
19
Source : frmGroupManager.cs
with BSD 3-Clause "New" or "Revised" License
from HalcyonGrid
with BSD 3-Clause "New" or "Revised" License
from HalcyonGrid
[STAThread]
static void Main()
{
frmGroupManager frm = new frmGroupManager();
frm.ShowDialog();
}
19
Source : RegEditorApplication.cs
with GNU Affero General Public License v3.0
from hamflx
with GNU Affero General Public License v3.0
from hamflx
private void CreateEditForm(bool isBinary)
{
string keyPath = tvRegistryDirectory.SelectedNode.FullPath;
string name = lstRegistryValues.SelectedItems[0].Name;
RegValueData value = ((RegValueData[])tvRegistryDirectory.SelectedNode.Tag).ToList().Find(item => item.Name == name);
// any kind can be edited as binary
RegistryValueKind kind = isBinary ? RegistryValueKind.Binary : value.Kind;
using (var frm = GetEditForm(value, kind))
{
if (frm.ShowDialog() == DialogResult.OK)
{
this.RegistryEditorAdapterHandler.ChangeRegistryValue(keyPath, (RegValueData)frm.Tag);
}
}
}
19
Source : InputBox.cs
with Microsoft Public License
from harborsiem
with Microsoft Public License
from harborsiem
public static string Show(string caption, string label, string text)
{
InputBox dialog = new InputBox();
dialog.label.Text = label;
dialog.Text = caption;
dialog.textBox.Text = text;
if (dialog.ShowDialog() == DialogResult.OK)
{
return dialog.textBox.Text;
}
else
return string.Empty;
}
19
Source : InputQuery.cs
with Microsoft Public License
from harborsiem
with Microsoft Public License
from harborsiem
public static DialogResult Show(string caption, string label, out string text)
{
InputQuery dialog = new InputQuery();
dialog.label.Text = label;
dialog.Text = caption;
DialogResult result;
if ((result = dialog.ShowDialog()) == DialogResult.OK)
{
text = dialog.textBox.Text;
}
else
text = string.Empty;
return result;
}
19
Source : NewFileForm.cs
with Microsoft Public License
from harborsiem
with Microsoft Public License
from harborsiem
public static bool NewFileDialog(out RibbonTemplate template, out string fileName)
{
NewFileForm dialog;
bool result;
template = RibbonTemplate.None;
fileName = string.Empty;
dialog = new NewFileForm();
try
{
result = (dialog.ShowDialog() == DialogResult.OK);
if (result)
{
int itemIndex = 0;
if (dialog.wordPadRadioButton.Checked)
itemIndex = 1;
template = (RibbonTemplate)(itemIndex);
fileName = Path.Combine(dialog.EditDirectory.Text, dialog.EditFilename.Text);
}
}
finally
{
dialog.Close();
}
return result;
}
19
Source : HelpRepaint.cs
with GNU General Public License v3.0
from hope140
with GNU General Public License v3.0
from hope140
public DialogResult ShowDialogInternal(Component controlOrItem, Point offset)
{
var visible = Visible;
var flag = visible;
var flag2 = flag;
var flag3 = flag2;
var flag4 = flag3;
var flag5 = flag4;
var flag6 = flag5;
var flag7 = flag6;
var flag8 = flag7;
var flag9 = flag8;
DialogResult result;
if (flag9)
{
result = DialogResult.None;
}
else
{
SetLocationAndOwner(controlOrItem, offset);
result = base.ShowDialog();
}
return result;
}
19
Source : AttributeEditor.cs
with MIT License
from hybridview
with MIT License
from hybridview
private bool TryEditValueUsingNewEditor(ConfigurationProperty configElement, LinkedElementCollection<Attribute> attributes, IServiceProvider provider)
{
// 1) Create a fake store with correct metadata
// 2) Map Attributes to ClrAttributes
// 3) Invoke the new editor with clrAttributes collection (this is required because the editor operates on ClrAttribute type.... WTF)
// 4) Map back (if necessary) the attributes from clrAttributes
var store = new Store(typeof(DslDefinitionModelDomainModel));
var clrAttributes = MapAttributesToClrAttributes(attributes, store);
var attributeFormCtor = AttributeEditorFormConstructor;
if (attributeFormCtor != null)
{
var form = attributeFormCtor.Invoke(new object[] { store, clrAttributes, provider }) as Form;
if (form != null)
{
DialogResult result;
using (form)
{
result = form.ShowDialog();
}
if (result == DialogResult.OK)
{
using (Transaction transaction = configElement.Store.TransactionManager.BeginTransaction("Edit custom attributes"))
{
MapClrAttributesToAttributes(clrAttributes, attributes, configElement.Store);
if (transaction.HasPendingChanges)
{
transaction.Commit();
}
else
{
transaction.Rollback();
}
}
}
return true;
}
}
return false;
}
19
Source : ClipboardListForm.cs
with GNU General Public License v3.0
from hyjiacan
with GNU General Public License v3.0
from hyjiacan
public static void Open()
{
if (instance != null)
{
return;
}
instance = new ClipboardListForm();
instance.ShowDialog();
}
19
Source : ImageListViewDesigner.cs
with MIT License
from iccb1013
with MIT License
from iccb1013
DialogResult IWindowsFormsEditorService.ShowDialog(Form dialog)
{
return (dialog.ShowDialog());
}
19
Source : SecurityWarning.cs
with GNU General Public License v3.0
from iccfish
with GNU General Public License v3.0
from iccfish
internal static void CheckShowSecurityWarning()
{
if (AppContext.Instance.Options.DismissSecurityWarning)
return;
new SecurityWarning().ShowDialog();
}
19
Source : InitializingUserPage.cs
with GNU General Public License v3.0
from iccfish
with GNU General Public License v3.0
from iccfish
public static IDisposable Show(Form parentForm)
{
var f = new InitializingUserPage(parentForm);
var ret = new DisposableScope(f);
new Thread(() => f.ShowDialog()).Start();
return ret;
}
19
Source : WizardImplementation.cs
with MIT License
from Ignition-Group-Open-Source-Contrib
with MIT License
from Ignition-Group-Open-Source-Contrib
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
{
try
{
// Display a form to the user. The form collects
// input for the custom message.
inputForm = new UserInputForm();
inputForm.ShowDialog();
applicationName = UserInputForm.ApplicationName;
// Add custom parameters.
replacementsDictionary.Add("$daprAppName$", applicationName);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
19
Source : AssetHeader.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static Section_AHDR Getreplacedet(replacedetHeader a)
{
if (a.ShowDialog() == DialogResult.OK)
{
AHDRFlags flags =
(a.checkSourceFile.Checked ? AHDRFlags.SOURCE_FILE : 0) |
(a.checkSourceVirtual.Checked ? AHDRFlags.SOURCE_VIRTUAL : 0) |
(a.checkReadT.Checked ? AHDRFlags.READ_TRANSFORM : 0) |
(a.checkWriteT.Checked ? AHDRFlags.WRITE_TRANSFORM : 0);
Section_ADBG ADBG = new Section_ADBG(0, a.replacedetName, a.replacedetFileName, a.checksum);
Section_AHDR AHDR = new Section_AHDR(a.replacedetID, a.replacedetType, flags, ADBG, a.data)
{
fileSize = a.data.Length,
plusValue = 0
};
return AHDR;
}
return null;
}
19
Source : ChoosePlatform.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static Platform GetPlatform()
{
using (var dialog = new ChoosePlatformDialog())
if (dialog.ShowDialog() == DialogResult.OK)
return dialog.platform;
return Platform.Unknown;
}
19
Source : ImportModel.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (List<Section_AHDR> AHDRs, bool overwrite, bool simps, bool ledgeGrab, bool piptVColors, bool solidSimps) GetModels(Game game)
{
using (ImportModel a = new ImportModel())
if (a.ShowDialog() == DialogResult.OK)
{
List<Section_AHDR> AHDRs = new List<Section_AHDR>();
replacedetType replacedetType = (replacedetType)a.comboBoxreplacedetTypes.SelectedItem;
if (replacedetType == replacedetType.MODL)
{
if (a.checkBoxGenSimps.Checked)
MessageBox.Show("a SIMP for each imported MODL will be generated and placed on a new DEFAULT layer.");
}
foreach (string filePath in a.filePaths)
{
string replacedetName;
byte[] replacedetData;
ReadFileMethods.treatStuffAsByteArray = false;
if (replacedetType == replacedetType.MODL)
{
replacedetName = Path.GetFileNameWithoutExtension(filePath) + ".dff";
replacedetData = Path.GetExtension(filePath).ToLower().Equals(".dff") ?
File.ReadAllBytes(filePath) :
ReadFileMethods.ExportRenderWareFile(
CreateDFFFromreplacedimp(filePath,
a.checkBoxFlipUVs.Checked,
a.checkBoxIgnoreMeshColors.Checked),
modelRenderWareVersion(game));
}
else if (replacedetType == replacedetType.BSP)
{
replacedetName = Path.GetFileNameWithoutExtension(filePath) + ".bsp";
replacedetData = Path.GetExtension(filePath).ToLower().Equals(".bsp") ?
File.ReadAllBytes(filePath) :
ReadFileMethods.ExportRenderWareFile(
CreateBSPFromreplacedimp(filePath,
a.checkBoxFlipUVs.Checked,
a.checkBoxIgnoreMeshColors.Checked),
modelRenderWareVersion(game));
}
else throw new ArgumentException();
AHDRs.Add(new Section_AHDR(
Functions.BKDRHash(replacedetName),
replacedetType,
ArchiveEditorFunctions.AHDRFlagsFromreplacedetType(replacedetType),
new Section_ADBG(0, replacedetName, "", 0),
replacedetData));
}
return (AHDRs, a.checkBoxOverwrite.Checked, a.checkBoxGenSimps.Checked, a.checkBoxLedgeGrab.Checked, a.checkBoxEnableVcolors.Checked, a.checkBoxSolidSimps.Checked);
}
return (null, false, false, false, false, false);
}
19
Source : LinkEditor.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static Link[] GetLinks(Game game, Link[] links, LinkType linkType, uint thisreplacedetID)
{
LinkEditor linkEditor = new LinkEditor(game, links, linkType, thisreplacedetID);
linkEditor.ShowDialog();
if (linkEditor.OK)
{
List<Link> newLinks = new List<Link>();
foreach (Link l in linkEditor.listBoxLinks.Items)
newLinks.Add(l);
return newLinks.ToArray();
}
return null;
}
19
Source : NewArchive.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (HipFile hipFile, Platform platform, Game game, bool addDefaultreplacedets) GetNewArchive()
{
NewArchive newArchive = new NewArchive();
newArchive.ShowDialog();
if (newArchive.result != null)
return (newArchive.result, newArchive.platform, newArchive.game, newArchive.checkBoxDefaultreplacedets.Checked);
return (null, Platform.Unknown, Game.Unknown, false);
}
19
Source : NewArchive.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (Section_PACK PACK, Platform newPlatform, Game newGame) GetExistingArchive(Platform previousPlatform, Game previousGame, int previousDate, string previousDateString)
{
NewArchive newArchive = new NewArchive(previousPlatform, previousGame, previousDate, previousDateString);
newArchive.ShowDialog();
if (newArchive.OK)
return (newArchive.result.PACK, newArchive.platform, newArchive.game);
return (null, 0, 0);
}
19
Source : MaterialEffectEditor.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static Material_0007[] GetMaterials(Material_0007[] materials)
{
MaterialEffectEditor eventEditor = new MaterialEffectEditor(materials);
eventEditor.ShowDialog();
if (eventEditor.OK)
{
List<Material_0007> outMaterials = new List<Material_0007>();
foreach (Material_0007 material in eventEditor.listBoxMaterials.Items)
outMaterials.Add(material);
return outMaterials.ToArray();
}
return null;
}
19
Source : EditName.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static string GetName(string oldName, string windowText, out bool OKed)
{
EditName edit = new EditName(oldName, windowText);
edit.ShowDialog();
OKed = edit.OKed;
if (edit.OKed)
return edit.textBox1.Text;
return oldName;
}
19
Source : AddMultipleAssets.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (List<Section_AHDR> AHDRs, bool overwrite) Getreplacedets()
{
AddMultiplereplacedets a = new AddMultiplereplacedets();
DialogResult d = a.ShowDialog();
if (d == DialogResult.OK)
{
List<Section_AHDR> AHDRs = new List<Section_AHDR>();
for (int i = 0; i < a.replacedetNames.Count; i++)
{
Section_ADBG ADBG = new Section_ADBG(0, a.replacedetNames[i], "", 0);
Section_AHDR AHDR = new Section_AHDR(Functions.BKDRHash(a.replacedetNames[i]), a.replacedetType, a.AHDRflags, ADBG, a.replacedetData[i])
{
fileSize = a.replacedetData[i].Length
};
AHDRs.Add(AHDR);
}
return (AHDRs, a.checkBoxOverwrite.Checked);
}
return (null, false);
}
19
Source : ApplyScale.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static Vector3? GetScale()
{
ApplyScale edit = new ApplyScale();
edit.ShowDialog();
if (edit.OK)
return new Vector3((float)edit.numericUpDownX.Value, (float)edit.numericUpDownY.Value, (float)edit.numericUpDownZ.Value);
return null;
}
19
Source : ApplyVertexColors.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (Vector4?, Operation) GetColor()
{
ApplyVertexColors edit = new ApplyVertexColors();
edit.ShowDialog();
if (edit.OK)
return (new Vector4((float)edit.numericUpDownX.Value, (float)edit.numericUpDownY.Value, (float)edit.numericUpDownZ.Value, (float)edit.numericUpDownW.Value),
(Operation)edit.comboBoxOperation.SelectedItem);
return (null, 0);
}
19
Source : ImportTextures.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (List<Section_AHDR> AHDRs, bool overwrite) Getreplacedets(Game game, Platform platform)
{
ImportTextures a = new ImportTextures();
if (a.ShowDialog() == DialogResult.OK)
{
ReadFileMethods.treatStuffAsByteArray = true;
List<Section_AHDR> AHDRs = new List<Section_AHDR>();
List<string> forBitmap = new List<string>();
for (int i = 0; i < a.filePaths.Count; i++)
{
if (Path.GetExtension(a.filePaths[i]).ToLower().Equals(".rwtex"))
{
byte[] data = ReadFileMethods.ExportRenderWareFile(new TextureDictionary_0016()
{
textureDictionaryStruct = new TextureDictionaryStruct_0001() { textureCount = 1, unknown = 0 },
textureNativeList = new List<TextureNative_0015>() { new TextureNative_0015().FromBytes(File.ReadAllBytes(a.filePaths[i])) },
textureDictionaryExtension = new Extension_0003()
}, currentTextureVersion(game));
string replacedetName = Path.GetFileNameWithoutExtension(a.filePaths[i]) + (a.checkBoxRW3.Checked ? ".RW3" : "");
Section_ADBG ADBG = new Section_ADBG(0, replacedetName, "", 0);
Section_AHDR AHDR = new Section_AHDR(Functions.BKDRHash(replacedetName), replacedetType.RWTX, ArchiveEditorFunctions.AHDRFlagsFromreplacedetType(replacedetType.RWTX), ADBG, data);
AHDRs.Add(AHDR);
}
else
{
forBitmap.Add(a.filePaths[i]);
}
}
AHDRs.AddRange(CreateRWTXsFromBitmaps(game, platform, forBitmap, a.checkBoxRW3.Checked, a.checkBoxFlipTextures.Checked,
a.checkBoxMipmaps.Checked, a.checkBoxCompress.Checked, a.checkBoxTransFix.Checked));
ReadFileMethods.treatStuffAsByteArray = false;
if (game == Game.Scooby)
for (int i = 0; i < AHDRs.Count; i++)
{
byte[] data = AHDRs[i].data;
FixTextureForScooby(ref data);
AHDRs[i].data = data;
}
return (AHDRs, a.checkBoxOverwrite.Checked);
}
return (null, false);
}
19
Source : Error.cs
with MIT License
from iirh
with MIT License
from iirh
public static void Show(string replacedle)
{
using (var form = new Error(replacedle))
{
form.ShowDialog();
}
}
19
Source : ChooseTarget.cs
with GNU General Public License v3.0
from igorseabra4
with GNU General Public License v3.0
from igorseabra4
public static (ExportFormatDescription format, string textureExtension) GetTarget()
{
ChooseTarget c = new ChooseTarget();
DialogResult d = c.ShowDialog();
if (c.OKed || d == DialogResult.OK)
return (c.comboBoxFormat.SelectedIndex == 0 ? null : c.formats[c.comboBoxFormat.SelectedIndex - 1], "." + c.textBoxExtension.Text);
return (null, null);
}
19
Source : ModUpdateSelectDialog.cs
with GNU General Public License v3.0
from IllusionMods
with GNU General Public License v3.0
from IllusionMods
public static List<UpdateTask> ShowWindow(ModUpdateProgressDialog owner, List<UpdateTask> updateTasks)
{
try
{
using (var w = new ModUpdateSelectDialog())
{
if (owner.Icon != null)
w.Icon = owner.Icon;
w.StartPosition = FormStartPosition.CenterParent;
w._updateTasks = updateTasks.OrderBy(x => x.UpToDate).ThenBy(x => x.TaskName).ToList();
w.ShowDialog();
return w._selectedItems;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Failed to get updates", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return null;
}
19
Source : frmEnhMiniPick.cs
with GNU General Public License v3.0
from ImaginaryDevelopment
with GNU General Public License v3.0
from ImaginaryDevelopment
public static int MezPicker(int startIndex)
{
Enums.eMez eMez = Enums.eMez.None;
frmEnhMiniPick frmEnhMiniPick = new frmEnhMiniPick();
string[] names = Enum.GetNames(eMez.GetType());
int num1 = names.Length - 1;
for (int index = 1; index <= num1; ++index)
frmEnhMiniPick.lbList.Items.Add(names[index]);
if (startIndex > -1 & startIndex < frmEnhMiniPick.lbList.Items.Count)
frmEnhMiniPick.lbList.SelectedIndex = startIndex - 1;
else
frmEnhMiniPick.lbList.SelectedIndex = 0;
frmEnhMiniPick.ShowDialog();
return frmEnhMiniPick.lbList.SelectedIndex + 1;
}
19
Source : frmOptionListDlg.cs
with GNU General Public License v3.0
from ImaginaryDevelopment
with GNU General Public License v3.0
from ImaginaryDevelopment
public static (DialogResult, bool? remember) ShowWithOptions(
bool AllowRemember,
int DefaultOption,
string descript,
params string[] OptionList)
{
var frm = new frmOptionListDlg();
frm.chkRemember.Enabled = AllowRemember;
frm.chkRemember.Visible = AllowRemember;
frm.chkRemember.Checked = false;
frm.lblDescript.Text = descript;
frm.cmbAction.Items.Clear();
frm.cmbAction.Items.AddRange(OptionList);
if (DefaultOption < frm.cmbAction.Items.Count - 1)
frm.cmbAction.SelectedIndex = DefaultOption;
else
frm.cmbAction.SelectedIndex = 0;
var result = frm.ShowDialog();
return (result, frm.remember);
}
19
Source : frmLoading.cs
with GNU General Public License v3.0
from ImaginaryDevelopment
with GNU General Public License v3.0
from ImaginaryDevelopment
static void ShowPrettyError(string replacedle, string text, Action onLabelClick = null)
{
var frm = new frmLoading();
frm.Label1.Text = text;
frm.Text = replacedle;
if (onLabelClick != null)
{
frm.Label1.Font = new Font(frm.Label1.Font.Name, frm.Label1.Font.SizeInPoints, FontStyle.Underline);
frm.Label1.Click += (sender, e) => onLabelClick();
}
frm.Label1.Dock = DockStyle.Fill;
frm.Size = new Size(frm.Size.Width, frm.Size.Height + 100);
frm.FormBorderStyle = FormBorderStyle.FixedDialog;
frm.ShowDialog();
}
19
Source : MessageForm.cs
with GNU General Public License v3.0
from indiff
with GNU General Public License v3.0
from indiff
public static void Show(IntPtr hwndParent, string strMessage, string strreplacedle, MessageBoxIcon icon, int msecDuration, bool fModal = false, bool fTopMost = false) {
MessageForm form = new MessageForm(strMessage, strreplacedle, null, icon, msecDuration);
Rectangle parentRect;
if(hwndParent != IntPtr.Zero) {
RECT rect;
PInvoke.GetWindowRect(hwndParent, out rect);
parentRect = rect.ToRectangle();
}
else {
parentRect = Screen.PrimaryScreen.WorkingArea;
}
form.Location = new Point(parentRect.Left + ((parentRect.Width - form.Width) / 2),
parentRect.Top + ((parentRect.Height - form.Height) / 2));
if(fModal) {
form.TopMost = true;
form.ShowDialog();
}
else {
form.TopMost = fTopMost;
form.ShowMessageForm();
}
}
19
Source : ExceptionReportView.cs
with GNU General Public License v3.0
from ipphone
with GNU General Public License v3.0
from ipphone
public void ShowExceptionReport()
{
_isDataRefreshRequired = true;
ShowDialog();
}
19
Source : fmSelectGrammars.cs
with MIT License
from IronyProject
with MIT License
from IronyProject
public static GrammarItemList SelectGrammars(string replacedemblyPath, GrammarItemList loadedGrammars) {
var fromGrammars = LoadGrammars(replacedemblyPath);
if (fromGrammars == null)
return null;
//fill the listbox and show the form
fmSelectGrammars form = new fmSelectGrammars();
var listbox = form.lstGrammars;
listbox.Sorted = false;
foreach(GrammarItem item in fromGrammars) {
listbox.Items.Add(item);
if (!ContainsGrammar(loadedGrammars, item))
listbox.SereplacedemChecked(listbox.Items.Count - 1, true);
}
listbox.Sorted = true;
if (form.ShowDialog() != DialogResult.OK) return null;
GrammarItemList result = new GrammarItemList();
for (int i = 0; i < listbox.Items.Count; i++) {
if (listbox.GereplacedemChecked(i)) {
var item = listbox.Items[i] as GrammarItem;
item._loading = false;
result.Add(item);
}
}
return result;
}
See More Examples