Store metadata per segment (SetMetaData)

Hi,

I would like to store some metadata in a project per segment (e.g. an additional identifier). For example, for segment 10, this would look like: ActiveDocument.SegmentPairs.ElementAt(10).Target.Properties.TranslationOrigin.SetMetaData("MyKey", "Meta data information");


This used to work in the past. However, after doing this on a Japanese translation segment, it does not seem to work anymore. After executing this code, "MyKey" is not added.

However, in the debugger, when I invoke this method, the item is added to MetaData.

Does anyone has a clue?

Are there other (better) ways to store information at a segment?

Best regards,
Henk
Parents Reply
  • It does not seem to work. In 2015 build 4996, the following call to UpdateSegmentPair does not set the metadata:

    activeSegmentPair.Properties.TranslationOrigin.SetMetaData("MYID","12345");
    ActiveDocument.UpdateSegmentPair(activeSegmentPair);

    If I attempt to retrieve the metadata:

    string mymetadata = activeSegmentPair.Target.Properties.TranslationOrigin.GetMetaData("MYID");

    Then mymetadata is null.

    The code above used to work for older versions (< build 4996).

    I also saw this metadata retrieval sometimes result in a null reference exception: "Object reference not set to an instance of an object.". We do not get this exception with each call. Sometimes it seems to succeed.

Children
No Data