.net

How do I sort a generic list based on a custom attribute?

I am working in c#.NEt 2.0. I have a class, let's say X with many properties. Each properties has a custom attribute, an interger, which I planned to use to specify its order int he final array. Using reflection I read through all of the properties and group the values and place them into a generic list of properties. This works and I c...

Since strings are immutable, do variables with identical string values point to the same string object?

a) string s = "value"; string s1 = "value"; Do s and s1 reference variables point to same string object ( I’m assuming this due to the fact that strings are immutable )? b) I realize equality operators ( ==, > etc ) have been redefined to compare the values of string objects, but is the same true when comparing two s...

.NET Framework & Visual Studio install order

Hi Folks, does it matter if we install .net framework & then visual studio or does visual studio comes with the framework ? I know it's a basic question but i never thought of this honestly. TIA ...

Changing thread priority to make my program and computer more responsive

I've written a .NET winforms application that uses a secondary thread to do some heavy processing, which communicates it's progress back to the UI thread. Everything works correctly, the form shows the progress, and I've also created a cancel button to interrupt the processing thread. However, when the time consuming process is going the...

Split executable path and arguments

Hi, I need to be able to to split the executable path and arguments in a command. Windows handles the following easily: "notepad.exe C:\testfile.txt" "notepad c:\testfolder\versioninfo.txt" "C:\Windows\notepad.exe" "C:\test folder\versioninfo.txt" rundll "C\Windows\somelibrary.dll" Anyone has a piece of code to parse such strings...

Where can I find a pre-compiled Markdown# dll?

I'd like to use Markdown# in a project I'm working on (Not a .Net project, but I have the ability to instantiate .Net class libraries and use them natively). Unfortunately I haven't been able to find a pre-compiled Markdown# DLL. I'd really rather not install Visual Studio just for the purpose of compiling the project. Are there DLL do...

Need to use COMM port 2 to get information from a device. .Net doesnt support it though

I am writing a vb.net app that has a piece which needs to send a small command to comm port 2 and get the return result. The problem is .net doesnt have any support for serial communication seems like. Please help. I just need to send the command "headtype" and get the result. ...

ImageMagick.Net confusion

I've been trying to use the IsSimilarImage magick method from the ImageMagickNet project but I'm confused as to whether I have to route these methods through the Magick++ as any functionality available to the .net side originates in the Magick++. Has anyone added any custom functions to ImageMagickNet that could shed some light on where ...

Creating a System::String object from a BSTR in Managed C++ - is this way a good idea???

My co-worker is filling a System::String object with double-byte characters from an unmanaged library by the following method: RFC_PARAMETER aux; Object* target; RFC_UNICODE_TYPE_ELEMENT* elm; elm = &(m_coreObject->m_pStructMeta->m_typeElements[index]); aux.name = NULL; aux.nlen = 0; aux.type = elm->type; aux.leng = elm->c2_length; aux....

What is the preferred method for storing application settings in Windows Mobile Applications?

I am using the .NET Compact Framework 3.5 and I am trying to determine if there is a standard way to store settings that a user to change in my application. I am aware of the Compact 3.5 SQL database, but I am trying to avoid that if I can to avoid a dependency that is not already installed on the user’s mobile device (I already have to ...

How to specify a MessageBodyMember is required?

I'm looking for a way to specify that some MessageBodyMember is required, so that the generated schema would have minOccurs=1 instead of minOccurs=0. I have to manually edit the schema to add it, and it's really a pain. I read a few articles that say this is not possible, but they are a bit old; perhaps now there's a way or a workaround...

A completely managed database solution?

Hey, I'm looking for an open source database engine, that is completely written in C# (no any native dll, not mixed mode, etc...). It should support basic actions on tables (INSERT, UPDATE, SELECT, DELETE and TRUNCATE) and transactions. SQL support is not needed. Thank you. ...

How do I serialize a .NET control to CODE?

I want to create a .NET Form at runtime, add buttons and other controls to that (also at runtime), and then be able to generate a something.designer.cs file from that form (which can then be added to a C# solution and compiled). What I want to do is very similar to what the WinForm designer does. But instead of having a drag/drop inter...

Quicktime Timecode

I'm trying to readnon-drop timecode data using the quicktime com component. Unfortunately I don't seem to be able to find any documentation on this at all. I can pull up the timecode with 0 starttime but I need the real timecode embedded in the clip. It looks to me like I need access to the MediaHandler to get SMPTE timecode. I can't s...

ASP.Net MVC 2.0: EditorFor setting name via attributes

Hey guys Just wondering how do I mimic the following using attributes... <%= Html.EditorFor(x => x.SportProgramIdList, "FormMultiSelectDropDownList", "SportProgramIds")%> I know I can specify the template by using [UIHint("FormMultiSelectDropDownList")] but I am left with the problem with how to set the name... Cheers Anthony ...

Targeting multiple WCF endpoints with one DLL

Good afternoon, I am writing a DLL that that leverages WCF to make a web services call. Normally this is fairly straightforward: I configure the endpoint in the .config file and be done with it. However, in this case, the DLL can be called in one of several contexts and depending on the context, the endpoint might change. The behavio...

SmallestDotNet as CustomAction after MSI installation

Is there anything to be said againt installing SmallestDotNet 3.5 (http://www.hanselman.com/blog/SmallestDotNetOnTheSizeOfTheNETFramework.aspx) as a CustomAction after MSI installation to ensure that .NET 3.5 is installed? I've found many more complicated ways which (partly) include .NET framework into the installer. How would you ins...

Is there a data structure that holds sets of data in .NET?

I'm looking for a data structure similar to a dictionary that returns the set of all related items to a key. For example, I would use it like this: var data = new FancyDataStructure(); data.Add(new string[] {"Elizabeth", "Liz", "Betty"}); data.Add(new string[] {"Bob", "Robert", "Rob"}); string[] alternateNames1 = data["Betty"]; strin...

What does setting up a symbol server give me?

I read through this article: Setting up a Symbol Server, which goes into details on how to set up a shared symbol server for my team. The thing I'm wondering about is adding my own symbols into the store. My question is this: What exactly is it that I gain from this? Let's assume that I have the following build process: I commit cha...

caspol.exe doesn't grant Full trust to the Intranet share on fw2.0 machines

I have few pre .net 3.5 Sp1 machines where i need to run an exe from a local intranet share. Here is the sample CAS commnad I am using to grant full trust to the local intranet share. CasPol.exe -m -ag 1.2 -url file://\\Server/Sahare/folder1/folder2/AppFolder/* FullTrust It alters the local intranet policy and grants Full trust to 1.2...