Ejemplo n.º 1
0
 internal void UnsidelineFields()
 {
     for (int i = fieldsSidelinedFromIndex; i < fieldList.Count; i++)
     {
         FtField field = fieldList[i];
         field.Index     = startFieldIndex + i;
         field.Sidelined = false;
         field.ResetValue();
     }
     fieldsSidelinedFromIndex = fieldList.Count;
 }
Ejemplo n.º 2
0
 internal void ResetFields(int startFieldIndex)
 {
     this.startFieldIndex = startFieldIndex;
     for (int i = 0; i < fieldList.Count; i++)
     {
         FtField field = fieldList[i];
         field.Index = this.startFieldIndex + i;
         if (i >= fieldsSidelinedFromIndex)
         {
             field.Sidelined = false;
         }
         field.ResetValue();
     }
 }
Ejemplo n.º 3
0
 internal override bool CheckTriggered(FtField field)
 {
     if (field.IsNull())
     {
         return(false);
     }
     else
     {
         try
         {
             return(field.AsRedirectDateTime == value);
         }
         catch (InvalidCastException) { return(false); }
         catch (FormatException) { return(false); }
         catch (OverflowException) { return(false); }
         catch (ArgumentNullException) { return(false); }
     }
 }
Ejemplo n.º 4
0
 internal override bool CheckTriggered(FtField field)
 {
     if (field.IsNull())
     {
         return(false);
     }
     else
     {
         try
         {
             return(string.Equals(field.AsRedirectString, value, StringComparison.OrdinalIgnoreCase));
         }
         catch (InvalidCastException) { return(false); }
         catch (FormatException) { return(false); }
         catch (OverflowException) { return(false); }
         catch (ArgumentNullException) { return(false); }
     }
 }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
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);
            };
        }
Ejemplo n.º 7
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;
         }
     }
 }
Ejemplo n.º 8
0
 private void HandleSequenceRedirectEvent(FtField field, FtSequence sequence, FtSequenceInvokationDelay delay,
                                          out int fieldsAffectedFromIndex)
 {
     SequenceRedirectEvent(field, sequence, delay, out fieldsAffectedFromIndex);
 }
Ejemplo n.º 9
0
 public FtSerializationException(FtSerializationError code, FtField field, string message) : this(code, field, message, null)
 {
 }
Ejemplo n.º 10
0
 public FtSerializationException(FtSerializationError code, FtField field, Exception innerException) : this(code, field, innerException.Message, innerException)
 {
 }
Ejemplo n.º 11
0
 internal abstract bool CheckTriggered(FtField field);
Ejemplo n.º 12
0
 internal void Add(FtField field)
 {
     list.Add(field);
 }