properties

Do adding properties to an interface prevent creating private/protected "set" in derived types?

Edit: It turns out I missed something obvious, but I'm going to leave the question open in case someone else makes the same obvious mistake. Thanks to those who pointed it out See bottom for explanation. Is it possible to have a non-public set on a property that is overriding an interface property? Perhaps I'm having a stupid moment, b...

Cocoa Objective-c Property C structure assign fails

Hi All, I want to change the variable value which is a member of a structure of another class. But the value is not getting changed. Here is the code. //Structure.. typedef struct { int a; double b; } SomeType; //Class which has the structure as member.. @interface Test2 : NSObject { // Define some class which uses Some...

Use properties or methods to expose business rules in C#?

I'm writing a class to encapsulate some business rules, each of which is represented by a boolean value. The class will be used in processing an InfoPath form, so the rules get the current program state by looking up values in a global XML data structure using XPath operations. What's the best (most idiomatic) way to expose these rules t...

How can a property resolve its own name and type with reflection?

Is there a way for a property to access its own name and type at runtime using reflection? I want to access this info without hard coding the name or index of the property in the class. Simple Example Code: Private ReadOnly Property MyProperyName() As String Get Console.WriteLine((Get Current Property Info).Type.ToString) ...

Where should the line between property and method be?

Possible Duplicate: Properties vs Methods For many situations it is obvious whether something should be a property or a method however there are items that might be considered ambiguous. Obvious Properties: "name" "length" Obvious Methods: "SendMessage" "Print" Ambiguous: "Valid" / "IsValid" / "Validate" "InBounds...

Implementing a Property Inspector/Editor in WPF

So far my plan is to have an event "Item selected" which the property inspector listens to. The actual property inspector is just a ContentControl. When the object is selected the content property is set and the appropriate DataTemplate for editing the object is loaded. In general I am trying to do this "MVVM" style. I guess you could u...

Documentation for ArcObjects' Java system properties

I'm currently debugging a Java application which uses the ESRI ArcObjects library. As the ArcObjects themselves are COM-classes and interfaces an integrated COM-bridge is used, which seems to be a stripped-down version of JIntegra. It occurred to me, that the initialization of the ArcObjects library creates some system properties but I ...

Using .NET XmlSerializer with get properties and setter functions

I'm trying to use XmlSerializer from C# to save out a class that has some values that are read by properties (the code being just a simple retrieval of field value) but set by setter functions (since there is a delegate called if the value changes). What I'm currently doing is this sort of thing. The intended use is to use the InT prop...

Load CoreData objects' string property into UIPickerView

Hello Currently I have an entity named "Events" in a CoreData app. "Events" has one string property named "eventName". In the -(void)viewDidLoad I am trying to Fetch all the "Events" objects and load their "eventName" by alphabetical order into a UIPickerView. The ultimate end goal is through the use of a textField, buttons and the p...

Grails domain class properties from properties file

In my grails application I want to read some values from properties file and set it to Grails Domain class static property at startup. Example Class A{ static myValues="1,2"; } class B{ static myValues="2,3"; } In the above example I have directly given the inputs..Instead of that I want to read it from one config.propert...

Use of properties vs backing-field inside owner class

I love auto-implemented properties in C# but lately there's been this elephant standing in my cubicle and I don't know what to do with him. If I use auto-implemented properties (hereafter "aip") then I no longer have a private backing field to use internally. This is fine because the aip has no side-effects. But what if later on I need ...

Change update value of property (LINQTOSQL)

Hi... I've got an entity object - Customer, with a property called VATRate. This VATRate is in the form of a decimal (0.25). I wanted to be able to enter a percentage value, and save it in the correct decimal value in the database, so I made this custom property: partial class Customer{ public decimal VatPercent { get{ .....

Need help understanding the affect of two java gui-related system properties

Hello, I had a problem envolving a mixing of lightweight and heavyweight components in java. http://stackoverflow.com/questions/2463108/weird-swing-heavyweight-lightweight-mixing-problem/2468519#2468519 A solution that was suggested to me (outside stackoverflow) was to set the system properties sun.awt.noerasebackground and sun.java2d...

read property file from a dependent project with maven

Hi, I have an issue when reading properties from a dependent project. I have a core project, and my application has a dependency on it. under classpath of core, it has file core.properties. and my application need to read this property file, but it couldn't. It requires the core.properties in my classpath of my application, instead ...

MS Access 2003 - text box calculation on a form

Lets say I have two text boxes on a form. the first returns a count value from a SQL statement, or a domain aggregate expression, etc. the second does the same with additional parameters. Now i want to have another text box (#3) that divides one by the other for a very simple percentage. like this for a controlsource: =[textbox2]/[text...

Objective-C Objects Having Each Other as Properties

Let's say we have two objects. Furthermore, let's assume that they really have no reason to exist without each other. So we aren't too worried about re-usability. Is there anything wrong with them "knowing about" each other? Meaning, can each one have the other as a property? Is it OK to do something like this in a mythical third c...

CodeDOM: Adding DebuggerStepThroughAttribute to property

I know how to add a DebuggerStepThroughAttribute to a method or a constructor, usually you add it to the CustomAttributes collection of a code member. But I don't see a way to do this for the setter and getter of a C# property, because neither of them provides this collection where you add the attributes. Does anyone have a clue? ...

How to make svn:executable to also set the executable flag for the group?

SVN uses the svn:executable property to set the executable flag upon checkout or update. This just happens for the user permissions. How can I get SVN to also set the executable flag for the group? ...

What's the best way to release objective-c properties?

I'm new to memory-management, and am reading different things about how to best release properties. If I have: in .h: @property(retain) NSString *myStr; and in .m: @synthesize myStr = _iVarStr; Should my dealloc have: [_iVarStr release]; or self.myStr = nil; or something else? Thanks! ...

Is read-only auto-implemented property possible?

Hello. I found a topic on MSDN that talks that yes, this is possible. I did a test that seems to break this statement: using System; namespace Test { class Program { static void Main(string[] args) { Foo f = new Foo("1"); Console.WriteLine(f.Bar); // prints 1 f.Test("2"); ...