

A child resource is not included in the result if the user in theĬontext does not have read permission for the properties (this is true if at least one parameter is used (not null) getChildrenCount int getChildrenCount(boolean visible,.Is false), false: visibility check is disabled and both visible and hidden resources are selected collections - true: activate check for collections and only collections are selected (links to collectionĪre also included regardless of links flag), false: check for collections is disabled links - true: activate check for links and only link resources are selected, false: check for links is disabled Returns: A list of resources Throws: ResourceException AccessDeniedException - If the resource is locked, readonly or If all filter check are disabled this method is equivalent to ICollection.getChildren() Parameters: visible - true: activate visibility check and only visible resource are selected (system property "hidden" Note that if collections check is active links to collection will be included regardless of the link flag value. Filter checks are active for visibility,Ĭollections and link if corresponding flag is set to true. Returns a filtered list of the resources in this collection. IResource as, checkIn, checkIn, checkIn, checkIn, checkOut, copy, copy, copy, copy, delete, deleteProperty, enableVersioning, getAccessRID, getAccessURI, getCheckedOutResources, getContent, getContent, getContext, getCreatedBy, getCreationDate, getDescription, getDisplayName, getDisplayName, getETag, getInheritedProperty, getLanguage, getLastModified, getLastModifiedBy, getLinkType, getLockByToken, getLocks, getName, getParentCollection, getProperties, getProperties, getProperty, getRepositoryManager, getResourceType, getRevisionID, getRID, getSupportedEvents, getSupportedOptions, getTargetResource, getTargetURL, getUnfilteredContent, getUnfilteredContent, getURI, getVersionHistory, isA, isCheckedOut, isCollection, isHidden, isLocked, isLockedByMe, isReadOnly, isRevision, isVersioned, lock, lock, move, move, move, move, refreshLock, rename, search, setAsCurrentVersion, setLinkType, setProperties, setProperties, setProperty, setTargetURL, undoCheckOut, unlock, update, updateContent ForEach(), you will need to convert it to List: ((List)Strings).ForEach(Console.WriteLine) īut it's a small price to pay for migratability. Of course, because your type is IEnumerable rather than a specific implementation, if you want to access methods specific to List such as. If you want to populate it as a list, just change up the new string for new List a la: private static readonly ICollection Strings =

String is automatically inferred from the contents of the array initializer.

Notice the missing "string" type in the second line line. In 3.5 though you can use type inference so you no longer need to use the string array which removes even more keystrokes: private static readonly ICollection Strings = Works in 2.0 and 3.5, I tested it just to be doubly sure. This both declares and populates the new readonly collection with the item list in one go. This can be done using an array literal (written over two lines to prevent scrolling): private static readonly ICollection Strings =
#ICOLLECTION CODE#
If I fully understand your question, it seems some others have missed the point, you're looking to create a static collection in a similar manner to Java in that you can declare and populate in a single line of code without having to create a dedicated method to do this (as per some of the other suggestions).
