/// <summary>
		/// <para>Gets a value indicating whether the
		///    <see cref="StatusItemCollection"/> contains the specified <see cref="StatusItem"/>.</para>
		/// </summary>
		/// <param name="value">The <see cref="StatusItem"/> to locate.</param>
		/// <returns>
		/// <para><see langword="true"/> if the <see cref="StatusItem"/> is contained in the collection;
		///   otherwise, <see langword="false"/>.</para>
		/// </returns>
		/// <seealso cref="StatusItemCollection.IndexOf"/>
		public bool Contains(StatusItem value) 
		{
			return List.Contains(value);
		}
		/// <summary>
		///    <para>Returns the index of a <see cref="StatusItem"/> in
		///       the <see cref="StatusItemCollection"/> .</para>
		/// </summary>
		/// <param name="value">The <see cref="StatusItem"/> to locate.</param>
		/// <returns>
		/// <para>The index of the <see cref="StatusItem"/> of <paramref name="value"/> in the
		/// <see cref="StatusItemCollection"/>, if found; otherwise, -1.</para>
		/// </returns>
		/// <seealso cref="StatusItemCollection.Contains"/>
		public int IndexOf(StatusItem value) 
		{
			return List.IndexOf(value);
		}
		/// <summary>
		///    <para> Removes a specific <see cref="StatusItem"/> from the
		///    <see cref="StatusItemCollection"/> .</para>
		/// </summary>
		/// <param name="value">The <see cref="StatusItem"/> to remove from the <see cref="StatusItemCollection"/> .</param>
		/// <returns><para>None.</para></returns>
		/// <exception cref="System.ArgumentException"><paramref name="value"/> is not found in the Collection. </exception>
		public void Remove(StatusItem value) 
		{
			List.Remove(value);
		}
		/// <summary>
		///    <para>Adds a <see cref="StatusItem"/> with the specified value to the
		///    <see cref="StatusItemCollection"/> .</para>
		/// </summary>
		/// <param name="value">The <see cref="StatusItem"/> to add.</param>
		/// <returns>
		///    <para>The index at which the new element was inserted.</para>
		/// </returns>
		public int Add(StatusItem value) 
		{
			return List.Add(value);
		}
Ejemplo n.º 5
0
		public override bool GetData()
		{
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(InOrderTraverse).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlNode el in childNodes)
				{
					statusItem = new StatusItem(el);
					statusItem.Height = 240;
					statusItem.Image = CreatePreviewImage(el);
					statusItemList.Add(statusItem);
				}
			}
			DialogType = typeof(BiTreeDialog);
			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					XmlNode tempNode = selectedItem.ItemInfo as XmlNode;
					if(tempNode != null)
					{
						dataNode = tempNode;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				//这里不需要输入数据
			}
			return true;
			
		}
Ejemplo n.º 6
0
		public override bool GetData()
		{
			ArrayList statusItemList = new ArrayList();
			
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(SequenceInsert).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlElement el in childNodes)
				{
					string s = el.Attributes["OriginalString"].Value;
					int pos = Convert.ToInt32(el.Attributes["InsertPosition"].Value);
					char c = Convert.ToChar(el.Attributes["InsertData"].Value);

					statusItem = new StatusItem(new SequenceInsertStatus(s,pos,c));
					statusItem.Height = 80;
					statusItem.Image = CreatePreviewImage(s,pos,c);
					statusItemList.Add(statusItem);
				}
			}
			DialogType = typeof(SequenceInsertDialog);

			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					SequenceInsertStatus tempStatus = selectedItem.ItemInfo as SequenceInsertStatus;
					if(tempStatus != null)
					{
						l = tempStatus.L.Substring(0,tempStatus.Length);
						i = tempStatus.I;
						e = tempStatus.E;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				l = status.L.Substring(0,status.Length);
				i = status.I;
				e = status.E;
			}
			return true;
			
		}
Ejemplo n.º 7
0
		public override bool GetData()
		{
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(IndexBF).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlElement el in childNodes)
				{
					string s = el.Attributes["String1"].Value;
					string t = el.Attributes["String2"].Value;
					int pos = Convert.ToInt32(el.Attributes["StartPosition"].Value);

					statusItem = new StatusItem(new IndexBFStatus(s,t,pos));
					statusItem.Height = 80;
					statusItem.Image = CreatePreviewImage(s,t,pos);
					statusItemList.Add(statusItem);
				}
			}
			DialogType = typeof(IndexBFDialog);
			
			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					IndexBFStatus tempStatus = selectedItem.ItemInfo as IndexBFStatus;
					if(tempStatus != null)
					{
						s = tempStatus.S;
						t = tempStatus.T;
						pos = tempStatus.Pos;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				s = status.S;
				t = status.T;
				pos = status.Pos;
			}
			return true;
			
		}
Ejemplo n.º 8
0
		public override bool GetData()
		{
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(OneQuickPass).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlElement el in childNodes)
				{
					string r = el.Attributes["OriginalString"].Value;

					statusItem = new StatusItem(new QuickSortStatus(r,1,r.Length));
					statusItem.Height = 145;
					statusItem.Image = CreatePreviewImage(r);
					statusItemList.Add(statusItem);
				}
			}
			DialogType = typeof(OneQuickPassDialog);
			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					QuickSortStatus tempStatus = selectedItem.ItemInfo as QuickSortStatus;
					if(tempStatus != null)
					{
						r = tempStatus.R;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				r = status.R;
			}
			return true;
			
		}
Ejemplo n.º 9
0
		public override bool GetData()
		{
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(SequenceMerge).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlElement el in childNodes)
				{
					string s1 = el.Attributes["String1"].Value;
					string s2 = el.Attributes["String2"].Value;

					statusItem = new StatusItem(new SequenceMergeStatus(s1,s2));
					statusItem.Height = 80;
					statusItem.Image = CreatePreviewImage(s1,s2);
					statusItemList.Add(statusItem);
				}
			}

			DialogType = typeof(SequenceMergeDialog);

			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					SequenceMergeStatus tempStatus = selectedItem.ItemInfo as SequenceMergeStatus;
					if(tempStatus != null)
					{
						la = tempStatus.La;
						lb = tempStatus.Lb;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				la = status.La;
				lb = status.Lb;

			}
			return true;
			
		}
Ejemplo n.º 10
0
        public override bool GetData()
        {
            ArrayList statusItemList = new ArrayList();

            statusItemList.Clear();

            StatusItemControl statusItemControl = new StatusItemControl();

            Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();

            if (table != null)
            {
                XmlNode node = table[typeof(SequenceInsert).ToString()] as XmlElement;

                XmlNodeList childNodes = node.ChildNodes;

                StatusItem statusItem = null;

                foreach (XmlElement el in childNodes)
                {
                    string s   = el.Attributes["OriginalString"].Value;
                    int    pos = Convert.ToInt32(el.Attributes["InsertPosition"].Value);
                    char   c   = Convert.ToChar(el.Attributes["InsertData"].Value);

                    statusItem        = new StatusItem(new SequenceInsertStatus(s, pos, c));
                    statusItem.Height = 80;
                    statusItem.Image  = CreatePreviewImage(s, pos, c);
                    statusItemList.Add(statusItem);
                }
            }
            DialogType = typeof(SequenceInsertDialog);

            InitDataForm form = new InitDataForm();

            form.StatusItemList = statusItemList;

            if (form.ShowDialog() != DialogResult.OK)
            {
                return(false);
            }
            if (form.SelectedIndex >= 0)             //说明用户是通过选中某个模板来初始化数据的
            {
                StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
                if (selectedItem != null)
                {
                    SequenceInsertStatus tempStatus = selectedItem.ItemInfo as SequenceInsertStatus;
                    if (tempStatus != null)
                    {
                        l = tempStatus.L.Substring(0, tempStatus.Length);
                        i = tempStatus.I;
                        e = tempStatus.E;
                    }
                }
            }
            else              //说明用户选择自定义数据
            {
                l = status.L.Substring(0, status.Length);
                i = status.I;
                e = status.E;
            }
            return(true);
        }
Ejemplo n.º 11
0
		public override bool GetData()
		{
			statusItemList.Clear();

			StatusItemControl statusItemControl = new StatusItemControl();

			Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();
			
			if(table != null)
			{
				XmlNode node = table[typeof(ListDelete).ToString()] as XmlElement;

				XmlNodeList childNodes  = node.ChildNodes;
		
				StatusItem statusItem = null;

				foreach (XmlElement el in childNodes)
				{
					string l = el.Attributes["OriginalString"].Value;
					int i = Convert.ToInt32(el.Attributes["DeletePosition"].Value);

					statusItem = new StatusItem(new ListDeleteStatus(l,i));
					statusItem.Height = 80;
					statusItem.Image = CreatePreviewImage(l,i);
					statusItemList.Add(statusItem);
				}
			}
			DialogType = typeof(ListDeleteDialog);

			InitDataForm form = new InitDataForm();

			form.StatusItemList = statusItemList;

			if(form.ShowDialog() != DialogResult.OK)
			{
				return false;
			}
			if(form.SelectedIndex >= 0)  //说明用户是通过选中某个模板来初始化数据的
			{
				StatusItem selectedItem = form.StatusItemList[form.SelectedIndex] as StatusItem;
				if(selectedItem != null)
				{
					ListDeleteStatus tempStatus = selectedItem.ItemInfo as ListDeleteStatus;
					if(tempStatus != null)
					{
						l = tempStatus.L;
						i = tempStatus.I;
					}
				}
			}
			else  //说明用户选择自定义数据
			{
				l = status.L;
				i = status.I;
			}
			return true;
			
		}
Ejemplo n.º 12
0
 /// <summary>
 ///    <para>Returns the index of a <see cref="StatusItem"/> in
 ///       the <see cref="StatusItemCollection"/> .</para>
 /// </summary>
 /// <param name="value">The <see cref="StatusItem"/> to locate.</param>
 /// <returns>
 /// <para>The index of the <see cref="StatusItem"/> of <paramref name="value"/> in the
 /// <see cref="StatusItemCollection"/>, if found; otherwise, -1.</para>
 /// </returns>
 /// <seealso cref="StatusItemCollection.Contains"/>
 public int IndexOf(StatusItem value)
 {
     return(List.IndexOf(value));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// <para>Gets a value indicating whether the
 ///    <see cref="StatusItemCollection"/> contains the specified <see cref="StatusItem"/>.</para>
 /// </summary>
 /// <param name="value">The <see cref="StatusItem"/> to locate.</param>
 /// <returns>
 /// <para><see langword="true"/> if the <see cref="StatusItem"/> is contained in the collection;
 ///   otherwise, <see langword="false"/>.</para>
 /// </returns>
 /// <seealso cref="StatusItemCollection.IndexOf"/>
 public bool Contains(StatusItem value)
 {
     return(List.Contains(value));
 }
Ejemplo n.º 14
0
 /// <summary>
 ///    <para>Adds a <see cref="StatusItem"/> with the specified value to the
 ///    <see cref="StatusItemCollection"/> .</para>
 /// </summary>
 /// <param name="value">The <see cref="StatusItem"/> to add.</param>
 /// <returns>
 ///    <para>The index at which the new element was inserted.</para>
 /// </returns>
 public int Add(StatusItem value)
 {
     return(List.Add(value));
 }
Ejemplo n.º 15
0
 /// <summary>
 ///    <para> Removes a specific <see cref="StatusItem"/> from the
 ///    <see cref="StatusItemCollection"/> .</para>
 /// </summary>
 /// <param name="value">The <see cref="StatusItem"/> to remove from the <see cref="StatusItemCollection"/> .</param>
 /// <returns><para>None.</para></returns>
 /// <exception cref="System.ArgumentException"><paramref name="value"/> is not found in the Collection. </exception>
 public void Remove(StatusItem value)
 {
     List.Remove(value);
 }