I have a stack panel with a few (different) items:
<StackPanel ...>
<TextBlock ... />
<CheckBox ... />
<CheckBox ... />
<Button ... />
</StackPanel>
I would like to apply VerticalAlignment="Center" to all children of the StackPanel without having to add VerticalAlignent="Center" or Style=... to every single child. So, ...
Hi
If I have a project and I mark it as
<Assembly: CLSCompliant(True)>
Do I need to put CLSCompliant(True) before every class in the project, or are they all defaulted to CLSCompliant?
...
Consider the code below
XmlSerializer serializer = new XmlSerializer(typeof(Invoice));
using (TextWriter writer = new StreamWriter(fileName))
{
// Serialize the object, and close the TextWriter.
serializer.Serialize(writer, invoice);
writer.Close();
}
No encoding is set on the stream writer by default. Does it def...
Hi there.
I have a running 3D engine built in D3D (via SlimDX). To avoid interupting the rendering pipeline I have batched together many objects with the same material into bigger meshes (to reduce state switching). This have worked well and gives a good performance level for my need.
The issue I am running into is that I, during runti...
I'm trying to port some code into .net which has a load of #define'd values e.g.
#define MY_CONSTANT (512)
#define MY_VERSION_STRING "v42.2"
When I import a cli library the #define's are lost. Is there a way of defining constants in the scope of a namespace. I was thinking something like this:
namespace MyNamespace
{
const ...
Hi I am writing javascript in my custom webpart's .cs file but it is giving me illegal XML character exception in browser.
PageJavaScript.Append(@"function closeLoadedDiv(){ <%=Page.ClientScript.GetPostBackEventReference(btnLinkButton, "", false)%> }")
I have used escape sequence for < but it is still not working
...
I'm trying to perform an import from Excel into an EF container, but every time I attempt this, every new record gets inserted twice. The 'AddToEntitySet' call only ever happens once, as does the SaveChanges, but immediately afterward, there are two of each record. What am I doing wrong?
int rowNum = 1;
foreach...
I have the following config file:
<system.diagnostics>
<trace autoflush="true" indentsize="1" >
<listeners>
<add name="dbgTrace" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\MyLogs\MyApp\Logs\LogFile.log" />
</listeners>
</trace>
</system.diagnostics>
So I can read the traceliste...
Does anyone knows how to change text on button in OpenFileDialog in Windows.Forms in C#.NET?
...
Lets say I have a Node class as follows:
class Node<T>
{
T data;
List<Node<T>> children;
internal Node(T data)
{
this.data = data;
}
List<Node<T>> Children
{
get
{
if (children == null)
children = new ...
I want to send a HTML email using HTML template.
I would like to just replace some value's from that HTML template.
Any idea how to achieve this?
...
I'm trying to use some legacy Delphi 5 DLLs from C# (2.0/3.5). Some of the exported functions are declared as such:
function SimpleExport: OleVariant; stdcall;
function BiDirectionalExport(X: OleVariant; var Y: OleVariant): OleVariant; stdcall;
I wish to set these up as delegates using Marshal.GetDelegateForFunctionPointer, but I'm ha...
I wish to automagically discover some information on a provided class to do something akin to form entry. Specifically I am using reflection to return a PropertyInfo value for each property. I can read or write values to each property from my "form", but if the property is defined as "int", I would not be able to, and my program should n...
When trying to apply some heavy stress on a new web app, we were having trouble with our usual array of free tools (WAS, some other free ms tool (wcat?)), so i created a v. quick and dirty tool that would use a .net webrequest object, open up new threads, and continually hit a list urls from a file. On a single thread it produced a littl...
Is there any way to force a C# application to use a specific version of the MSHTML DLL?
I'm trying to write an application that uses the different versions of the IE rendering engine to help web designers test their creations for backwards compatibility with IE6, IE7 etc...
As far as I understand so far, the SHDOCVW DLL 'hosts' or 'run...
Hi
I wrote a code in C# that maps logical drives to their physical disks, using WMI (System.Management).
The code working perfectly, but slow like hell.
In my machine (Windows 7 x64, Dual-Core with 3 GB RAM) it runs as least 1 second.
1 second is too slow for me, even 0.1 is more than enough to accomplish.
I more than sore that this fun...
Hi,
I've bumped into examples using either of both notations. I can't find anything about it what tells which one is the common one, why 2 notations are allowed, and if there is actually any subtle difference between the two.
anyone an idea?
...
I have a solution that includes several class library's and a website. The solution was built in .net 2.0 Visual Studio 2005, and later converted to .net 3.5 (all class library's and website are targeting 3.5 framework).
Before installing the update, the website functioned perfectly. After, a build fails on
using System.Web.Extensions;
...
Hi,
I want to define the begin of a day in another timezone with .NET/C#.
Example:
My current timezone = GMT+1
so DateTime.Today returns 19/11/2009 23:00 UTC
but actually I want to get the DateTime.Today for timezone GMT+2 which would be 19/11/2009 22:00 UTC.
How do I do this without juggling with offsets & daylightsaving calcu...
Also, there is one other thing that is an lvalue in VC#, though it's a language extension - __argvalue().
Source
That was the only Google result for __argvalue.
I tried it in LINQPad and it doesn't seem to exist.
...