.net

When does BackgroundWorker thread get killed?

Hello, I'm developing C# .NET windows Forms application. In which I've a main window and few other window form classes (which are used as dialogs). I've a computationally intensive task(takes 3-4min). When user selects this task from the menu, a new dialog (window) pops up and takes parameters required from the user and it has a progres...

Handling Async With Specflow for Silverlight

The Silverlight Unit test Framework defines a process for dealing with Async calls (derive test class from Microsoft.Silverlight.Testing.SilverlightTest, add Asynchronous attribute, use EnqueueXXX methods.) Considering the separation that SpecFlow presents between the test class and the steps: Can these tools be brought to bear to wai...

How to copy a textbox value from Form1 to Form2?

I have Form1 that has a textbox and a button. When user clicks the button in Form1, Form2 opens up with a label control that carries the value of textbox in Form1. What i did is set the textbox modifier of Form1 to Public, but when i call the textbox name of Form1 in Form2, i get an error that says "The name "txtbx1" doesn't exist in th...

DbProviderFactory with Npgsql?

I have a project which I'm trying to port from SQL Server to PostgreSQL. I've got almost everything done I believe except for I can not get DbProviderFactory to work with Npgsql. Factory = DbProviderFactories.GetFactory("Npgsql"); yields Unhandled Exception: System.Configuration.ConfigurationErrorsException: Failed to find or...

How to compare Image objects with C# .NET?

Can we compare two Image objects with C#? For example, check whether they are equal, or even better check how similar are their pixels? if possible, how? ...

Can I use Named and Optional Arguments in ironpython

I hope to load .net dll in ironpython. But one of static functions in .net dll, has some Named and Optional Arguments. like, Draw(weight:w,height:h, Area=1) Only can I use full arguments? ...

Can we share a static field across Application domains?

Consider a process, in which multiple Application domains are created. Can we share a single static field across these Application domains or can we pass this static field across these application domains? How does CLR handle this? ...

Console.Write in .NET GUI Application

In a C# .NET GUI Application. I also need the console in the background for some tasks. Basically, I'm using a Thrid Party library for some processing (takes lot of time) which writes its intermediate results to console. This processing is a computationally time taking task. So, I'm assigning this task to backgroundworker. I mean backgro...

Event raising in another thread

I want to implement the following logic: private static AutoResetEvent _autoResetEvent = new AutoResetEvent(false); static void Main(string[] args) { var someObjectInstance = new SomeObject(); someObjectInstance.SomeEvent += SomeEventHandler; _autoResetEvent.WaitOne(); //... } static void SomeEventHandler...

OO Inheritance concept - Can we inherit private methods and use them?

Let's say in ASP.NET you have a base page class which defines a private Page_Load method which handles Page.Load. All aspx pages in your project inherit from this base page class. In this case the aspx pages would be able to call this private method. However it does not feel right that private methods can be called outside its own class?...

Grid with "decoupled" scrolling (aka "frozen" rows and columns)

Here is, roughly, what I'm trying to achieve: The green part is fixed. Cells in the orange (or pink?) part are editable. Cells in the blue part are also editable. The [add fridge] button adds another column. Now the tricky part: The blue+green parts should, together, be scrollable vertically. The blue+orange parts should, together, b...

Unable to use a Stored Procedure with my Entity Framework v4 + POCO's :(

Hi folks, I've got a very simple Entity Framework project with POCO Entities. I've got a single stored procedure which I have imported using the EF Wizard. Kewl. I've then made my own EF Entity which I've then Add Function Import to map the Stored Procedure to my EF Entity. Now ... I'm not sure how to map my EF Entity to a POCO. As su...

How can I retrieve strongly typed properties from an anonymous type?

I'm using anonymous types to pass collections of typed objects to a TemplateResolver, where the named placeholders in a newly instantiated text template may source values from multiple objects, e.g. var body = TemplateResolver.ResolveTemplate(template.ExternalRecipientBody, new {Sender = customer, NewJobCard = jobCard}); where the te...

Diagnosing why DebuggerTypeProxy attributes are not working

I'm trying to make a wrapper for a COM object easier to work with when debugging by adding a DebuggerTypeProxy attribute - the attribute appears to work some of the time (when running unit tests etc...), but doesn't work when I'm actually debugging the target process and I don't know why: I've checked to make sure that the correct asse...

How to create an application in .NET to be able to run on Linux or other Operating Systems

I have heard that applications created in .net can be run on linux and other operating system using mono framework. Up to what extent it is true. How it makes an application platform independent. How monoframework recognizes dll's of .net How can i host my site created in asp.net to be hosted on linux server. What all softwares do I n...

Align controls' sizes

Simplified problem. I have two ItemsControls that are located one under another and are bound to the same sequence: [Control] [Another Control] [More Controls] [Other Ctrl] [Super Control] [Control] What I would like to do is align their sizes such that they appear to be a single table: [Control ] [Another Control] [More Controls]...

C# HMACSHA256 Problem - Matching Facebook Signed Request Implementation

Hi Everyone, I thought I would try and get the new Signed Request logic added to my facebook canvas application, to make this "easy" on myself I went to the facebook PHP sdk over at GitHub and took a look at the unit tests. http://github.com/facebook/php-sdk/blob/master/tests/tests.php My actual problem is that I cannot get the hash...

Accessing or using data of foxpro of old application in new applicaiton with c#.net

There is one software application in which foxpro is used as back-end. Now this application is need to change. And want to develop same new application in .net. But now database will be sql. And I don't want to let user make all data entry again. Is this possible to use data of foxpro in new application with .net? EDIT: I have not codin...

Possible to use the Repository Pattern + Stored Procedures ? Should / can they return IQueryable?

Hi folks, I'm a big fan of using the Repository pattern to return IQueryable<T> objects. I then let my services layer determine what does what (eg. filter by XXX, order by YYY, project into ABCD, etc). But I've got some hardcore DB stuff, so I've got it all wrapped up into a Stored Procedure. Works fine. I know EF can execute stored pr...

how to create PDF from HTML stored in a string from database using itextsharp

I need to create a pdf file from the HTML provided from database which was stored from a editor... i have to show the corresponding HTML with all the styles in the pdf...please help I have uses itextsharp method but i am not getting the correct content i provided in the editor when i convert it to pdf, Code i used string content ...