Exemplo n.º 1
0
 /// <summary>
 /// Копирование элентов в коллекцию.Ф
 /// </summary>
 public void CopyTo(DBInterfaceItemBases dbRecieves)
 {
     foreach (DBInterfaceItemBase item in this)
     {
         dbRecieves.Add(item);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Поиск определенного типа во всех привязанных XPCollection.
 /// </summary>
 public static bool IsUsedXPCollection(DBInterfaceItemBases itemsSeq, Type type)
 {
     foreach (DBInterfaceItemBase item in itemsSeq)
     {
         if (item is DBInterfaceItemXPObject)
         {
             DBInterfaceItemXPObject xpItem = (DBInterfaceItemXPObject)item;
             if (xpItem.DataSource is XPCollection &&
                 ((XPCollection)xpItem.DataSource).ObjectType == type)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Поиск неиспользуемых объектов коллекции.
        /// </summary>
        public XPCollectionContainer FindUnuseCollections(DBInterfaceItemBases itemsSeq, object collectionExept)
        {
            XPCollectionContainer unuses = new XPCollectionContainer();

            foreach (XPCollection collection in this)
            {
                if (collection != collectionExept)
                {
                    if (collection.ObjectType == null)
                    {
                        unuses.Add(collection);
                    }

                    if (!IsUsedXPCollection(itemsSeq, collection.ObjectType))
                    {
                        unuses.Add(collection);
                    }
                }
            }
            return(unuses);
        }
        /// <summary>
        /// Изменение позиции записи в дереве.
        /// </summary>
        private void SetNodeIndex(int inc)
        {
            if (treeExist.Selection.Count > 0)
            {
                TreeListNode node  = treeExist.Selection[0];
                int          index = treeExist.GetNodeIndex(node);
                treeExist.SetNodeIndex(node, index + inc);

                TableMemberInfo tmInfo = treeExist.GetDataRecordByNode(node) as TableMemberInfo;
                if (tmInfo != null && tmInfo.Item != null)
                {
                    DBInterfaceItemBases dbItems = tmInfo.Item.Owner;
                    if (0 <= index + inc && index + inc < dbItems.Count)
                    {
                        DBInterfaceItemBases dbBuffs = new DBInterfaceItemBases();
                        dbItems.CopyTo(dbBuffs);
                        dbItems.Clear();
                        dbBuffs.Change(index, index + inc);
                        dbBuffs.CopyTo(dbItems);
                        //dbItems.CorrectVisibleIndex();
                    }
                }
            }
        }
Exemplo n.º 5
0
 public DBInterfaceItemXPComplex()
 {
     _Items = new DBInterfaceItemBases(this, true);
 }