readonly

How to implement a read-only member variable in PHP?

When trying to change it,throw an exception. ...

Do not declare read only mutable reference types - why not?

I have been reading this question and a few other answers and whilst I get the difference between changing the reference and changing the state of the current instance I'm not certain why this means that I shouldn't mark it readonly. Is this because marking something as readonly tells the compiler something special about the instance an...

jQuery inconsistency in setting readonly attribute in IE-8 and FF-3.5.8

This is my code inside document.ready: var $inputs = mySelectors(); $inputs.each(function() { $(this).attr("readonly", "true"); }); This code works for IE8, but not for FF3.5 IE output(as seen with IE Developer toolbar)<input type="text" readOnly="readonly"..../> FF output (seen with Firebug) <input type="text" readonly=""> What i...

How to make a RichTextBox Transparent as well as Read-only Silverlight

As soon as i set the readonly property to true,the Transparency of the RichTextBox becomes greyish, so my RichTextBox no longer looks transparent. ...

SQL Server 2005: how to copy database from one server to another (manually/programmatically)

I am developing an ASP.NET-app which uses an SQL2005-DB - and from time to time I need to copy the db from the dev-environment to test or production - or vice-versa. With SQL2000, I had written some batches to do that, but haven't had the time yet to find out how to do that under 2005, and did it manually. In SQL Mgmnt Studio, I would de...

How can you make a variable/Object read only in Javascript?

Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object that I only want to be defined when constructed. How can I prevent the Object reference from being changed? ...

Implementing Read Only view in Winform App

I have an in house winform app for viewing, editing, and inserting member data. There are about 40 sepertate form pages that they use to manipulate different portions of the data. My question is this; What is the best way of implementing a read only view for a form page? My thoughts were to cycle through the controls setting Enabled ...

How do I make MFC checkbox read-only but keep text enabled?

It seems that disabling a checkbox through the Disabled property also grays out the caption. Does anyone know how to keep the caption enabled but disable input? EDIT Based on Paul's idea, I've done the following (now that I figured out that the static label and checkbox has a transparent property). Added a couple checkboxes. Set the...

Is read-only auto-implemented property possible?

Hello. I found a topic on MSDN that talks that yes, this is possible. I did a test that seems to break this statement: using System; namespace Test { class Program { static void Main(string[] args) { Foo f = new Foo("1"); Console.WriteLine(f.Bar); // prints 1 f.Test("2"); ...

Infragistics WebScheduleInfo Sample code

I am working with Infragistics35.WebUI.WebSchedule.v8.2. I am not seeing any good documentation on this on the Infragistics Web site. Does anyone have any sample code I could see? I am trying to create a week view of the calendar. One that "Admins" can edit and the rest of the users can only view. I would love to have a different db...

How do you create a unit-testing stub for an interface containing a read-only member?

I am writing some unit tests for an extension method I have written on IPrincipal. To assist, I have created a couple of helper classes (some code for not-implemented members of the interfaces has been omitted for brevity): public class IPrincipalStub : IPrincipal { private IIdentity identityStub = new IIdentityStub(); public ...

Disable Drag-drop from TextBox

I have a WPF textBox that is declared as ReadOnly <TextBox IsReadOnly="True" IsTabStop="False" Width="200" /> So, User can not write anything into the TextBox or delete the content but it still allows user to drag the text from this textbox and drop it in any other textbox that caused the text removed from the first textbox(the read-o...

Determining if a SQL Server table is read-only

What's the best way to determine if a given SQL Server table is readonly, either because of account permissions or the database being marked as read-only? ...

C# - Making fields/properties read only conditionally

I have three classes; Classes A and B both reference class C. How can I make it so members of class C can be modified when referenced from class A but not modified when referenced from class B? IE, the following should be possible; classA myClassA = new classA(); myClassA.myClassC.IssueNumber = 3; But this should not be possible; c...

How to exclude read only fields using :input in jquery?

hi guys, thus far i've only been using some basic jquery selectors and functions. but i'm looking at this clear form function and i can't figure out how to add it so i can remove hidden inputs and readonly input from getting cleared. can anybody help? thanks. function clearForm(form) { // iterate over all of the inputs for the form ...

MOSS - Create folder with read only..

The following works. How do I add ReadOnly = true to this newly created folder (Item. Folder. ReadOnly) SPListItem myItem = properties.ListItem; SPList documentLibrary = myItem.ParentList; SPListItem folder = documentLibrary.Folders.Add(documentLibrary .RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, "My New Folder"); fol...

In Mscrm 4.0 how can a form be readonly, including the relationship link

In MS CRM 4.0 how can a form be readonly, including the relationship link. Clicking the link must show readonly forms of related entities as well (if main entity is readonly even realtions must appear as readonly whereas its not.). ...

Adobe AIR - Write a file and specify as read-only

Hey Stack Overflow community, Another Adobe AIR question for you: Can we write files to the file system and leave them as read-only in Adobe AIR? In the future, we would overwrite these files (or delete them and write a new one). Thanks, Mauricio Update: I tried the following approach, but I was still able to open the file, edit,...

What is a read only collection?

I ran a security code analyst i found myself having a CA2105 warning. I looked at the grade tampering example. I didn't realize you can assign int[] to a readonly int. I thought readonly was like the C++ const and makes it illegal. The How to Fix Violations suggest i clone the object (which i don't want to do) or 'Replace the array with...

Does the order of readonly variable declarations guarantee the order in which the values are set?

Say I were to have a few readonly variables for filepaths, would I be able to guarantee the order in which the values are assigned based on the order of declaration? e.g. static readonly string basepath = @"my\base\directory\location"; static readonly string subpath1 = Path.Combine(basepath, @"abc\def"); static readonly string subpath2...