Пример #1
0
 /// <summary>
 ///   子要素とセッターのペアを列挙します。
 /// </summary>
 /// <returns> 子要素 </returns>
 public virtual IEnumerable <ElementReference> ElementReferences()
 {
     return(PropertyInfos.Select(
                p => ElementReference.Create(
                    () => (UnifiedElement)p.GetValue(this, null),
                    e => p.SetValue(this, e, null))));
 }
Пример #2
0
        private string GetFields(FieldTypes fieldType)
        {
            string returnValue = null;

            switch (fieldType)
            {
            case FieldTypes.Fields:
                // Concatenated fields for SELECT command
                returnValue = string.Join(", ", PropertyInfos.Select(p => string.Format("[{0}]", p.Name)).ToArray()); break;

            case FieldTypes.Values:
                // Concatenated fields for INSERT command
                returnValue = string.Join(", ", PropertyInfos.Select(p => string.Format("@{0}", p.Name)).ToArray()); break;

            case FieldTypes.Updates:
                // Concatenated fields for UPDATE command
                returnValue = string.Join(", ", PropertyInfos.Where(p => p.Name != this.IdField).Select(p => string.Format("[{0}] = @{1}", p.Name, p.Name)).ToArray()); break;
            }

            return(returnValue);
        }
Пример #3
0
 private string[] GetProperties()
 {
     // Create array of property names for DirectorySearcher.PropertiesToLoad.AddRange(string[])
     return(PropertyInfos.Select(p => p.Name).ToArray());
 }