I'm trying to bind a TextBlock's Text property in a very dynamic way. I need to get the Path from an underlying object.
Here's the DataTemplate:
<DataTemplate DataType={x:Type local:DummyClass}>
<TextBlock Text={Binding Path=???} />
</DataTemplate>
The DummyClass object has a property named "FieldValuePath" - the path that needs to...
I have a C++ console application to which I want to a Windows Form. I don’t want to use MFC because I don’t know how. Instead, I am using a C# to create the COM dll (Class Library). When I distribute the application and the dll to the target computer, I need to register the dll such that the application can see the COM interface and use ...
I keep a lot of settings in AppSettings, and I was wondering if it's considered good practice to name them in UpperCase. Essentially, they're the same as Constants right? As I understand it, if you change the Web.Config, the app does a recompile.
So, I was thinking, should you keep the settings in AppSettings in UPPERCASE (Assuming you...
I have a Windows Form (C# .NET 3.5) with a number of buttons and other controls on it, all assigned to a topmost Panel which spans the whole Form. Eg the hierarchy is: Form -> Panel -> other Controls.
As soon as i assign a BackgroundImage to the Panel the Controls draw very slowly. I have the same effect if i use the Form's BackgroundIm...
Hi guys,
I'm writing an application that uses a COM library. I have a class library that wraps the calls to the COM library and adds some more functionality. Eventually this will run as a Windows Service. For now I test it using a Winforms test harness.
When the class library is created by the test harness everything seems to be working...
I have a .net form that is created in Excel (I don't know if that's relevant), and when I call form.Hide(), Excel flickers briefly. If I instead call form.Close(), the flicker is absent.
Why does the Hide() version cause flicker, while the Close() version not?
...
I was reading this article, where they have this code:
// Serialization
XmlSerializer s = new XmlSerializer( typeof( ShoppingList ) );
TextWriter w = new StreamWriter( @"c:\list.xml" );
s.Serialize( w, myList );
w.Close();
// Deserialization
ShoppingList newList;
TextReader r = new StreamReader( "list.xml" );
newList = (ShoppingList)s....
I have a listbox(l1) in an updatePanel that gets populated on changing a drop-down which is in the updatepannel as well. I have another listbox(l2) in the updatepanel which can populate l1 via javascript. I have 2 two items in dropdown. Item 1 has 6 items releated to it and Item 2 has none. When the page loads Item 1 is selected in t...
What I'm trying to do is provide a generic search capability on a table. So the user is presented with all data in a table, they enter some text to filter on, and voila, the table is now filtered on all results that match that entry.
I have this working with a single field:
public ActionResult Index(string user_name)
{
var dataCon...
I have a rather peculiar data source I have to work with (an interface to an accounting application actually). While it is pretty powerful, I have to jump through pretty many hoops to get the data I want out of it. For example, if I want to get the contents of a table and specify which columns it should return, I have to iterate through ...
I have created two classes:
public class Params : List<Param>
{
}
public class Param
{
public enum enType
{
Integer,
Double,
String,
DateTime
}
private string sName_m;
public string Name
{
get { return sName_m; }
set { sName_m = value; }
}
private string...
I am trying to send E-mails asynchronously and it works fine as long as there isn't an AlternateView attached to the e-mail. When there is an alternate view, I get the following error:
Cannot access a disposed object. Object name: 'System.Net.Mail.AlternateView'
System.Net.Mail.SmtpException: Failure sending mail. ---> System.ObjectDis...
I keep having discussions about this topic and I want the input of the community.
As far as I've heard, .NET is the current leader in $/hr or $/project ranking. How does .NET rank against Java or J2EE?
...
I'd like to do two things on my progress bar.
Change the green colour to red.
Remove the blocks and make it in one color.
Any information about those two things I wonder how to accomplish will be greatfuly appreaciated!
Thanks.
...
In this example:
var p1 = new {Name = "A", Price = 3};
And this translates into IL:
class __Anonymous1
{
private string name ;
private int price;
public string Name{ get { return name; } set { name = value ; } }
public int Price{ get { return price; } set { price= value ; } }
}
__Anonymous1 p1 = new __Anonymous1();
p1.Nam...
Hi,
I am currently developing a webapp based on c# that calls some webservices. I have imported three different WSDLs from the provider into my WebApplication3 project (references -> add web reference). In the class viewer they appear as:
WebApplication3.com.provider.webservices1
WebApplication3.com.provider.webservices2
WebApplication...
I've been attempting to fully document all types, methods, properties, etc. of a class library using XML comments but have run into a curious effect involving the cref attribute (used by see tags for example). Going by the advice of this MSDN page as well as following various other examples on MSDN and other websites, it seems that whene...
When you overload the - unary operators, for an immutable type, you can write it like:
public static Point3 operator - (Point3 p)
{
return new Point3 (-p.X, -p.Y, -p.Z);
}
But for the + unary operator, how should you implement it? Like this:
public static Point3 operator + (Point3 p)
{
return p;
}
or like this:
public stat...
I have some server side code that needs to check a username/password pair. I'm looking for something to do this that is nice and simple as in having a text file with username/MD5 hash pairs. I'd love the code use to look like this:
if(!PasswordChecker.ValidLogin("passwords.dat", username, password)
throw new Exception("Invalid usern...
Hello,
If you like to create custom delegates you would use the delegate keyword in lowercase.
What can you do with the actual Delegate Class? What is this good for? Don't understand the exact difference.
Thanks
Kave
...