示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XliffDocument"/> class.
 /// </summary>
 /// <param name="sourceLanguage">The language of the source text to translate.</param>
 public XliffDocument(string sourceLanguage)
 {
     this.RegisterElementInformation(ElementInformationFromReflection.Create(this));
     this.extensions     = new Lazy <List <IExtension> >();
     this.Files          = new ParentAttachedList <File>(this);
     this.SourceLanguage = sourceLanguage;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Segment"/> class.
        /// </summary>
        /// <param name="id">The Id of the segment.</param>
        /// <param name="state">The translation state of the segment.</param>
        public Segment(string id, TranslationState state)
            : base(id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.State = state;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Reference"/> class.
        /// </summary>
        /// <param name="href">An IRI referencing an external resource.</param>
        public Reference(string href)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.HRef       = href;
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceData"/> class.
        /// </summary>
        public ResourceData()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.ResourceItemReferences = new ParentAttachedList <ResourceItemRef>(this);
            this.ResourceItems          = new ParentAttachedList <ResourceItem>(this);
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Revision"/> class.
        /// </summary>
        public Revision()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Items      = new ParentAttachedList <Item>(this);
        }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceItem"/> class.
        /// </summary>
        public ResourceItem()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.References = new ParentAttachedList <Reference>(this);
        }
示例#7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Validation"/> class.
        /// </summary>
        public Validation()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Rules      = new ParentAttachedList <Rule>(this);
        }
示例#8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Group"/> class.
        /// </summary>
        /// <param name="id">The Id of the group.</param>
        /// <param name="internalCtor">True if this internal constructor was called that is used for deserialization,
        /// false if the public one was called.
        /// </param>
        private Group(string id, bool internalCtor)
            : base(id, internalCtor)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.Containers = new ParentAttachedList <TranslationContainer>(this);
        }
示例#9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Translation"/> class.
        /// </summary>
        /// <param name="id">The Id of the translation.</param>
        public Translation(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Id         = id;
        }
示例#10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Item"/> class.
        /// </summary>
        /// <param name="property">The type of revision data.</param>
        public Item(string property)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Property   = property;
        }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProfileData"/> class.
        /// </summary>
        /// <param name="profile">The normalization form to apply for general size restrictions.</param>
        public ProfileData(string profile)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Profile    = profile;
        }
示例#12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Match"/> class.
        /// </summary>
        /// <param name="sourceReference">The reference to to a span of source text within the same <see cref="Unit"/>,
        /// to which the translation candidate is relevant.</param>
        public Match(string sourceReference)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions      = new Lazy <List <IExtension> >();
            this.SourceReference = sourceReference;
        }
示例#13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceItemRef"/> class.
        /// </summary>
        /// <param name="reference">A reference to an associated <see cref="ResourceItem"/> element located at the
        /// <see cref="Localization.Xliff.OM.Core.File"/> level.</param>
        public ResourceItemRef(string reference)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.Reference  = reference;
        }
示例#14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeBase"/> class.
        /// </summary>
        /// <param name="id">The Id of the span.</param>
        protected CodeBase(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions     = new Lazy <List <IExtension> >();
            this.Id             = id;
            this.SubFormatStyle = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RevisionsContainer"/> class.
        /// </summary>
        /// <param name="appliesTo">The specific XLIFF element which is a sibling, or a child of a sibling element, to
        /// the change track module within the scope of the enclosing element.</param>
        public RevisionsContainer(string appliesTo)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
            this.AppliesTo  = appliesTo;
            this.Revisions  = new ParentAttachedList <Revision>(this);
        }
示例#16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Note"/> class.
        /// </summary>
        /// <param name="text">The text to put in the note.</param>
        public Note(string text)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions     = new Lazy <List <IExtension> >();
            this.SubFormatStyle = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            this.Text           = text;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ContainerResource"/> class.
        /// </summary>
        /// <param name="id">The Id of the container.</param>
        protected ContainerResource(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            if (id != null)
            {
                this.Id = id;
            }
        }
示例#18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Meta"/> class.
        /// </summary>
        /// <param name="type">The type of metadata contained by the enclosing element.</param>
        /// <param name="text">The non-translatable text.</param>
        public Meta(string type, string text)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.NonTranslatableText = text;

            if (type != null)
            {
                this.Type = type;
            }
        }
示例#19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MarkedSpanStart"/> class.
        /// </summary>
        /// <param name="id">The Id of the marked span.</param>
        public MarkedSpanStart(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions     = new Lazy <List <IExtension> >();
            this.Id             = id;
            this.SubFormatStyle = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            this.EnableAttribute(MarkedSpanStart.PropertyNames.EquivalentStorage, false);
            this.EnableAttribute(MarkedSpanStart.PropertyNames.SizeInfo, false);
            this.EnableAttribute(MarkedSpanStart.PropertyNames.SizeInfoReference, false);
        }
示例#20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GlossaryEntry"/> class.
        /// </summary>
        /// <param name="id">The Id of the entry.</param>
        public GlossaryEntry(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions   = new Lazy <List <IExtension> >();
            this.Id           = id;
            this.Term         = new Term();
            this.Translations = new ParentAttachedList <Translation>(this);

            // The default .ctor is called during deserialization and that is the only case where term can be overridden.
            this.storedTerm = id != null;
        }
示例#21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Data"/> class.
        /// </summary>
        /// <param name="id">The Id of the data.</param>
        /// <param name="text">The non-translatable text.</param>
        public Data(string id, string text)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.Id   = id;
            this.Text = new ParentAttachedList <ResourceStringContent>(this);

            if (text != null)
            {
                this.Text.Add(new PlainText(text));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TranslationContainer"/> class.
        /// </summary>
        /// <param name="id">The Id of the container.</param>
        /// <param name="canOverrideNotes">True if notes can be replaced during deserialization, false if they cannot.
        /// </param>
        internal TranslationContainer(string id, bool canOverrideNotes)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));
            this.EnableAttribute(TranslationContainer.PropertyNames.EquivalentStorage, false);

            this.extensions    = new Lazy <List <IExtension> >();
            this.noteContainer = new NoteContainer();
            Utilities.SetParent(this.noteContainer, this);

            this.Id             = id;
            this.SubFormatStyle = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            this.storedNotes    = !canOverrideNotes;
        }
示例#23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Unit"/> class.
        /// </summary>
        /// <param name="id">The Id of the unit.</param>
        /// <param name="internalCtor">True if this internal constructor was called that is used for deserialization,
        /// false if the public one was called.
        /// </param>
        private Unit(string id, bool internalCtor)
            : base(id, internalCtor)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.translationCandidates = new TranslationMatches();
            Utilities.SetParent(this.translationCandidates, this);

            // DEV NOTE: Order of segments must be maintained during serialization and deserialization so make sure
            // the order can be preserved. Using a type of list maintains order, but if you change this.Resources
            // to another type (like dictionary), make sure you have a way to maintain order.
            this.Resources = new ParentAttachedList <ContainerResource>(this);

            // The default .ctor is called during deserialization and that is the only case where matches can be overridden.
            this.storedMatches = !internalCtor;
        }
示例#24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="File"/> class.
        /// </summary>
        /// <param name="id">The Id of the file.</param>
        public File(string id)
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions    = new Lazy <List <IExtension> >();
            this.noteContainer = new NoteContainer();
            Utilities.SetParent(this.noteContainer, this);

            this.Containers     = new ParentAttachedList <TranslationContainer>(this);
            this.Id             = id;
            this.SubFormatStyle = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            this.storedNotes = true;

            this.EnableAttribute(File.PropertyNames.EquivalentStorage, false);
        }
示例#25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Ignorable"/> class.
 /// </summary>
 /// <param name="id">The Id of the element.</param>
 public Ignorable(string id)
     : base(id)
 {
     this.RegisterElementInformation(ElementInformationFromReflection.Create(this));
 }
示例#26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Rule"/> class.
        /// </summary>
        public Rule()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.extensions = new Lazy <List <IExtension> >();
        }
示例#27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XliffProvider"/> class.
 /// </summary>
 public XliffProvider()
 {
     this.RegisterElementInformation(ElementInformationFromReflection.Create(this));
 }
示例#28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TranslationMatches"/> class.
        /// </summary>
        public TranslationMatches()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.Matches = new ParentAttachedList <Match>(this);
        }
示例#29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetaGroup"/> class.
        /// </summary>
        public MetaGroup()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.Containers = new ParentAttachedList <MetaElement>(this);
        }
示例#30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OriginalData"/> class.
        /// </summary>
        public OriginalData()
        {
            this.RegisterElementInformation(ElementInformationFromReflection.Create(this));

            this.DataElements = new ParentAttachedList <Data>(this);
        }