Ejemplo n.º 1
0
        private void WindowAdded(object sender, GwmWindowEventArgs e)
        {
            if (e.Form is PwEntryForm form && form.EditModeEx == PwEditMode.AddNewEntry)
            {
                Transliteration currentTransliteration = Transliterations.Get(_host.CustomConfig.GetCurrentTransliterationName());

                if (currentTransliteration == null)
                {
                    return;
                }

                e.Form.Shown += delegate(object o, EventArgs args)
                {
                    TextBox tbTitle    = e.Form.Controls.Find("m_tbTitle", true).FirstOrDefault() as TextBox;
                    TextBox tbUserName = e.Form.Controls.Find("m_tbUserName", true).FirstOrDefault() as TextBox;

                    tbTitle.LostFocus += delegate(object s, EventArgs eventArgs)
                    {
                        string title = currentTransliteration.Front(tbTitle.Text.ToShortTitle());

                        string userName = tbUserName.Text;

                        if (string.IsNullOrEmpty(userName))
                        {
                            tbUserName.Text = title;
                        }
                        else if (userName.Contains('\\'))
                        {
                            string[] parts = userName.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
                            tbUserName.Text = $"{parts[0]}\\{title}";
                        }
                    };
                };
            }
        }
Ejemplo n.º 2
0
        static RussianToEnglishGost1983UN1987()
        {
            Instance = new RussianToEnglishGost1983UN1987();

            Transliterations.Register(Instance);
        }
Ejemplo n.º 3
0
        static RussianToEnglishAlaAc()
        {
            Instance = new RussianToEnglishAlaAc();

            Transliterations.Register(Instance);
        }
Ejemplo n.º 4
0
        static TajikToEnglishIso9()
        {
            Instance = new TajikToEnglishIso9();

            Transliterations.Register(Instance);
        }