.net

MDI Application minimize/restore issue

Ok, so I have a VB .Net MDI Forms Application. frmMain is the "parent" form with IsMDIContainer set to TRUE. I load "frmChild" from frmMain setting the MDIparent property to frmMain. I minimize the form, then minimize the application. I restore the application a few minutes later, then restore frmChild and find that frmChild is now t...

Unable to set the DropDownHeight of ComboBox

I cannot get the DropDownHeight of the ComboBox set properly to display all the items. I am using a control that inherits from the ComboBox. I have overridden the OnDrawItem and OnMeasureItem methods in order to create multiple columns and text-wrapping within a column if it is required. This all works fine. The problem occurs when I...

Font 'Times New Roman' does not support style 'Regular'

Anybody hear of this one? System.ArgumentException: Font 'Times New Roman' does not support style 'Regular'. I've got a WinForms app that is deployed via ClickOnce. For some reason a number of users are getting this error. I can see getting this error because of picking a non-standard font, but Times New Roman, Regular? Is there a servi...

Linq 2 Entities : Performing a join on two columns with different types

Hello, I'm currently using Entity framework, and I want to perform a Linq query with a join on two columns, one being of type 'String', and the other of type 'Int32'. Somethign similar to from FirstEntity obj in context.FirstEntity join SecondEntity obj2 in context.SecondEntity on obj.SecondEntityId equals obj2....

DataContractJsonSerializer, ISerializable and Arrays...

I have some JSON- [{\"crudtype\":\"Update\",\"objectid\":\"11\",\"attributes":[{\"CREATED_BY\":\"OSPLOADER\",\"x\":\"y\"}]}] Having difficulty with getting the "attributes" out. I'm using DataContractJsonSerializer in combination with ISerializable from this example. protected Attributes(SerializationInfo info, StreamingContext ...

Monitoring for non-pgp files

For privacy reasons, I want to prevent my users from posting unencrypted files to my ftp site. It is company policy that all data exchanges of sensitive data be encrypted with PGP. I'd like to setup a program to monitor the ftp folders and whenever a new file is placed there, verify that it is in fact encrypted. I can't just rely on ...

Which methods can be used to make thread wait for an event and then continue its execution?

I have a thread running that delegates out some tasks. When a single task is complete, an event is raised saying that it has completed. These tasks need to be run in a specific order and need to wait for the previous task to finish. How can I make the thread wait until it receives the "task completed" event? (Aside from the obvious event...

Type.GetProperties Method

I have a class like this: class ItemList { Int64 Count { get; set; } } and when I write this: ItemList list = new ItemList ( ); Type type = list.GetType ( ); PropertyInfo [ ] props = type.GetProperties ( ); I get an empty array for props. Why? Is it because GetProperties doesn't include automatic properties? ...

What are the most common misunderstandings of how things work in .Net?

In your experience, what do you see (or hear) as common misunderstandings about how things work in .Net? I'm not thinking of common programming mistakes, such as throw ex to rethrow an exception, but rather common misconceptions about how the framework works such as: the [Serializable] attribute is required for xml serialization, or...

Why isn't PropertyInfo.SetValue a generic method?

I see the signature is: public virtual void SetValue(object obj, object value, object[] index) Wouldn't this method cause the parameters to be boxed and unboxed? Why wasn't this method designed to be generic? Then it could even be inferred by the compiler with no boxing/unboxing penalty at runtime. ...

VB 6 COM+ <-> .NET Enterprise Services, 'Multiple-Step operation generated errors.'

I have a legacy VB 6 client app, which uses a VB ActiveX control, which then communicates via DCOM to a VB component registered in the COM+ Catalog. The VB COM+ component communicates with a .NET component, also registered in the COM+ Catalog. I have an issue when our COM+ application Activation is set to Server, which is required to m...

Catching IP address changes

I want to be able to monitor the IP address and log it to file using C# , is this possible and how ...

Web Application project versus Web Site Project in Visual Studio

Possible Duplicates: website or webapplication in.ASP.NET web application projects v.s. web site projects What are the differences? I can right click on a solution and say Add New Website... or Add New Project... > Web > ASP.NET Web Application Is one preferred over the other in terms of best practices or extensibility/p...

Real advantages of .Net delegates over Java's anon classes?

I know a lot of the uses of .Net delegates can be emulated in Java by using a combination of interfaces and anonymous classes, but are there any situations where delegates have a real advantage and there is no Java equivalent? ...

.net console app with hyperlinks ?

is it possible ? any samples/patterns or ideas on how to go about it ? Update - this essentially becomes a text browser which displays various tables of information based on various commands on the prompt like typing the url in a browser now instead of typing various commands like prompt>command arg1 arg2 if only you could say "click"...

.NET IoC - Equivalent Code for .NET Unity

In this Autofac IoC article they show an example of mapping an interface to an implementation with a parameter. You'll find it halfway down the article. What is the Unity equivalent in XML? Can't use the fluent syntax for what I'm doing. Needs to be an external config file. UPDATE: This is the specific piece of code I want to know how ...

.NET TreeView control with checkboxes

The TreeView control has the checkboxes property, but it puts a checkbox on every node. How do I put a checkbox on just the nodes I want? ...

In IIS hosted WCF services, how to disable address translation?

When I publish my ASP.NET WCF service, the WSDL uses the machine name instead of the domain name. How to prevent this? Example: <wsdl:import namespace="http://ListenerService" location="http://MACHINE_NAME/ListenerService/service.svc?wsdl=wsdl0"/&gt; <soap:address location="http://MACHINE_NAME/ListenerService/service.svc"/&gt; ...

Truncate before SqlBulkCopy

I want to truncate a table before doing a SqlBulkCopy. Does SqlBulkCopy automatically truncate a table before copying the data? ...

Does ClickOnce auto update work for windows services applications?

I think the question is clear. ...