.net

How to set file/directory ownership/permissions in a Samba share on Windows using Python/.NET?

I need to create directories and files in a Samba share on Windows, from a Python script. I can (and do) also use .NET 3.5 from Python. I would like to create these directories and files with certain owners and permissions. Can I achieve this somehow? ...

Castle Windsor: Find an implementing assembly and used it.

How do I tell castle to pick up an interface implementation from the assemblies in the executing directory. E.g. How do I tell castle to find an implementation for ILog and then If I drop log4net among the assemblies in the executing directory, it should pick it and use it. Tomorrow if I decide to change log4net to Nlog it should pick...

WPF: Using bindings in data trigger condition

Let's say I have the following simple classes: public class Person { public int Id { get; set; } public string Name { get; set; } } public class PersonHolder { public Person CurrentPerson { get; set; } public int ActiveId { get; set; } } Now I have a grid with an instance of class PersonHolder as DataContext, and in ...

What are the different triggers in WPF?

What are the different triggers in WPF? How do they differ and when should I use them? I've seen the following triggers: Trigger DataTrigger MultiTrigger MultiDataTrigger EventTrigger ...

Tag property for Controls not carrying over to static method

I have the below method in a class, HUD.cs, that has helper methods. The below method is suppossed to check all controls TAG for "required" and highlight those it finds. It works fine if I call it from a UserControl and the Control's to be Highlighted are not contained in a GroupBox but when they are the TAG does not seem to come acr...

What are background, foreground & main threads ?

Hi folks, what's the difference between background, foreground & main threads? What are the diff types of threads in .NET? TIA ...

Does converting a source module from Unicode to ASCII or vice-versa seriously mess up the diffs?

In a test suite, I had tests that deal with unicode scattered about in various modules. I have now consolidated them into a single test class. The .cs source modules that no longer have any unicode in them, remain unicode-encoded, and as a result are 2x their required size. I'd like to convert them back to ASCII, to save the space, an...

Mixed Lucene / MySQL Query or Concept

Our project requires near-real time searches and constant updating. The data is currently stored in a MySQL database and the Lucene index is updated as the database is modified. We have the search capability currently where we want it. However, we are attempting to add the ability to "tag" documents in the index/database. Since the d...

How well does .NET dictionary resolve collisions?

I have a problem with a custom object that needs to be keyed for a table. I need to generate a unique numeric key. I'm having collision problems and I'm wondering if I can leverage a dictionary to help me. Assume I have an object like this: class Thingy { public string Foo; public string Bar; public string Others; } and so...

Refresh Page C# Asp.net

Is there a Page.Refresh type of Command to refresh a page? I don't want to redirect to the page or refresh in javascript. Any help on this is greatly appreciated. Thanks in advance. ...

Redirect to an intermediate page before going to external site

Here is my problem. I'm working within a CMS and users are able to create hyperlinks (both internal and external) I'm wondering if there is a good way to check when a user clicks a link if they are navigating to an external site. I don't want to do anything if they use the back/forward buttons, type something into the address bar, etc...

Using binding for the Value property of DataTrigger condition

I'm working on a WPF application and struggling with a data trigger. I'd like to bind the value of the trigger condition to some object I have: <DataTrigger Binding="{Binding Foo}" Value="{Binding ElementName=AnotherElement, Path=Bar}">.. However, I'm not allowed as it doesn't seem to be possible to use bindings for the...

EF4: There is no property with name 'CountryId' defined in type referred by Role 'Customer'.

Within my database (SQL2008), I have a customer table and a country table (among others) and there is a foreign key relationship defined in the database between these tables based upon "Country.Id -> Customer.CountryId". I have created an EF model using VS2010 RC and built this model from the database. When generating the model, I selec...

Marshalling what is it and why do we need it?

What is marshalling and why do we need it. I find it hard to believe that i cannot send an int over the wire from c# to c and have to marshall it. Why cant c# just send the 32bits over with a starting and terminating signal, telling C code that it has received an int. If there are any good tutorials or sites about why we need marshallin...

Trace not working in a .NET DLL loaded from VB6 EXE

Hello I have a .NET DLL that writes to the Trace. But seems that when I call my DLL from a VB6 EXE the trace is not working. I have created an myApp.config file in the EXE folder with the trace configuration, but this does not solves the issue. I've also tried creating the Trace objects in code,but doesn't work: Dim _traceSrc as Trace...

Why does the number of threads reported by WinDbg, Task Manager and VS Debugger differ?

While my .Net 3.5 app was running, the Windows Task Manager shown that my app had 16 threads. I collected a memory dump for the process and opened it using WinDbg/SOS. Running the !threads command reveals that I have : ThreadCount: 456 UnstartedThread: 0 BackgroundThread: 6 PendingThread: 0 DeadThread: 449 Hosted Runtime: no Here are...

\n and \t and getting them to display in a <textarea> using javascript or .net

HI, using C# I am saving formated HTML data in MSSQL such as: <div>\n\t<p>x</p>\n</div> I am than populating it into a textarea to display. I understand that I can use the .val() method in jQuery to pull all of the ASCII characters out of the textarea, however, I can't seem to figure out how to get the "\n" and "\t" characters to show...

.net: Is there a way to read a txt file from bottom to top?

Possible Duplicate: How to read a text file reversely with iterator in C# I am wondering if there is a way to read a text file from bottom to top without any performance penalty, the readLine, movenext approach, but reversed, is this sort of thing possible in .net? To make matters more interesting the text file has around 100...

Recommended Big O Notation book with .NET examples

Does anyone know of any good .NET books that focus on algorithmic complexity specifically looking at Big O Notation? The only book I have found is Data Structures and Algorithms Using C# by Michael McMillan but unfortunately (based on Amazon reviews) this does not appear to be the greatest.... Any other suggestions would be much apprec...

DDD - Entity state transition

Hi all, consider the following simplified example: public class Ticket { public int Id; public TicketState State; public Ticket() { // from where do I get the "New" state entity here? with its id and name State = State.New; } public void Finished() { // from where do I get the "Finished" state e...