.net

Manipulating a tab control

I have a form with a bunch of tabs on it, but I don't want them to all be visible all the time. I've tried For Each t In TabControl1.TabPages t.Hide() Next TabControl1.TabPages("DateRange").Show() in order to hide them all on doc load and then .Show() for just the tabs that I want at that time, but that apparentl...

XPath expression to select nodes between a defined sequence of preceding and succeeding nodes

I've got the following structured XML file: <w:document> <w:body> <w:p> <w:r> <w:t/> </w:r> </w:p> <w:p> <w:r> <w:t/> </w:r> </w:p> <w:p> <w:r> <w:instrText/> </w:r> </w:p> ...

Conversion of Inteface from vb.net to c#

I have a control that overrides the protected GetService method and assigns it to the IServiceProvider interface: Class MyControl Inherits Control Implements IServiceProvider Protected Overrides Sub GetService(t as Type) as Object Implements IServiceProvider.GetService End Sub End Class I'm struggling to convert this...

How do you UrlEncode without using System.Web?

I am trying to write a windows client application that calls a web site for data. To keep the install to a minimum I am trying only use dlls in the .NET Framework Client Profile. Trouble is that I need to UrlEncode some parameters, is there an easy way to do this without importing System.Web.dll which is not part of the Client Pofile? ...

How to create a extension method to sum up a column of a generic constrained type in a datatable

Is something like the below possible? public static T Sum<T>(this DataTable dt, string columnName) where T : IEnumerable<decimal>, IComparable<decimal> { return (from c in dt.AsEnumerable() where !c.IsNull(columnName) select c.Field<T>(columnName) ).Sum...

Does it make sense to use F# for BLL implementation?

Do you think it could be a good idea to use F# for implementation Business Logic Layer? I am going to use Entity Framework as 'data mapper' and implement UI logic using C#. Any thought are welcome. I would appreciate any help! Thanks. P.S. What is a purpose of that? I am newbie in F# and would like to experiment with that Language (te...

Disable All Events on a Windows Form

Is there any way to temporarily disable ALL events on an windows form? I have situation where processing on a secondary thread is being corrupted by events on the main thread. (The main thread events are modifying the contents of controls that are data-bound to variables used by the secondary thread.) Looking for a way to "lock" the...

What is the difference between log4net.ThreadContext and log4net.LogicalThreadContext?

log4net provides two different "thread context" objects: ThreadContext and LogicalThreadContext, each of which has a property bag, Properties. ThreadContext has a ThreadContextProperties bag while LogicalThreadContext has a LogicalThreadContextProperties bag. ThreadContext is perhaps more commonly known as "MDC". LogicalContext is per...

Visual Studio 2010 SOAP service reference returns only null values

A client generated using Visual Studio 2010's 'Add Service Reference' tool returns a null value for calls to any remote function. The server is a Perl CGI script (SOAP::Transport::HTTP::CGI) that I know is functioning correctly through testing with other clients. I used POD::WSDL to generate the WSDL file that the 'Add Service Reference'...

Variance doesn't work with delegates with reference types

a) Compiles Func<string, bool> f1 = (Func<object, bool>)null; b) Not Func<int, bool> f2 = (Func<object, bool>)null; Why value types are special here? Is contravariance broken with value types? ...

Which .Net Reporting Tool?

I'm improving a software written in .net (3.5) and have decided to change its reports engine from crystal reports to something else. (not very user friendly and buggy IMO. also deep learning curve) The project is a winforms project. The most important thing that I want from the new engine: Support right to left layout. (when using mu...

C# Method overriding with delegates as parameters, compiler is not infering the input types

Hi! Can you please help me here, why the compiler does not infer the lambda input parameter right? Example: void Test(Action<string> n) { } void Test(Action<int,string> n) { } Ok so when doing this: obj.Test(x=>{}); // compiler doesn't know x is a string If I do this: obj.Test((x,y)=>{}); // that works, compiler know x is a int ...

Finding the Child Window inside a Microsoft RemoteApp Programmatically

Background I'm using SendKeys() to send keyboard commands to the active window, but I'm not having any luck finding the child window when the application is running through RemoteApp. It all works as expected when I run the application locally. Microsoft RemoteApp allows users to connect to applications through the RDP protocol, but i...

c# DateTime, Trim without converting to string

How can I "trim" a value of a DateTime property in c#? For example, when I get a date it is of the format "10/1/2010 00:00:00". How can I "trim" 'Time' 00:00:00 without converting this to a String? Since I use a property of type DateTime to manipulate this, I don't need to convert to String. Any help is appreciated. ...

Fastest way to draw a series of Bitmaps with C#

I'm building an application that captures video frames from a camera (30fps @ 640x480), processes them, and then displays them on a Windows Form. I was initially using DrawImage (see code below) but the performance was terrible. Even with the processing step disabled the best I can get is 20fps on a 2.8GHz Core 2 Duo machine. Double buff...

Linking to a .Net v2.0 assembly from a .Net v4.0 assembly also appears to link (and alias) mscorlib v2.0. Why?

I have a .Net assembly which imports an assembly linked against the v2.0 runtime. The problem I'm having is that when I try to run some tests on my assembly, Fusion trys to load the wrong version of a dependent assembly. After looking at the assembly manifest, I can see why: the wrong version of FSharp.Core is linked. In my build file,...

Ajax Modal Popup Progress Bar/Indicator

Hello all, I am having problems trying to create a modal popup progress bar in Ajax 3.5. The following works okay, but I cannot see my aspx page in VS 2008 due to the changes I made to my style sheet. It appears that the div tag i am using sits on top of the page. Here is the code: <asp:UpdatePanel runat="server" ID="UpdatePanel1"> ...

Convert Resultant Values to List of Strings in Linq

I'm having issues with returning a list of strings of the .Value of a Linq query: Dim details = <Details> <Vector size="5"> <Item>Syntactic Structures</Item> <Item>Introduction</Item> <Item>The Independence of Grammar</Item> ...

What are the proper steps to deploy a click once online only c#.net application

I have a .net application that I published as a click-once online only windows application. When I published the app a folder was created on the target machine as expected. After the publish how does the user access the application? Do they execute the .application file inside the "application files" folder? Also what about the config...

Panel.TabStop = true has no effect

I Trying to switch Panel.TabStop property totrue but it does not affect anything. How to enable TabStop in a Panel? ...