XService.UI
2025.10.30.1913
dotnet add package XService.UI --version 2025.10.30.1913
NuGet\Install-Package XService.UI -Version 2025.10.30.1913
<PackageReference Include="XService.UI" Version="2025.10.30.1913" />
<PackageVersion Include="XService.UI" Version="2025.10.30.1913" />
<PackageReference Include="XService.UI" />
paket add XService.UI --version 2025.10.30.1913
#r "nuget: XService.UI, 2025.10.30.1913"
#:package XService.UI@2025.10.30.1913
#addin nuget:?package=XService.UI&version=2025.10.30.1913
#tool nuget:?package=XService.UI&version=2025.10.30.1913
Just a 'gentleman set' of UI-specific routinues for small applications.
This package includes VS-generated documentaiton, so this readme file contsina only some typically used highlights.
Example of typical code for AboutBox
private void mmiAbout_Click(object sender, EventArgs e)
{
Dictionary<string, string> props = new Dictionary<string, string>();
TypeUtils.CollectVersionInfoAttributes(props, Assembly.GetEntryAssembly());
props["ApplicationName"] = "ADO.NET Query";
props["EOL"] = Environment.NewLine;
props["url"] = "https://dmitrybond.wordpress.com/2012/10/20/three-queries/";
props["userConfig"] = (string.IsNullOrEmpty(this.userConfigPath) ? "-" : this.userConfigPath);
Assembly asm = Assembly.GetExecutingAssembly();
props["HostInfo"] = CommonUtils.HostInfoStamp() + string.Format(" ProcessType:{0};", asm.GetName().ProcessorArchitecture);
string info = ""
+ "$(ApplicationName).$(EOL)"
+ "Version $(Version) / $(FileVersion)$(EOL)"
+ "Written by Dmitry Bond. (dima_ben@ukr.net)$(EOL)"
+ "$(EOL)"
+ "$(HostInfo)$(EOL)"
+ "$(EOL)"
+ "$(url)$(EOL)"
+ "$(EOL)"
+ "$(userConfig)$(EOL)"
+ "";
info = StrUtils.ExpandParameters(info, props, true);
FormAbout.Execute(this, StrUtils.ExpandParameters("About $(ApplicationName)", props, true),
info, HELP_LICENSE_TEXT);
}
Example of rendering text into RichText UI control:
StringBuilder sb = new StringBuilder();
[...]
sb.AppendLine(string.Format("<color color=\'navy\'>Statistic generation time</color>: <b>{0}</b> ms, <b>{1}</b><br/>",
(DateTime.Now - t1).TotalMilliseconds.ToString("N1"), DateTime.Now));
sb.AppendLine("</root>");
UiTools.RenderInto(txtInfo, sb.ToString());
Example of saving UI form location and settings:
private string serializeExtraUiProps()
{
string txt = "";
txt += string.Format("QueryHeight:{0}%; ", (100.0d * (double)panQuery.Height / this.Height).ToString("N2"));
txt += string.Format("LogPanelHeight:{0}%; ", (100.0d * (double)lvLogger.Height / this.Height).ToString("N2"));
txt += string.Format("HoldConnection:{0}; ", (tbHoldConnection.Checked ? "1" : "0"));
return txt;
}
private void deserializeExtraUiProp(string pName, string pValue)
{
if (StrUtils.IsSameText(pName, "QueryHeight"))
{
try { panQuery.Height = (int)(Convert.ToDouble(pValue.Trim("%".ToCharArray())) / 100.0 * this.Height); }
catch { }
}
if (StrUtils.IsSameText(pName, "LogPanelHeight"))
{
try { lvLogger.Parent.Height = (int)(Convert.ToDouble(pValue.Trim("%".ToCharArray())) / 100.0 * this.Height); }
catch { }
}
if (StrUtils.IsSameText(pName, "HoldConnection"))
{
try { tbHoldConnection.Checked = StrUtils.GetAsBool(pValue); }
catch { }
}
}
private void FormMain_Shown(object sender, EventArgs e)
{
// load MainForm UI settings (window position & state)
if (!string.IsNullOrEmpty(Settings.Default.MainFormView))
UiTools.DeserializeFormView(Settings.Default.MainFormView, this, this.deserializeExtraUiProp);
[...]
}
private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
{
Settings.Default.MainFormView = UiTools.SerializeFormView(this) + serializeExtraUiProps();
Settings.Default.Save();
[...]
}
Example of SidePanel for UI:
private void FormMain_Load(object sender, EventArgs e)
{
[...]
this.sideToolsPanel = new SidePanelHandler(Settings.Default, "Side_ToolsPanel", false);
this.sideToolsPanel.Setup(this.labToolsShortcut, this.btnToolsHide, this.panTools, this.labToolsCaption, this.splitTools);
[...]
}
private void mmiToolsToggleToolsPanel_Click(object sender, EventArgs e)
{
this.sideToolsPanel.ToggleState(!this.sideToolsPanel.State);
mmiToolsToggleToolsPanel.Checked = this.sideToolsPanel.State;
}
Example of simple modal EditValue UI:
bool isOk = FormEditValue.Execute(this,
Languages.Translate("Set Workspace Name"),
Languages.Translate("Type workspace name"),
ref s, FormEditValue.EEditValueFlags.NonEmpty, null, validateWsName);
if (isOk)
{
this.document.DefaultWorkspace.SetName(s);
updateAppCaption();
populateWorkspaces();
}
Example of simple modal SelectItems UI:
List<string> list2 = new List<string>();
FormSelectItems.WINDOW_SIZE = new System.Drawing.Size(520, 320);
string title = (pRemove ? "Rules to Un-setup" : "Rules to Setup");
string prompt = (pRemove ? "Select rules to un-setup" : "Select rules to setup");
bool isOk = FormSelectItems.Execute(
this, title, prompt, list1, list2,
FormSelectItems.ESelectItemFlags.DetailsView | FormSelectItems.ESelectItemFlags.NonEmpty | FormSelectItems.ESelectItemFlags.UsePreferedSize);
if (!isOk) return;
Example of simple modal ShowText UI:
FormShowText.UiParams prm = new FormShowText.UiParams() { WindowSize = new Size(900, 450), UseWebView = false };
FormShowText.Execute(this, string.Format("Please Check Rules {0}Setup Log File", (pRemove ? "Un-" : "")), sb.ToString(), prm);
/Dmitry Bond (dmitry_bond@hotmail.com)/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net20 is compatible. net35 was computed. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.10.30.1913 | 237 | 10/30/2025 |
| 2024.4.26.2106 | 263 | 4/26/2024 |
| 2023.6.15.1629 | 327 | 6/23/2023 |
| 2022.5.17.1121 | 564 | 12/28/2022 |
Just a 1st official release