properties

How to do Selection Alignment using the RichTextBox in Silverlight 4?

I cannot seem to figure out how to do a Selection Alignment in the new RichTextBox, I have an idea that I need to convert the selection into the Paragraph type which supports alignment, but cannot seem to figure this out. None of the Silverlight examples have this, but I'm sure it is possible. I have this code, that does not work - as I ...

Using the value from the private variable or from the actual property in class functions?

When referencing class properties from a function within the class do you use the value from the actual property or the private variable value? Which way is best? Why? public class private m_Foo as double public property Foo() as double get return m_Foo end get set(byval value as double) m_Foo = value ...

null comparison, prefix increment, properties, Length properties of struct in C#

Hi everyone, I have some questions in C# what are the differences between null comparisons null == value and value == null (value is a variable of any kind: int, string, float,...) I heard that using prefix increment ++i instead of i++ in some case will enhance the program performance. Why is it so? I have a snippet code as follow: ...

iPhone UIButton buttonType always evaluates to 0?

Whenever I execute the code below I always get button type = 0 no matter what I specify for buttonWithType. Does anyone know an explanation for this behavior? I'm trying to distinguish button based on their type obviously without success since the buttonType property appears to be broken (or useless). As always thanks very much for an...

Code infrastructure for accessing different properties of multiple elements (vector graphics editor)

Hi everybody, I am currently working on a small vector graphics editor (sort of) and facing a code design question, wondering how it would be solved in an elegant and straightforward manner. If anyone has a good idea how to solve this, or knows a good link or a piece of open source code dealing with a similar setup, I would be really ...

Lvalue required as left operand of assignment

Hello I get the "Lvalue required as left operand of assignment" error in xcode. Why? Here is my code (window1/2 are UIViewController) : - (void)loadView { UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,460)]; UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0,0,640,460)]; s...

Returning a value type from a property

Hey, I'm getting confused with what happens on the stack and heap in respect to value type properties in classes. My understanding so far: When you create a class with a structure (value type) like this: class Foo { private Bar _BarStruct; public Bar BarStruct { get {return _BarStruct; } set {_BarStruct = value; } } ...

How to merge two java.util.Properties objects?

I'm trying to have a default java.util.Properties object in my class, with the default properties it accepts, and let the developer override some of them by specifying another java.util.Properties object, but I couldn't find a nice way for doing that. The intended usage is the following: Properties defaultProperties = new Properties();...

Property Scope (Iphone)

Hello All. I am having trouble accessing a declared property and I think I am missing something fundamental about the nature of properties and perhaps view controllers. Here's what I'm doing so far: declaring a property "myPhone" in a root view controller called RootViewController. grabbing a phone number from a modally presented peo...

Apply dynamic properties to a bean at runtime

Assume I have a bean DialogBox, with properties for height and width: public class DialogBox { int x; int y; ... } In my applicationContext.xml I would define properties as reasonable defaults: <bean id="dialogbox" class="DialogBox"> <property name="x" value="100"/> <property name="y" value="100"/> </bean> We have multiple c...

Load properties file in a java servlet deployed in JBoss as a war

I have a servlet deployed as a war in JBoss 4.0.2. I have a properties file for the deployed application. Where should I put this file? Under the conf directory in the jboss server\default\conf folder? How do I load that properties file in a portable manner? ...

iphone @property

What is the difference between these two? @property (nonatomic, retain) @property (nonatomic, copy) What is the other type like this? ...

How to get public properties of a class?

I can't use simply get_class_vars() because I need it to work with PHP version earlier than 5.0.3 (see http://pl.php.net/get_class_vars Changelog) Alternatively: How can I check if property is public? ...

How to name a property when the preferred name is also the name of the type

Possible Duplicate: Giving a property the same name as its class In working on a solution where I was struggling to "add" properties to a sealed class, someone pointed out that my naming of a property with the same name as a type was asking for trouble. Here's a snippet of my code: class BackupFileInfo : IEquatable<BackupFileI...

Java OutputStream equivalent to getClass().getClassLoader().getResourceAsStream()

I am attempting to Store() the change made to my application's Properties. The .Properties file is located in 'resources' package, which is different from the package that contains my UI and model. I opened the package using: this.getClass().getClassLoader().getResourceAsStream("resources/settings.properties") Is there a functional e...

C#, NUnit: Clear way of testing that ArgumentException has correct ParamName

To test that something throws for example an ArgumentException I can do this: Assert.Throws<ArgumentException>(() => dog.BarkAt(deafDog)); How can I check that the ParamName is correct in a clear way? And bonus question: Or would you perhaps perhaps recommend not testing this at all? ...

Is a new object that's created in a static property getter only created once?

I'm creating a static helper class for web services I'm writing. I'm tapping into the API of Telligent and therefore creating these Telligent "service" objects that allow me to do things with the platform. For example, I'm creating a MembershipSerice object in my helper class so I can do membership stuff with the same object. In my helpe...

If I set a system property with -D can I access it from my code?

I'd like to be able to set a property on the JVM using the -D switch. If I do that, can I access it from my code? If yes, how? ...

How can I make a property "Write Once Read Many" in VB.NET?

What is the best way to make a class property "Write Once, Read Many" such that you can only set the property once? I know that I could pass all the properties in the constructor and make them ReadOnly, but in cases with a lot of properties I don't want a constructor that has 20+ arguments. Also, I realize I can "roll my own" setters, ...

Sharepoint Webpart Properties / Rich text box ?

Is it possible to make a String in a web part properties editable with a rich text box (to be able to use the Bold, etc.) ? UPDATE / SOLUTION The 1st class is the "Custom property" that should appear in the toolbar using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft...