private void DetailsUpdater_DetailsUpdated(object sender, DetailsUpdatedEventArgs e)
        {
            Dispatcher.Invoke(delegate
            {
                DetailedInfo.Clear();

                foreach (var p in e.Details)
                {
                    var label = Localize.ResourceManager.GetString(p.Key.ToString()) ?? p.Key.ToString();
                    DetailedInfo.AppendText(string.Format("{0}: {1}\r\n", label, string.Join(", ", p.Value)));
                }
            });
        }
示例#2
0
        private void DoDetails(Unicode.Summary input)
        {
            if (IsCancelled())
            {
                return;
            }
            var dict = new SortedDictionary <Unicode.DataKey, IEnumerable <string> >();
            int code = (int)input.Code;

            if (IsCancelled())
            {
                return;
            }
            var unihan_source = UniHanData.GetSources(code);

            if (unihan_source != null)
            {
                dict.Add(Unicode.DataKey.UniHanSources, unihan_source);
            }

            if (IsCancelled())
            {
                return;
            }
            var unihan_mapping = UniHanData.GetMappings(code);

            if (unihan_mapping != null)
            {
                dict.Add(Unicode.DataKey.UniHanMappings, unihan_mapping);
            }

            if (IsCancelled())
            {
                return;
            }
            var unihan_variant = UniHanData.GetVariants(code);

            if (unihan_variant != null)
            {
                dict.Add(Unicode.DataKey.UniHanVariants, unihan_variant.Select(u => "U+" + u.ToString("X04")));
            }

            if (IsCancelled())
            {
                return;
            }
            var other_info = OtherData.GetData(code);

            if (other_info != null)
            {
                dict.Add(Unicode.DataKey.OtherProperties, other_info);
            }

            if (IsCancelled())
            {
                return;
            }
            var handler = DetailsUpdated;

            if (handler != null)
            {
                var e = new DetailsUpdatedEventArgs();
                e.Details = dict;
                handler(this, e);
            }
        }