public DomainEnumPropertyDescriptor(ElementTypeDescriptor owner, ModelElement modelElement, DomainPropertyInfo domainProperty, DomainEnumeration domainEnum, Attribute[] attributes) : base(owner, modelElement, domainProperty, attributes) { this.domainEnum = domainEnum; System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>(); foreach(EnumerationLiteral enumerationLiteral in this.domainEnum.Literals) list.Add(enumerationLiteral.Name); enumFields = list.AsReadOnly(); }
public DomainEnumPropertyDescriptor(ElementTypeDescriptor owner, ModelElement modelElement, DomainPropertyInfo domainProperty, DomainEnumeration domainEnum, Attribute[] attributes) : base(owner, modelElement, domainProperty, attributes) { this.domainEnum = domainEnum; System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); foreach (EnumerationLiteral enumerationLiteral in this.domainEnum.Literals) { list.Add(enumerationLiteral.Name); } enumFields = list.AsReadOnly(); }
/// <summary> /// Returns the names of the files in the specified directory that fit the selection /// criteria specified in the FileSelector, optionally recursing through subdirectories. /// </summary> /// /// <remarks> /// This method applies the file selection criteria contained in the FileSelector to the /// files contained in the given directory, and returns the names of files that /// conform to the criteria. /// </remarks> /// /// <param name="directory"> /// The name of the directory over which to apply the FileSelector criteria. /// </param> /// /// <param name="recurseDirectories"> /// Whether to recurse through subdirectories when applying the file selection criteria. /// </param> /// /// <returns> /// An collection of strings containing fully-qualified pathnames of files /// that match the criteria specified in the FileSelector instance. /// </returns> public System.Collections.ObjectModel.ReadOnlyCollection <String> SelectFiles(String directory, bool recurseDirectories) { if (_Criterion == null) { throw new ArgumentException("SelectionCriteria has not been set"); } var list = new System.Collections.Generic.List <String>(); try { if (Directory.Exists(directory)) { String[] filenames = System.IO.Directory.GetFiles(directory); // add the files: foreach (String filename in filenames) { if (Evaluate(filename)) { list.Add(filename); } } if (recurseDirectories) { // add the subdirectories: String[] dirnames = System.IO.Directory.GetDirectories(directory); foreach (String dir in dirnames) { list.AddRange(this.SelectFiles(dir, recurseDirectories)); } } } } // can get System.UnauthorizedAccessException here catch (System.UnauthorizedAccessException) { } catch (System.IO.IOException) { } return(list.AsReadOnly()); }
public virtual System.Collections.Generic.IList <Term[]> GetTermArrays() { return(termArrays.AsReadOnly()); }
static int _m_AsReadOnly(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Collections.Generic.List <XLua.LuaTable> gen_to_be_invoked = (System.Collections.Generic.List <XLua.LuaTable>)translator.FastGetCSObj(L, 1); { System.Collections.ObjectModel.ReadOnlyCollection <XLua.LuaTable> gen_ret = gen_to_be_invoked.AsReadOnly( ); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
/// <summary> /// Returns the names of the files in the specified directory that fit the selection /// criteria specified in the FileSelector, optionally recursing through subdirectories. /// </summary> /// /// <remarks> /// This method applies the file selection criteria contained in the FileSelector to the /// files contained in the given directory, and returns the names of files that /// conform to the criteria. /// </remarks> /// /// <param name="directory"> /// The name of the directory over which to apply the FileSelector criteria. /// </param> /// /// <param name="recurseDirectories"> /// Whether to recurse through subdirectories when applying the file selection criteria. /// </param> /// /// <returns> /// An collection of strings containing fully-qualified pathnames of files /// that match the criteria specified in the FileSelector instance. /// </returns> public System.Collections.ObjectModel.ReadOnlyCollection<String> SelectFiles(String directory, bool recurseDirectories) { if (_Criterion == null) throw new ArgumentException("SelectionCriteria has not been set"); var list = new System.Collections.Generic.List<String>(); try { if (Directory.Exists(directory)) { String[] filenames = System.IO.Directory.GetFiles(directory); // add the files: foreach (String filename in filenames) { if (Evaluate(filename)) list.Add(filename); } if (recurseDirectories) { // add the subdirectories: String[] dirnames = System.IO.Directory.GetDirectories(directory); foreach (String dir in dirnames) { if (this.TraverseReparsePoints || //TODO isn't this a bug? Shouldn't this be Directory.GetAttributes anyway? ((File.GetAttributes(dir) & FileAttributes.ReparsePoint) == 0)) { // workitem 10191 if (Evaluate(dir)) list.Add(dir); list.AddRange(this.SelectFiles(dir, recurseDirectories)); } } } } } // can get System.UnauthorizedAccessException here catch (System.UnauthorizedAccessException) { } catch (System.IO.IOException) { } return list.AsReadOnly(); }