properties

'caching' properties

Hey everyone, I have a class filled with properties. When the properties are accessed it reads some values out of an XDocument. public class Foo { private XDocument root; public Foo(Stream str) { root = XDocument.load(str); } public String Bar { get { return root.Element("bar").Value; } } } Only it seems a bit o...

XPath query to parse xml properties file

I have the following xml document: <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt; <properties> <comment>My Happy Configuration</comment> <entry key="HappyKey">Happy Key</entry> <entry key="SadKey">Sad Key</entry> <entry key="AngryKey">Angry Key</entry> <entry key="ConfusedKey">Co...

Java: can I require a child class to define a property value?

I have an abstract base class that many classes extend. I'd like all these classes to define a unique value for a specific property that is originally defined in the base class (similar to the serialVersionUID property that causes a warning when not defined in classes that inherit from Serializable). Is there a way for me, within my ab...

How to update the svn properties but not all files of a folder

In my coding environment I've got a dev, test and production machine. Sometimes I have to add files to svn:ignore for all machines. But if I want to update these properties, I have to make an update on a whole folder instead of only some stable files. Is there any chance to get only the update of the folder properties (like svn:ignore) ...

How a jar file can read an external properties file

We have a connection pooling comeponent(jar file) for one of our application. As of now the application connection details are bundled with-in the jar file(in .properties file). Can we make it more generic? Can we have the client tell the properties file details(both the path and the file name) and use the jar to get the connection? D...

Can you instantiate objects via a Property setter?

C#: can you instantiate objects via a Property setter? eg. private List<MyObject> myList; public List<MyObject> MyListProperty { get {return myList;} set {myList = value;} } THEN: MyListProperty = new List<MyObject>(); ...

Setting property values declaritively for nested properties in web user control

Using ASP.NET 2.0 Say I have a user control that has a property which contains other properties. Is there a way to set these in a declarative fashion? For example, setting the MapOptions.Zoom property: <goog:RegionPicker runat="server" id="RegionPicker1" MapOptions.Zoom="15" ></goog:RegionPicker> I know I can expose it as a normal ...

Objective C: @property(retain) doesn't call retain?

I was trying to track a strage memory allocation bug so I overrode the retain and release methods of my class. I noticed that when assigning an instance of this class to a property of another, the retain count of the object increased, but my redefined retain was never called. How can this be possible? Are (retain) properties retaining t...

SharePoint Managed Properties (Mappings) - Multiple Site Collections

Have mapped properties for custom fields used in multiple site collections. The property is also used to display additional information on the search results page if it contains information. The search results work fine as content from each site collection is returned, but the managed property only contains data for content found on on...

Why would Spring be trying to use the properties variable reference string instead of the value?

Here's the problem in a nutshell: <bean id="handlerFactory" class="com.westfieldgrp.audit.jdklogging.cpm.CPMHandlerFactory"> <property name="schemaName" value="${env.audit.databaseSchema}" /> <property name="bufferSize" value="${env.audit.bufferSize}" /> <property name="threaded" value="${env.audit.threadedAuditHandler}" />...

Is there any way to get the PropertyInfo from the getter of that property?

Is there any way I can get the PropertyInfo for a property from its getter? Like this: public object Foo { get { PropertyInfo propertyInfoForFoo = xxx; ... } } I want to avoid having to hard code the name of the property as a string, as that's tricky to maintain. I'm using .NET 2.0, so I'm hoping for a lin...

define get or set in c#

hi friends i have problem with using get or set in class in c# when i use get or set in gives error(invalid token { in class) pls, see below code,i have this problem in it static int abcd { get { return _abcd; } } thanx this is the complete code,i dont have this problem with any of your codes ...

Is a synthesized property already alloc/init -ed?

If I have a custom NSObject class called ProgramModel, does it get alloc/init -ed when I @property and @synthesize it from another class? For instance, in a ProgramController class like this // ProgramController.h #import "ProgramModel.h" @interface ProgramController : UIViewController { ProgramModel *programModel; } @property (nona...

Dependent fields when using object property initialisation in C#

I was quite suprised today to discover that I can't do the following. public class NumberyStuff { public List<int> Numbers { get; set; } public int Total { get; set; } } var numbers = new NumberyStuff { Numbers = new List<int>{ 1, 2, 3, 4, 5 }, Total = Numbers.Sum() // "Numbers does not exist in the current context"...

How can I store a reference to object property in another object?

This is a C# winforms app. Preface: I am creating a form that will allow users to import data from an existing MySql or SQL Server database into my SQL Server database. This allows users to quickly import IP addresses and other data without having to re-enter it via a control. Example: Simplified, I have two objects, FieldObject and ...

Set a variable in a different class

I am trying to create an application were 2 classes share a variable. Just to keep the code looking a little bit cleaner I created a 3rd class. This "third class" sole job is to house this variable. In class 3 I put a "get" and "set" method. SharedURL.H (Class 3) @interface SharedURL : NSObject { NSString *theURL; } -(NSString *)getT...

When will a property get call create a local copy of a reference type? How to avoid that?

In the class fooBase there is SomeProperty. In the class barBase, I have a field of type fooBase: public class fooBase { public object SomeProperty { get; set; } } public class barBase { protected fooBase _foo; } It's clear that from barBase I can change SomeProperty by _foo.SomeProperty = whatever;. Now in the derived clas...

Building JCoServer without Properties-File

Hello, I got another JCo-related question and hopefully finding help. With JCo you can easily build up a connection like it is explained in the example sheets which came with the JCo-library. Unfortunately, the only way building a connection is handled with a created property file. It wouldn´t be that bad, if there wasn´t any sensible d...

Is it possible to bind dynamic properties to WinForms control properties?

I'd like to bind dynamic properties to WinForms control properties. In the following example I bind the IsAlive property of a thread to the Enabled of a button. using System; using System.Windows.Forms; using System.Threading; namespace ThreadTest { public partial class Form1 : Form { Thread thread; public Form1() { ...

how to add properties to objects dynamically in c#

I want to add the properties to the class / object dynamically in c# in VS 3.5. how can i do this? ...