typeofOPCserver OPCserverObj = (typeofOPCserver)Activator.CreateInstance( typeofOPCserver ); ??
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
My programs never have bugs, they just develop random features.
I have the usual layers UI, objects, DAL and SQL Server.
In VB I instantiate the DAL in the object layer using a friend variable in a module. This allows me to use the DAL in any class in the object layer without exposing the DAL to the UI. DAL stays alive as long as the app is in process.
Now C# does not have the module concept and I do not want to pass the DAL to the UI to pass to each class in the object layer. I assume it is done with a static class but I am struggling to get it just right.
 What you can do is to create a public static variable on a class and use it like...
The only problem is static classes cannot have constructors, so can I declare the static class, pass values to a method that instantiates the static DAL? Then use the static DAL var in the other classes
Never underestimate the power of human stupidity
I have one class derived from ContentControl.
And inside it's content I have ImageSource and a TextBlock, I want to bind the Text property of TextBlock to the Name proeprty of an object but it's not working.Below is the code snippet:
public void AddBitmapToCanvas(System.Drawing.Bitmap bitmap, string pageName,int width,int height,HorizonPage hpage)
I can get data from SQL to datagridview, textbox and combobox objects.
I can edit or view any data from or to database with the above objects!!!
But not to StatusStrip, at least not directly!!!
I get the data from sql to other object, and then pass it to statusstrip.
Is there a direct way? like the other object. statusstrip doesn´t has a datasource
Hi, I am very new to C# but I am modifying an image buffer directly within memory, I am scanning along moving the pointer to get the RGB of each pixel, but I need away to jump around the image memory and read the pixels at random rather than just p++ or p--?
byte* p = (byte*)(void*)pBuffer;
for(int y = 0; y < Height; y++)
for(int x = 0; x < Width; x++)
int srcB = p;
int srcG = p;
int srcR = p;