properties

AdvancedDataGrid does not displays object properties

I read your matter and I wonder did you resolve it? If you found out, let me know and give mail for me. My mail is [email protected]. Thanks much! http://stackoverflow.com/questions/2298908/advanceddatagrid-does-not-displays-object-properties ...

C# Nested Property Accessing overloading OR Sequential Operator Overloading

Hey, I've been searching around for a solution to a tricky problem we're having with our code base. To start, our code resembles the following: class User { int id; int accountId; Account account { get { return Account.Get(accountId); } } } class Account { int accountId; OnlinePresence Presence { ...

How can I simulate the effects of an observable collection in this situation?

I am making a configuration editor for another application and am using reflection to pull editable fields from the configuration class. The following class is the base class for my various "DataTypeViewModels" and shows how I get and set the appropriate properties. public abstract class DataTypeViewModel<T> : ViewModelBase { Func<T...

What's the order of execution in property setters when using IDataErrorInfo?

Situation: Many times with WPF, we use INotifyPropertyChanged and IDataErrorInfo to enable binding and validation on our data objects. I've got a lot of properties that look like this: public SomeObject SomeData { get { return _SomeData; } set { _SomeData = value; OnPropertyChanged("SomeData"); } } Of course, I have an appropr...

UserControl Gridview extended with dinamic columns at same

Hi guys i'm with a doubt in asp.net webforms I'm creating a new user control "MyGrid" and i want a pager more dinamic than have: - 1stPage - prevPage - dropdown (with indices of the pages) - Label (telling the total of the pages) - nextPage - lastPage The user control is dont and implementation too, now i have the next problem: ...

Add properties to stdClass object from another object

I would like to be able to do the following: $obj = new stdClass; $obj->status = "success"; $obj2 = new stdClass; $obj2->message = "OK"; How can I extend $obj so that it contains the properties of $obj2, eg: $obj->status //"success" $obj->message // "OK" I know I could use an array, add all properties to the array and then cast t...

relating to objects inside an object

Got a problem, I have an an array of objects inside a constructor of a class. I'm trying to use the array to relate to a property in the object but I can't relate to them. lessonObjectsArray(0) = lessonObject1 lessonObjectsArray(1) = lessonObject2 lessonObjectsArray(2) = lessonObject3 the properties of the object "lesson...

How can I move my SVN working copy to Codeplex, maintainting file properties, but not history?

I am about to open-source one of my projects, and I want to move the current instance of it into CodePlex. How would I go about copying the current working directory into CodePlex's SVN, maintainting pile properties (like "svn:needs-lock" and "svn:mime-type"), without maintaining history? I don't want or need the history moved, I will ...

In Javascript convert a string so it can be used to call a property

So, I have an associative array and the keys in the array are properties of an object. I want to loop through the array and in each interation do something like this: Object.key This however does not work and results in returning undefined rather than the value of the property. Is there a way to do this? Thanks ...

Parsing files "/etc/default" using java

I'm trying to parse the configuration files usually found in /etc/default using java and regular expressions. So far this is the code I have iterating over every line on each file: // remove comments from the line int hash = line.indexOf("#"); if (hash >= 0) { line = line.substring(0, hash); } // create the patterns Pattern double...

Adding format to properties

I have an object with a couple of DateTime properties: public DateTime Start_Date { get; set; } public DateTime? End_Date { get; set; } I would like to set a format for each of these, along the lines of Start_Date.ToString("M/d/yyyy hh:mm tt") Do I have to code the get, or is there an elegant way to do this? ...

When is it better to use a method versus a property for a class definition?

Partially related to an earlier question of mine, I have a system in which I have to store complex data as a string. Instead of parsing these strings as all kinds of separate objects, I just created one class that contains all of those objects, and it has some parser logic that will encode all properties into strings, or decode a string ...

Use of type 'id' in cocoa class

Hey guys, I want to implement a class which can be used by two classes of my project. One is manipulating 'NewsRecord' objects. One is manipulating 'GalleriesRecord' objects. In another class, I may use one of the two objects so i do something like that : // header class id myNewsRecordOrGalleriesRecord; // class.m // NewsRecord an...

attaching id to a movieclip

I have a loop that creates mc from a database for (var i:Number = 0; i < t.length; i++) { var portfolioItem:PortfolioItem = new PortfolioItem(); addChild(portfolioItem); portfolioItem.name = t[i][0]; portfolioItem.addEventListener(MouseEvent.CLICK, getThisName); } public function getThisName(evt:Event) { trace(evt.target.name); } I...

MATLAB: Can axes tick labels be accesed as text objects?

I'm curious is it possible to change text properties of tick labels independently of axes properties. Do they have handles? I'd like to control their position better, alignment, color, fonts, etc. I know I can substitute them with text labels, but it has some drawbacks. Any alternative solutions? Particularly, is it possible to put xtic...

How can I add an Items-like property to my User Control?

It's pretty straightforward to add simple properties to a User Control that will appear in the desired categories in the Windows Forms designer, e.g.: [Category("Appearance")] public Color BackColor { get { return _textBox.BackColor; } set { _textBox.BackColor = value; } } What if I want to expose a more complex property, such...

Question about C# properties

Hey there, i bumped the other day into a little problem regarding C#'s properties. Let's say i do have this setup: public class Point { public float X; public float Y; } public class Control { protected Point m_Position = new Point(); public Point Position { get { return m_Position; } set { m_Position = value; } ...

readonly property setter

Hi Everyone After a extensive debugging session I found that the problem was that I called the setter of a readonly property. Is there a trick to provoke a compiler warning when this happens? Because marking the setter private does not work. Cheers, CA To make clear what I mean: private readonly List<SomeObject> _budget; p...

C# - Recursive / Reflection Property Values

What is the best way to go about this in C#? string propPath = "ShippingInfo.Address.Street"; I'll have a property path like the one above read from a mapping file. I need to be able to ask the Order object what the value of the code below will be. this.ShippingInfo.Address.Street Balancing performance with elegance. All object gr...

Is it possible to set properties on a Mock Object in Simpletest

I normally use getter and setter methods on my objects and I am fine with testing them as mock objects in SimpleTest by manipulating them with code like: Mock::generate('MyObj'); $MockMyObj->setReturnValue('getPropName', 'value') However, I have recently started to use magic interceptors (__set() __get()) and access properties like so...