Ejemplo n.º 1
0
 private void ShowLanguageInfo() {
   if (_grammar == null) return;
   var langAttr = LanguageAttribute.GetValue(_grammar.GetType());
   if (langAttr == null) return;
   lblLanguage.Text = langAttr.LanguageName;
   lblLanguageVersion.Text = langAttr.Version;
   lblLanguageDescr.Text = langAttr.Description;
   txtGrammarComments.Text = _grammar.GrammarComments;
 }
Ejemplo n.º 2
0
        public GrammarItem(Type grammarClass, string assemblyLocation)
        {
            _loading = true;
            Location = assemblyLocation;
            TypeName = grammarClass.FullName;
            //Get language name from Language attribute
            Caption     = grammarClass.Name; //default caption
            LongCaption = Caption;
            var langAttr = LanguageAttribute.GetValue(grammarClass);

            if (langAttr != null)
            {
                Caption = langAttr.LanguageName;
                if (!string.IsNullOrEmpty(langAttr.Version))
                {
                    Caption += ", version " + langAttr.Version;
                }
                LongCaption = Caption;
                if (!string.IsNullOrEmpty(langAttr.Description))
                {
                    LongCaption += ": " + langAttr.Description;
                }
            }
        }