Ejemplo n.º 1
0
        public void StartCreateHyper(object showRun)
        {
            try
            {
                ShowHyperRun curRun = (ShowHyperRun)showRun;
                if (curRun.CurDeep > curRun.DeepSearch || Interlocked.Read(ref StopCreateHyper) == 0)
                {
                    return;
                }

                //WordSemanticBranch newBranch = m_SemanticHelper.GetSemanticLinkFromDB(curRun.CurDeep == 1 ? "тест2" : curRun.WordLink.ParentWord.Word);
                WordSemanticBranch newBranch = m_SemanticHelper.GetSemanticLinkFromDB(curRun.WordLink.ParentWord.Word);
                curRun.WordLink = newBranch;
                OnHyperChainAdded(new HyperChainAddedEventArgs(curRun));
                int  nNewDeepSearch = curRun.DeepSearch - 1;
                bool bNewBranch     = false;
                foreach (WordLink link in newBranch.Children)
                {
                    WordSemanticBranch childBranch = m_SemanticHelper.GetSemanticLinkFromDB(link.Child.Word);
                    if (childBranch != null &&
                        (link.RelationType == WordLinkType.eNormal ||
                         link.RelationType == WordLinkType.eTentative))
                    {
                        StartCreateHyper(new ShowHyperRun(childBranch, curRun.DeepSearch, curRun.CurDeep + 1, bNewBranch));
                    }
                    bNewBranch = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}\n{1}", "CLientLogic.StartSearch", ex.Message));
            }
        }
Ejemplo n.º 2
0
        void CreateTable(ShowHyperRun aRun)
        {
            //m_Hypers = new DataTable();
            for (int i = 0; i < aRun.DeepSearch; i++)
            {
                m_Hypers.Columns.Add((i + 1).ToString(), typeof(HyperChainItem));
            }

            GridView gv = new GridView();

            for (int i = 0; i < m_Hypers.Columns.Count; i++)
            {
                GridViewColumn col = new GridViewColumn();
                col.Header = (i + 1).ToString();
                col.DisplayMemberBinding = new Binding("[" + i + "].Word");
                col.Width = 150;
                gv.Columns.Add(col);
            }

            lvHyperChains.View        = gv;
            lvHyperChains.ItemsSource = m_Hypers.Rows;
        }
Ejemplo n.º 3
0
 public HyperChainAddedEventArgs(ShowHyperRun aRun)
 {
     CurrentRun = aRun;
 }