properties

C# - 2 struct questions

Hi, I know structs are value types but then I do not understand why this works: EDIT: I mean, why this.Size.Height does not work then? struct A { int height; public int Height { get { return height; } set { height = value; } } } //... class Main ...

I check INotifyPropertyChanged but how can I make use of It ?

In this post i found INotifyPropertyChanged and i check it's example but I notice that i can do the same thing without implement INotifyPropertyChanged and more i can define my event and do the same... For example in public string CustomerName { get { return this.customerNameValue; } set { if (v...

looping through properties in struct - C

Can I use a forloop to get the property names of a "struct" in C? Or would I just have make a separate list? (Just the name I am looking for) ...

Properties compare question

Suppose you have 2 Properties objects. One contains master properties, the other one is a target. Your job is to compare the two. masterValue = masterProperties.getProperty(masterKey); for (Properties targetFileProperty : targetFileList) { if (targetFileProperty.containsKey(masterKey)) { targetValue = targetFileProperty.getPrope...

WPF: binding nested properties to combobox

Guys I'm trying to bind a "second level" property of my class to a combobox. What am i doing? I'm assigning a ObservableCollection to be the datacontext of the grid that hold all my textboxes and one combobox. The Hierarchy can be described as public class ListaLogradouro : ObservableCollection<Logradouro> { } public class Logradou...

ASP.Net Shared Webpart Pages: How do I share changes made when modifying properties of webparts to anonymous users?

By education and initial experience, I am a desktop developer. I am currently working as a SharePoint developer on corporate internal websites. My experience with building ASP.Net applications from scratch is limited. I would like to know how I can build custom webparts on an ASP.Net platform (v3 or v3.5) and allow custom properties to...

as3 simple issues in code, regarding properties and variables

Well there is two issues with the code below. Help with either of them would be greatly appreciated. The first issue is that it doesn't like "(t.attribute==true)". It doesn't seem like me using a variable in that way. Are there any ways of getting around this? The second issue, is again with the same variable, "("un" + attribute)", I r...

Is it a correct way to use auto-implemented properties in C#

I want to assign some default value to a property or want to replace some character like given below. Is it a correct syntax or should i do this by creating a variable. public string Login_Name { get { return this.Login_Name; } set { this.Login_Name = value.Replace("'", "''"); } ...

Binding to a property of an instance of a class, or modifying the properties from code

I've been having trouble with some databinding with WPF. I have a class to hold various data. I want the data it holds to be binded to Text Boxes in a different window. Everything I've found reccomends this: <Grid.Resources> <c:PropertyModel x:Key="propMod" /> </Grid.Resources> <Grid.DataContext> <Binding Source="{StaticResource...

Programmatically generate additional properties during SharePoint crawl

Is it possible to hook into the MOSS 2007 crawl process and programmatically populate a metadata property as the content is being indexed? The reason I need to do this at crawl time is that the content is coming from outside SharePoint (from a file share) and so I can't add the metadata directly to the documents themselves. There's a wi...

How To: Dynamically-defined properties in Java

Hi, How can I define some properties dynamically in Java. For now, I'm using a properties file, but I need to change these properties before installation, so these properties should be set in a file outside the jar (or install) file. These properties define my IBatis connection. Thansk in advance, Victor ...

Defining properties of a class

can somebody tell me the difference between public class Vendor { public string VendorName { get; set; } } and public class Vendor { private string vendorName = string.Empty; public string VendorName { get { return vendorName; } set { vendorName = value; } } } Is there any benefit of using a pr...

Ruby - dynamically add property to class (at runtime)

I'm looking for a way to add properties to my already defined class at runtime, or better: class Client attr_accessor :login, :password def initialize args = {} self.login = args[:login] self.password = args[:password] end end But then, I have this hash {:swift_bic=>"XXXX", :account_name=>"XXXX", :id=>"...

ActionScript Setting Object Properties From Other Object Properties?

i'm attempting to cast an object's property as an actual property of another object. here's my object variable: var propObj:Object = {prop:"width", width:50}; now i want to assign the property of a sprite using that object's properties. var sp:Sprite = new Sprite(); sp.(propObj.prop as Sprite.property) = propObj.width; now, i'm no...

From what object do you get a revised files properties from SharpSVN [c#]?

Hello, I've been working with SharpSVN for a few weeks now and I was looking to access an individual files properties (at a specific revision) as you can in TurtoiseSVN by clicking on the revision then right clicking on a path and selecting 'Show Properties'. I have looked where I would assume these properties would be located (under a S...

Using Python's @property decorator on dicts

I'm trying to use Python's @property decorator on a dict in a class. The idea is that I want a certain value (call it 'message') to be cleared after it is accessed. But I also want another value (call it 'last_message') to contain the last set message, and keep it until another message is set. In my mind, this code would work: >>> class...

Visual Studio - Debug vs Release

I built a windows service, targeted for .NET 2.0 in VS 2008. I run it as a console app to debug it. Console app is working great. I put it on my local computer as a service, compiled in debug mode, still working great. I'm ready to release now, and suddenly, when I set it to release mode, the service compiles and installs, but nothing ...

To implement properties or not?

I've found a few methods online on how to implement property-like functionality in c++. There seems to be some sound work-arounds for getting it to work well. My question is, with the prevalence of properties in managed langues, should I spend the effort and the possibilty of code-breakage (or whatever) to implement properties in my co...

How do you set specific properties to a class created by an abstract factory?

Is it possible to have concrete factories create concrete classes with type specific parameters for them using the abstract factory pattern? Or do the different concrete classes created by their respective concrete factories need to to have the same fields? Best regards, Christian ...

Is there an elegant way to set a default value for a property in c#?

I have read that there are good reasons to use properties instead of fields in c# on SO. So now I want to convert my code from using fields to using properties. For an instance field of a class, I can set a default value. For example: int speed = 100; For the equivalent property, which I think is: int Speed { get; set; } My unders...