properties

What is the Objective-C equivalent of a public get/protected set property in C#

Is there any way to create a property like this C# property in Objective-C? public int prop { get; protected set;} Essentially, I want to make it possible to get the value from outside the class, but to only be able to set the value from within the class. ...

c# hide from dervied classes some properties of base class

I want to know if its possible to hide a base class property from a derived class: Example: class BaseDocument { public string DocPath{get; set;} public string DocContent{get; set;} } class DerviedDocument: BaseDocument { //this class should not get the DocContent property public Test(...

Delphi 2009 - Set default property values in custom delphi components

This should be very simple but I can't find the exact answer I want. I have a custom delphi control based on TSpeedButton. I want the Caption Property of the SpeedButton to always be 'Comments' but I don't want to set it at run-time I want to set it in the component itself so that when I place it on my form it's already populated with th...

C++ game and decorator pattern

I'm porting a 2D platformer and I need a good way of getting some extensibility out of my level tiles. I'm not sure if Decorator is correct here, but nothing else comes to mind. Maybe I need something unique. Anyway, say I have a basic Tile that has things like it's image, and whether the player can pass through it (background or foregr...

Using System Properties in Java

Hi, I have a question on using System Properties in Java. Some classes like Authenticator require that we set the system properties regarding Proxy settings and than verify whether the Proxy was valid or not. My question is should I remove the Set Properties after I am done using it ? There are other parts of programs that might be us...

Properties File listener in Java?

I have properties file. I want to use listeners. if some Values change in this file then i want to update my integers. So, Which classes or implements do i need to use? ...

How can I tell if something is a property or a method?

I am new to programming. Using C# & ASP.Net, how would I differentiate between a property & a method? How can I tell if something is a property or a method? ...

Creating read-only properties in Actionscript 3

Many library classes in AS3 have "read only" properties. Is it possible to create such properties in custom as3 classes? In other words, I want to create a property with a public read but a private set without having to create a complex getter/setter system for every property I want to expose. ...

How to display the properties of the current selected component in a JPanel using the Netbeans Platform API

I am currently building a small visual designer using the Netbeans Platform. All my components that can be placed on the JPanel show correctly in the Palette Window. What I am struggling to do at the moment, is to let the property window show the properties of the component that was either just dragged and dropped or showing the current...

java.util.Properties and Cp1250

Can I use java.util.Properties with encoding different then default? ...

Managing the localization of Java properties files

I have a Web application written in Java that is targeting several countries, all of which speak different languages (and more often than not, several languages -- that's Europe for you). We have a bunch of .properties files that hold the localized strings, and our current procedure is to e-mail the language-specific files to our partne...

Java properties - .properties files vs xml?

I'm a newbie when it comes to properties, and I read that XML is the preferred way to store these. I noticed however, that writing a regular .properties file in the style of foo=bar fu=baz also works. This would mean a lot less typing (and maybe easier to read and more efficient as well). So what are the benefits of using an XML file?...

Parse Map from properties files

This is a follow-up to my previous question (found here). My properties files so far consists of simple key-value pairs, like ints and Strings. I would now like to use it to place some more advanced structures in it, more specifically I need a Map<A, Integer> where A is a class i have defined, for example like so: foo=bar,5;baz,10 Is ...

Configure Tomcat to use properties file to load DB connection information

What are the accepted practices for creating a Tomcat deployment that reads configuration parameters from a properties file? It would be nice to be able to deliver a WAR file and specify that the client need only create or edit a properties file in a specific directory. Is this a somewhat regular way of doing things? Is there a better ...

Should properties do nontrivial initialization?

I have an object that is basically a Python implementation of an Oracle sequence. For a variety of reasons, we have to get the nextval of an Oracle sequence, count up manually when determining primary keys, then update the sequence once the records have been inserted. So here's the steps my object does: Construct an object, with a ke...

How do you handle memory management of outlets in the iPhone SDK

Since KVC is used to set outlets on the iPhone, there are 2 methods (that I know of) to make sure you've properly handled memory management. Specifically, I am referring to this article written by Aaron Hillegass. My question is which method do you use and what is your reasoning? Release all your outlets in dealloc and viewDidUnload ...

When reflecting: Should set property or directly set value? (Objective-C)

I'm writing an xml serialization class for objective-c. The point is to give the class a class type and an xml file. It should return an instance with data. I've got it working, and it does quite a bit - handles primitives (+nsstring), user defined classes and nsarrays. Doesn't handle pointers or C-arrays. Obviously this relies heavily ...

C++: Convert Macro based Property System to use templates

I've already implemented, using macros, a C++ property system that satisfied the following requirements: Property can be referenced using a integeral key Property can be accessed via a generic Set/Get Properties (and property keys) must be inheritable Properties can be registered with getters/setters and is implemented as follows E...

How can I track custom Windows Workflow Foundation activity properties?

I want to track my custom activities' property values in my own tracking service, .i.e. I don't need it in the built in SQL tracking service. I have been successful in reproducing the SQL tracking service in that I can see the worklfow and activity states etc. but I want to see property values also. We are writing many workflows for a d...

C# Equivilent for C++ Macros and using Auto<> Properties

I have some auto-instantiation code which I would like to apply to about 15 properties in a fairly big class. The code is similar to the following but the type is different for each instance: protected ComplexType _propertyName; public ComplexType PropertyName { get { if (_propertyName == null) _propertyName ...