properties

GWT - Fail to Read properties

When I run in hosted mode, it able to get the result. But when I deploy it to tomcat then I cant get the result at all. Anyone can tell me what is the problem?? public class Customwidget implements EntryPoint { private static final SystemConfig constants = (SystemConfig)GWT.create(SystemConfig.class); public void onModuleLoad() {...

Testing properties with reflection using attributes

I'm trying to create a nUnit test to do the following: 1) Load the DLL to test. 2) Iterate among the various types. 3) Find the ones that have a certain custom attribute. 4) Instantiate these types and make sure that all their public properties aren't null. Here's what I wrote so far: Assembly assembly = Assembly.LoadFile("MyLib.dll...

Accessing members in your own class: use (auto)properties or not?

I've created this "question" as a community-wiki, because there is no right or wrong answer. I only would like to know how the community feels about this specific issue. When you have a class with instance variables, and you also created properties that are simply getters and setters for these instance variables, should you use the prop...

WPF TextBox Validating results ToolTip

Experimenting with WPF validating input, I tried to use ToolTip for displaying results of TextBox input validation, like this: <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].E...

Can I set a PHP class property from an existing variable?

I am trying to figure out how I want to handle settings in my PHP app. I have pretty much decide that I would like to use a Confg class file so it will be autoloaded and flexible in the future. Below is some stuff I was playing with. I know you cannot set a variable to popluate a Constant so I then try to use a public static propert...

iPhone SDK synthesizing BOOL Array

Hello, I get a compiler error when trying to synthesize a bool array like this: // .h #import <UIKit/UIKit.h> @interface SomeViewController : UIViewController { BOOL boolArray[100]; } @property (nonatomic) BOOL boolArray; @end //m #import "SomeViewController" @implementation SomeViewController @synthesize boolArray; @e...

Publishing a property in a Lazarus component raises an 'Access violation'

Hi all, in Lazarus on Linux, I registered a class as a component, so that I can drop it on a form. Works like a charm, except that the properties that I can publish are limited to simple types like strings and integers. Whenever I try to publish a property like a TStringList or a TImage, it raises an 'Access Violation' when I click on ...

Chaining properties in C# & unexpected results

I was just having a quick read through this article (specifically the bit about why he chose to use structs / fields instead of classes / properties) and saw this line: The result of a property is not a true l-value so we cannot do something like Vertex.Normal.dx = 0. The chaining of properties gives very unexpected results. What...

Objects becoming null when passed to a Property in C#

I have an abstract class Employee and 2 other classes that extend it (Developer and Manager). My problem is that when I whenever I create a Manager Employee man = new Manager(1234567, 30, "Bob", "Pie") and try to set it in the Manager field of a new Developer, Employee codemonkey = new Developer(1234568, 20, "Code", "Monkey", (Mana...

How to get properties file from WEB-INF folder in jsf?

I have some properties file in WEB-INF. And I want to load it as a bundle. Is there any way to do that? ...

Are .Net property setters ever called implicitly?

I'm on an ASP.Net 2.0 project, in C#. I have some data that gets stored in session state. For ease of use, it is wrapped in a property, like this: protected IList<Stuff> RelevantSessionData { get { return (IList<Stuff>) Session["relevant_key"]; } set { Session["relevant_key"] = value; } } Gettin...

C# protected property or field

Do you think it's better to always make protected class members an auto-implemented protected property to keep isolation or make it protected field is enough? protected bool test { get; set; } or protected bool test; ...

Why do I need a private field that is exposed via public property?

I'm comming from Java world mainly. So, C# properties do look nice. I know that with C# 3.0 or above I can use Automatic Properties. I like it even more :). My question is about a (maybe older) code where I can see this: private int age; public int Age { get { return age; } set { age = value; } } Why do I n...

Can I add custom properties to TortoiseSVN's list of properties in Add Properties dialog?

Our team is using some user-defined properties on our SVN repository. When I go to add a property to a file using TortoiseSVN, I right-click on the file and choose TortoiseSVN / Properties. I then click the New... button and get the Add Properties dialog. At the top of this dialog is a drop-down list of pre-defined properties labeled Pro...

When inside a class, is it better to call its private members or its public properties?

This is something that I've always wrestled with in my code. Suppose we have the following code: public class MyClass { private string _myVariable; public string MyVariable { get { return _myVariable; } set { _myVariable = value; } } public void MyMethod() { string usingPrivateMember = _myVariab...

Why can TextBlock show a code-behind property value but border/padding is not able to use it?

In the following Silverlight application why does the property OuterPadding not change the padding in the outer border, although the TextBlock correctly displays the value of OuterPadding? If I change the Border padding to a simple integer it the padding works fine, but not when it is defined by the property in code behind. This same c...

Loading Liferay Properties from Spring IoC container (to get jdbc connection parameters)

I'm developing some portlets for Liferay Portal 5.2.3 with bundled tomcat 6.0.18 using Spring IoC container. I need to map the User_ table used in Liferay database to an entity with Hibernate, so I need to use two different dataSources to separate the liferay db from the db used by portlets. My jdbc.properties has to hold all connecti...

IIS Application Pool: change settings programmatic

How can I change IIS application pool seetings / properties programmatic (C#) ? For example, how can I change the setting "Enable 32-Bit Applications" ? Are there property references for IIS 6 and IIS 7 on MSDN or Technet ? Thanks in advance for your help ! ...

where to place properties files in a jsp servlet web application

In my web application I have to send email to set of predefined users like [email protected], so I wish to add that to a .properties file and access it when required. Is this a correct procedure, if so then where should I place this file, I am using Netbeans IDE which is having two separate folders for source and JSP files, advice solicite...

visual c++ inner class as a property, possible ?

Hello, As a C++ programmer I've recently started to work with visual c++. I've get stuck with the properties. The idea is to create an inner class that would have 2 methods plus property like get/set functions. Does it even possible in visual C++ (i guess yes). The usage would be like this: Foo ^ foo = gcnew Foo(); int a; foo->Metho...