当前位置: 首页>>代码示例>>C#>>正文


C# Item.GetHashCode方法代码示例

本文整理汇总了C#中Item.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetHashCode方法的具体用法?C# Item.GetHashCode怎么用?C# Item.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item.GetHashCode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Remove

		public void Remove(Item _item)
		{
			var have = m_items.FirstOrDefault(_item1 => _item1.GetHashCode() == _item.GetHashCode());
			if (have == null)
			{
				throw new ApplicationException("Такого предмета нет.");
			}
			if (have is Stacked)
			{
				((Stacked) have).Count--;
				if (((Stacked) have).Count == 0)
				{
					m_items.Remove(have);
				}
			}
			else
			{
				m_items.Remove(have);
			}
		}
开发者ID:Foxbow74,项目名称:my-busycator,代码行数:20,代码来源:ItemsCollection.cs

示例2: Add

		public void Add(Item _item)
		{
			var have = m_items.FirstOrDefault(_item1 => _item1.GetHashCode() == _item.GetHashCode());
			if (have == null)
			{
				m_items.Add(_item);
			}
			else if (have is StackOfItems)
			{
				((StackOfItems) have).Add((StackOfItems) _item);
			}
			else if (have is Stacked)
			{
				((Stacked) have).Count++;
			}
			else
			{
				m_items.Remove(have);
				m_items.Add(new Stacked(_item, 2));
			}
		}
开发者ID:Foxbow74,项目名称:my-busycator,代码行数:21,代码来源:ItemsCollection.cs

示例3: PlaylistItemDelete

		public bool PlaylistItemDelete(Item cItem, PlaylistItem[] aItems)
		{
			bool bRetVal = false;
			try
			{
				if (0 < Client.nID)
				{
					Item cItemLocal = GarbageCollector.ItemGet(cItem);
					if (null != cItemLocal)
					{
						((Playlist)cItemLocal).PlaylistItemsDelete(aItems);
						bRetVal = true;
					}
					else
						(new Logger()).WriteError("skip: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("skip: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			return bRetVal;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:25,代码来源:Player.asmx.cs

示例4: PlaylistItemsGet

		public PlaylistItem[] PlaylistItemsGet(Item cItem)
		{
			PlaylistItem[] aRetVal = null;
			try
			{
				if (0 < Client.nID)
				{
					Item cItemLocal = GarbageCollector.ItemGet(cItem);
					if (null != cItemLocal)
						aRetVal = ((Playlist)cItemLocal).aPlaylistItems;
					else
						(new Logger()).WriteError("plis:get: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("plis:get: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			return aRetVal;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:22,代码来源:Player.asmx.cs

示例5: Skip

		public bool Skip(Item cItem, bool bSkipLastEffect, ushort nTransitionDuration)  //TODO nTransitionDuration пока никуда не ведёт ))
		{
			bool bRetVal = false;
			try
			{
				if (0 < Client.nID)
				{
					Item cItemLocal = GarbageCollector.ItemGet(cItem);
					if (null != cItemLocal)
					{
						((Playlist)cItemLocal).Skip(bSkipLastEffect, nTransitionDuration);
						bRetVal = true;
					}
					else
						(new Logger()).WriteError("skip: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("skip: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			return bRetVal;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:25,代码来源:Player.asmx.cs

示例6: AddVideo

		public PlaylistItem[] AddVideo(Item cItem, PlaylistItem[] aItems)
		{
			bool bRetVal = false;
			try
			{
				if (0 < Client.nID)
				{
					Item cItemLocal = GarbageCollector.ItemGet(cItem);
					if (null != cItemLocal)
					{
						Playlist cPlaylist = (Playlist)cItemLocal;
						foreach (PlaylistItem cPLI in aItems)
							if (cPLI.bFileIsImage)
								cPlaylist.AddAnimation(cPLI);
							else
								cPlaylist.AddVideo(cPLI);
						bRetVal = true;
					}
					else
						(new Logger()).WriteError("add:video: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("add:video: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			if (bRetVal)
				return aItems;
			else
				return null;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:33,代码来源:Player.asmx.cs

示例7: ItemStop

		public bool ItemStop(Item cItem)
		{
			bool bRetVal = false;
			Item cItemLocal = null;
			try
			{
				if (0 < Client.nID)
				{
					if (null != (cItemLocal = GarbageCollector.ItemGet(cItem)))
					{
						(new Logger()).WriteDebug2("stop: " + cItemLocal.ToString());
						cItemLocal.Stop();
						bRetVal = true;
					}
					else
						(new Logger()).WriteError("item:stop: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("item:stop: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				if (null != cItemLocal)
					cItemLocal.eStatus = Item.Status.Error;
				(new Logger()).WriteError(ex);
			}
			return bRetVal;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:28,代码来源:Common.cs

示例8: ItemDelete

		public bool ItemDelete(Item cItem)
		{
			bool bRetVal = false;
			try
			{
				if (0 < Client.nID)
				{
					Item cItemLocal = GarbageCollector.ItemGet(cItem);
					if (null != cItemLocal)
					{
						(new Logger()).WriteDebug2("delete: " + cItemLocal.ToString());
						GarbageCollector.ItemDelete(cItemLocal);
						bRetVal = true;
					}
					else
						(new Logger()).WriteError("item:delete: указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
				}
				else
					(new Logger()).WriteError("item:delete: не инициирован механизм регистрации клиента");
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
			return bRetVal;
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:26,代码来源:Common.cs

示例9: ItemDelete

		static private void ItemDelete(Item cItem, bool bAddToDeleted, Item.Status eStatus)
		{
			string slog = "deleted: status = {" + cItem.eStatus + "}, item = {" + cItem.GetHashCode() + "}, info = {" + cItem.sInfo + "}";
			try
			{
				lock (_aItems)
				{
					lock (_aItemsDeleted)
					{
						try
						{
							if (_aItems.Contains(cItem))
							{
								_aItems.Remove(cItem);
								if (bAddToDeleted)
								{
									cItem.eStatus = eStatus;
									_aItemsDeleted.Add(cItem);
								}
							}
							else if (_aItemsDeleted.Contains(cItem))
							{
								_aItemsDeleted.Remove(cItem);
								(new Logger()).WriteNotice("item:delete:vanished: " + cItem.ToString());
							}
						}
						catch
						{
							throw new Exception("указанный элемент не зарегистрирован [item:" + cItem.GetHashCode() + "]");
						}
					}
				}
				(new Logger()).WriteNotice(slog);
			}
			catch (Exception ex)
			{
				(new Logger()).WriteError(ex);
			}
		}
开发者ID:ratsil,项目名称:bethe.ingenie,代码行数:39,代码来源:GarbageCollector.cs


注:本文中的Item.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。