Beispiel #1
0
        /// <summary>
        ///     Adds an edge label and optional edge properties to the edge.
        /// </summary>
        /// <param name="label">Label of the edge</param>
        /// <param name="properties">
        ///     Properties of the edge as a tuple where Item1 is the property name
        ///     and Item2 is the property value.
        /// </param>
        /// <returns>This entity object.</returns>
        public Entity AddEdgeLabel(string label, List <Tuple <string, string> > properties = null)
        {
            if (HasEdgeLabel)
            {
                throw new InvalidOperationException("Only one edge label per edge is allowed!");
            }

            AdditionalFields.Add(new AdditionalField("link#maltego.link.label", null, label));
            AdditionalFields.Add(new AdditionalField("link#maltego.link.show-label", null, "1"));

            if (properties != null)
            {
                for (var i = 0; i < properties.Count; i++)
                {
                    AdditionalFields.Add(new AdditionalField("link#" + i, properties[i].Item1, properties[i].Item2));
                }
            }

            HasEdgeLabel = true;

            return(this);
        }
Beispiel #2
0
 private void AddField()
 {
     AdditionalFields.Add(new EntryFieldVm(_cryptography));
     AdditionalFieldSelectedIndex = AdditionalFields.Count - 1;
 }