Possible Duplicate:
Properties vs Methods
In method you can type some code and in properties too. For example I have a property Name. When class name changes I would like to get some data from database and change state of my object. I can add this code to set part of my property. Other solution is to change set part to private ...
Update
Sorry. I didn't mean the whole reflection library was off limits. I just meant the insanely slow *.Invoke() stuff.
Hi,
I need to implement a property system in C# that allows both normal property access
[property_attribute()]
return_type Property { get; set; }
and access by string
SetProperty(string name, object value);
obje...
I'm trying to read the value of a C# property from my code behind file into some JQuery script (see below). The JQuery selector I've written accesses an ASP.Net GridView and then a CheckBox field within the gridview. Whenever a checkbox is checked or un-checked the code is hit, but I need to access the C# property from the code behind ...
Note that the following code is in a class a single class
private string _fee;
private string _receipt;
public string Fee
{
get { return _fee; }
private set { _fee = value; }
}
public string Receipt
{
get { return _receipt; }
private set { _receipt = value;}
}
public MyValue(string fee, string receipt) : this()
{
...
Hi.
I need to save in my model a list of objects from a certain class on the datastore.
Is there any simple way to archive this with ListProperty and custom property's without going into pickled/simplejson blob data?
I just want something like this:
class Test:
pass
class model(db.Model):
list = db.ListProperty(Test)
Loo...
Hi there
I am trying to determine the type of a property which an attribute relates to, from within the attributes constructor. More specificity I am looking for the class which contains the property.
my current constructor looks like this:
public IndexedCategoryAttribute(Type DefiningClass, String HeaderText, int Index)
{
...
Hi, I'm implementing a Custom Workflow and Activities to be reused in multiple projects and trying to get them to be as easy to use as possible. In this workflow I have a Property whose name is 'UserID' which I'd like to bind to a dependencyproperty in one of my activities. I can currently bind it at design time searching explicitly for ...
I have a class in C++/CLI that I'd like to give a property. I want to declare the property in a header file and then implement that property in a .cpp file.
Here's the header:
public ref class Dude
{
static property Dude^ instance
{
Dude^ get();
}
}
If I declare the header file and don't put anything in the c...
Visual C# 2008 is giving an error when I attempt to change the anchor for multiple controls simultaneously. This error does not occur when done individually.
Property value is not valid.
Could not find file
'C:\Users\user\Documents\Visual
Studio
2008\Projects\test\test\Resources\WelcomeBorder.png'.
The image was previou...
The goal is to create a mock class which behaves like a db resultset.
So for example, if a database query returns, using a dict expression, {'ab':100, 'cd':200}, then I would to see
>>> dummy.ab
100
So, at the beginning I thought I maybe able to do it this way
ks = ['ab', 'cd']
vs = [12, 34]
class C(dict):
def __init__(self, ks...
I am trying to develop a simple interface for allowing quick lists to be generated from classes. Basically, the interface needs to return an ID and a Name. However, some classes have a calculated name property which is read only, others just use a read/write name property. Basically, all I care is that it has a getter, it does not matter...
I'm trying to create a point class which defines a property called "coordinate". However, it's not behaving like I'd expect and I can't figure out why.
class Point:
def __init__(self, coord=None):
self.x = coord[0]
self.y = coord[1]
@property
def coordinate(self):
return (self.x, self.y)
@coo...
I admit I am totally new to QT so bare with me. I am used to develop in Delphi, but I have recently moved to developing in Python and with that PyQT (later I'll switch to PySide). Anyway, I'm trying to figure out if there's anything in QT that is equivalent to Delphi's Align property possibilities like alTop, alClient, alRight and so on?...
I have a strange problem that I could not solve. When I try to compile the following snipped I get this error:
'AbstractClass' does not implement interface member 'Property' (Compiler Error CS0535)
The online help tells me to make my AbstractClass abstract, which it is. Can anybody tell me where I went wrong?
Cheers Rüdiger
public in...
I have upgraded what had been a working AD Users and Computers property sheets extension from Visual Studio 2003 to 2008 and am trying to debug it. The symptoms are that MMC.EXE crashes when selecting that property sheet tab.
I tried attaching to mmc.exe, but although the property sheet displayed the tab, the DLL is not on the call sta...
Hello,
I wish to allow the user of my control to choose the licensing method for the control. The choice comes from an enumeration, so they must choose one of the methods I have laid out for them. This license needs to be chosen prior to the code executing at runtime. Therefore I wish for them to selected a value at design time. Fu...
given a CSV ant property,
<property name="module.list" value="mod1,mod2,mod3,mod4,mod5"/>
how can I just get the first element (ie "mod1" here)? I want to execute a command that will take in "mod1" as one of the arguments.
Moreover.. I cannot modify this original "module.list" property to a list or anything else.. although I can crea...
I want to be able to call a method that creates an object and sets properties of the object based on the parameters passed into the method. The number of parameters is arbitrary, but the catch is I don't want to use strings. I want to use the actual properties sort of like you do in lambda expressions.
I want to be able to call the me...
Hi,
I have a UserControl Tasks.xaml that is used within a couple of property pages that inherit from a PropertyPageBase class - which itself inherits from UserControl. Within the Tasks UserControl, I want to use a Context menu command and the CommandParameter needs to bind to a DependencyProperty called Data on the PropertyPageBase cla...
I have one main outstanding issue, I know now how to databind to lists and individual items, but there is one more problem I have with this, I need to bind a listbox to some properties that are in a Class.
For Example I have two Properties that are bound in some XAML in a class called Display:
Public Property ShowEventStart() As Visibil...