Example #1
0
        void thisBox_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode != Keys.Control) && (e.KeyCode != Keys.PrintScreen) && (e.KeyCode != Keys.Down))
            {
                Name_Info_Form showNameForm = new Name_Info_Form();
                showNameForm.SetName(nameObject, false, true, null, false);
                showNameForm.Read_Only = read_only;
                showNameForm.ShowDialog();

                if (showNameForm.Changed)
                {
                    OnDataChanged();
                }

                string nameText = nameObject.ToString().Replace("<i>", "").Replace("</i>", "").Replace("&amp;", "&").Replace("&quot;", "\"");
                if (nameText == "unknown")
                {
                    thisBox.Text = String.Empty;
                }
                else
                {
                    thisBox.Text = nameText;
                }
            }
        }
 private void show_name_info()
 {
     if ((affiliation != null) && (affiliation.hasData))
     {
         string name_text = nameObject + " [ " + affiliation + " ]";
         base.thisBox.Text = name_text.Replace("<i>", "").Replace("</i>", "").Replace("&amp;", "&").Replace("&quot;", "\"");
     }
     else
     {
         string show_name_text = nameObject.ToString().Replace("<i>", "").Replace("</i>", "").Replace("&amp;", "&").Replace("&quot;", "\"");
         if (show_name_text.ToUpper() == "UNKNOWN")
         {
             base.thisBox.Text = String.Empty;
         }
         else
         {
             base.thisBox.Text = show_name_text;
         }
     }
 }
        /// <summary> Writes this name used as a subject as a simple string </summary>
        /// <param name="Include_Scheme"> Flag indicates whether the role(s) should be included </param>
        /// <returns> This name as a subject returned as a simple string </returns>
        public override string ToString(bool Include_Scheme)
        {
            StringBuilder builder = new StringBuilder();

            if (nameInfo.Full_Name.Length > 0)
            {
                builder.Append(nameInfo.ToString());
            }

            builder.Append(base.To_Base_String());

            if (Include_Scheme)
            {
                if (!String.IsNullOrEmpty(authority))
                {
                    builder.Append(" ( " + authority + " )");
                }
            }

            return(builder.ToString());
        }