Why do I never see the prototype property in JavaScript code I edit, from books and documentation I've read, it seems to be a cornerstone of the language.
I am working with WPF TreeView control. I am creating a hierarchical data structure and assigning it to ItemsSource and it will generate TreeviewItems automatically. By default I use IsExpanded of TreeViewItem to true. But in a particular case, I want to set IsExpanded property to false. So that treeview loading doesn't take time to generate all items. How can I set that in code since I don't have reference to TreeViewItem's instance at that time?
I have a Nhibernate mapping file for a simple user/role mapping.
Here are the mapping files:
Users.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Sample.Persistence" namespace="Sample.Persistence.Model">
<class name="User" table="Users">
<id name="UserKey">
<generator class="identity"/>
</id>
<property name="UserName" column="UserName" type="String" />
<property name="Password" column="Password" type="Byte[]" />
<property name="FirstName" column="FirstName" type="String" />
<property name="LastName" column="LastName" type="String" />
<property name="Email" column="Email" type="String" />
<property name="Active" column="Active" type="Boolean" />
<property name="Locked" column="Locked" type="Boolean" />
<property name="LoginFailures" column="LoginFailures" type="int" />
<property name="LockoutDate" column="LockoutDate" type="DateTime" generated="insert" />
<property name="Expired" column="Expired" type="Boolean" generated="insert"/>
<set name="Roles" table="UsersRolesBridge" lazy="false">
<key column="UserKey" />
<many-to-many class="Role"
not-found="exception"
column="RoleKey" />
</set>
</class>
</hibernate-mapping>
Role.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Sample.Persistence" namespace="Sample.Persistence.Model">
<class name="Role" table="Roles">
<id name="RoleKey">
<generator class="identity"/>
</id>
<property name="Name" column="Name" type="String" />
<set name="Users" inverse="true" atable="UsersRolesBridge" lazy="false" >
<key column="RoleKey" />
<many-to-many class="User" column="UserKey" />
</set>
</class>
</hibernate-mapping>
I am able to retrieve roles for each user via NHibernate but when I go to save a new object, the roles are not saved in the Bridge table.
The user is created and insert with no issues. I've checked that the Role collection, a field on the user, is being populated with the proper rolekey before the Session.Save() is called.
There is no exception thrown as well.
Hello,
I often hear a Model must be wrapped by a ViewModel that the View is not coupled to the Model/not aware of it.
With MVC it is common to bind the View to the Model... nobody complains so what ?
I am frightened of creating all that wrappers and doing nearly only duplicating property stuff.
I have a conceptual model in EDM where one of the entities has a property which is essentially a big value object whose properties aren't really useful as columns in the datamodel. I'd like to apply the Serialized LOB pattern to it so that I can fit it into a 192 byte binary column.
How do I map this in the EDM v4? Is it even possible at this time?
Actually, is it possible in any ORM?
I would like to give a property setter to a delegate. How is this done?
class A {
private int count;
public int Count {
get { return count; }
set { count = value; }
}
}
A a = new A();
delegate void ChangeCountDelegate(int x);
ChangeCountDelegate dlg = ... ? // should call a.Count = x
Hi all, i have a usercontrol.. and i'd like to set one of it's property's from the parent page and at the same time "reload" the usercontrol so it's updated.
formally the usercontrol was picking up a querystring parameter and setting itself up with the querystring parameter.. now i'd like to set this from within the parent page..
open to any suggestions. thanks!
I run into this frequently enough that I thought I'd see what others had to say about it.
Using the StyleCop conventions, I find that I often have a property name that is hard to make different than the class name it is accessing. For example:
public class ProjectManager
{
// Stuff here
}
public class OtherClass
{
private ProjectManager ProjectManager { get; set; }
}
It compiles and runs, but seems like it would be an easy way to confuse things, even with the use of "this".
The title ask it all : How to get all property names of a Groovy class?
Is it even possible? I thought I could use collection syntaxes with classes too be it don't seem to work.
Hi there,
I was just wondering if an attribute can be applied to a static class, method or property in c#? Like,
[MyAttribute]
public static MyMethods(string str) ...
Thanks
Ray.
In my code, is there a shorthand that I can use to assign a variable the value of a object's property ONLY if the object isn't null?
string username = SomeUserObject.Username; // fails if null
I know I can do a check like if(SomeUserObject != null) but I think I saw a shorthand for this kind of test.
I tried:
string username = SomeUserObject ?? "" : SomeUserObject.Username;
But that doesn't work.
If I am loading a view from another NIB, how do I set the File's Owner view property? IB is not letting me hook it up to my View Controller which is loading the external NIB.
My NIB looks like this:
File's Owner - Identity is set to LBRootViewController
First Responder
LBTableViewController - Identity is set to LBTableViewController, NIB Name is LBTableViewController
Put a textbox, a checkbox and a button on a website.
Set the "EnableViewState" property of textbox and checkbox to false.
Write something into textbox and check the checkbox.
Click the button.
Why is the textbox still written and the checkbox checked after response?
I have a property in a dto that I don't want the modelbinder/view to use the get on? Is there an attribute I can decorate it with to stop them from interrogating it?
Thanks
I'm trying to read property name but I'm not shore how.
Is it possible in ObjC to get string "theProperty" from self.theProperty?
I know how to read all properties (with "class_copyPropertyList") and their names (with "property_getName") but couldn't find a way to do something like:
NSString *text = [self.theProperty somehowReadThePropertyName];
// expected result is: text == @"theProperty"
Any ideas?
Hi. I don't have much experience with C# or VS, but I want to add a property table to a form, like this one:
So that columns are resizable, editable, of different types (e.g. checkbox for boolean) and sortable. How do I do that?
im trying to load an assembly nunit created in Monodevelop
Im using the software NUnit Test Case Code Generator for create unit testing
http://www.codeproject.com/Articles/28461/NUnit-Test-Case-Code-Generator
After compiling the project in MonoDevelop, loading file .dll of the proyect in Nunit Test case generator the following error appears:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Can you help me?
How to use margin as property of WPF usercontrol?
public Double pCusSPAge
{
get
{
return btnCusSPAge.Margin.Left;
}
set
{
btnCusSPAge.Margin = new Thickness(value);
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("pCusSPAge"));
}
}
In javascript you can detect if a property is defined by using the undefined keyword:
if( data.myProperty == undefined ) ...
How would you do this in C# using the dynamic keyword with an ExpandeObject and without throwing an exception ?
Most HTML elements have style properties associated with them - such a "color", "font-size" and "padding". These style properties have default values. For example the "color" style property associated with the "a" (anchor) element seems to have a default value of "#000066".
What are the default style properties values fo in HTML?
If I have a MovieClip with its "visible" property set to "false", would it aid performance to "stop()" its timeline? Or will that have no effect, since its not being rendered, anyway?
Occasionally I will know that there is a .NET Framework function that returns a particular type of object, but I can't recall the property or function name. It would be really nice to be able to somehow scan the Framework or other DLL for functions that return a particular type of object. (For example, it would have helped when I asked this question, and I have a similar question again.)
Can anyone suggest how I might do this?
Hey guys,
while surfing through the web and through stackoverflow.com i found many posts in forums, etc. where this message occures in IE but not in the other browsers. the thing is, the resolutions vary widely and it's not clear for me what's the best way to avoid this problem.
So my question is, if anybody knows exactly, specificly what this message
Object doesn't support this property or method
means, causes, says ,...
thanks for help.
helle
Hi,
what is DesignMode property? When it is useful? I don't understand it from msdn definition http://msdn.microsoft.com/en-us/library/system.web.ui.control.designmode.aspx
Some example? Thanks for answer.