property

Rhino Mocks AssertWasCalled (multiple times) on property getter using AAA.

I have a mocked object that is passed as a constructor argument to another object. How can I test that a mocked object's property has been called? This is code I am using currently: INewContactAttributes newContact = MockRepository.GenerateMock<INewContactAttributes>(); newContact.Stub(x => x.Forenames).Return("One Two Three"); someobj...

How to detect a property return type in Objective-C

Hello, I have an object in objective-c at runtime, from which I only know the KVC key and I need to detect the return value type (e.g. I need to know if its an NSArray or NSMutableArray) of this property, how can I do that? ...

Setting the a Property to what maven.compile.classpath Contains WITHOUT Ant

Hi, I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible. I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this...

.NET Default Properties Error

I have a VB.NET project where I am able to iterate through the keys and values collections of a dictionary object using an index: MyDictionary.Keys(idx) MyDictionary.Values(idx) When this code is taken from the test project and placed into the real project I get the following error: 'System.Collections.Generic.Dictionary(Of ...

Property Name and need its value

I have a name of a property and need to find its value within a Class, what is the fastest way of getting to this value? ...

What is the difference between a property and an instance variable?

I think I've been using these terms interchangably / wrongly! ...

What does the property "Nonatomic" mean?

What does "nonatomic" mean in this code? @property(nonatomic, retain) UITextField *theUsersName; What is the difference between atomic and nonatomic? Thanks ...

How Ant can get a value read from a file into a property value?

The file looks like: a1,b1 a2,b2 ... I know the value "a2". How to get the value "b2" into a property value. I know how to select line which contains "a2" by: <linecontains> <contains value="a2"/> </linecontains> But I do not know how to set a property value to "b2". I am at your disposal for more other informations. ...

How to install a MIDlet on a SonyEricsson phone directly in the Organizer folder

This question refers strictly to Sony Ericsson phones running Java Platform 8 or higher. It is possible to instruct the AMS to install the application in one of the folders Applications or Games. But I want to install the MIDlet in a different folder. The target folders are Organizer, Entertainment or Location services. Is it possible t...

Best Practice on local use of Private Field x Property

Hi, When inside a class you have a private fiels and expose that field on a public property, which one should I use from inside the class? Below you is an example on what I am trying to find out. Should manioulate the Private Field _Counter or the Property Counter? Public Class Test Private _Counter As Integer Public Property Counte...

.net Immutable objects

I want to enforce on my code base immutable rule with following test [TestFixture] public class TestEntityIf { [Test] public void IsImmutable() { var setterCount = (from s in typeof (Entity).GetProperties(BindingFlags.Public | BindingFlags.Instance) where s.CanWrite select s) ...

Is it possible to initialize a Control's List<T> property in markup?

Let's say we have the following: public enum RenderBehaviors { A, B, C, } public class MyControl : Control { public List<RenderBehaviors> Behaviors { get; set; } protected override void Render(HtmlTextWriter writer) { // output different markup based on behaviors that are set } } Is it possible to...

An object reference is required for the non-static field, method, or property?

Hi there, I know this is probably a very newbish question, so I apologize. I am trying to access the Text property of a label on Form1 from another form, MaxScore. When I click the Ok button on MaxScore, I want to set Form1's myGameCountLbl.Text to Form1's variable, max by using max.ToString(). Here is my code in the OK button event o...

terminology for temporarily diverting data from a stream

It's hard to search for something when you don't know what it's called. I am buffering a stream of data points with a sort of switchable buffer (imagine a garden hose with a valve): in one state ("true"), I let the data points through to their eventual consumer. In the other state ("false"), I retain those data points in a queue until I...

Properties for custom control using in .NET Compact framework

Hi, I could able to display my custom controls properties in the property window (using EditorBrowsable() attribute). But I have another property which has class as it's return type. So the same property appearing in the window as read only format. I need property it should take the class values at design time just like, Font Name=...

Setting a custom property with DontEnum

If I create: Object.prototype.count = function() {}; var m = {prop: 1}; for(var i in m) window.status += i + ", "; in the code above i contains also count inherited by its prototype. Now I want to know if there is a way to set a custom property as the flag DontEnum (it is not settable for custom property) so it will not be enumer...

What's the correct way to test for existence of an attribute on a JavaScript Object?

I have a custom Javascript object that I create with new, and assign attributes to based on creation arguments: function MyObject(argument) { if (argument) { this.prop = "foo"; } } var objWithProp = new MyObject(true); // objWithProp.prop exists var objWithoutProp = new MyObject(false); // objWithoutProp.prop does not ex...

Setting default values for custom Maven 2 properties

I have a Maven pom.xml with a plugin that I want to be able to control on the command line. Everything works otherwise fine, except even after searching the net a while I can't figure out how to set a default value for my control property: <plugin> ... <configuration> <param>${myProperty}</param> </configuration> ...

Issue with adding new properties to existing Google AppEngine data models / entities

In GAE, I have a model called Foo, with existing entities, and attempt to add a new property called memcached to Foo that takes datetime values for the last time this value was set to memcache. If I try to query and sort on this property, or even filter for entities that do not have a value for memcached, entities that haven't had a val...

In XAML, how can I keep an ellipse being a circle?

I'm getting XAML-blind I'm afraid. I'm developing a MS Surface application and I have an ellipse inside a ScatterViewItem (a container an end user can resize). I would like to keep the ellipse a circle (width == height) and keep it as big as possible (the lowest value of width/height of the SVI should be taken for both width/height prope...