コード例 #1
0
 /// <summary>
 /// Sets up this game object list for working with our editor
 /// </summary>
 public void Init(UpdateToolstripDelegate updateToolStripHandler, UpdateItemDelegate updateItemHandler, ToolstripButtonClickDelegate newDelegate,
                  ToolstripButtonClickDelegate copyDelegate, ToolstripButtonClickDelegate undoDelegate, ToolstripButtonClickDelegate pasteDelegate, ToolstripButtonClickDelegate deleteDelegate)
 {
     FocusChangedHandler       = updateToolStripHandler;
     UpdateItemHandler         = updateItemHandler;
     ToolStripItemNew_Click    = newDelegate;
     ToolStripItemCopy_Click   = copyDelegate;
     ToolStripItemPaste_Click  = pasteDelegate;
     ToolStripItemUndo_Click   = undoDelegate;
     ToolStripItemDelete_Click = deleteDelegate;
 }
コード例 #2
0
        public bool UpdateItem(T search, UpdateItemDelegate foundItemFunc)
        {
            bool result = false;

            foreach (var item in m_List)
            {
                if (foundItemFunc != null && item.Equals(search))
                {
                    foundItemFunc(item);
                    result = true;
                }
            }
            return(result);
        }
コード例 #3
0
        /// <summary>
        /// Public constructor for direct use of this class.
        /// </summary>
        /// <param name="compareItemsCallback">Delegate for comparing identity of items in the source and destination collections.</param>
        /// <param name="addItemCallback">Delegate for adding items to the destination collection.</param>
        /// <param name="updateItemCallback">Delegate for updating items in the destination collection, or null if items should not be updated.</param>
        /// <param name="removeCallback">Delegate for removing items from the destination collection, or null if items should not be removed.</param>
        public CollectionSynchronizeHelper(
            CompareItemsDelegate compareItemsCallback,
            AddItemDelegate addItemCallback,
            UpdateItemDelegate updateItemCallback,
            RemoveItemDelegate removeCallback)
        {
            _compareItemsCallback = compareItemsCallback;
            _addItemCallback      = addItemCallback;
            _updateItemCallback   = updateItemCallback;
            _removeItemCallback   = removeCallback;

            _allowUpdate = _updateItemCallback != null;
            _allowRemove = _removeItemCallback != null;
        }
コード例 #4
0
        protected void UpdateItem(int p_nIndex, string p_strName, string p_strPath, InstallState p_state, string p_strMsg)
        {
            if (this.InvokeRequired)
            {
                UpdateItemDelegate d = new UpdateItemDelegate(UpdateItem);
                this.Invoke(d, new object[] { p_nIndex, p_strName, p_strPath, p_state, p_strMsg });
                return;
            }
            else
            {
                ListViewItem item = this.listView1.Items[p_nIndex];
                item.Text             = p_strName;
                item.SubItems[1].Text = p_strPath;
                item.SubItems[2].Text = p_state.ToString();
                item.SubItems[3].Text = p_strMsg;

                this.listView1.EnsureVisible(p_nIndex);
            }
        }
コード例 #5
0
        public static bool UpdateItem(AppId_t GameAppId, PublishedFileId_t ItemToUpdate, bool bIsNewItem, string foldername, string previewfilename, string title, string tags, string description, UpdateItemDelegate InUpdateItemDelegate)
        {
            UpdateItem_delegate = InUpdateItemDelegate;
            hUpdate             = SteamUGC.StartItemUpdate(GameAppId, ItemToUpdate);
            if (title == "")
            {
                ErrorMessage = "No title was provided.";
                return(false);
            }
            if (tags == "")
            {
                ErrorMessage = "No tags were provided.";
                return(false);
            }
            if (description == "")
            {
                ErrorMessage = "No description was provided.";
                return(false);
            }
            string[]      tags_array = tags.Split(' ');
            List <string> tags_list  = new List <string>(tags_array);

            SteamUGC.SetItemTitle(hUpdate, title);
            SteamUGC.SetItemTags(hUpdate, tags_list);
            SteamUGC.SetItemDescription(hUpdate, description);
            if (bIsNewItem)
            {
                SteamUGC.SetItemVisibility(hUpdate, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate);
            }
            SteamUGC.SetItemContent(hUpdate, foldername);
            SteamUGC.SetItemPreview(hUpdate, previewfilename);
            SteamAPICall_t hSteamAPICall = SteamUGC.SubmitItemUpdate(hUpdate, "");

            if (hSteamAPICall != SteamAPICall_t.Invalid)
            {
                m_SubmitItemUpdateResultCallback.Set(hSteamAPICall, null);
            }
            else
            {
                UpdateItem_delegate(EResult.k_EResultFail);
            }
            return(true);
        }
コード例 #6
0
 private void UpdateItemSafe(VideoListItem item)
 {
     if (lvActiveDownloads.InvokeRequired)
     {
         var d = new UpdateItemDelegate(UpdateItemSafe);
         lvActiveDownloads.Invoke(d, new object[] { item });
     }
     else
     {
         item.SubItems[1].Text = ((Video)item.Tag).getName();
         item.SubItems[2].Text = ((Video)item.Tag).getSizeForUpdate();
         item.SubItems[4].Text = ((Video)item.Tag).getSpeedForUpdate();
         item.SubItems[5].Text = AllUserConfig.languageRM.GetString("status" + ((Video)item.Tag).getStatus());
         item.SubItems[6].Text = ((Video)item.Tag).getETAForUpdate();
         item.PB.changeValue(((Video)item.Tag).getProgress(), ((Video)item.Tag).getStatus());
         item.PB.DrawToBitmap(item.PBBitmap, progressBarBounds);
         progressBars.Images[progressBars.Images.IndexOfKey(item.ImageKey)] = item.PBBitmap;
     }
 }
コード例 #7
0
 /// <summary>
 /// 移除更新监听者。
 /// </summary>
 /// <param name="listener">监听者。</param>
 public void RemoveItemUpdateListener(UpdateItemDelegate listener)
 {
     OnItemUpdate -= listener;
 }
コード例 #8
0
 /// <summary>
 /// 添加更新监听者。
 /// </summary>
 /// <param name="listener">监听者。</param>
 public void AddItemUpdateListener(UpdateItemDelegate listener)
 {
     OnItemUpdate += listener;
 }