properties

MSBuild: Evaluating reserved properties with ReadLinesFromFile

Hi all! I'm using MSBuild to customize the build process of Visual Studio, WiX, SandCastle, ... projects. To keep it as generic as possible I'd like to use text files defining some 'project specific' settings, like where the files should be loaded from, which custom executables to run and so on. A text file could look like this: $(MSBu...

Reading a list from a java .properties using Spring properties place holder

Hi there, i want to fill a bean list property using Spring properties place holder. Context file ------------ <bean name="XXX" class="XX.YY.Z"> <property name="urlList"> <value>${prop.list}</value> </property> </bean> Properties File --------------- prop.list.one=foo prop.list.two=bar Any help would be much ...

Spring's PropertyPlaceholderConfigurer with property in a jar file

I have multiple property files I need to refer to. Below I can refer to two that are on the classpath. How do I refer to a property file with in a jar file ? <bean id="placeholderConfig" name="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <...

Writing a maintainable commit method

I have a ViewModel that encapsulates some properties that are being edited in an options dialog. I can't actually save them to the settings until they hit the Ok button, which will end up calling Commit on this particular ViewModel. A single property in my ViewModel looks like this: public bool SomeProperty { get { ret...

How will I do a property drill down?

How will I know if an object instance is a property or a sub property of another object instance? for example I have this class structure: public class Car { public Manufacturer Manufacturer {get;set;} } public class Manufacturer { public List<Supplier> {get;set;} } public class Supplier { string SupplierName {get...

JavaScript set scrollHeight

Hi, In JavaScript what's the right way to set the scrollHeight of one element to that of another element? Direct assignment has no effect. Thanks, Greg ...

C# question about getter and setter?

class Foo { public List<float> Data { get ; set ; } // list of numbers private float Total { get ; set ; } // Contains sum of numbers in Data // Constructors and other stuff. } My code that uses this class keeps modifying Data so I want to see the relevant changes in Total also. I don't want to add func...

Ant (1.6.5) - How to set two properties in one <condition> or <if>

I am trying to assign two different strings to two different variables dependent on two booleans in Ant. Pseudocode (ish): if(condition) if(property1 == null) property2 = string1; property3 = string2; else property2 = string2; property3 = string1; What I've tried is; <if> <and> <not><isset propert...

Interfaces with different getter and setter for the same propertie

I've made the following declaration for interfaces: public interface IBasic { int Data { get; } } public interface IChangeable : IBasic { int Data { set; } } The compiler says that IChangeable.Data hides IBasic.Data. It's reasonable. The alternative I've found is: public interface IBasic { int Data { get; } } public interface...

Using enum types as properties in Objective C

I'm a veteran .NET developer making my first foray into Objective C programming. I'm having difficulty with a property of an enum type. Some context... I have an class header and enum like this: typedef enum { Open, Unavailable, Unknown } LocationStatus; @interface Location : NSObject { LocationStatus status; } @pr...

Possible ways to abstract away hard-coded path-names for properties file in java app

I'm trying to bind in a third party app to our project but have discovered that the unix paths of their property files have been hard-coded into several classes. It is probably possible to make minimal changes to their setup, so my question is: what are the possible (and quickest) ways to achieve this? The third party app uses neither an...

GlassFish reading in a Properties File

I'd like to have a class read in a properties file when GlassFish starts up, then access the properties throughout the application. How do I get GlassFish to instantiate a class and then access the properties read in through out the application? ...

Using properties defined at a per-instance level not per-class

What I am trying to achieve is something like this: class object: def __init__(self): WidthVariable(self) print self.width #Imagine I did this 60frames/1second later print self.width #output: >>0 >>25 What I want happening (as above): When WidthVariable - a class - is created it adds the variable ...

Is is possible to define a class property in Objective-C?

To declare an instance property you can use a declaration similar to this: @property (readonly) int size; The property can later be accessed using the dot syntax: NSLog(@"The object has a size of: %d", objectInstance.size); However, I'd like to declare a class property so that, even without an instance, I can access it in this mann...

ASP.NET C# - How do I set a public property for a CheckBoxList inside a UserControl?

I'm having trouble figuring this out. If I have a checkboxlist inside a usercontrol, how do I loop through (or check, really) what boxes are checked in the list? As I said in the comment below, I'd like to expose the checked items through a property in the control itself. ...

Could it be a good idea to put Properties into Dictionaries?

Suppose I have a class with several properties that correspond to user-defined parameters, such as: bool StepUpHedge { get; set; } bool PullOnJump { get; set; } bool PullOnCross { get; set; } double MaxStockSpread { get; set; } double MaxHedgeSpread { get; set; } (These are just examples, not real code, and anyway what they mean isn't...

How to get a property name?

This might seam like a strange question but.... public string MyProperty { get { return "MyProperty"; } } How can I replace the return statement go it returns the property name without it being hard coded? ...

How do I compare the fields/properties between POCOs?

Let's say I have a POCO: public class Person { public string Name { get; set; } public DateTime DateOfBirth { get; set; } public IList<Person> Relatives { get; set; } } I want to compare two instances of Person to see if they're equal to each other. Naturally, I would compare Name, DateOfBirth, and the Relatives collection...

.NET - When should I use a property vs. variable + accessor functions?

Is there ever a situation where I should do the following in .NET instead of using a property with read/write capability? private S as string public function GetS() as string return S end function public sub SetS(byval NewS as string) S = NewS end function Do properties simply provide a more efficient way for doing the same...

Communicate between two windows forms in C#

I have two forms, one is the main form and the other is an options form. So say for example that the user clicks on my menu on the main form: Tools -> Options, this would cause my options form to be shown. My question is how can I send data from my options form back to my main form? I know I could use properties, but I have a lot of opt...