I am currently developing an application in where a user will dynamically choose dlls and the application will execute some of the methods in that dll. (if you follow the first link, you will see that I am developing a sort of Robocode game application using the .Net Framework).
For example, when the battle starts, the run method from ...
We are having problems with the Windows.Forms.RichTextBox control in Visual Studio 2008.
We are trying to display text supplied as an RTF file by a 3rd party in a windows forms application (.NET 3.5). In this RTF text file there are tables, which contain text that spans multiple lines. The RTF file displays correctly when opened with e...
So I basically want to have a static method in my AR class to delete all records on a specified expression. But apparently Castle Active Record doesnt have an overload for IQuery params (at least not the version I am using).
This is what I am "effectively" trying to acheive:
public static void Delete(string pAppIdentifier) {
DeleteA...
I'm fighting here with System.Printing namespace of .net framework.
And what i always saw as a wired thing in all the tools by MS to manage my printservers is they lack Port and Driver managing functionality.
So I'm stuck here with a piece of code that works:
PrintServer _ps = new PrintServer(PServer,
PrintSystemDesiredAccess.Adminis...
Say I have an interface IFoo, and I want all subclasses of IFoo to override Object's ToString method. Is this possible?
Simply adding the method signature to IFoo as such doesn't work:
interface IFoo
{
String ToString();
}
...since all the subclasses extend Object and provide an implementation that way, so the compiler doesn't c...
The following code tries to create a new record and then modify it after it has been committed to the database. The last SubmitChanges() call throws a ChangeConflictException.
ItemA itemA = new ItemA();
itemA.Foo = "a";
itemA.Created = DateTimeOffset.Now.UtcDateTime;
ItemAs.InsertOnSubmit(itemA);
SubmitChanges();
itemA.Foo = "b";
Subm...
I've created a custom resource provider which returns strings from our database to use for whatever.
The issue is I haven't found a way to "bust" the cache on these items and reload them from the database. Ideally I'd do this every x minutes or manually when we update the cache and want to reload it.
Technically, that's easy. I'm stori...
In C#, how can I output a number as binary to the console? For example, if I have a uint with the value of 20, how can I print to the console: 00010100 (which is 20 in binary)?
...
Hi, I need custom behavior for tab keys in RichTextEdit control.
Currenty the best I have is this:
editBox.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.field_PreviewKeyPress);
private void field_PreviewKeyPress(object sender, PreviewKeyDownEventArgs e)
{
switch (e.KeyCode)
...
Lets consider that I have a public property called AvatarSize like the following,
public class Foo
{
...
public Size AvatarSize
{
get { return myAvatarSize; }
set { myAvatarSize = value; }
}
...
}
Now if a target class wants to set this property, then they need to do it the following way,
myFoo.AvatarSize = new Si...
I'm trying to create my own error window for the project I am working on. When I show my error window I have no way to pass the error message, and user message to the Error window because the "ErrorMessage.Text" cannot be seen in the classes I make.
I went into the form designer generated code and tried to make the TextBox static, but t...
I'm creating a website in asp.net and mysql, I noticed that the performance of connection pooling in the mysql .net connector is horrible to say the least! For example sql server is 10x times faster in connection pooling (the sql server .net provider connecting to sql server), is there anything I could do to speed up connection pooling? ...
With LINQ, a lot of programming problems can be solved more easily - and in fewer lines of code.
What are some the best real-world LINQ-to-Objects queries that you've written?
(Best = simplicity & elegance compared to the C# 2.0 / imperative approach).
...
When a form is posted back to the server, is it possible to manipulate, change, set the values contained in HTTP Post in the controller action? I would like to remove certain textbox values entered by the user so that these values always have to be re-entered (e.g. password fields). By default Html helpers extract initial values for HTML...
I use a lot of ObjectDataSources (ods) in my website projects. Almost all of my ods's use SessionParameters; typing the session parameter name into the SessionField property of the ods is annoying and prone to typos.
I have a static SessionParams class where I store all the session parameter names, is it possible to reference the membe...
I am looking for a managed code library/API or samples that let me write and read cabinet (.cab) files. There is a CAB SDK here: http://support.microsoft.com/kb/310618 but the DLL that ships with it only supports native code.
...
I've been looking around for some decent tutorials on .NET remoting (old style MarshallByRef), and have come across a couple, but nothing that I'm happy with. Does anyone know of any decent tutorials around?
...
Icon files (*.ico) may contain multiple images at different sizes and of different colour depths.
How can I obtain a System.Drawing.Image object from a .ico file?
One option is Image.FromFile(...), but for icon files with multiple images there is no way to specify which image size and colour depth to return.
Ideally the solution would...
I've got a client/server application, written in WCF / C#3.5.
The server is in my local TimeZone, and clients are spreaded accross the world.
My current strategy is to use UTC DateTime everywhere on the server and in the database, and to let the clients handle correctly the UTC DateTimes they receive.
This means that everytime the cli...
The Windows SDK ships with a tool called signtool.exe that lets you sign a file with a certificate. I need to do the same thing but in a background service so I'm on the lookout for a library (preferably managed code, but COM will do) to do the same thing. Any ideas?
Found the answer. Here's how to use an X.509 certificate to sign a fil...