.net

Gray out dates older than the MinDate in WinForms MonthCalendar control

I am using the MonthCalendar controls in a Windows Forms application. I want to gray out the dates older than the control's MinDate (or give the user some visual clue about which dates are not valid for selection). The control has no property for getting the behaviour I expect. I have tried the UltraDateTimeEditor from Infragistics but i...

For a .net developer, what's the learning curve to get into mobile development?

For a .net developer, what's the learning curve to get into mobile development? How many different operating systems are there that run .net? Is windows mobile that same as windows ce? ...

Coping with rapidly changing technology (in particular Microsoft)

Today as I booted up Visual Studio 2008 to do my work, I saw on the Start page a new blog post about Visual Studio 2010 and .NET 4.0. I can't help but feel a little overwhelmed. I am just starting to come to grip with all the stuff Microsoft added in .NET 3.0 & 3.5 (LINQ, WPF, lambda functions, etc, etc).... I know these things are no ...

Operation could destabilize the runtime?

I'm having a little bit of trouble understanding what the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them into an object which is cast into an interface. It looks a bit like this: public IEnumerable<ISomeObject> query() { return from a in dc.SomeTable select new SomeObje...

[F#] Trying to figure out how to set off an event when the enter key is pressed in a TextBox

The code I'm playing with is: open System open System.Windows.Forms open System.Drawing let tehform = new Form(Text = "STOP!", Width = 200, Height = 200) let awe = new TextBox(Left = 1, Top = 30, Width = 100) let stuff _ _ = MessageBox.Show(awe.Text) |> ignore let handler = new EventHandler(stuff) let yeah = new Button(Text = "", Left ...

IP address parsing in .NET

I'm using IPAddress.TryParse() to parse IP addresses. However, it's a little too permissive (parsing "1" returns 0.0.0.1). I'd like to limit the input to dotted octet notation. What's the best way to do this? (Note: I'm using .NET 2.0) Edit Let me clarify: I'm writing an app that will scan a range of IPs looking for certain devices...

What is the best practice for using public fields?

When I write a class I always expose private fields through a public property like this: private int _MyField; public int MyField { get{return _MyField; } When is it ok to just expose a public field like this: public int MyField; I am creating a structure called Result and my intention is do this: public Result(bool result, string...

Tool that resizes .NET winform to resolution

Is there a freeware tool that can resize a .NET winform window on a running application to a specific resolution? If I'm running on a large resolution and want to see what a window looks like at a specific resolution, this tool should resize a single window to that resolution. I use to have something like this but not sure what the nam...

Automated testing .NET (Gallio?)

I am working on a software development project that uses code written primarily in C and C#. Currently, the responsibility of testing falls mostly on developers as they change the code. I am interested in implementing an automated testing framework to help us improve the quality of our code. In particular, it would be great to have ...

Line information/number from Textbox in Silverlight

Hi Area : Textbox in Silverlight Question: I need to know what "line number" that is currently edited. I've tried: As a workaround I've tried splitting with textBox.Split("\r") and counting matches on Regex with similar performance. Performance during the first 2000 lines are acceptable but then it gets to slow. Why: I have a Textbox...

Why is a DataViewManager not sorting?

First off, a quick rundown of what the code is doing. I have two tables: Companies and Clients. There is a one to many relationship between Companies and Clients (one company can have many clients). In some processing logic, I have both tables loaded into a DataSet - each are DataTables. I have added a DataRelation to set the relationsh...

Windows service, can't access app.config from within my Installer's constructor

Hi, I want to store the username/password information of my windows service 'logon as' user in the app.config. So in my Installer, I am trying to grab the username/password from app.config and set the property but I am getting an error when trying to install the service. It works fine if I hard code the username/password, and fails wh...

Permission to delete from a directory

All-- I am writing code that checks for the permission to write to and delete from certain directories. The first is fairly easy. To whit: FileIOPermission writePermit = new FileIOPermission(FileIOPermissionAccess.Write, _ArchiveHome); writePermit.Demand(); But, how do I do the same for permission to delete from a given directory? T...

Are implicit operators and TypeConverters equivalent?

It seems to me its very easy to implement an implicit operator versus a TypeConverter, so I'm assuming they aren't equivalent because of the prevalence of TypeConverters in the framework (see anything that extends FrameworkElement). But why? Wouldn't it have been much easier to create string->object and object->string implicit operator...

Getting Data From a Composite Control - Visitor Pattern?

I've got some rather complex forms, that need to be configured by web designers. I've been building some composite controls that appear to be doing the job. The top level control is simply a container, and the sections of the form are contained within. SubControls implement common interfaces, (i.e. NeptuneAddressControl and MarsAddres...

What are some large .NET projects with source code?

I'd like to find a few large .NET projects that have public source code available. ...

.Net WebServices and out/ref WebMethod arguments

I've received some documentation from one of our suppliers for a webservice they're publishing and they're very specific that on one of their WebMethods that an argument has the out modifier(? not sure if that's the right descriptor) for instance consider the following WebMethod signature: [WebMethod] public void HelloWorld(out string s...

Opinions on IdeaBank?

I'm a PHP developer who is being considered for a job implementing IdeaBank, idea management software written in .net. The software appears to have been selected based on its features and clients. The OpenDNS community appears to be using it. Is anyone familiar with this software? What's it like to customize and maintain? Would you ...

Compiling with CodeDomProvider doesn't allow new features of C# or VB

I'm compiling some C# and VB code at run time using the CodeDomProvider, CompilerInfo, and CompilerParameters. It works great, and I really like being able to add scripting support to my application, but it only seems to support .NET 2.0 syntax. For example, the var keyword isn't supported in C#, and the If(bool, string, string) expressi...

How to implement One Definition Rule

This post reference to the One Definition Rule. Wikipedia is pretty bad on explaining how to implement it Where can I find good ressources about guidelines to follow in C++ .NET? ...