property

Accessing a property inside a property

I curently have a set up like below public class ProptsClass { public class ClassA { public list<ClassB> pcb { get; set; } } public class ClassB { public list<ClassC> pcc { get; set; } } public class ClassC { public string _someproperty { get; set; } } } what I want to d...

PHP make class propery inheritable

Hi, i have 2 classes A and B that extends A. A has a public property and i want that on the instances of B that property can't be accessible. I try to explain better: class A { public $prop; } class B extends A { ... } $instance=new B; $instance->prop; //This must throw an error like "Undefined property prop" I tried with the ...

Fileset/patternset's refid attribute isn't expanded. How would you write a target that operates on an arbitrary set of files?

I have a set of targets that each do essentially the same thing except each contains a specific patternset on which to perform its tasks. I want to collapse these targets into a single "reusable" target that instead takes a set of files "as a parameter". For example, this <target name="echo1"> <foreach item="File" property="fn"> ...

C# return non-modifiable list

I have a class which contains a List<Item> I have a getter on the class that returns this. Is there some thing I can do to ensure the user who calls cannot modify the returned List? (Since it's a reference type - I believe changes to the returned reference would affect the list stored in the source object) ...

Should I use @property (retain) for a @dynamic property setter that is retaining?

I have the following code for a property whose getter/setter I write manually using the @dynamic keyword: @property (nonatomic, retain) NSObject* obj; @dynamic obj; -(NSObject*) obj { return obj; } -(void) setObj:(NSObject*)newObj { [obj release]; obj = [newObj retain]; } My question is, if I remove the retain from the @p...

Function to create a tree of properties?

I am trying to create a List of properties for objects. I can create a list for basic objects just fine, but if I have a situation where type object A contains a property of type object B which contains a property of type object A.... well.. then I get infinite recursion. What I've done is added a static property to all of my objects ca...

VB.net Invoke a property change in a control

Lots of examples of how to invoke methods, but how does one change a simple property? For demonstration-sake, here's a very simple set of code that should help. Let's say I need to set the visible property from a child form, and thus, it needs to be invoked: Friend Sub activateItem(ByVal myItem As PictureBox) If myItem.InvokeRequ...

PHP Indirect modification of overloaded property

Hi, i have this simple class: class A { var $children=array(); function &__get($name) { if($name==="firstChild") { if(count($this->children)) $ret=&$this->children[0]; else $ret=null; } return $ret; } } By accessing the "firstChild" property it should return its ...

cannot read a readonly property, compiler complains.

Hi, I'm new to Objective C, but have extensive C++ experience. I have a member variable called bOn, which I have declared as a readonly property. I then synthesize it. However, the compiler won't let me read it, saying "Instance Variable 'bOn' is declared protected". I would understand this error if I had not synthesized. Here are my...

how to add dynamic property for python object

site=object() for k,v in dict.iteritems(): setattr(site,k,v) print site.a#it won't works i use this code but it didn't work,any one could help?thanks ...

UISwitch and UIButton in UITableViewCell, how to ident them

Hi, I've got a little problem in my UITableViewCell. Each Custom Cell have an UISwitch and an UIButton. And when the user change the value of the UISwitch i would like to set the button.hidden property to YES. I can find which UISwitch was clicked with this method: - (IBAction)closeHour:(id)sender { UISwitch *senderSwitch = (UISwitc...

How to programmingly set the loading path of dynamic libraries in java?

System.setProperty("java.library.path", "pathToLibs"); doesnt work because it seems either "java.library.path" is read only or JVM just ignores the property. I know it can be done by setting PATH(in windows), LD_LIBRARY_PATH(in POSIX) or just use the command java -Djava.library.path=your_path. But is there a programming way of doing...

How can I set the value of this cookie property from code behind?

I would like to do this: Dim str As String = class.isGuest("yes") but it won't work. Public Property IsGuest(ByVal guestStatus As String) As String Get Dim guestCookie As New HttpCookie("g") For Each key As String In Context.Response.Cookies.Keys If key = MYACCOUNT_SESSION_COOKIE_NAME Then ...

Does @property (readonly, retain) have a meaning ?

XCode accepts it. But will retain be applied when I internally set the property (no setter outside since readonly but when I initialize the value in a class method) ? Regards, Apple92 ...

dictionaryWithContentsOfFile returning nil from my property list file

Hi there, I'm learning how to use plist files for storing data in my iPhone app. I've been reading a bunch of the questions about plist and dictionaryWithContentsOfFile on this site, but can't see what I'm doing wrong. The following line returns nil ("The dictionary is null" to the console). NSLog(@"The dictionary is %@",[NSDictionar...

how to set time property in ant

I want to have a property with the current time in a specific format: yyyyMMddhhmm . how can I do that in java ant build.xml? ...

Get specific property of object using java Reflection

I have class User which have different objects like country,address,car and many others. All embedded objects have userid property which is long. I have User object, i want to set userid property of all embedded objects to specific value or null using java reflection. Otherwise i have to write methods for each different object. ...

TableNewRow-Event of a DataTable in VB.net

I have a DataTable-Property: Public Property Files() As DataTable Implements Presenter.ISearchSetup.Files Get Return _files End Get Set(ByVal value As DataTable) _files = value RaiseEvent OnPropertyChanged() End Set End Property Private WithEvents _files As DataTable Now I add a row with: Dim r...

how to implement a read only property

hello, i am pretty sure this has been asked. although i have not found a discussion about this on stackoverflow. please redirect me if there is a duplicate to this one. i need to implement a read only property on my type. moreover the value of this property is going to be set in the constructor and it is not going to be changed (i am w...

How is retain setter implemented with @synthesize?

I have the following in the header: @property (nonatomic, retain) UIView *overlay; And in the implementation: @synthesize overlay; Then: UIView *tempOverlay = [[UIView alloc] initWithFrame:CGRectMake(160.0f, 70.0f, 150.0f, 310.0f)]; self.overlay = tempOverlay; [tempOverlay release]; Isn't the tempOverlay variable above unnecessa...