property

objective c- property

Hello all , I think i am missing somthing with property attributes. first i cant understand the different between retain and assign? If i use assign does the property increase the retain counter by 1 to the setter and also to the getter, and i need to use release to both of them? and how this work with readwrite or copy? from the view ...

Why does this binding doesn't work through XAML but does by code ?

I am trying to bind to a static property on a static class, this property contains settings that are deserialized from a file. It never works with the following XAML : <Window.Resources> <ObjectDataProvider x:Key="wrapper" ObjectType="{x:Type Application:Wrapper}"/> </Window.Resources> <ScrollViewer x:Name="scrollViewer" Scrol...

KindError: Property r must be an instance of SecondModel, why ?

class FirstModel(db.Model): p = db.StringProperty() r=db.ReferenceProperty(SecondModel) class SecondModel(db.Model): r = db.ReferenceProperty(FirstModel) class sss(webapp.RequestHandler): def get(self): a=FirstModel() a.p='sss' a.put() b=SecondModel() b.r=a b.put() a.r=b a.put() self.r...

how to confine to write a string in specific list ,on google-app-engine

class FirstModel(db.Model): p = db.StringProperty({option:['aa','bb','cc']}) the error is : NameError: name 'option' is not defined what should i do ,thanks ...

iphone @property(retain), init(), and standards

I'm new to the memory management of the iphone and had a question about standards/correctness. My header file declares: IBOutlet UITabBarController *tabBarController; @property (nonatomic, retain) UITabBarController *tabBarController; In my init() code I was doing something like the following: self.tabBarController = [[UITabBarCon...

ASP.NET user control list/collection/array property

Hello. I created user control. It has string[] public property (it may be List<string> or whatever). I want to support defining this property in aspx code, when declaring the instance of this usercontrol. Something like this: <uc1:MyControl ID="MyControl1" runat="server"> <MyStringCollectionProperty> <string>My String 1</str...

SQLAlchemy - how to map against a read-only (or calculated) property

I'm trying to figure out how to map against a simple read-only property and have that property fire when I save to the database. A contrived example should make this more clear. First, a simple table: meta = MetaData() foo_table = Table('foo', meta, Column('id', String(3), primary_key=True), Column('description', String(64), ...

How to dynamically assign a value to a class property in PHP?

I would like to assign a value in a class property dynamically (that is referring to it using a variable). #Something like: setPropValue($obj, $propName, $value); ...

Entity Framework - adding new items via a navigation property

I have come across what appears to be very peculiar behaviour using entity framework 4.0. I have a User entity, which has a Company (A Company has many Users). If I do this, everything works as expected and I get a nice shiny new user in the database: var company = _model.Companies.First(); company.Users.Add(new User(1, "John", "Smith...

Help: Instance Variables & Properties [iPhone]

In something like this: @interface Control_FunViewController : UIViewController { UITextField *nameField; UITextField *numberField; } @property (nonatomic, retain) IBOutlet UITextField *nameField; @property (nonatomic, retain) IBOutlet UITextField *numberField; I understand that "UITextField *nameField;" is an instance variabl...

How to assign class property as display data member in datagridview

hi guys, I am trying to display my data in datagridview. I created a class with different property and used its list as the datasource. it worked fine. but I got confused how to do that in case we have nested class. My Classes are as follows: class Category property UIN as integer property Name as string end class class item ...

Problem with UserControl with custom Dependency Property

Hi, I'm writing a user control with a dependency property for a search text called SearchText. It is a dependency property because I want to allow consumers of the control to use data binding. The user control contains a WPF TextBox where the user can enter the search text. I could use data binding to connect the SearchText dependency ...

C# Custom Control Properties load before Load and arrays are empties

EDITED FOR BETTER UNDERSTANDING I made a custom control with propertise for some global variables. private string[] LBTitles = new string[1] { "Rien" }; //... [CategoryAttribute("WildData"), DescriptionAttribute("Tableau des noms des titres au dessus de le listbox")] public string[] Titles { get { return LBTitles; } set { LBTi...

Properties and Instance Variables in Objective-C 2.0

Do properties in Objective-C 2.0 require a corresponding instance variable to be declared? For example, I'm used to doing something like this: MyObject.h @interface MyObject : NSObject { NSString *name; } @property (nonatomic, retain) NSString *name; @end MyObject.h @implementation @synthesize name; @end However, what if I did thi...

PHP read XML properties

I have the following XML data which is generated by a webservice <?xml version="1.0" encoding="UTF-8"?> <rsp xmlns="http://worldcat.org/xid/isbn/" stat="ok"> <isbn oclcnum="263710087 491996179 50279560 60857040 429386124 44597307" lccn="00131084" form="AA BC" year="2002" lang="eng" ed="1st American ed." title="Harry Potter and...

Mocking a property using SetupGet and SetupSet - this works, but why?

Using Moq I am mocking a property, Report TheReport { get; set; } on an interface ISessionData so that I can inspect the value that gets set on this property. To achieve this I'm using SetupGet and SetupSet as follows: // class-level fields protected Report _sessionReport; protected Mock<ISessionData> SessionData { get; private set; } ...

Passing a property into a method to change that property

Not sure if this is possible, but here is what I am trying to do: I want to have a dictionary that contains a mapping of a column index to a property name used to populate that index. In my code I will loop through an array if strings and use the dictionary to look up which column it should map to. My end result code would look like: ...

Round-trip Property on Entity Framework entity

Hi, I have a Candidate entity that is read/write to a Candidate table under EF 4.0. This all works great but I need to load another type of Candidate from our existing membership table via a stored proc and Function Import. From the applications POV they are also a Candidate they just happen to have an additional attribute of Grade. ...

C# Get the name of a non-static property of a class.

I have a question very similiar to another question: http://stackoverflow.com/questions/2820660/get-name-of-property-as-a-string. His solution ended up with // Static Property string name = GetPropertyName(() => SomeClass.SomeProperty); // Instance Property string name = GetPropertyName(() => someObject.SomeProperty); What I'd ...

Override Property with different compatible Type

I need a base class with a property where I can derive classes with the same property but different (compatible) types. The base Class can be abstract. public class Base { public virtual object prop { get; set; } } public class StrBase : Base { public override string prop { get; set; } // compiler error } public class UseIt { ...