Beispiel #1
0
        private void readProperties(List <SprIndexedAccessor> list, TItem target)
        {
            ISpmUpdateProperties write = target as ISpmUpdateProperties;

            if (write != null)
            {
                write.BeginUpdateProperties();
            }
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Accessor.Read(this.context, list[i].Index, target);
            }
            if (write != null)
            {
                write.EndUpdateProperties();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Скопировать размеченные свойства элемента source в элементе dest
        /// </summary>
        /// <param name="source">Исходные элемент</param>
        /// <param name="dest">Целевой элемент</param>
        /// <param name="group">Группа, если null, то все размеченные свойства</param>
        public static void Copy(TItem source, TItem dest, string group = null)
        {
            ISpmUpdateProperties write = dest as ISpmUpdateProperties;
            ReadOnlyCollection <ISpmAccessor <TItem> > coll = SpmAccessors <TItem> .Collection;

            if (write != null)
            {
                write.BeginUpdateProperties();
            }
            for (int i = 0; i < coll.Count; i++)
            {
                if (coll[i].Mapped.InGroup(group))
                {
                    coll[i].Copy(source, dest);
                }
            }
            if (write != null)
            {
                write.EndUpdateProperties();
            }
        }