properties

A more elegant solution to creating an array from comma sep list of properties?

In my properties file I have one property, which contains a comma separated list of values In my code, I would like to load that property in, split it from the commas, and add each value into an array. I also want to make sure I don't have values in the array due to whitespace etc example property : prop_allowed_extensions = .jpeg,ti...

Correct use of C# properties

private List<Date> _dates; public List<Date> Dates { get { return _dates; } set { _dates = value; } } OR public List<Date> Dates { get; set; } I have always used the former, is that incorrect or bad practice? It never occurred to me that I could just use the second option. I do like having my encapsulate...

how to add type in list<T> in c# 4,0

im trying to get datas from database dynamically. i've list<T> select<T>() method... heres my issue i can get datas by using datareader here is code: public list<T> Select<T>() { Type type = typeof(T); ... ... using (SqlConnection connection = new SqlConnection(ConnectionString)) { try { ...

How to show Properties Dialog like in Explorer? (in WPF)

Possible Duplicate: How do I display a files Properties dialog from C#? Hello. Is there a way to show the exact (ie. not simulated) Properties dialog in WPF? The one in Explorer's context menu? Thanks ...

Properties exposing array elements in C#

I want to create a property in C# that sets or returns an individual member of an array. Currently, I have this: private string[] myProperty; public string MyProperty[int idx] { get { if (myProperty == null) myProperty = new String[2]; return myProperty[idx]; } set { myProperty[i...

Setting property values dynamically

I am using a PivotGrid(DevExpress). I want to set AppearancePrint property settings in a for loop. How do i use the variable type for properties such as Cell in the example below? so instead of grid.AppearancePrint.Cell.BackColor = Color.White; grid.AppearancePrint.Cell.BackColor2 = Color.LightBlue; I want to do this: //datarow e...

How do I evaluate a string as a property name in Nant?

I'm rejigging our deploy scripts, and have moved to external config files for each defined environment. I have the ${environment} and the ${system} component passed as variables on the command line. I load config.${environment}.xml, which contains a bunch of property definitions. <property name="server.component1" value="server01" /...

JEE i18n without property files

Hi there, normally I place my translations etc in properties - e.g. message_de.properties etc. I'm facing now a situation where I have to provide this data in a database. (Translations will be imported/edited in an other system) Is there a common way/best practises to use a database table for messages in my webapp? One way I would thin...

Help me unserstand this XML key/value declaration from the WebDAV specs

See this example from RFC2518: <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://www.foo.bar/container/&lt;/D:href&gt; <D:propstat> <D:prop xmlns:R="http://www.foo.bar/boxschema/"&gt; <R:bigbox> <R:BoxType>Box type A</R:BoxType> ...

C# Properties and this-keyword

When should I use the this-keyword for properties in code? public class MyClass { public string MyString { get; private set; } public void MyMethod() { OtherClass.DoStuff(MyString); // Or this.MyString? } } I know that if the type and name of a property is the same you have to use this. to make it work. public str...

Issue with custom TypeConverter and nested properties in the designer

I'm trying to add a nested property to my custom control using a TypeConverter, here is my test code: public class TestNestedOptionConverter : TypeConverter { public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] filter) { return TypeDescriptor.GetPro...

How to access events of a properties.settings.default field in C#?

I have two forms, Form A and Form B. My Properties.Settings.Default has a timer object that when "ticked" needs to open Form B. What I would like to do is program the timer_tick(object sender, Eventargs e) event for the timer object that is in the solution's properties. Is this possible? If so how? The issue I am having is I don't know...

Are all Java Properties' methods fully synchronized?

I know that the Properties class is a sub-class of Hashtable. So all the inherited methods are synchronized, but what about the other methods of Properties such as store, load, etc? (Dealing specifically with Java 1.6) ...

WebDAV: can a client modify the mtime of a file?

Is a WebDAV client, per RFC, able to update the modification-date timestamp of a file. WebDAV lists this as the "getlastmodified" property. Being able to do a utime() on files is quite important when moving files as I regard mtime as essential file metadata. But for example doing a propset with cadaver (which I regard as a kind of refere...

Is there a .NET attribute for specifying the "display name" of a property?

Is there a property that allows you to specify a user friendly name for a property in a class? For example, say I have the following class: public class Position { public string EmployeeName { get; set; } public ContactInfo EmployeeContactInfo { get; set; } } I'd like to specify that the display name for the EmployeeName pr...

Why use public properties for private fields in C#?

If I make a class member private, and then I want to acess that member, we have to define a public property for that member. But then I wonder: If we can use the class member publicly by declaring a public property for it, then why don’t we just define the class member itself as public? ...

Creating Classes and Properties in AS3

I'm new to AS3. Learning how to create classes. Is comp = new HouseObjects creating a new class? Is comp creating an instance of the HouseObjects? I realize that this is inside public class TreeHouse. I'm thinking that HouseObjects, how I set it up is not a class...not sure what the correct way to set up classes and properties. Also I n...

Contravariance problems with event properties

Suppose I have a simple EventArgs subclass: class MyArgs : EventArgs { } Consider I have two classes with events: class MyData { public event EventHandler<MyArgs> Method; } class MyObject { public event EventHandler Method; } And a simple program that uses them: static void Main(string[] args){ MyObject o = n...

Properties file in python (similar to Java Properties)

Given the following format (.properties or .ini): propertyName1=propertyValue1 propertyName2=propertyValue2 ... propertyNameN=propertyValueN For Java there is the Properties class that offers functionality to parse / interact with the above format. Is there something similar in python's standard library (2.x) ? If not, what other al...

Unable to create a file with foreign language characters

I get the following error, when trying to save a properties file (containing name/value pairs) with foreign language characters. How do I set the encoding Save could not be completed. Some characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "C...