.net

javascript generated content in .Net windows forms application?

hi, i want to load some content from an "HTML" page in to a windows forms application the problem is that the content on the HTML page will be generated by javascript so i am confused with what should i do, so if you have a solution then please tell me. Otherwise if someone can tell me about how can i embed IE into windows forms applicat...

Problem creating DataContract with SVCUTIL

I am trying to create a DataContract for a simple REST based webservice using a XSD file. <?xml version="1.0" encoding="utf-8"?> <xs:schema id="workcodes" xmlns="http://timesheet.domain.com/webservices/workcodes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unquali...

"No module named fcntl" when py script run from c# but works from windows command line

I am calling a python script that uses imaplib.py and get the "no module named fcntl" error. From searching I found that this module is only available in unix and so I wonder if the py script is confused about what os it is running under. Again, script works fine under windows run directly from the python directory. var engine = P...

How do I get this result using LINQ?

I am a beginner to LINQ and I have a query where I need result like this. Id | RoleName ------------------- 1 | Member 2 | Admin 3 | Manager 4 | Accountant Id | UserId| RoleId | ExpirationDate ------------------------------------- 1 | 1 | 1 | 1/1/2011 2 | 1 | 4 | 1/1/2012 3 | 2 ...

DAL Datamapper persisting fat objects

Hi there, I'm in the process of rewriting our application. We are building DataMappers to work in our DAL. My question relates to the situation where I have a complex object from the BLL that get's passed to the DataMapper to be persisted. Let's say this object has a lot's of properties including lists of other objects. i.e... pub...

Better way of refactoring this ?

I have the following classes: public abstract class BaseClass { private readonly double cachedValue; public BaseClass() { cachedValue = ComputeValue(); } protected abstract double ComputeValue() } public class ClassA : BaseClass { protected override double ComputeValue() { ... } ...

WCF RIA Services - 'Table' is not a member of 'TContext'

Hello, Some background information: I am creating a Silverlight WCF RIA Services Project. I started off by creating a Silverlight Business Application and adding a Domain Service Class and an ADO.Net Entity Data Model to hook up to my SQL database. Inside of the SQL database I have about 15 tables. I am pretty much just doing basic WC...

Migrate workflow and activity from .net 3.5 to .net 4.0

Any one has recommendation, links to how to migrate workflow 3.5 to 4.0? Any issues to look for, does MS provide some tool to facilitate migration? Or the only was is to re-write the whole thing .... ...

Returning strongly typed stored procedure results

Currently, if we want to get a list of records from the database, our DAL returns a DataTable to our business layer, which then returns the same DataTable to our calling interface (in this case an asp.vb page). However I don't believe we should be returning a DataTable from the BLL, I always thought it would be better to return a strong...

VCL port to .NET

Is there a open source effort to port VCL (Delphi Lib) to .NET ...

How to determine if a network path is available or not (online or offline)?

Using .NET / C#, how to determine if a network path (e.g. \mymachine\myfolder) is available or not (online or offline)? Is there a way to be notified by WMI of such event? Thanks! ...

Is there a way to get behavior similar to default(T) using reflection?

I'm refactoring some code that was originally designed with generics to also work with reflection. The particular code base has default(T) scattered throughout. I've created a method that will look similar named Default(T), but I don't think my implementation is correct. Essentially my implementation looks like this: private object D...

How can I programatically render Google Charts API images into a PDF file?

I'm rendering charts on my website using the Google Charts API and I want to export these into a report for the users, most likely a PDF file. What methods are available to do this programmatically into a PDF file? ...

Bayesian Classification for Text Author Identification

I am interested in building my own text author identification system using C#. I am assuming that I will probably have to use some type of Bayesian Classification algorithm to accomplish this. Does anyone know of any resources or existing libraries out there that do something similar to this? ...

FileInfo.LastWriteTime might be misleading. Any other approach?

Hi, I used FileInfo.LastWriteTime to know when was the exact last time where a certain file, let's say "c:\temp\test_file.txt" was CHANGED. It works greate when someone is actually opens the file, make changes and then save - the FileInfo.LastWriteTime for this path is being updated with the time the file was changed. But what happens...

outlook 2007: adding new employees automatically/programmatically?

we have about 300 employees and we are hiring like crazy. is it possible to programmatically add new contacts to every employees' address books as new hires come in? ...

Which method is better for debugging/profiling - .DLL or source code?

Hello all, I am developing an application and I will need to take measurements on different aspects, namely time spent in each method and the strain on system resources as well as doing the occasional bit of debugging to monitor how the data is processed. I'll be using an open source library for MIDI files that is available as source c...

MSIL - how do you invoke a private method from MSIL?

I'm writing a "weak event factory" - code which converts any Delegate into a new delegate with an identical signature, but with implementing a WeakReference on the target. I'm using MSIL to avoid calls to Delegate.CreateDelegate (which performance have shown to be slow). The weak reference delegates work perfectly as long as the underly...

PredicateBuilder methods clarification

I looked through PredicateBuilder sources and its' implementation makes me curious. Let's look at Or method implementation: public static Expression<Func<T, bool>> Or<T> (this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2) { var invokedExpr = Expression.Invok...

How to attach an object to an event in C#/.NET?

I defined the following DataTemplate for a LibraryContainer: <DataTemplate x:Key="ContainerItemTemplate"> <Grid> <Border BorderThickness="1" BorderBrush="White" Margin="3"> <s:SurfaceTextBox IsReadOnly="True" Width="120" Text="{Binding Path=name}" Padding="3"/> </Border> ...