Hi,
In reference to an earlier question of mine link text, I have been searching for good ways to write code that is very dependant on 3d party libraries, but still unit-testable.
Just to sketch the contest (so you don't have to read the previous post), I am writing code with the AutoCAD API. This way my code is very dependant on that ...
I'm doing a document viewer for some document format. To make it easier, let's say this is a PDF viewer, a Desktop application. One requirement for the software is the speed in rendering. So, right now, I'm caching the image for the next pages while the user is scrolling through the document.
This works, the UI is very responsive and i...
I bind some collection to a DataGridView. Collection contains KeyValuePair objects where key is a string and value is an object of my class Field. DataGridView displays two columns - one containing the key and the other one containing the value. The value (Field object) is displayed with its ToString() method. But I would like it to be d...
Hello. In my last question I asked about running a C# form in a C++ program. I got it working, but I am having problems. I will try to be brief.
My C++ program must execute a C# form and execute some simple functions in it (increasing counters and showing them). However I do not know the best way to do this. I have the form initialized ...
Hi all,
I'm wondering if it's possible to create a windows service in .NET and then create another windows.forms process that connects to the service and passes parameters, modifies and views its datastructures and connected database, etc.
I believe that in Vista this is only possible with the use of sockets, and not with a ServiceContr...
To able to do proper cross-thread access I'm using a piece of code something like this :
Private Delegate Sub DelSetButton(ByVal button As Button, ByVal label As String, ByVal enabled As Boolean)
Private Sub SetButton(ByVal button As Button, ByVal label As String, ByVal enabled As Boolean)
If InvokeRequired Then
Invoke(New ...
Hi,
I am struggling with setting up StructureMap without the use of the
generic fluent interface,
I can't use the generic methods, because I don't know the types at
design time.
Ie:
To choose a default constructor the only method I could find is using
'SelectConstructor<T>()', but I only know the type at runtime...
This is related: ...
I have two flags:
[Flags]
enum Flags
{
A = 1,
B = 2
};
I set them like this:
Mode = Flags.A | Flags.B; // default value
for(int i = 0; i < args.Length; i++) {
switch(args[i])
{
case "--a":
{
if ((Mode & Flags.A) == Flags.A && (Mode & Flags.B) == Flags.B)
// both, default assume
{
Mode = Flags.A; // only A
...
I need to generate a unique temporary file with a .csv extension.
What I do right now is
string filename = System.IO.Path.GetTempFileName().Replace(".tmp", ".csv");
However, this doesn't guarantee that my .csv file will be unique.
I know the chances I ever got a collision are very low (especially if you consider that I don't del...
I came across a recent Audit report in our company for the code we maintain which says that we should not use Get in the method (not properties) naming like in GetSearchResults or GetXyzInformation. I looked up the MS guidelines (http://msdn.microsoft.com/en-us/library/4df752aw(VS.71).aspx) for method naming and as per that Get is allow...
I am using the M-V-VM pattern in a WPF app. I am binding a ViewModel to a COntentControl and using a data template defined int eh window resources to render the view (a UserControl) for that ViewModel.
In the ViewModel, I have a collection of items. I'm binding that collection to the data grid provided in the WPF toolkit. Also in the...
Hi all,
How can use BackgroundWorker or Threading for my code. I update TreeView (Winforms) and I call WCF service.
Any suggestions please. Kind regards.
Thanks in advance
AdministradorUILogging.TrazarDebug("PanelArbolFicheros. tslGuardarArbol_Click")
Dim listaFichero As New List(Of Fichero)
Windows.Forms.Cursor.Current = Cursors.Wa...
Good morning everyone,
I'm experiencing an error when using the windows installer to install an event source in a product I am deploying.
The error message I receive states the following ...
Unable to get installer types in the
c:\temp\program.exe assembly. -->
Unable to load one or more of the
requested types. Retrieve the
...
Let say you hav a database with alot of products/customers/orders and the codebase (java/c#) contains all the business logic. During the night several batches are needed to export data to flat-files and then ftp them to properitary systems.
how should we do this "write-database-into-a-flat-file? what are the best-practices?
Some though...
I would like to create a rectangular 'flat 3D' look for one of my control templates. In it's most simple version this means having a line at the bottom that is darker than that at the top, and maybe some variation between the left and right lines too.
A more complex version would allow me to provide on or more brushes so that gradients...
When using System.Windows.Forms.ShowDialog(IWin32Window) should I be able to pass in an IWin32Window representing any window handle and have it be modal with respect to that window?
As part of an IE7 extension I'm trying to open a window modal with respect to an IE tab. It's not the currently selected tab, but I can get the hwnd of the ...
I have the following statement
DateTime now = DateTime.Now;
string test = string.Format("{0}{1}{2}{3}", now.Day, now.Month, now.Year, now.Hour);
This gives me:
test = "242200915"
But I'd like to have something like:
test = "2402200915"
So the question is, how can I enforce the string formatter to output each int with the width ...
Let say a company are building a brand new application. The application are following the DDD principles.
The old codebase has alot of products (or another "entity" for the company) that they want to convert to the new codebase.
How should this work be done? normally it is faster and easier to import using for examples ssis,-transferrin...
I have been given to the task of writing a coding standards document and creating a framework for web services.
I've looked at numerous articles but I am still stumped to what is exactly required especially when developing a framework as it is completely different from application code.
Has anyone got any useful tips or books they can...
I'm trying to come up with a way to easilly detect if a change has been made to a control on a winform. This approach works but it provides no information about what controls have been changed. Is there a way to override the TextChanged event so it will pass and EventArg which contains the name of the control that fired the event? Whe...