Exemplo n.º 1
0
        internal FtSequence New(FtFieldDefinitionList fieldDefinitionList)
        {
            FtSequence sequence = SequenceFactory.CreateSequence(Count);

            sequence.LoadRootFieldDefinitionList(fieldDefinitionList);
            return(sequence);
        }
Exemplo n.º 2
0
        internal FtSequenceInvokation TryPredictedNew(int index, FtSequence sequence, int fieldIndex)
        {
            if (index >= PredictCount || index != Count)
            {
                return(null);
            }
            else
            {
                FtSequenceInvokation predictedInvokation = list[index];

                if (predictedInvokation.Sequence != sequence)
                {
                    return(null);
                }
                else
                {
                    if (predictedInvokation.StartFieldIndex != fieldIndex)
                    {
                        return(null);
                    }
                    else
                    {
                        predictedInvokation.Restart(fieldIndex);
                        count++;
                        return(predictedInvokation);
                    }
                }
            }
        }
Exemplo n.º 3
0
        internal FtSequence New()
        {
            FtSequence sequence = SequenceFactory.CreateSequence(Count);

            list.Add(sequence);
            return(sequence);
        }
Exemplo n.º 4
0
        internal FtSequenceInvokation New(FtSequence sequence, int fieldIndex)
        {
            FtSequenceInvokation invokation = new FtSequenceInvokation(Count, sequence, fieldIndex);

            invokation.SequenceRedirectEvent += HandleSequenceRedirectEvent;
            list.Add(invokation);
            count = list.Count;
            return(invokation);
        }
Exemplo n.º 5
0
        internal protected virtual void LoadMeta(FtMetaSequenceRedirect metaSequenceRedirect, FtMetaSequenceList metaSequenceList, FtSequenceList sequenceList)
        {
            type            = metaSequenceRedirect.Type;
            invokationDelay = metaSequenceRedirect.InvokationDelay;

            int sequenceIdx = metaSequenceList.IndexOf(metaSequenceRedirect.Sequence);

            if (sequenceIdx < 0)
            {
                throw FtInternalException.Create(InternalError.FtSequenceRedirect_LoadMeta_MetaSequenceRedirectSequenceNotFoundInMetaSequenceList, metaSequenceRedirect.Sequence.Name); // should never happen
            }
            else
            {
                sequence = sequenceList[sequenceIdx]; // sequenceList are in same order as Meta Sequence List
            }
        }
Exemplo n.º 6
0
        internal FtSequenceInvokation(int myIndex, FtSequence mySequence, int myStartFieldIndex)
        {
            index           = myIndex;
            sequence        = mySequence;
            startFieldIndex = myStartFieldIndex;

            int sequenceItemCount = sequence.ItemList.Count;

            fieldList = new FieldList(sequenceItemCount);

            for (int i = 0; i < sequenceItemCount; i++)
            {
                FtField field = FieldFactory.CreateField(this, sequence.ItemList[i]);
                field.Index = myStartFieldIndex + i;
                field.SequenceRedirectEvent += HandleSequenceRedirectEvent;
                fieldList.Add(field);
            }

            fieldsSidelinedFromIndex = sequenceItemCount;
        }
Exemplo n.º 7
0
        public FtSerializationException(FtSerializationError error, FtField field, string message, Exception innerException) : base(Enum.GetName(typeof(FtSerializationError), error) + ((message == "")? "": (": " + message)), innerException)
        {
            state.Error = error;
            if (field == null)
            {
                state.FieldName         = null;
                state.FieldIndex        = -1;
                state.SequenceName      = null;
                state.SequenceItemIndex = -1;
            }
            else
            {
                state.FieldName  = field.Name;
                state.FieldIndex = field.Index;
                FtSequence sequence = field.Sequence;
                if (sequence == null)
                {
                    state.SequenceName = null;
                }
                else
                {
                    state.SequenceName = sequence.Name;
                }
                FtSequenceItem sequenceItem = field.SequenceItem;
                if (sequenceItem == null)
                {
                    state.SequenceItemIndex = -1;
                }
                else
                {
                    state.SequenceItemIndex = sequenceItem.Index;
                }
            }

            SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs)
            {
                eventArgs.AddSerializedState(state);
            };
        }
Exemplo n.º 8
0
        public FtField(FtSequenceInvokation mySequenceInvokation, FtSequenceItem mySequenceItem, bool myValueTextNullTrimmable)
        {
            definition             = mySequenceItem.FieldDefinition;
            sequence               = mySequenceInvokation.Sequence;
            sequenceItem           = mySequenceItem;
            sequenceRedirectList   = mySequenceItem.RedirectList;
            sequenceInvokation     = mySequenceInvokation;
            valueTextNullTrimmable = myValueTextNullTrimmable;

            name     = definition.MetaName;
            headings = new string[definition.MetaHeadingCount];
            Array.Copy(definition.MetaHeadings, headings, definition.MetaHeadingCount);

            if (definition.Constant)
            {
                valueIsNull = definition.Null;
            }
            else
            {
                valueIsNull = true;
            }
        }
Exemplo n.º 9
0
 private void HandleSequenceRedirectEvent(FtField field, FtSequence sequence, FtSequenceInvokationDelay delay,
                                          out int fieldsAffectedFromIndex)
 {
     if (field != redirectingField)
     {
         if (sequence == null)
         {
             fieldsAffectedFromIndex = FtField.NoFieldsAffectedIndex;
         }
         else
         {
             SequenceRedirectEvent(field, sequence, delay, out fieldsAffectedFromIndex);
             redirectingField = field;
         }
     }
     else
     {
         SequenceRedirectEvent(field, sequence, delay, out fieldsAffectedFromIndex);
         if (sequence == null)
         {
             redirectingField = null;
         }
     }
 }
Exemplo n.º 10
0
 private void HandleSequenceRedirectEvent(FtField field, FtSequence sequence, FtSequenceInvokationDelay delay,
                                          out int fieldsAffectedFromIndex)
 {
     SequenceRedirectEvent(field, sequence, delay, out fieldsAffectedFromIndex);
 }
Exemplo n.º 11
0
 protected void OnSequenceRedirect(FtSequence sequence, FtSequenceInvokationDelay delay, out int fieldsAffectedFromIndex)
 {
     SequenceRedirectEvent(this, sequence, delay, out fieldsAffectedFromIndex);
 }
Exemplo n.º 12
0
 private FtSequenceInvokation(FtSequence mySequence, int myStartFieldIndex)
 {
     sequence        = mySequence;
     startFieldIndex = myStartFieldIndex;
 }