Exemple #1
0
        //private bool? _prevTestFrameIsMoreToFollow = null;

        public void MergeWith(Extensions extensions)
        {
            if (extensions.ExtensionsList.Count > 0)
            {
                if (ExtensionsList.Count > 0)
                {
                    var last = ExtensionsList[ExtensionsList.Count - 1];
                    if (last.properties1.type != (byte)ExtensionTypes.Test)
                    {
                        last.properties1.moreToFollow = 1;
                    }
                }
                ExtensionsList.AddRange(extensions.ExtensionsList);
            }
            if (extensions.EncryptedExtensionsList.Count > 0)
            {
                if (EncryptedExtensionsList.Count > 0)
                {
                    var last = EncryptedExtensionsList[EncryptedExtensionsList.Count - 1];
                    if (last.properties1.type != (byte)ExtensionTypes.Test)
                    {
                        last.properties1.moreToFollow = 1;
                    }
                }
                EncryptedExtensionsList.AddRange(extensions.EncryptedExtensionsList);
            }
        }
        void MoveBottomButton_Click(object sender, RoutedEventArgs args)
        {
            if (Extensions.Count < 2)
            {
                return;
            }

            var index    = ExtensionsList.SelectedIndex;
            var newindex = ExtensionsList.Items.Count - 1;

            if (index == ExtensionsList.Items.Count - 1)
            {
                ExtensionsList.Focus();
                return;
            }

            var target = Extensions[index];

            Extensions.RemoveAt(index);

            Extensions.Insert(newindex, target);

            SyncWithUI();
            SyncSelection(newindex);
        }
        void MoveDownButton_Click(object sender, RoutedEventArgs args)
        {
            if (Extensions.Count < 2)
            {
                return;
            }

            var index    = ExtensionsList.SelectedIndex;
            var newindex = index + 1;

            if (index == ExtensionsList.Items.Count - 1)
            {
                ExtensionsList.Focus();
                return;
            }

            SwapItems(index, newindex);
        }
Exemple #4
0
        public void AddMosExtension()
        {
            if (ExtensionsList.Count > 0)
            {
                ExtensionsList[ExtensionsList.Count - 1].properties1.moreToFollow = 1;
            }

            ExtensionsList.Add(
                new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1
            {
                extensionLength = GetLengthByExtensionType(ExtensionTypes.Mos),
                properties1     = new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1.Tproperties1
                {
                    moreToFollow = 0,
                    critical     = 0,
                    type         = (byte)ExtensionTypes.Mos
                }
            });
        }
Exemple #5
0
        public void AddSpanExtension(byte[] senderEntropyInput)
        {
            if (ExtensionsList.Count > 0)
            {
                ExtensionsList[ExtensionsList.Count - 1].properties1.moreToFollow = 1;
            }

            ExtensionsList.Add(
                new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1
            {
                extensionLength = GetLengthByExtensionType(ExtensionTypes.Span),
                properties1     = new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1.Tproperties1
                {
                    moreToFollow = 0,
                    critical     = 1,
                    type         = (byte)ExtensionTypes.Span
                },
                extension = new List <byte>(senderEntropyInput)
            });
        }
Exemple #6
0
        public void AddMpanGrpExtension(byte groupId)
        {
            if (ExtensionsList.Count > 0)
            {
                ExtensionsList[ExtensionsList.Count - 1].properties1.moreToFollow = 1;
            }

            ExtensionsList.Add(
                new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1
            {
                extensionLength = GetLengthByExtensionType(ExtensionTypes.MpanGrp),
                properties1     = new COMMAND_CLASS_SECURITY_2.SECURITY_2_MESSAGE_ENCAPSULATION.TVG1.Tproperties1
                {
                    moreToFollow = 0,
                    critical     = 1,
                    type         = (byte)ExtensionTypes.MpanGrp
                },
                extension = new List <byte>(new[] { groupId })
            });
        }
 void SyncSelection(int index)
 {
     ExtensionsList.SelectedIndex = index;
     ExtensionsList.Focus();
     ExtensionsList.ScrollIntoView(ExtensionsList.SelectedItem);
 }