property

.Net Property Grid. Is there a way to let the Grid manipulate object in different way

As I understood , The property grid is given an object which it can manipulate by extracting its Properties using reflections. My problem is that I have a set of Parameters that is determined during run-time , thus I can't staticly compose a class with properties to represent this set. I have two idea in mind to solve this problem but ...

Java System.getProperty("user.dir") on Mac OS X

I have an application bundle on Mac OS X 10.4 on the desktop. My application looks for a folder named "resources" in which files to be displayed are kept (kept in the same location as the runnable JAR). I know there is a folder named "Resources" within the app bundle too, sorry if thats confusing, but I never programmed on a Mac and didn...

Using Projections on Formula Properties

I have a property in my XML mapping file like <property name="CreatedByLogin" formula="(select x.fst_name || ' ' || x.last_name from sebl_dev.S_CONTACT x where x.ROW_ID=CREATED_BY)" type="String" /> and I want to use a projection on this particular name like .Add(Projections.Property("CreatedByLogin"), "CreatedByLogin") and I do g...

Pros and cons of 'new' properties in C# / .Net?

Considering the following sample code: // delivery strategies public abstract class DeliveryStrategy { ... } public class ParcelDelivery : DeliveryStrategy { ... } public class ShippingContainer : DeliveryStrategy { ... } and the following sample Order class: // order (base) class public abstract class Order { private DeliveryStr...

WPF Multiple Values for Property

I would like to apply a style, to a ProgressBar, for when it between certain values the style should change. <Style x:Key="ProBar" TargetType="{x:Type ProgressBar}"> <Style.Triggers> <Trigger Property="Value" Value="<10"> <Setter Property="Foreground"> <Setter.Value> <!--OrangeColou...

Accessibility of abstract properties

I have an abstract class with an abstract property that is set to have both Get and Set. I know I'll always want to be able to get this property from derived classes but there are some cases where it doesn't make sense to set this property in certain types of derived classes. I can't just omit the Set accessor in a derived class (see c...

WPF: How to bind to a nested property?

I can bind to a property, but not a property within another property. Why not? e.g. <Window DataContext="{Binding RelativeSource={RelativeSource Self}}"...> ... <!--Doesn't work--> <TextBox Text="{Binding Path=ParentProperty.ChildProperty,Mode=TwoWay}" Width="30"/> (Note: I'm not trying to do master-details or an...

.NET Dictionary as a Property

Can someone point me out to some C# code examples or provide some code, where a Dictionary has been used as a property for a Class. The examples I have seen so far don't cover all the aspects viz how to declare the dictionary as property, add, remove, and retrieve the elements from the dictionary. ...

Setting Label and StaticText Color property problem - Delphi 2009

When I set the Label's color e.g. on value clRed, the red on it only blink for a while. The color property still has clRed value, but in fact it has default clBtnFace color. Screenshot discribes the problem better. ...

How to create a property to store the index of the selected value from another property?

Hi everyone, I need help with the following problem: I have a class with two properties. private byte m_selectedValue; public byte SelectedValue { get { return m_selectedValue; } set { m_selectedValue = value; } } private string[] m_possibleValues; public string[] PossibleValues { get { return m_possibleValues; } set { m_poss...

Replace Field with Property using System.Reflection.Emit namespace???

I'm trying to figure out a way to use the Reflection.Emit namespace to remove a field and replace it with my own Property implementation. I've been reading on how to generate code using Emit and writing and compiling IL code directly, but I haven't seen any examples on how to do a replace or remove using the Reflection.Emit namespace; Ca...

Parsing a property file content to HTML

I have a property file( actually 100 or more). This is actually placed in one of the configuration folder so usually not been able to modify very often. So now we came up with an idea that the property file is parsed read and converted into meaningful HTML page .For example : forecast.allow.pattern.overrides = N. This property has 2 ...

Sharepoint Search Property Weighting

I'm using the code listed here: http://msdn.microsoft.com/en-us/library/ms553069.aspx With an additional line added as a call to .update() after the property is set in order to save the changes, but even with a weight of 10,000 the search results for my property are still at the bottom, particularly below title. Is there some other thi...

How do you get the Name of the Property

Possible Duplicate: Print property name (not what you would think) Possible Duplicate: Print property name (not what you would think) How do you get the name of the property from the property itself for example theres a property Myproperty and i want to get Name of Myproperty from the property Myproperty, something lik...

How to map a set of objects in Hibernate without primary keys being equally named?

I have a domain object class that represents a table. This class has an association to another table, but the source class' property is not named the same as the target class' property, and I'm not sure how to hibernate map it. Here is an example of the class to have the set (one CT to many R instances): public class CT { // This ...

Can't Set Property's Property

I am having trouble with, as I said, setting a property's property. Let's say I have a class that represents a transaction. In my class I have a property that represents another class, such as this: Public Class PersonRecord _myPerson = new Person() Public Property MyPerson as Person Get _myPerson = Person.GetApp...

C#: property/field namespace ambiguities

I get compile error because the compiler thinks Path.Combine refers to my field, but I want it to refer to class System.IO.Path. Is there a good way to handle this other than always having to write the FQN like System.IO.Path.Combine()? using System.IO; class Foo { public string Path; void Bar(){ Path.Combine("",""); } // compil...

Monkeypatching a method call in Python

How do I put off attribute access in Python? Let's assume we have: def foo(): ... class Bar: ... bar = Bar() Is it possible to implement Bar so that any time bar is accessed, a value returned by the callback foo() would be provided? bar name already exists in the context. That's why it's access semantic...

C# - get propery name inside setter

I want to preserve a property between postbacks in an ASP.Net application. Currently doing this: public int MyIndex { get { return (int)Session[ToString() + "MyIndex"]; } } but would prefer something like: public int MyIndex { get { return (int)Sessio...

WPF: refreshing a control with a bound property using Model View View-Model

Hey there, I am using the Model View View-Model pattern for a WPF app. I have a ViewModel (set as a pages DataContext) with two properties, one of which is an Entity with a PropertyChanged event. In the event handler i set the value of the other property (a boolean) to some value. Now the Button and TextBox properties are binding fine ...