15,902,749 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Pawel Wzietek (Top 4 by date)
Pawel Wzietek
15-Feb-22 11:39am
View
The fact that shape is declared inside Form1 only means that private fields of Form1 appear as public to shape, otherwise it doesn't change anything in that you still need an instance reference to access a non-static class variable from a code outside the class. From this perspective, the code of test is in the shape class but outside the Form1 class. Look here for more examples:
https://www.geeksforgeeks.org/nested-classes-in-c-sharp/
Pawel Wzietek
3-Apr-19 2:25am
View
" so long as your code is running something like an event handler, the UI thread cannot process the message pump "
It is still possible to invoke the message pump from inside the handler with "DoEvents()". Of course in this case the handler itself should be made reentrant.
Pawel Wzietek
30-May-18 3:52am
View
Of course it will work, the only problem is that "Read()" will block the thread until the response is received (UI will not respond) this is why we use events. But even without using the DataReceived handler you can make the app more responsive if you set a short timeout and repeat the Read until you get data, something like:
serialport.ReadTimeout=1;
string response = null;
do
Application.DoEvents(); //keep the UI responsive
try
{response = serialport.ReadLine();}
catch (TimeoutException ){}
while (response == null && !abort); //may add an "abort" variable
Pawel Wzietek
12-Sep-17 9:15am
View
"each test step is call one mothod and pass some necessary parameters, all the methods that are invoked are independent of each other and are distributed across different DLLs."
I'm not sure at all I understand the problem, but maybe you just need a generic abstract class with different implementation for each dll? Eg. this is what I'm using in my library to address different interfaces in a uniform way:
Multithreaded communication for GPIB/Visa/Serial interfaces
[
^
]
Pawel