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...
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...
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
{
...
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
...
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...
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...
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" /...
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...
See this example from RFC2518:
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>http://www.foo.bar/container/</D:href>
<D:propstat>
<D:prop xmlns:R="http://www.foo.bar/boxschema/">
<R:bigbox>
<R:BoxType>Box type A</R:BoxType>
...
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...
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...
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...
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)
...
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 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...
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?
...
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...
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...
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...
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...