Exemple #1
0
        public FtMetaSubstitution New()
        {
            FtMetaSubstitution result = SubstitutionFactory.CreateMetaSubstitution();

            Add(result);
            return(result);
        }
Exemple #2
0
        public FtMetaSubstitution CreateCopy()
        {
            FtMetaSubstitution substitution = SubstitutionFactory.CreateMetaSubstitution();

            substitution.Assign(this);
            return(substitution);
        }
Exemple #3
0
        public void Assign(FtMetaSubstitutionList source)
        {
            list.Clear();
            list.Capacity = source.Count;

            for (int i = 0; i < source.Count; i++)
            {
                FtMetaSubstitution substitution = source[i].CreateCopy();
                Add(substitution);
            }
        }
Exemple #4
0
        public void LoadMeta(FtMetaSubstitution metaSubstitution, FtEndOfLineAutoWriteType autoWriteType)
        {
            type  = metaSubstitution.Type;
            token = metaSubstitution.Token;
            switch (type)
            {
            case FtSubstitutionType.String:
                value = metaSubstitution.Value;
                break;

            case FtSubstitutionType.AutoEndOfLine:
                switch (autoWriteType)
                {
                case FtEndOfLineAutoWriteType.CrLf:
                    value = SerializationCore.CarriageReturnLineFeedString;
                    break;

                case FtEndOfLineAutoWriteType.Cr:
                    value = SerializationCore.CarriageReturnChar.ToString();
                    break;

                case FtEndOfLineAutoWriteType.Lf:
                    value = SerializationCore.LineFeedChar.ToString();
                    break;

                case FtEndOfLineAutoWriteType.Local:
                    value = System.Environment.NewLine;
                    break;

                default:
                    throw FtInternalException.Create(InternalError.FtSubstitution_LoadMeta_UnsupportedAutoWriteType, autoWriteType.ToString());
                }
                value = metaSubstitution.Value;
                break;
            }
        }
Exemple #5
0
 public void Remove(FtMetaSubstitution substitution)
 {
     list.Remove(substitution);
 }
Exemple #6
0
 public void Add(FtMetaSubstitution substitution)
 {
     list.Add(substitution);
 }
Exemple #7
0
 public virtual void Assign(FtMetaSubstitution source)
 {
     Type  = source.Type;
     Token = source.Token;
     Value = source.Value;
 }