.net

How do you implement a custom filter with Lucene.net?

The code below is from the Lucene In Action book (originally in Java). It's for building a list of 'allowed' documents (from a user permission point of view) to filter search results with. The problem is the termsDocs.Read() method does not accept the 'doc' and 'freq' arrays to be passed by reference, so they're still empty when it comes...

Calling Console.WriteLine from multiple threads

Why does Console.WriteLine work from multiple threads? ...

How to take a screenshot and send by email programaticly on dotnet

Background: I'm developing a bussiness application, and in the final stages we are encountering some extrange errors, mostly with connection and some edge use cases. For this kind of exceptions, we now provide a nice dialog with error details, of which the user take a screenshot, and send by email with some remarks. Problem: I would...

Recording ASP.NET MVC performance metrics

We want to time how long certain actions run for in an ASP.NET MVC application. We're using ActionFilters to start and stop a timer each time a contoller action is invoked. The result is a small dataset a bit like this: { ContollerName: 'Account', ActionName: 'Index', ExecutionDuration: 287, TimeRecorded: '2009-07-02 17:34:...

Non-determinstic choice with amb-operator

Is it possible to implement McCarthy's amb-operator for non-deterministic choice in C#? Apparently .NET lacks continuation support but yield return could be useful. Would this be possible in other static .NET-languages like F#? ...

Good e-commerce platform for Java or .NET

I'm looking for an e-commerce "platform" in Java or .NET that can satisfy the following requirements: Product / Service Management Customer Account Management Shopping Cart Checkout / Merchant Integration Localization (especially for currency) Coupons Multiple Storefronts Reporting Possible PayPal / Google Checkout Integration The go...

Targeting both .NET 3.5 and Silverlight

Let's imagine I already have a project building .NET 3.5 assembly. Now I want to build this assembly for Silverlight, and moreover, maintain its Silverlight version with minimal efforts further. What is not acceptable: Creating separate project for Silverlight build What is acceptable: Adding custom directives allowing me to targ...

xlinq throw null data? how can i solve it?

Hello again; i try to save xml data from xml file. How can i do that? if i use below codes, XmlStream return null "throw null". How can do that? my data: <list> <subscriber Type="Random"> <name>yusuf</name> <surname>karatoprak</surname> </subscriber> </list> public static XDocument GetRawsSnippetAsXDocuments() ...

Why doesn't Bloch's Builder Pattern work in C#

Consider a verbatim copy of Bloch's Builder pattern (with changes made for C#'s syntax): public class NutritionFacts { public int ServingSize { get; private set; } public int Servings { get; private set; } public int Calories { get; private set; } ... public class Builder { private int ServingSize { get; set; } priva...

Pattern for objects initialization at startup

I'm building an application and as time goes on, I have more and more objects to initialize at startup. Moveover, some of the newer objects depend on others so I'm getting some kind of spaggetti initialization where objects are created then passed to other constructors. I'm suspecting that I'm getting it wrong. For example I have a WinF...

How to make DockPanel fill available space

I'm trying the content of a shopping cart in an ItemsControl (ListBox). To do so, I've created the following data template: <DataTemplate x:Key="Templates.ShoppingCartProduct" DataType="{x:Type viewModel:ProductViewModel}"> <DockPanel HorizontalAlignment="Stretch"> <TextBlock DockPanel.Dock="Left" ...

ListBox Focused Item

Hello, this is a WinForms question. In a ListBox with SelectionMode = MultiSimple, how can I get the currently focused item? Note, I don't want to get the SelectedItem or SelectedItems, but the item which currently have the dash lines around, something like ListView.FocusedItem. ...

Updating Visual Studio project references programatically

I wish to programatically update the references in the projects in my Visual Studio solution. I have roughly 15 projects in my solution and when I am developing/debugging I want the references to point to the projects within the solution. As part of my release procedure I sometimes need to make a copy of one project and then update the...

Disadvantages of using properties only with no corresponding fields in .NET?

I have classes which have automatic properties only like public customerName {get; set;}. They are public because they are accessed outside the class. They can also be accessed inside the class. They offer good encapsulation and better debugging. I can put a breakpoint on one if I need to know who is accessing it and when. My question i...

What is your favorite Business Logic Layer (BLL) development toolkit for .NET? Are there any at all?

What is your favorite Business Logic Layer (BLL) development toolkit? Are there any at all? BLL toolkit is a set of classes (controls, VS.NET add-ins) handling typical business logic scenarios. E.g. implementing access control, providing validation and so on. Of course, IMHO. ...

Moving to .NET Framework

We have an application that is being moved to .NET One part of the application will be deployed using ClickOnce, SXS (Registration-free COM to host Active-X controls which may be ported later). This part is not as big a deal, as the environment is controlled. This will be a mostly "consulted" environment. Another part is a mostly web-...

C# partial class

How do I program a partial class in C# in multiple files and in different namespaces? ...

Wix File element Source set to installed file

I am installing files to \MyApp. I want to add some of these files to GAC. How could i refer to the installed location in source attribute of the File element ( which has assembly set to .net) to acheive this ? Thx for your help. ...

Microsoft Access 2007 Connection

I wrote a program that connected to a Microsoft Access 2000/2003 mdb file and accesses the data. It works fine, but I'm wondering if there is a way to connect to Access 2007? If I change my connection string, will my program work with access 2007 or is it more complicated then that? And if it will work, can someone provide an example of ...

looking for an e-book about Architecting Applications using .NET

Hi all Sorry, I really don't know that whether I can ask my request here or not. but actually, I need to read a book named: "Microsoft® .NET: Architecting Applications for the Enterprise" I googled internet but I didn't find.... Do you have it's e-book? ...