Esempio n. 1
0
        /// <summary>
        /// 显示查找到的结果(位置)
        /// </summary>
        /// <param name="_currentPosition">查找到的位置</param>
        private void DisplayFindedResult(Position _currentPosition)
        {
            if (_currentPosition == null)
            {
                MessageService.Show("未找到结果,搜索回到起始点。");
            }
            else
            {
                Position    position    = _currentPosition;
                XmlDocument xmlDocument = (XmlDocument)position.GetDocument();
                Type        type        = xmlDocument.GetType();
                switch (type.Name)
                {
                case "HrXmlDocument":
                    HrXmlDocument       hrDoc  = (HrXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm hrForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, hrDoc.Id) as MdiBaseEditViewForm;
                    hrForm.MarkPosition(position);
                    break;

                case "InviteBiddingXmlDocument":
                    InviteBiddingXmlDocument bidDoc  = (InviteBiddingXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm      bidForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, bidDoc.Id) as MdiBaseEditViewForm;
                    bidForm.MarkPosition(position);
                    break;

                case "KnowledgeXmlDocument":
                    KnowledgeXmlDocument knowDoc  = (KnowledgeXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm  knowForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, knowDoc.Id) as MdiBaseEditViewForm;
                    knowForm.MarkPosition(position);
                    break;

                case "ProductXmlDocument":
                    ProductXmlDocument  prodcutDoc  = (ProductXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm productForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, prodcutDoc.Id) as MdiBaseEditViewForm;
                    productForm.MarkPosition(position);
                    break;

                case "ProjectXmlDocument":
                    ProjectXmlDocument  projectDoc  = (ProjectXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm projectForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, projectDoc.Id) as MdiBaseEditViewForm;
                    projectForm.MarkPosition(position);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
        //结果窗口的定位 by lisuye on 2008年6月13日
        void _resultsListView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = _resultsListView.SelectedItems[0].Index;

            if (index != 0)
            {
                Position    position    = _dictionry[index];
                XmlDocument xmlDocument = (XmlDocument)position.GetDocument();
                Type        type        = xmlDocument.GetType();
                switch (type.Name)
                {
                case "HrXmlDocument":
                    HrXmlDocument       hrDoc  = (HrXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm hrForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, hrDoc.Id) as MdiBaseEditViewForm;
                    hrForm.MarkPosition(position);
                    FindOptions.Singler.CurrentPosition = position;
                    //if (index > 0)
                    //    FindOptions.Singler.StartPosition = _dictionry[index];
                    //else
                    //    FindOptions.Singler.StartPosition = null;
                    break;

                case "InviteBiddingXmlDocument":
                    InviteBiddingXmlDocument bidDoc  = (InviteBiddingXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm      bidForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, bidDoc.Id) as MdiBaseEditViewForm;
                    bidForm.MarkPosition(position);
                    FindOptions.Singler.CurrentPosition = position;
                    FindOptions.Singler.CurrentPosition = position;
                    //if (index > 0)
                    //    FindOptions.Singler.StartPosition = _dictionry[index];
                    //else
                    //    FindOptions.Singler.StartPosition = null;
                    break;

                case "KnowledgeXmlDocument":
                    KnowledgeXmlDocument knowDoc  = (KnowledgeXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm  knowForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, knowDoc.Id) as MdiBaseEditViewForm;
                    knowForm.MarkPosition(position);
                    FindOptions.Singler.CurrentPosition = position;
                    FindOptions.Singler.CurrentPosition = position;
                    //if (index > 0)
                    //    FindOptions.Singler.StartPosition = _dictionry[index];
                    //else
                    //    FindOptions.Singler.StartPosition = null;
                    break;

                case "ProductXmlDocument":
                    ProductXmlDocument  prodcutDoc  = (ProductXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm productForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, prodcutDoc.Id) as MdiBaseEditViewForm;
                    productForm.MarkPosition(position);
                    FindOptions.Singler.CurrentPosition = position;
                    FindOptions.Singler.CurrentPosition = position;
                    //if (index > 0)
                    //    FindOptions.Singler.StartPosition = _dictionry[index];
                    //else
                    //    FindOptions.Singler.StartPosition = null;
                    break;

                case "ProjectXmlDocument":
                    ProjectXmlDocument  projectDoc  = (ProjectXmlDocument)position.GetDocument();
                    MdiBaseEditViewForm projectForm = Service.Workbench.OpenWorkDocument(WorkDocumentType.Edit, projectDoc.Id) as MdiBaseEditViewForm;
                    projectForm.MarkPosition(position);
                    FindOptions.Singler.CurrentPosition = position;
                    FindOptions.Singler.CurrentPosition = position;
                    //if (index > 0)
                    //    FindOptions.Singler.StartPosition = _dictionry[index];
                    //else
                    //    FindOptions.Singler.StartPosition = null;
                    break;

                default:
                    break;
                }
            }
        }