Ejemplo n.º 1
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.º 2
0
        public override void Initialize(bool isOpen)
        {
            base.Initialize(isOpen);

            status = new SequenceMergeStatus(la, lb);

            InitGraph();

            WorkbenchSingleton.Workbench.ActiveViewContent.SelectView();
        }
Ejemplo n.º 3
0
 public override void Recover()
 {
     k      = 0;
     status = new SequenceMergeStatus(la, lb);
     base.Recover();
 }
Ejemplo n.º 4
0
		public override void Recover()
		{
			k = 0;
			status = new SequenceMergeStatus(la,lb);
			base.Recover();
		}
Ejemplo n.º 5
0
		public override void Initialize(bool isOpen)
		{
			base.Initialize(isOpen);

			status = new SequenceMergeStatus(la,lb);

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


		}