property

Removing Message from Queue only if user does some operation

We are having MVC application which reads data from MSMQ. We are trying to find out a way to read message from queue and remove it from queue only if user has done a successful operation on the queue. The message should remain in the queue until user completes the processing, the message should not be available to anyone else until the u...

WPF Custom Control and exposing properties thru DependencyProperty

Ok - I'm pulling my hair out over what I thought was a simple scenario: create a custom Label for bilingual use that contained two additional properties (EnglishText, FrenchText). Currently its structured like this: Public Class myCustomLabel Inherits System.Windows.Controls.Label Public myEnglishTextProperty As DependencyProp...

How to grab property list file created in Xcode?

I am having a hard time figuring out how to get the property list file that was created using Xcode. I created a property list file using array with NSString members. I want to grab that file and get all the NSString members and save it to a UITextField. But my problem is that I can't see that file. I don't know if I'm looking in the wro...

ASP.NET user control: Page_Load fires before property is set

This is driving me crazy. I have a very simple user control: public int? ImageId {set; get;} protected void Page_Load(object sender, EventArgs e) { ... do something with ImageId... } And then I put this control on the page with ListView within UpdatePanel: <asp:ListView ID="ListViewImages" runat="server" DataSourceID="src"> ...

Best practice: Accessor properties or parameterless methods?

Which is the better practice and why? bool IsTodayMonday { get { return DateTime.Now.DayOfWeek == DayOfWeek.Monday; } } Or bool IsTodayMonday() { return DateTime.Now.DayOfWeek == DayOfWeek.Monday; } ...

Strange Property Override in DataGridViewTextBoxCell.

If you look at the DataGridViewTextBoxCell property, ValueType, in reflector, you can see it overrides a property from DataGridViewCell. The strange thing is, is that the overriden property is readonly, but the property in the parent class is read and write. I can only presume that the property has been shadowed and reflector doesn't ....

Toggle BorderStyle with a method. C#

Does anybody know how I can write "cardImage1.BorderStyle = BorderStyle.Fixed3D;" without having to explicitly declare "cardImage1"? I'm trying to put it into a method so that I don't need to write the code to toggle between two Border Styles when a Picture Box is clicked, for every single single picture box (there are 52!) e.g. for e...

C# - Property Clarification

According to the definition : "As interface is not an object by itself ,I can't initialize it.If interface were allowed to declare fileds, then it needs storage location,so we can not declare fields inside interface." Incase of property say example when i declare string SayHello { get; set; } inside the interface It is in...

What is the c# equivalent of this weird VB syntax for property?

I found the following syntax as a VB.NET property and I'm trying to convert it to c#, but I'm not sure how to accomplish that. Public Property SomeText(ByVal someEnumThing as SomeEnum) As String Get Select Case someEnumThing //figure out what string to return End Select End Get Set(ByVal Value as ...

ASP.Net MVC How to display an image property of a model in a view ?

I'm new to asp.net mvc, but I'm trying to do an funny app with GDI+ and I need to do some image view with asp.net mvc. I have a Model which has an image property: namespace DomainModel.Entities { public class BackgroundImage { // Properties public Image Image {get; private set; } public BackgroundImage(...

Binding Component <-> Container (Enabled property)

Hi everyone, I'm just trying to work out the best way to replicate a pretty useful feature of Windows' Forms.Panel in Java. Basically, when you disable a Windows Forms.Panel, all child control's are set to disabled too. However, their enabled property is preserved such that, when the the Panel is enabled again, any child control that wa...

C# checkboxes - Can I clean this up?

Hi all... This function is called from the form_onload. I am basically reading the registry, determining which checkboxes are checkmarked, and then reflecting that in the GUI. Is there any way to condense this and write better code? How about using CheckState property? Thanks. Woody private void checkExcelSettings() { //...

get text of linklabel created at runtime

hello, can someone please explain to me how i can get the Text property of the linklabel that i have created at runtime? I have tried: string str = e.Link.LinkData; ...but that just displays an empty messagebox. Thanks lots :) ...

C# creating attribute that indicate running code after property call

Hello, I would like to create an Attribute to put on properties. The properties that will contains this attribute will execute another method after setting a new value. For example: [MethodExecute(Log)] [MethodExecute(Save)] public string Name { get { return name; } set ...

Accessing ServletContext outside of a servlet

Hello I wonder if anyone can advise on a Java webapp question? I have a set standard Java class which has methods to set and get values of a property file. These methods are used system wide and are called by servlets and non-servlet class methods alike. But what I would like to do is to use a ServletContextListener to set the paths ...

Weird result comparing property values using reflection

Can someone explain why this is occurring? The code below was executed in the immediate window in vs2008. The prop is an Int32 property (id column) on an object created by the entity framework. The objects entity and defaultEntity were created using Activator.CreateInstance(); Convert.ChangeType(prop.GetValue(entity, null), prop.Prop...

Overloading Getter and Setter Causes StackOverflow in C#

I am not sure what is causing the StackOverflowException when I try to overwrite a get and set function. When I just use the default get and set it works. enum MyEnumType { .... } public MyEnumType data { get; set; } But when I try to add additional data, it throws a StackOverflowException public MyEnumType data { get { re...

How to pass a property from an ASP.Net page to a user control

I have created a user control which exposes a custom type property called SoftwareItem. The page where I have placed this user control has a page property of the same type. I cannot figure out how to pass the page's property to the user control. I understand that this can be done in the code_behind but wanted to set the property declarat...

How to create Public String property with drop-down list of options?

Is it possible to attach a List of strings to a String property so that the user can select one of the strings from the Properties window? Should I implement ICollection or something of that sort? ...

.NET valid property names

Where is the documentation for valid property names in .NET? Obviously things like space, * or & aren't valid in a property name, but where is this documented? ...