Beispiel #1
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);
        }
Beispiel #2
0
        public override void Initialize(bool isOpen)
        {
            base.Initialize(isOpen);

            status = new IndexBFStatus(s, t, pos);

            InitGraph();

            WorkbenchSingleton.Workbench.ActiveViewContent.SelectView();
        }
Beispiel #3
0
		public override void Recover()
		{
			status = new IndexBFStatus(s,t,pos);
			base.Recover();
		}
Beispiel #4
0
		public override void Initialize(bool isOpen)
		{
			base.Initialize(isOpen);

			status = new IndexBFStatus(s,t,pos);

			InitGraph();
			
			WorkbenchSingleton.Workbench.ActiveViewContent.SelectView();
	
		}
Beispiel #5
0
 public override void Recover()
 {
     status = new IndexBFStatus(s, t, pos);
     base.Recover();
 }