.net

Can we change the text/background color of an individual property in PropertyGrid

I have a .NET PropertyGrid control which displays properties of some class. I want to change the color or font or background color(it doesn't matter just that they look different from the other displayed properties) of some property. I can do with writing custom editor but I was wondering If an easier method exists? If I use custom e...

How can I make the "internal" classes and members of a .NET assembly visible to IronRuby code?

My scenario consists of the following points. I have a packaged software product I am developing in C# Since it is a packaged product, the public interfaces of the assemblies need to be tightly controlled... All assemblies are strong-named Any classes that don't absolutely have to be "public" are "internal" I want to write unit tests...

How can I delete from a GridView when DataSource is a DataTable?

My DataSource is a DataTable populated from file system data in Page_Load. There is no database. How can I remove rows from the DataTable and rebind? I thought this had to be done in the GridView_RowCommand "Delete" section... if(e.CommandName == "Delete") ... When I try to access the DataRow's within //get the datatable DataTabl...

Given an XElement, how do I retrieve a reference to another relative XElement/Xattribute given an XPath?

Given the following XML: <SomeXML> <Element1> <Element2 Attribute3="Value4" /> </Element1 </SomeXML> ... and an XElement reference to 'SomeElement' and an XPath 'Element1/Element2/@Attribute3' How do I retrieve a reference to Attribute3 so that I may alter it's value (using the Xpath)? The XPath is to be a retrieved ...

Command Pattern vs. Visitor Pattern

Is it generally acceptable to allow a Visitor to modify state of the Receiver, or should that be a Command pattern instead? ...

Strong Naming an assembly using command line compile

I am trying to use NAnt in order to compile and sign an assembly using the vbc compiler. I have a project set up and am able to successfully sign the assembly compiling with VS2010. When I try to sign it using the command line I get this error: vbc : error BC30140: Error creating assembly manifest: Error signing assembly -- The parame...

WinForms: Why is Control.Parent null?

I'm trying to get the parent of a listview docked within a splitcontainer, and am finding that ListView.Parent is null. According to the documentation this should be: A Control that represents the parent or container control of the control. Can anyone explain why this property would be null? I've tried moving the ListView to the ...

Taking by myself the MCPD: Enterprise Applications Developer

I'm on road to take the MCPD Enterprise Applications Developer certification, by myself. I already did some courses (WCF and ADO) and was planning to take the others. I found the courses too poor in details - they were more an "introduction" to the content -. Needed to study by the MSDN content. So what's the "path to certification", ...

.NET CF 2.0: Stream implements IDisposable ... kind of?

I've run into something odd in a .NET CF 2.0 project for Pocket PC 2003 (Visual Studio 2005). I was dealing with a System.IO.Stream object and found that the IDE wouldn't auto-complete the Dispose() method. I typed it in manually and received: 'System.IO.Stream.Dispose(bool)' is inaccessible due to its protection level The error is...

Problem running VBScript from my UIAccess VB app using MSScriptControl

I'm trying to run some VBSCRIPT from within my application. This works fine when I run my program from within VB. But once I add "UIAccess=true" to my manifest and digitally sign my exe with my certificate, I am unable to run the code any more. It gives errors when I try to interface with any program saying "429: ActiveX component can't ...

What is the reason of "Transaction context in use by another session"

I'm looking for a description of the root of this error: "Transaction context in use by another session". I get it sometimes in one of my unittests so I can't provider repro code. But I wonder what is "by design" reason for the error. UPDATE: the error returns as SqlException from SQL Server 2008. A place where I get the error seems to...

log4net ADO.NET Appender works on Dev Fabric, but fails silently on Azure

I'm using log4net appender ADO.NET to log messages of Azure Worker Role to the SQL Azure instance (default diagnostics just does not fit). For some reason, while running the worker in dev fabric, logging works. Yet, when the instance is deployed to the cloud (with exactly the same config) errors do not get logged. Configuration happens ...

How can I overload the [] operators?

I'm creating a class which populates a dictionary as a private member. I want to expose the values of the dictionary without exposing the dictionary itself (in a read-only fashion.) I can easily make a property to expose _dictionary.Keys, but how can I overload [] so that MyClass[key] returns _dictionary[key]? I think I may need to impl...

Direct Descendants with html agility pack

I have a specific html node and i want to get the 2nd aka last direct descendant. So after writing .Descendants("div") i wrote ls.Last(). I actually got the last div in the 2nd descendant. Not what i am expecting. How do i get only the direct descendants? or how do i get the descendant with a specific classname? because "div.postBody" wo...

Library to work with XAdES digital signatures

I'm looking for a library compatible with microsoft.net framework that allows the creation and verification of XAdES signatures (XAdES, XAdES-C, XAdES-XL, etc...). It is important that the library enable the programmer to choose: 1.- Type of certificate to use in the signature process (PFX file, Windows centralized store, SmartCard) 2....

How to detect if Windows is directing traffic over LAN or over WiFi in C#

Hi there, I am writing a piece of software in C# using .NET 2 which detects whether there is an active ethernet connection on the Windows machine. It is important that it knows that it is ethernet rather than WiFi as the program will behave differently depending on whether sending data with a WebClient is going over WiFi or Ethernet. I...

Generate PDB from .NET DLL file ?

I need something that can generate a PDB from a DLL file (C# .NET code), is there any free program to do that? ...

What is the easiest way to generate a Valid x:Name?

I am generating some Xaml based on some other source of input. In some cases I am generating x:Name values but they have invalid characters. I found this article on MSDN: XamlName Grammar Which describes the grammar of a x:Name tag but doesn't tell me how to actually apply this. Clearly there is some code to validate this name at runti...

What is wrong with this slimbox script code?

I want to make a gallery with slimbox but cannot get it to run the script. I'm using an ASP.NET Master Page and want the script to be retrieved on this page. The code I am using is: <script type="text/javascript" src="js/slimbox.js"></script> <script type="text/javascript" src="js/mootools.js"></script> ...

Anyone using SharpKeeper in production?

SharpKeeper is a port of ZooKeeper to .NET. The port was done by Eric Hauser as seen on his blog. The code is only available on GitHub here as far as I can tell. My question is does it work? Is anyone using SharkKeeper in production or is it just a toy at this point? ...