Exemplo n.º 1
0
        private void HandleHyperlinkClick(Hyperlink sender, HyperlinkClickEventArgs args)
        {
            Hyperlink hyperlink = sender;

            if (hyperlink.FindName("HyperViewerGrid") != null)
            {
                // 현재 표시 중인 HyperViewer 존재시
                Grid        HyperViewerGrid = hyperlink.FindName("HyperViewerGrid") as Grid;
                HyperViewer HyperViewer     = HyperViewerGrid.Parent as HyperViewer;
                int         sup_no;
                if (2 < hyperlink.Inlines.Count)
                {
                    int.TryParse(NumberConvertor.SupToNumber((hyperlink.Inlines[1] as Run).Text), out sup_no);
                }
                else
                {
                    int.TryParse(Regex.Replace((hyperlink.Inlines[0] as Run).Text, "[^0-9.]", ""), out sup_no);
                }

                string target_code = hyperlink.Inlines[hyperlink.Inlines.Count - 1].FontFamily.Source;
                if (target_code == "0")
                {
                    HyperViewer.SearchWords((hyperlink.Inlines[0] as Run).Text);
                }
                else
                {
                    HyperViewer.DisplayWordDetail(target_code, sup_no);
                }
            }
        }