property

Property file in java

Hi, I want read property file in my java class. for this i have written: try { Properties property = new Properties(); property .load(new FileInputStream("abc.properties")); String string = property.getProperty("userName"); } catch (Exception e) { e.printStackTrace(); } ...

C# accessing value-type properties like variables

hey there! I'd like to know whether the following is possible with C# properties. I have a class "Transform" that holds a 4x4 matrix in a private member field. Now I want to create a property like this: Matrix m; public Vector3 Position { get { return new Vector3(m[12], m[13], m[14]); } set { m[12] = value....

How to set a property of a property in NHibernate

How can I have the property of a property set using NHibernate? Here is an example (just an example!) public class Person { private FullName _subClassProperty = new FullName(); public FullName Name { get { return _subClassProperty; } set { return _subClassProperty; } } } public class FullName { public virt...

Value is a variable but used as a method

Hi, The error here is "Range is a variable but used as a method" I added " Microsoft.Office.Interop.Excel" and using it currently as Microsoft.Office.Interop.Excel.Workbook SelWorkBook = excelappln1.Workbooks.Open(curfile, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, false, fal...

How to set order for dependency properties Callback change methods?

Hi! I have many dependency properties in my WPF usercontrol and many of them are set directly in XAML. Among these are ItemsSource and Value (my custom properties). The problem is that initial Value selects a concrete item in ItemSource. But to achieve this, ItemsSource must be set first. While debugging I realized that ValueChangeCallb...

C# Indexer Property Question

I have a class like this: public class SomeClass { private const string sessionKey = "__Privileges"; public Dictionary<int, Privilege> Privileges { get { if (Session[sessionKey] == null) { Session[sessionKey] = new Dictionary<int, Privilege>(); } ...

Objective-C Properties in iPhone Development

Hi, Whats the difference between a property and an instance variable in Objective-C. I need to understand this in OOP terms. Is a property declaration just a convenience wrapper (with @synthesize in the implementation) for accessing instance variables? thanks, codecowboy. ...

Set Only On Deserialization

Problem: I have a class, say Foo, that implements an Id property. Foo must be serializable. Foo.Id should be initialized to a new GUID on initialization of Foo. Foo.Id should not be changable once it has been set. Deserialization will attempt to set the Foo.Id, so it must be made Public. Private _Id As String=system.Guid.NewGuid....

How is a struct defined as a property?

The title may be incorrect, if so please change. I'm not sure how to ask my question so just look at the code as it should be obvious. Using the commented code will work but I want to know why the actual code does not work. I'm sure it's wrong but how can it be fixed? Or is this not how its done? using System; namespace SomethingAwful...

Assigning list of values to user control property

Hi, I have a button user control, on which I've created a property, UserRights, which I use to define the rights a user must have before the button is enabled. These rights are defined as public constants in a class called UserRight (I don't use Enum for some special code design reasons). So, what I would like to achive is this: <hmk:...

Using Xaml and WPF, How do you animate a property on click, and then reverse on successive clicks.

I would like to know if there is a way to use only XAML to perform an animation on a property, and then on the next click perform the reverse animation? Here is a sample of the Trigger I have on a Border object to give the appearance of sliding out: <!-- Animates the Width to Slide It Out. --> <EventTrigger RoutedEvent="Border.MouseLef...

Get a variable from an external Class

I'm using an external class to draw an object in my Flash movie but I need to get some variables from the Class as well. I want to put the variable persPoints[0].x into a variable in my main document called newvar for example. This is the part of the External Class I'm using class Shape { function set2DTo3D():Void { var persPoi...

Python @property versus method performance - which one to use?

I have written some code that uses attributes of an object: class Foo: def __init__(self): self.bar = "baz" myFoo = Foo() print (myFoo.bar) Now I want to do some fancy calculation to return bar. I could use @property to make methods act as the attribute bar, or I could refactor my code to use myFoo.bar(). Should I go back...

User control (ascx) and properties

The only way I've found to persist property values within a user control is to use the ViewState. public string Title { get { return Convert.ToString(ViewState["Title"]); } set { ViewState["Title"] = value; } } I can't say I'm real impressed with this though, as the more properties a user control has the more crap ...

Python Properties & Swig

I am attempting to create python bindings for some C++ code using swig. I seem have run into a problem trying to create python properties from some accessor functions I have for methods like the following: class Player { public: void entity(Entity* entity); Entity* entity() const; }; I tried creating a property using the python pr...

struts1,properties file

hi, i have a selection box in struts1 jsp file.In that box the key values i have to get from the properties file.Any idea please Thanks Usman.sk ...

How to get current property name via reflection?

I would like to get property name when I'm in it via reflection mechanism. Is it possible? Update: I have code like this: public CarType Car { get { return (Wheel) this["Wheel"];} set { this["Wheel"] = value; } } And because I need more properties like this I would like to do something like this: publ...

What's the point of this in objective-c

SomeObject *temp = [[SomeObject alloc] init] self.theObject = temp; [temp release]; Why is it always done that way? Why not self.theObject = [[SomeObject alloc] init]; ...

Objective-C Difference between setting nil and releasing

I've learned that in dealloc you do [object release]; but in viewDidUnload (in a UIViewController subclass) you do self.object = nil. What is really the difference because self.object = nil (we're assuming object is a (nonatomic, retain) property) retains nil (which does nothing) and then releases the old value and then the reference cou...

How to create a property with its name in a string?

Using Python I want to create a property in a class, but having the name of it in a string. Normally you do: blah = property(get_blah, set_blah, del_blah, "bleh blih") where get_, set_ and del_blah have been defined accordingly. I've tried to do the same with the name of the property in a variable, like this: setattr(self, "blah", pr...