Exemplo n.º 1
0
 internal void OnCreateNewClicked(object sender, CreateNewArgs e)
 {
     if (CreateNewTargetItem != null)
     {
         CreateNewTargetItem.Invoke(this, e);
     }
 }
Exemplo n.º 2
0
        //private void OnCreateNewLexEntry(object sender,
        //                                      CreateNewArgs e)
        //{
        //    LexEntry newGuy = CreateNewLexEntry(e);
        //    e.NewlyCreatedItem = newGuy;

        //}

        private void OnCreateNewPairStringLexEntryId(object sender, CreateNewArgs e)
        {
            LexEntry newGuy = CreateNewLexEntry(e);
            IWritingSystemDefinition writingSystem = GetWritingSystemFromField();

            _lexEntryRepository.SaveItem(newGuy);
            _resultSet         = _lexEntryRepository.GetAllEntriesSortedByLexicalFormOrAlternative(writingSystem);
            e.NewlyCreatedItem = GetRecordTokenFromLexEntry(newGuy);
        }
Exemplo n.º 3
0
        private LexEntry CreateNewLexEntry(CreateNewArgs e)
        {
            LexEntry newGuy = _lexEntryRepository.CreateItem();
            // If we're creating from a previously deleted word, omit the guid part of the stored label.
            // See https://jira.sil.org/browse/WS-96 for a picture of what could happen otherwise.
            // Also restore the guid in case this form was referred to more than once.
            string word = e.LabelOfNewItem;
            Match  m    = Regex.Match(e.LabelOfNewItem, "_[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}");

            if (m.Success)
            {
                word        = e.LabelOfNewItem.Substring(0, m.Index);
                newGuy.Guid = new Guid(m.Value.Substring(1));
            }
            newGuy.LexicalForm.SetAlternative(_field.WritingSystemIds[0], word);
            //hack: if something is a baseform itself, it isn't likely to have its own baseform
            //This satisfies Rene's request of WS-419
            if (_field.FieldName == "BaseForm")
            {
                newGuy.SetFlag(LexEntry.WellKnownProperties.FlagSkipBaseform);
            }
            return(newGuy);
        }
 private static void _control_CreateNewClicked(object sender, CreateNewArgs e)
 {
     //_createNewClickedFired=true;
 }
 private static void OnCreateNewTargetItem(object sender, CreateNewArgs e)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 private static void _control_CreateNewClicked(object sender, CreateNewArgs e)
 {
     //_createNewClickedFired=true;
 }
 private static void OnCreateNewTargetItem(object sender, CreateNewArgs e)
 {
     throw new Exception("The method or operation is not implemented.");
 }