property

COM object in base class - access via field or property?

I've inherited a codebase of C# dlls that are called via COM-interop (or so it has been described). The C# code also uses COM objects internally to perform the basic functionality of the parent application. I'm refactoring some of the DRY violations out of the code because finding duplications in 100,000 lines of code across 50 or 60 d...

Reading info inside a node of an XML using dataset

<cat number="35"> <eye>brown</eye> <tail>long</tail> </cat> <dog number="35"> <eye>green</eye> <tail>short</tail> </dog> I've loaded an XML like this into a dataset, and to access info i'm just using this: ds.Tables(cat).Rows(0)(eye) //returns brown but i'd like to get the cat's number, how do i access this information using one...

Server code in Javascript

I have: Page.aspx Page.aspx.vb TestClass.vb I'm trying to access a shared property of the TestClass class from the Page.aspx. This code works fine: ... <head> <script language="JavaScript"> <% if System.Globalization.CultureInfo.CurrentCulture.Name.ToLower = "pt-br" Then %> alert('portugues'); <% else %> ale...

Which attribute do I tag a property with to make the VS2008 designer not save it to the .designer.cs file?

If I have an informational property that provides an editor only, in the property inspector, is there an attribute I can tag the property with so that it won't be saved to the .Designer.cs file? ...

JSF converter property

I am trying to register different converter instances in the faces-config, using a standard converter class to which different parameters are passed. The code below registers two DateTimeConverters, the first one for dates including time and the second one for time only. But the pattern property never gets set. Can this be done? <conve...

Inexplainable InvalidOperationException with GroupPrincipal and SAM PrincipalContext

I am trying to create a Principal like this: PrincipalContext pc = new PrincipalContext(ContextType.Machine); GroupPrincipal group = new GroupPrincipal(pc); group.Name = "Some Group Name"; group.Description = "Some Group Name Description"; group.Save(); However, when the code is executed, I get the following exception message: ...

XML Standard for Real Estate property

Is there a standard XML format for property listings? I've found a couple: reaxml1 reaxml.realestate.com.au/docs/reaxml1-xml-format.html RELML www.xml.com/98/08/real/relml-dtd.html but which is best / most used? Has anyone created xml property listings using these? ...

Using binary type of a UserProperty

Hello, For some reason I need to save some big strings into user profiles. Because a property with type string has a limit to 400 caracters I decited to try with binary type (PropertyDataType.Binary) that allow a length of 7500. My ideea is to convert the string that I have into binary and save to property. I create the property using t...

Objective-C, enumerators and custom setters - How to make it work?

I have an Application Delegate class with a enumeration which looks like this: typedef enum { Online = 3500, DoNotDisturb = 9500, Offline = 18500, Away = 15500, Busy = 6500, BeRightBack = 12500 } status; Additionally I have a property to set a value from the enumerator in my interface file: @interface MyAppDel...

C# change property of an object dynamically

Is there a way to change the property of an object in C# like this. int Number = 1; label[Number].Text = "Test"; And the result will change label1.Text to "Test"; Hope you understand what I mean. ...

Python: multiple properties, one setter/getter

Consider the following class definitions class of2010(object): def __init__(self): self._a = 1 self._b = 2 self._c = 3 def set_a(self,value): print('setting a...') self._a = value def set_b(self,value): print('setting b...') self._b = value def set_c(self,value): ...

Python property

The output seems a bit fishy given the following code. Why is "get in Base" only printed once? And why is not "set in Base" printed at all? The actual getting/setting seems to work fine though. What am I missing? class Base: def __init__(self): self.s = "BaseStr" def getstr(self): print "get in Base" ret...

Setter Getter oddness @property

I am having a really odd problem trying to set a simple float value to 1. My property: { float direction; } @property(nonatomic)float direction; Which is synthesized: @synthesize direction; I then used the following code: - (void)setDirection:(float)_direction { NSLog(@"Setter called with value of %f",_direction); self->d...

NHibernate: lazy loaded properties ?

NHibernate question: Say I have a SQL table Person and it has a Picture column ( OLE Object ) . I have a class Person and it has : byte[] Picture attribute. Is it possible to map like this ? <property name = "Picture" column = "Picture" type = "System.Byte[]" lazy="true" /> Does the "lazy" keyword have any effect on properties ...

Is it possible to reference a property using Django's QuerySet.values_list?

I have a custom property on my Django model that returns the full name of a Person: class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) def _get_full_name(self): return "%s %s" % (self.first_name, self.last_name) full_name = property(_get_full_name) When I create ...

How to create string property for each address book record?

Hi, I want to store network carrier as a string (e.g. AT&T) for each contact in address book. I found a method addPropertiesAndTypes for creating a custom property. But I am not able to find any proper example to do this. I am using following code to iterate through contact book records: ABAddressBookRef addressBook = ABAddressBookCr...

Property visibility in abstract class

Hi, Does someone knows C# best practice about the way to define attribute visibility (private or protected) behind public property in abstract class or parent class. In other worlds what is the best practice by default (and why) between: public abstract class MyClass { private string myAttribute; public string MyAttribute ...

Difference between @interface declaration and @property declaration

I'm new to C, new to objective C. For an iPhone subclass, Im declaring variables I want to be visible to all methods in a class into the @interface class definition eg @interface myclass : UIImageView { int aVar; } and then I declare it again as @property int aVar; And then later I @synthesize aVar; Can you help me understa...

visual c++ inner class as a property, possible ?

Hello, As a C++ programmer I've recently started to work with visual c++. I've get stuck with the properties. The idea is to create an inner class that would have 2 methods plus property like get/set functions. Does it even possible in visual C++ (i guess yes). The usage would be like this: Foo ^ foo = gcnew Foo(); int a; foo->Metho...

asp.net use class object on form

Hello , I am creating an object at server side of an aspx (test.cs) page from a class (asp.net 2.0 C#) public partial class Vendor_VendorUsedTicketsPopup : System.Web.UI.Page { ReportInvoice _objReportInvoice = new ReportInvoice(); protected void Page_Load(object sender, EventArgs e) { _objReportInvoice.ReportId = ...