Exemplo n.º 1
0
 private void Init()
 {
     this.drawer.onAddCallback         = _OnAdd;
     this.drawer.drawHeaderCallback    = DrawHeader;
     this.drawer.drawElementCallback   = _DrawItem;
     this.drawer.onReorderCallback     = Reorder;
     this.drawer.elementHeight         = HEIGHT;
     this.drawer.elementHeightCallback = GetElementHeight;
     this.drawer.onRemoveCallback      = OnRemove;
     this.createItem = CreateItem;
     this.drawItem   = DrawItem;
 }
        public static void CreateItem(AppId_t GameAppId, CreateItemDelegate InCreateItemDelegate)
        {
            CreateItem_delegate = InCreateItemDelegate;
            SteamAPICall_t hSteamAPICall = SteamUGC.CreateItem(GameAppId, EWorkshopFileType.k_EWorkshopFileTypeFirst);

            if (hSteamAPICall != SteamAPICall_t.Invalid)
            {
                m_CreateItemResultCallback.Set(hSteamAPICall, null);
            }
            else
            {
                CreateItem_delegate(EResult.k_EResultFail, false, default(PublishedFileId_t));
            }
        }
Exemplo n.º 3
0
        private void AddItem <T> (
            Dictionary <Guid, T> dictionary,
            XmlNode parentNode,
            string xpath,
            XmlNamespaceManager namespaceManager,
            CreateItemDelegate <T> createItemDelegate) where T : MetadataObject
        {
            XmlNodeList itemNodes = parentNode.SelectNodes(xpath, namespaceManager);

            foreach (XmlNode itemNode in itemNodes)
            {
                T item = createItemDelegate(namespaceManager, itemNode);
                dictionary.Add(item.MetadataItemID, item);
            }
        }
Exemplo n.º 4
0
        protected virtual TLIST ReadList <TLIST, TITEM>(ref TLIST list, CreateListDelegate <TLIST, TITEM> listCreate, CreateItemDelegate <TITEM> itemCreate, ReadItemDelegate <TITEM> itemReader) where TLIST : List <TITEM>
        {
            int count = Reader.ReadInt32();

            list = listCreate(count);
            for (int i = 0; i < count; i++)
            {
                var item = itemCreate();
                itemReader(ref item);
                list.Add(item);
            }
            return(list);
        }