property

Public Properties within VB Module - Cross-client Behavior

Can one client call a public property within a VB.NET module and see the value of that public property changed by another client accessing it at the same time? Example: Client 1 calls Public Module DataModule Private theDateTime As DateTime = GetAdjustedDateTime() //initial TZ value Public Property GetSetDateTime() As DateTim...

Array as class property ?

Hello, I have this API that requires me to have a specific array key to be send. Since that array needs to be used on ALL class methods, I was thinking on putting as a class property. abstract class something { protected $_conexion; protected $_myArray = array(); } Later on, on the methods of this class, I will then use: $t...

property and field are not equals when using nhibernate with lazy true

Hello, I'm having a strange issue when I put lazy true inside a hibernate xml. In my class I have a property like this "Name" and a field like this "name". When I retrive a single record against the database the I receive a classe like this: Property: "john doe" ; field: "null". Explaining, the property and fields are not equals. How t...

Can I set a property for an array?

currently I have a variable and a property: private System.Xml.Linq.XDocument myDoc; public System.Xml.Linq.XDocument getMyDoc { get { return myDoc; } set { myDoc = value; } } now I need two docs: private System.Xm...

Python: getting an object's “attribute/method/property” either as a parameter to a method or as a property.

In the WMI module (yeah, my boss wants me to program in Windows — but at least it’s not in COBOL), it seems that you can access a WMI value either by passing it’s name as a string parameter of a method, blabla=wmithingy().getvalue('nameOfValue') or as a property/method: blabla=wmithingy().nameOfValue() Am I dreaming, smoking bad w...

ASP.NET: custom control (or user control) with property of type List<Something>. Can the property be set in the ASPX source?

I have a user control with a property of type List<Something>: Private p_myList As New List(Of Guid) Public Property MyList() As List(Of Guid) Get Return p_myList End Get Set(ByVal value As List(Of Guid)) If value Is Nothing Then Throw New ArgumentNullException() p_myList = value End Set End Prope...

Float property non-zero default, is it possible?

Hi, I would like to use a float property in my component, but set it to some non-zero default value (let's say it is 1000.0). If I try to do this in the Create, the property start to behave wildly since the default value for floats it 0 (see classes.TWriter.WriteProperty.WriteFloatProp.IsDefaultValue) so when I override some value with ...

How to define a Property that it's the keyword like 'checked'?

Hi everyone,Who can help me to resolve the question? When I defined the Property 'checked' in a class,It's always not passed. Example: public class Node { public bool checked { get;set; } } I do so because of I am using a jquery plugin which the return json object's property is checked ...

C#: How to Bind Button.Enabled to Whether If There Is Any Item Selected of a ListView

Hi, I have a question about Control.DataBindings. How can I bind Button.Enabled to whether if there is any item selected of a ListView? i.e.: Button.Enabled = ListView.SelectedItems.Count > 0; I know that I can use ListView.SelectionChanged event to do this. I'm just wondering how can I use DataBinding to do the same job. Thanks. ...

C++ Static Property

I am having issues accessing a static property in a class. I am getting the following error: shape.obj : error LNK2001: unresolved external symbol "public: static class TCollection<class Shape *> Shape::shapes" The definition of the class is: class Shape { public: static Collection<Shape*> shapes; static void get_all_instanc...

Linq-to-SQL: property without a storage column

hey, there, is there any way to ass a NON DB property to a Linq-to-SQL class? (etc calculated fields), I'm getting an error when trying ...

Objective C ViewController with a C++ object as a property has getters and setters that re-initialise it every time it's referenced

I have tried so many combination's of code I don't have a sample to show. I have a Objective C view controller, and in the interface I declare a C++ class that contains the preferences of what the user wants to have. I do my @property command in the header and @synthesize command at the top of the .mm file. Then I use the class in the...

Reflection and custom ControlDesigner doesn't seem to work in c#

I have made a custom ControlDesigner that I need to include and exclude properties shown in the property grid. But for some reason it seems just to ignore the code? I don't know what I might have done wrong? Could I be missing something? Do I need to setup VS or something? Also in the examples I have found they seem to disagree about wh...

Javascript Class + Properties not sticking to their values

I'm attempting to make a class in javascript. I create it with the JSON type object thing. Doing this: Foo = { PubId: '', Init:function( oCallback ) { this.sendCommand( 'INIT', {}, oCallback ); }, sendCommand : function( sCommand, aParams, oCallback ) { setTimeout( oCallback, 1000, '{"response":"...

Why animating custom CALayer properties causes other properties to be nil during animation?

I have a custom CALayer (say CircleLayer), containing custom properties (radius and tint). The layer renders itself in its drawInContext: method. - (void)drawInContext:(CGContextRef)ctx { NSLog(@"Drawing layer, tint is %@, radius is %@", self.tint, self.radius); CGPoint centerPoint = CGPointMake(CGRectGetWidth(self.bounds)/2, C...

NHibernate Property Mapping, best practise for type attribute?

I have a little doubt for mapping of property in hbm file. Sometimes I've mapped the string field of my db in this way: <property name="MyPropName" column="MyColumnName" length="20" /> but the same mapping can be wrote in this way: <property name="MyPropName" column="MyColumnName" type="String(20)" /> my question is...what's the b...

What is the inner difference between (MyType)SomeObj.Property1 and (MyType)(SomeObj.Property1) in C# ?

It's probably very lame question, but I found no references in C# specification about round brackets. Please point me to spec or msdn if answer on that question will be obvious. What is the inner difference between (MyType)SomeObj.Property1 and (MyType)(SomeObj.Property1) in C# ? AFAIK, in first case ( (x)SomeObj.Property1 cast ) - it ...

How do I automatically display all properties of a class and their values in a string?

Imagine a class with many public properties. For some reason, it is impossible to refactor this class into smaller subclasses. I'd like to add a ToString override that returns something along the lines of: Property 1: Value of property 1\n Property 2: Value of property 2\n ... Is there a way to do this? ...

How do static properties work in an asp.net enviroment?

If I had a class with a static property that is set when a user loads a particular page, is that static value unique to that users session? In other words, if a second user then loads the page and sets the static property, will each user have a distinct value, or will both use the second users value? ...

Moq: Setup a property without setter?

Hi, I have following class: public class PairOfDice { private Dice d1,d2; public int Value { get { return d1.Value + d2.Value; } } } Now I would like to use a PairOfDice in my test which returns the value 1, although I use random values in my real dice: [Test] public void DoOneStep () { var mock = new Moc...