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


C# LinkedList.IsEmpty方法代码示例

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


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

示例1: Main

    public static void Main()
    {
        try
        {
            LinkedList list = new LinkedList();

            Console.WriteLine("It is {0} that this list in empty", list.IsEmpty());

            list.Insert("Happy days");
            list.Insert("Pie in the sky");
            list.Insert("Trouble in River City");

            Console.WriteLine("The original list is:");

            list.Display();
            list.Reset();
            list.Advance();

            Console.WriteLine("The current list element is {0}", list.GetData());

            list.Remove();

            Console.WriteLine("The list, after removing the current element, is:");

            list.Display();

        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
        Console.WriteLine("Hit any key to exit");
        Console.ReadLine();
    }
开发者ID:JnS-Software-LLC,项目名称:CSC153,代码行数:34,代码来源:LinkedList.cs

示例2: AddToHistory

        private static void AddToHistory(LinkedList<ViewModel> history, ViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException("viewModel");
            }

            if (history.Count >= HistorySize)
            {
                history.RemoveLast();
            }

            if (history.IsEmpty())
            {
                history.AddFirst(viewModel);
            }
            else if (history.First.Value != viewModel)
            {
                history.AddFirst(viewModel);
            }
        }
开发者ID:v-zubritsky,项目名称:MilitaryFaculty,代码行数:21,代码来源:NavigationHistory.cs

示例3: Iterator

 internal Iterator(LinkedList list, int index)
 {
     m_list = list;
     if (m_list.IsEmpty()) {
         m_link = null;
     }
     if (index > m_list.Count)
         throw new LinkedListException("Index out of list size");
     if (index == m_list.Count) {
         m_link = null;
     } else {
         m_link = m_list.m_bottom;
         while ((index--) > 0) {
             m_link = m_link.next;
         }
     }
 }
开发者ID:imarshall,项目名称:Interpretator,代码行数:17,代码来源:LinkedList.cs

示例4: Iterator

			internal Iterator(LinkedList list, int index) {
				m_list = list;
				if (m_list.IsEmpty()) {
					m_link = null;
				}
				if (index > m_list.Count)
					throw new LinkedListException("Попытка обращения к элементу за пределом списка");
				if (index == m_list.Count) {
					m_link = null;
				} else {
					m_link = m_list.m_bottom;
					while ((index--) > 0) {
						m_link = m_link.next;
					}
				}
			}
开发者ID:8bit-cat,项目名称:archive,代码行数:16,代码来源:LinkedList.cs


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