コード例 #1
0
ファイル: BinSearch.cs プロジェクト: tangxuehua/DataStructure
		public override void Recover()
		{
			arrayIterator = null;
			nullIterator = null;
			indexArray = new ArrayList();
			status = new BinSearchStatus(r,key);
			base.Recover();
		}
コード例 #2
0
 public override void Recover()
 {
     arrayIterator = null;
     nullIterator  = null;
     indexArray    = new ArrayList();
     status        = new BinSearchStatus(r, key);
     base.Recover();
 }
コード例 #3
0
        public override bool GetData()
        {
            statusItemList.Clear();

            StatusItemControl statusItemControl = new StatusItemControl();

            Hashtable table = AlgorithmManager.Algorithms.GetExampleDatas();

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

                XmlNodeList childNodes = node.ChildNodes;

                StatusItem statusItem = null;

                foreach (XmlElement el in childNodes)
                {
                    string r   = el.Attributes["OriginalString"].Value;
                    char   key = Convert.ToChar(el.Attributes["Key"].Value);

                    statusItem        = new StatusItem(new BinSearchStatus(r, key));
                    statusItem.Height = 80;
                    statusItem.Image  = CreatePreviewImage(r, key);
                    statusItemList.Add(statusItem);
                }
            }
            DialogType = typeof(BinSearchDialog);

            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)
                {
                    BinSearchStatus tempStatus = selectedItem.ItemInfo as BinSearchStatus;
                    if (tempStatus != null)
                    {
                        r   = tempStatus.R;
                        key = tempStatus.Key;
                    }
                }
            }
            else              //说明用户选择自定义数据
            {
                r   = status.R;
                key = status.Key;
            }
            return(true);
        }
コード例 #4
0
        public override void Initialize(bool isOpen)
        {
            base.Initialize(isOpen);

            status = new BinSearchStatus(r, key);

            InitGraph();

            WorkbenchSingleton.Workbench.ActiveViewContent.SelectView();
        }
コード例 #5
0
ファイル: BinSearch.cs プロジェクト: tangxuehua/DataStructure
		public override void Initialize(bool isOpen)
		{
			base.Initialize(isOpen);

			status = new BinSearchStatus(r,key);

			InitGraph();
			
			WorkbenchSingleton.Workbench.ActiveViewContent.SelectView();
		}