property

Faster/better way to compare .NET References' properties?

I am in the process of upgrading an older component which shares references to custom assemblies of differing versions. To compare the properties of references from two different projects I have been copying and pasting the property values individually from the two different references to a text file for easier overview and comparison....

WPF IsReadOnly property Binding

Hello there. Is there any way I can bind some datacontext's property value to the IsReadOnly property? e.g: <toolkit:DataGridTemplateColumn Header="MyColumn" Width="160" IsReadOnly="{Binding Path=BooleanPropertyFromMyViewModel, Converter={StaticResource InvertBoolConv}}"/> Or should I create a DataTrigger? ...

accessing a static property via COM

is it possible to access a static property of a COM object without creating an instance of the object? my situation is this: i have an unmanaged application (written in delphi). this application exposes a COM-based plugininterface. until now i only wrote managed plugins in c#. plugins provide their info (name, author, ..) via a static p...

What's the best approach for readonly property

Hi, I'm using a model UserRepository->User The Repository is used to Save and Load the User. I want to be able to set the ID in the Repository, but I don't want it to be access by UI. The User and Repository are found in a Core project, and the UI in a Web. Is there a way to do this, like a modifier for the property, or should I put...

Bind to a property of a parent element in wpf

Hello all, 'I want to bind the Height property of the RichTextBox to the Height Property of the GridView`s Row. How can I do that? I do not know how to get the Row's Height as I can not access the Row in xaml what I would like to do. The Ancestor type should be GridViewHeaderRow , but I do not know its level... EDIT: <my:RadGridView ...

WPF C# how to create THIS binding in code?

I wonder, how to create this binding, since Line.X2 IS NOT dependency property! :( <Line Y1="0" X1="0" Y2="0" Stroke="Blue" StrokeThickness="3" Margin="0 -2 0 -2" X2="{Binding Path=RenderSize.Width, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type StackPanel}}}"/> ...

How do I set a property based on condition that a user has selected a feature in WIX?

I want to set a property to be used after the FeaturesDlg (the one with the feature tree) , based on condition that an user selected a feature or not. Is this possible? I've declared a new property, but I don't know how to set its value (that feature is enabled/disabled on feature tree). ...

Approach to side-effect-free setters

I would like to get your opinion on as how far to go with side-effect-free setters. Consider following example Activity activity; activity.Start = "2010-01-01"; activity.Duration = "10 days"; // sets Finish property to "2010-01-10" Note that values for date and duration are shown only for indicative purposes. So using setter fo...

Calling "Base-Getter" in Overriding Getter of Property

I have a base class "Parent" like this: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Parent { private int parentVirtualInt = -1; public virtual int VirtualProperty { get { return parentVirtualInt; ...

.Net Inherited Control Property Default

Hello fellows Im trying to make a simple "ButtonPlus" control. the main idea is to inherit from the button control and add some default property values (such as font,color,padding...) No matter how i try, the WinForm always generates (or "serializes") the property value in the client forms the whole point is to have minimal and clean c...

Are Python properties broken?

How can it be that this test case import unittest class PropTest(unittest.TestCase): def test(self): class C(): val = 'initial val' def get_p(self): return self.val def set_p(self, prop): if prop == 'legal val': self.val = prop ...

Javascript object list sorting by object property

I need to do this: (sorry not in javascript syntax-still learning object language :) ) object=car attibutes:top-speed, brand.... now I want to sort the list of those cars in order by top-speed, brand... How do I do this (please note the solution must be javascript only, no php or other stuff) ? ...

property names are different from original Object in the silverlight

Following is part of service layer which is provided by WCF service : [Serializable] public class WaitInfo { private string roomName; private string pName; private string tagNo; public string RoomName { get { return roomName; } set { this.roomName = value; } } public string PName { get { return...

Create UserControl DependencyProperty of which value can be chosen in dropdown list (as combo box)

Hello everybody, I'm a starter at WPF, now i would like to make a WPF userControl library which include a Rating bar userControl. All the steps of creating the rating Bar has been done, however i would like to add a property RatingValue: public static readonly DependencyProperty RatingValueProperty = DependencyProperty.Regi...

how to detect operating system language (locale) from java code

What is the correct way of knowing operating system language (locale) from java code? I have tried Locale.getDefault() System.getProperties("user.language") etc. but they are not correct nothing actually displays the "System Locale" which is available by the command "systeminfo" in windows. Please help. ...

C# Enum List/Collection on User/Web Control design time support?

I've been banging my head against a brick wall over this little problem since thursday and I'm still no nearer to an answer than I was back then. I have a user control which has a property like this: /// <summary> /// Gets or sets the media types. /// </summary> /// <value>The media types.</value> public List<MediaType> MediaTypesFilte...

How do I use a code behind property in a trigger to change a control property?

Hi, I am trying to do a fairly simple thing in my WPF application, or at least I think it's simple. I have a Window that contains an int property in the code behind. Let's call this one IntProperty. The Window implements the INotifyPropertyChanged interface and IntProperty fires the notification on change. It looks like this: ...

how can I get instance from the property.

In my application I have a class which has properties of user-defined types like this: class MyType { public A MyProperty { get; set; } } class A { .....some methods and proeprties } for some operations that I need to perform from my main program, I have created a List of A and add in to it MyProperty w...

How do I mock a class property with mox?

I have a class: class MyClass(object): @property def myproperty(self): return 'hello' Using mox and py.test, how do I mock out myproperty? I've tried: mock.StubOutWithMock(myclass, 'myproperty') myclass.myproperty = 'goodbye' and mock.StubOutWithMock(myclass, 'myproperty') myclass.myproperty.AndReturns('goodbye') ...

[MSBuild] Problem with setting properties 's values.

Let's consider the below example. There, I have: target MAIN call target t then call target tt. target t call target ttt, target tt call target tttt. target t define property aa, target ttt modify aa. target tttt try to print property aa 's value. in short we have: MAIN -> {t -> {ttt->modify aa, define aa}, tt -> tttt -> print aa} B...