Sir Ruggie
Sir Ruggie
CC#
Created by Sir Ruggie on 2/14/2023 in #help
❔ WinUI 3 Pivot Header Size
3 replies
CC#
Created by Sir Ruggie on 2/13/2023 in #help
✅ C# Bold Text
I'm trying to make Address: Bold, but I'm having issues with it and it's displaying <b> </b> as text. This is in WinUI 3
private void locInfo_Click(object sender, RoutedEventArgs e)
{
var selectedItem = (Location)MainList.SelectedItem;
if (selectedItem != null)
{
DialogHelper dialogHelper = new DialogHelper();

var Title = "Location Information";
var Address = string.Format("<b>Address:</b> {0}", selectedItem.LocationInformation.AddressInfo.FullAddress);
var Phone = string.Format("Phone: {0}", selectedItem.LocationInformation.PhoneNumber);
var Fax = string.Format("Fax: {0}", selectedItem.LocationInformation.FaxNumber);
var Content = string.Format("{0}\n\n{1}\n{2}", Address, Phone, Fax);

dialogHelper.DisplayDialog(Title, Content, "Ok");
}
}
private void locInfo_Click(object sender, RoutedEventArgs e)
{
var selectedItem = (Location)MainList.SelectedItem;
if (selectedItem != null)
{
DialogHelper dialogHelper = new DialogHelper();

var Title = "Location Information";
var Address = string.Format("<b>Address:</b> {0}", selectedItem.LocationInformation.AddressInfo.FullAddress);
var Phone = string.Format("Phone: {0}", selectedItem.LocationInformation.PhoneNumber);
var Fax = string.Format("Fax: {0}", selectedItem.LocationInformation.FaxNumber);
var Content = string.Format("{0}\n\n{1}\n{2}", Address, Phone, Fax);

dialogHelper.DisplayDialog(Title, Content, "Ok");
}
}
3 replies
CC#
Created by Sir Ruggie on 2/7/2023 in #help
❔ WinUI exe launch issue
I receive this following issue every time from event viewer when I try to start the application via the exe, but it works fine from within Visual Studio. I'm not quite understanding why it's not creating the dependencies it needs. Application: RestDB.exe CoreCLR Version: 7.0.222.60605 .NET Version: 7.0.2 Description: The process was terminated due to an unhandled exception. Exception Info: System.DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E) at RestDB.Program.XamlCheckProcessRequirements() at RestDB.Program.Main(String[] args) in C:\Users\psa_gposab7\source\repos\RestDB\RestDB\obj\x64\Release\net7.0\win10-x64\App.g.i.cs:line 28
4 replies
CC#
Created by Sir Ruggie on 1/29/2023 in #help
✅ PowerShell Method in WinUI C#
So firstly, yes I have to use Powershell and am unable to just do it in C#. Below will be an example of a basic PowerShell script that I have My issue is that I'm returning a System.Data.Datarow, but I'm unable to return any data in C#. PowerShell Console Results
PS R:\> \\ris1\xnet\data\Wan\RestDB_Dependencies\PowerShell_Scripts\POS\Get-POS.ps1 -Site 1124

POS POSNumber
--- ---------
POS 1 - Cashier 01
POS 2 - Takeout 02
POS 3 - Takeout 03
POS 4 - Bar 04
POS 5 - Takeout 05
POS 6 - Takeout 06
POS 7 - Takeout 07
POS 8 - Takeout 08


PS R:\> \\ris1\xnet\data\Wan\RestDB_Dependencies\PowerShell_Scripts\POS\Get-POS.ps1 -Site 1124 |GM


TypeName: System.Data.DataRow

Name MemberType Definition
---- ---------- ----------
AcceptChanges Method void AcceptChanges()
BeginEdit Method void BeginEdit()
CancelEdit Method void CancelEdit()
ClearErrors Method void ClearErrors()
Delete Method void Delete()
EndEdit Method void EndEdit()
Equals Method bool Equals(System.Object obj)
GetChildRows Method System.Data.DataRow[] GetChildRows(string relationName), System.Data.DataRow[] GetChildRows(string relationName, ...
GetColumnError Method string GetColumnError(int columnIndex), string GetColumnError(string columnName), string GetColumnError(System.Da...
GetColumnsInError Method System.Data.DataColumn[] GetColumnsInError()
GetHashCode Method int GetHashCode()
GetParentRow Method System.Data.DataRow GetParentRow(string relationName), System.Data.DataRow GetParentRow(string relationName, Syst...
GetParentRows Method System.Data.DataRow[] GetParentRows(string relationName), System.Data.DataRow[] GetParentRows(string relationName...
GetType Method type GetType()
HasVersion Method bool HasVersion(System.Data.DataRowVersion version)
IsNull Method bool IsNull(int columnIndex), bool IsNull(string columnName), bool IsNull(System.Data.DataColumn column), bool Is...
RejectChanges Method void RejectChanges()
SetAdded Method void SetAdded()
SetColumnError Method void SetColumnError(int columnIndex, string error), void SetColumnError(string columnName, string error), void Se...
SetModified Method void SetModified()
SetParentRow Method void SetParentRow(System.Data.DataRow parentRow), void SetParentRow(System.Data.DataRow parentRow, System.Data.Da...
ToString Method string ToString()
Item ParameterizedProperty System.Object Item(int columnIndex) {get;set;}, System.Object Item(string columnName) {get;set;}, System.Object I...
POS Property string POS {get;set;}
POSNumber Property string POSNumber {get;set;}
PS R:\> \\ris1\xnet\data\Wan\RestDB_Dependencies\PowerShell_Scripts\POS\Get-POS.ps1 -Site 1124

POS POSNumber
--- ---------
POS 1 - Cashier 01
POS 2 - Takeout 02
POS 3 - Takeout 03
POS 4 - Bar 04
POS 5 - Takeout 05
POS 6 - Takeout 06
POS 7 - Takeout 07
POS 8 - Takeout 08


PS R:\> \\ris1\xnet\data\Wan\RestDB_Dependencies\PowerShell_Scripts\POS\Get-POS.ps1 -Site 1124 |GM


TypeName: System.Data.DataRow

Name MemberType Definition
---- ---------- ----------
AcceptChanges Method void AcceptChanges()
BeginEdit Method void BeginEdit()
CancelEdit Method void CancelEdit()
ClearErrors Method void ClearErrors()
Delete Method void Delete()
EndEdit Method void EndEdit()
Equals Method bool Equals(System.Object obj)
GetChildRows Method System.Data.DataRow[] GetChildRows(string relationName), System.Data.DataRow[] GetChildRows(string relationName, ...
GetColumnError Method string GetColumnError(int columnIndex), string GetColumnError(string columnName), string GetColumnError(System.Da...
GetColumnsInError Method System.Data.DataColumn[] GetColumnsInError()
GetHashCode Method int GetHashCode()
GetParentRow Method System.Data.DataRow GetParentRow(string relationName), System.Data.DataRow GetParentRow(string relationName, Syst...
GetParentRows Method System.Data.DataRow[] GetParentRows(string relationName), System.Data.DataRow[] GetParentRows(string relationName...
GetType Method type GetType()
HasVersion Method bool HasVersion(System.Data.DataRowVersion version)
IsNull Method bool IsNull(int columnIndex), bool IsNull(string columnName), bool IsNull(System.Data.DataColumn column), bool Is...
RejectChanges Method void RejectChanges()
SetAdded Method void SetAdded()
SetColumnError Method void SetColumnError(int columnIndex, string error), void SetColumnError(string columnName, string error), void Se...
SetModified Method void SetModified()
SetParentRow Method void SetParentRow(System.Data.DataRow parentRow), void SetParentRow(System.Data.DataRow parentRow, System.Data.Da...
ToString Method string ToString()
Item ParameterizedProperty System.Object Item(int columnIndex) {get;set;}, System.Object Item(string columnName) {get;set;}, System.Object I...
POS Property string POS {get;set;}
POSNumber Property string POSNumber {get;set;}
Within my application I have a PowerShellHelper.cs where I'm trying to use System.Management.Automation with the below method
public static Collection<PSObject> GetTableData(string script)
{
using (PowerShell powerShellInstance = PowerShell.Create())
{
Debug.WriteLine("Script: " + script);
powerShellInstance.AddScript(script);


Collection<PSObject> results = powerShellInstance.Invoke();

if (results == null || results.Count == 0)
{
Debug.WriteLine("No results returned.");
}
else
{
Debug.WriteLine("Results: " + results.ToString());
}

return results;
}
}
public static Collection<PSObject> GetTableData(string script)
{
using (PowerShell powerShellInstance = PowerShell.Create())
{
Debug.WriteLine("Script: " + script);
powerShellInstance.AddScript(script);


Collection<PSObject> results = powerShellInstance.Invoke();

if (results == null || results.Count == 0)
{
Debug.WriteLine("No results returned.");
}
else
{
Debug.WriteLine("Results: " + results.ToString());
}

return results;
}
}
52 replies
CC#
Created by Sir Ruggie on 12/8/2022 in #help
❔ C sharp object reference error
7 replies