I have a set of strings. I want to select all strings that contains another string. But I want to have as the first items, the items that start with the search, and then, alphabetically the other items. But the following code doesn't work:
items = items
.Where(a => a.Contains(contained))
.OrderBy(a => a)
;
var startsWith = item...
I'm attempting to use powershell to access a remote registry like so:
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $server)
$key = $reg.OpenSubkey($subkeyPath)
Depending on some factors that I'm not yet able to determine I either get
Exception calling "OpenSubKey" with "1" argument(s): "Requested registr...
I have the following inheritance:
internal abstract class TeraRow{}
internal class xRow : TeraRow {} // xRow is a child of TeraRow
public IEnumerable<TeraRow> Compare(MappedTables which, DateTime selectionStart
, DateTime selectionEnd, string pwd)
{
IEnumerable<xRow> result=CompareX();
return (IEnumerable<TeraRow>)result; /...
How do I convert a FormattedText string into a geometry-based object?
I don't think this question requires much explanation, and I can't think if very many other details I could give ...
I just need to convert the FormattedText into something I can use mathematically (geometrically).
Any advice is appreciated!
...
Hi,
I have a GridView control which has a DataSet as a datasource. The dataset contains a parent child relation between two tables, Publications and Owner. When iterating through the dataset creating each row of the gridview, how do I access the data in the child table so that I can display it?
Thanks R.
...
Using Visual Studio 2005 and C# .NET I was attempting to call methods from the SkillSoft API through their web service and have been running into issues when creating the instance. I started by adding the web service reference to the project (Add Web Reference) and that works fine. Where I get tripped up is in the main .cs where I wish t...
I have this lead generation form and after they give us their information, I would like the form's thank you page to popup a window where the user can save the file or open it.
This web page will be served from a Microsoft server so .net C# or javascript are options.
thx
...
We've been toying around with the idea that some of the reason we're not getting a higher caliber of client is because we've made it known that one of our primary partnerships is with an open source application vendor that provides a product built on PHP. Some clients we've talked to that don't even have the budget for "enterprise langua...
The following listener will create an event entry when the Trace.WriteLine is called. If the source does not exist he will create it in the default log channel which is 'Application' . I want to specify another default Log channel but after searching for 45 minutes i don't seem to find the solution. Any ideas?
<configuration>
<syst...
Hi, I have some custom/user controls that in most cases have label and entry, like this:
Is there any way I can customize standard WinForms ErrorProvider to display it's icon inside entry (entry - textbox, combo, datetime etc...), like this:
where red elipse is of course error indicator.
Thanks for any help.
...
I am writing a small .NET Windows Forms app, and I use the built-in Visual Studio settings to manage my programs config. I noticed an issue however that after I had added a StringCollection setting (to store a list of recently accessed documents), my program took eversoslightly longer to startup.
I ran a StopWatch over the programs ini...
A colleague asked me an interesting question today - is the C# keyword/operator "is" considered reflection?
object tmp = "a string";
if(tmp is String)
{
}
How is this operator implemented behind the scenes? Does it require reflection or introspection? Or because of the strongly typed nature of the language, is the Type of the object ...
What compelling reasons exist for using them?
...
I know how to generate Crash Dump files with ADPlus or DebugDiag, but I'm wondering if there is a way to do this on a customer's computer without installing these tools... specifically, I would like to be able to configure my application (using a registry value, for example) to generate a crash dump in the case of a critical failure. M...
I can't seem to find the answer to this question.
It seems like I should be able to go from a number to a character in C# by simply doing something along the lines of (char)MyInt to duplicate the behaviour of vb's Chr() function; however, this is not the case:
In VB Script w/ an asp page, if my code says this:
Response.Write(Chr(139...
The server hosting csharpindepth.com has recently been migrated.
Most of it is working fine, but I can't get at the database used to hold errata, notes etc.
Relevant details:
32 bit Windows Server 2003
SQL Server Express 2005 installed
ASP.NET pool running under "NETWORK SERVICE" account
.NET 3.5
Everyone has full permission to datab...
I have this code:
[RdfSerializable( HasResourceUri=false )]
public class Item
{
[RdfProperty(true)]
public string MyProp;
}
[RdfSerializable]
public class AllItems
{
[RdfProperty(true)] public string mTitle;
private int id = new Random().Next(0, 20);
[ResourceUri]
public string...
I've implemented a class that looks like this interface:
[ImmutableObject(true)]
public interface ICustomEvent
{
void Invoke(object sender, EventArgs e);
ICustomEvent Combine(EventHandler handler);
ICustomEvent Remove(EventHandler handler);
ICustomEvent Combine(ICustomEvent other);
ICustomEvent Remove(ICustomEvent ...
For example if I wanted to see what my .NET options were for something implementing IList or IDictionary. Is there a way to find that for example in the MSDN documentation?
...
I am working on a ASP.NET response filter that rewrites URL's to point to a different domain in specific situations.
Because ASP.NET chunks the response writes, my filter gets called several times before the page is fully streamed. This means that I need to be careful that each call to Regex.Replace doesn't double replace a url (You end...