properties

Limit Values for Properties in .NET

I know this may be a noob question, but it's bugging the heck out of me. Let's say I have a user control that I reference in my .aspx page: <uc:somecontrol runat="server" id="uc1" property1="red" /> how do I make it so when in VS05 the intellisense will show options like "red", "green", "blue" for property1? Similar to how when you w...

How can I serialise a javabean to be loaded by Spring's DataBinder?

I need to serialise a javabean (with arbitrary nested beans) to plain text, and then later restore as an Object graph. For the purposes of this question I am not interested in XML, JSON, etc. but rather name/value pairs. The Spring DataBinder is great for turning a list of name/value pairs into a real Object. For example we can supply:...

Is there a Delphi library which reads and writes .properties files?

I thought about creating my own, but there are many details to consider to make it 100% compatible with Java .properties files, so I'm asking first. ...

What to do when property name matches class name

In our C# code, we have a class called Project. Our base BusinessObject class (that all business objects inherit from) defines a property: public Project Project { get; set; } This is normally not a problem as long as we stay within the C# codebase. However, these business object classes are exposed in web services over the wire. Some...

C# property and ref parameter, why no sugar?

I just ran across this error message while working in C# A property or indexer may not be passed as an out or ref parameter I known what caused this and did the quick solution of creating a local variable of the correct type, calling the function with it as the out/ref parameter and then assigning it back to the property: RefFn(re...

How to loop through all the properties of a class?

I have a class. Public Class Foo Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Private _Age As String Public Property Age() As String Get Retur...

How to filter or find properties based on attributes

I have a class as follows Public Class Foo Private _Name As String <ShowInDisplay()> _ Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Private _Age As String Public Property Age() As St...

How do I update all svn:externals references after a server migration?

I migrated an SVN server today and ran into an issue. I have a repo that has an svn:externals property on a trunk subfolder. This folder has been branched a bunch of times and now this svn:externals reference needs updated on every single branch to refer to the new server. Is there an easy way to update all of these properties? I'm not...

How to collect spring properties from multiple files for use on a single bean

I haven't gotten my head wrapped around Spring yet, so correct me if this question doesn't make sense... I have a PropertyPlaceholderConfigurer <bean id="rdbmPropertiesPlacholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="false"> <property name="location" value="classpath:/properties/...

How can I do a conditional checkout using properties in svn?

Is there a possibility to checkout from a repo based on the properties of a svn-versioned file? That would be a special kind of sparse checkout. For example to checkout only files with "svn:corelib" == "yes". Or is the only chance just to checkout the whole repo and to delete the unwanted files later? For example with a script that pull...

Adding properties to T4 template - picking server, database, table

Folks, I'd like to create some T4 templates for generating class files (about 7 per table) from a database to support our in-house ORM (don't ask - long story and historical reasons.....) What I'd really love to do is have a property on my main TT template to visually pick server, database and table for which to create the files (somet...

Why doesn't the MaxLength property on a RichTextBox work in WPF?

I am trying to set the MaxLength property on a RichTextBox but it does not seem to work. Any ideas what might be happening? ...

Where did C#'s attributes come from?

I find C#'s Attributes, Python's Properties too a really nice idea, and I guess their direct ancestor might have come from Java's Annotations, but I'm curious as to where this concept originally came from, anyone has any clues? ...

Is it possible to add an accessor to a property in .NET by overriding it?

Is it possible to do something like this? class A { public virtual string prop { get { return "A"; } } } class B: A { private string X; public override string prop { get { return X; } set { X = value; } ...

polymorphic properties design pattern

I have this big polymorphic object hierarchy, and I want to expose these objects to another language using primitive types. I'm thinking my base object will have a dictionary of properties (C++), and each sublcass down the hierarchy will add properties or modify properties, and then when i forward to the other language, i don't need any...

Is it possible to observe a readonly property of an object in Cocoa Touch?

I've attempted to observe the (readonly) visibileViewController property of a UINavigationController with no success. I was able to successfully observe a readwrite property I defined myself for testing purposes on another class. Is it possible to observer readonly attributes? ...

Checking for null before ToString()

Here's the scenario... if (entry.Properties["something"].Value != null) attribs.something = entry.Properties["something"].Value.ToString(); While effective and working correctly, this looks ugly to me. If I don't check for a null before performing the ToString() then it throws an exception if the property was null. Is there a be...

What's the point of using constants for property keys?

Lately, I've come across a lot of Java code that relies on "properties files" for configuration. But instead of plain old string literals, the code uses constants (static final Strings) to retrieve the property values . I find this extra level of indirection annoying because I need to perform TWO lookups in EITHER direction. If I star...

Merge properties into a ResourceBundle from System.getProperties()

Hello honorable forum, I'm building a ResourceBundle from a file, this bundle holds < String, String> values. InputStream in = getClass().getResourceAsStream("SQL.properties"); properties = new PropertyResourceBundle(in); in.close(); I would like to add/replace on this bundle some properties that I'm passing from the command line usi...

Overriding ReadOnly Property in a subclass to make it Read/Write (VB.NET)

In C# I can have a base class with a property containing just a getter. Subclasses can then override the property and give it both a getter and a setter. This doesn't seem possible in VB.NET with properties since the property statement itself must describe whether it is ReadOnly or not. In my example below, it doesn't let me make the ...