IvanGit

Results 9 comments of IvanGit

I have installed RJCP.Diagnostics.Trace, added to app.config as described in 6.1.2, but file logfile.txt is not created. I use .NET 4.7.2 and package ``

I have modified file as described, but nothing. No logs, only IOException in runtime while Open().

The exception occurs in SerialPortStream::Open() => SerialPortStream::Open(true) => WinNativeSerial::SetPortSettings() => m_CommState.SetCommState() after Kernel32.SetCommState returned false.

It looks like 2.4.2 does not contain GetPortSettings() method.

But I have implemented via reflection. ```cs var m_NativeSerial = sps.GetType().GetField("m_NativeSerial", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(sps); var type = m_NativeSerial.GetType(); type.InvokeMember("Open", BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, m_NativeSerial, null); type.InvokeMember("GetPortSettings", BindingFlags.Public |...

It works without stopbits: ```cs (int BaudRate, int DataBits, Parity Parity, StopBits StopBits, int ReadTimeout, int WriteTimeout) = (sps.BaudRate, sps.DataBits, sps.Parity, sps.StopBits, sps.ReadTimeout, sps.WriteTimeout); var m_NativeSerial = sps.GetType().GetField("m_NativeSerial", BindingFlags.NonPublic |...

The reason was in StopBits. RJCP.IO.Ports.Parity is compatible with System.IO.Ports.Parity, but RJCP.IO.Ports.StopBits is not compatible with System.IO.Ports.StopBits. Code was ported from SerialPort and stream setup before like `sps.StopBits = (RJCP.IO.Ports.StopBits)db_Int32Value;`...

Yes, you are right. I have rechecked, reflection is not needed here. Now GetPortSettings() is appeared. No idea why it wasn't compiling before.

Hi! You can try the [Minimal MVVM](https://github.com/IvanGit/NuExt.Minimal.Mvvm.MahApps.Metro) framework for MahApps.Metro: ``` ``` Validation can be achieved via the `ValidatesOnDataErrors` and/or `ValidatesOnNotifyDataErrors` properties of the MetroDialogService for custom dialogs. [Sample](https://github.com/IvanGit/NuExt.Minimal.Mvvm.MahApps.Metro/blob/main/samples/MetroWpfApp/MainWindow.xaml) that...