properties

Is there a metadata exclusion filter for the SVN DIFF command?

I use SVN as source control system and I wonder how to compare directories while ignoring any metadata differences. Is there a way to tell svn diff to compare only the actual content and ignore any metadata? I mean metadata like SVN properties, etc, that don't affect the file content. Assume file X has an additional property in branch ...

Differences between Private Fields and Private Properties

Hi, What is the difference between using Private Properties instead of Private Fields private String MyValue { get; set; } // instead of private String _myValue; public void DoSomething() { MyValue = "Test"; // Instead of _myValue = "Test"; } Is there any performance issue ? or just a naming convention ? ...

How to access properties of a usercontrol in C#

Hi, I've made a C# usercontrol with one textbox and one richtextbox. How can I access the properties of the richtextbox from outside the usercontrol. For example.. if i put it in a form, how can i use the Text propertie of the richtextbox??? thanks ...

C# Multiple Indexers

Is it possible to have something like the following: class C { public Foo Foos[int i] { ... } public Bar Bars[int i] { ... } } If not, then are what are some of the ways I can achieve this? I know I could make functions called getFoo(int i) and getBar(int i) but I was hoping to do this with pro...

Looking for a nice add on to VS 2008

Hello all, I am looking for a nice add on to VS 2008 that will let me select all of my private fields and automatically turn them into public properties. Does a tool like this exist? Thanks ...

JavaBeans alternatives?

I hate the JavaBeans pattern with a passion that burns like the fire of a thousand suns. Why? Verbose. It's 2009. I shouldn't have to write 7 LOC for a property. If they have event listeners then hold on to your hat. No type-safe references. There is no type-safe way to reference a property. The whole point of Java is that it is type s...

Reasons for using Ant Properties files over "Properties Tasks"

I'm currently working with some developers who like to set up Ant tasks that define environment specific variables rather than using properties files. It seems they prefer to do this because it's easier to type: ant <environment task> dist Than it is to type: ant -propertyfile <environment property file> dist So for example: <pro...

Custom nested properties/methods in asp.net

I'm looking for a way to write a custom .net class that would allow for nested methods. For example... say I have a class X with a function Y that returns a list. Then I have another function that returns a sorted list... I would like to be able to do something like x.y().z() where z would accept the output of y() as its input. Basic...

How Serialization Works in .Net

I have a feeling this is a repost but I can't seem to find any good information about it. I was just wondering how serialization actually works (well actually deserialization). What I'm wondering is if say I have a property that is not actually backed by a private field; i.e.: public string SomeProp { get { return GetValue("Som...

Create an array of integers property in Objective C

I'm having troubles creating a property of an array of integers in Objective C. I'm not sure whether this is even possible to do in Obj-C so I'm hoping someone can help me in finding out either how to do it correctly or provide an alternative solution. myclass.h @interface myClass : NSObject { @private int doubleDigits[10]; } @proper...

Is there a PropertyPlaceholderConfigurer-like class for use with Spring that accepts XML?

Spring has a very handy convenience class called PropertyPlaceholderConfigurer, which takes a standard .properties file and injects values from it into your bean.xml config. Does anyone know of a class which does exactly the same thing, and integrates with Spring in the same way, but accepts XML files for the config. Specifically, I'm t...

What is the name of term meaning next approach: A a = new A { Prop1 = a, Prop2 = b };

Hi! Could you please tip how to properly name object construction approach where public proprieties values are being set on object creation? For example, SqlCommand command = new SqlCommand { Connection = connection, CommandType = CommandType.Text }; ...

Best Practice for Using Java System Properties

Our code uses a lot of system properties eg, 'java.io.tmpdir', 'user.home', 'user.name' etc. We do not have any constants defined for these anywhere (and neither does java I think) or any other clever thing for dealing with them so they are in plain text littered throughout the code. String tempFolderPath = System.getProperty("java.io.t...

Java web application properties

Does Java and/or Spring have the concept of properties? I have bunch of domain models, each of which has several properties. Example: public class Person { private String name; private Date dateOfBirth; private float height; private float weight; // getters and setters not shown } When displaying a person, the prop...

Why is considered best practice to have no complex logic in class properties??

What are the cons of some code like this: public class Class1 { public object Property1 { set { // Check some invariant , and null // throw exceptions if not satisfied // do some more complex logic //return value } } } ...

What is the type of the 'value' reserved word in C# properties

I am wondering what type the 'value' keyword in a property takes. so: public class Test { string _numberAsString; int _number = -1; public Test() {} public string NumberAsString { get { return _numberAsString; } set { _numberAsString= value; } } public int Number { get { return...

Logic in get part of property. Good practice?

When databinding my xaml to some data I often use the "get" part of a property to do some logic. Like giving to sum of totals of a list or a check if something is positive. For example: public List<SomeClass> ListOfSomeClass{get;set;} public double SumOfSomeClass { get { return ListOfSomeClass.Sum(s => s.Totals); } } public...

Comparing object properties in c#

This is what I've come up with as a method on a class inherited by many of my other classes. The idea is that it allows the simple comparison between properties of Objects of the same Type. Now, this does work - but in the interest of improving the quality of my code I thought I'd throw it out for scrutiny. How can it be better/more eff...

Absence of property syntax in Java

C# has syntax for declaring and using properties. For example, one can declare a simple property, like this: public int Size { get; set; } One can also put a bit of logic into the property, like this: public string SizeHex { get { return String.Format("{0:X}", Size); } set { Size = int.Parse(value,...

Setting property's property directly in C#

Lets consider that I have a public property called AvatarSize like the following, public class Foo { ... public Size AvatarSize { get { return myAvatarSize; } set { myAvatarSize = value; } } ... } Now if a target class wants to set this property, then they need to do it the following way, myFoo.AvatarSize = new Si...