Exemplo n.º 1
0
 /// <summary>
 /// Searches for the specified PropertySpec and returns the zero-based index of the first
 /// occurrence within the entire PropertySpecCollection.
 /// </summary>
 /// <param name="value">The PropertySpec to locate in the PropertySpecCollection.</param>
 /// <returns>The zero-based index of the first occurrence of value within the entire PropertySpecCollection,
 /// if found; otherwise, -1.</returns>
 internal int IndexOf(PropertySpec value)
 {
     return innerArray.IndexOf(value);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the PropertySpecCollection.
 /// </summary>
 /// <param name="obj">The PropertySpec to remove from the PropertySpecCollection.</param>
 internal void Remove(PropertySpec obj)
 {
     innerArray.Remove(obj);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the elements of an array of PropertySpec objects to the end of the PropertySpecCollection.
 /// </summary>
 /// <param name="array">The PropertySpec array whose elements should be added to the end of the
 /// PropertySpecCollection.</param>
 internal void AddRange(PropertySpec[] array)
 {
     innerArray.AddRange(array);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Copies the entire PropertySpecCollection to a compatible one-dimensional Array, starting at the
 /// beginning of the target array.
 /// </summary>
 /// <param name="array">The one-dimensional Array that is the destination of the elements copied
 /// from PropertySpecCollection. The Array must have zero-based indexing.</param>
 internal void CopyTo(PropertySpec[] array)
 {
     innerArray.CopyTo(array);
 }
Exemplo n.º 5
0
        private PropertySpec GetQuestPartProperties(DataColumn col)
        {
            PropertySpec spec = new PropertySpec(col.ColumnName, col.DataType, null, null, col.DefaultValue);
            switch (col.ColumnName)
            {
                case DB.COL_QUESTPART_ID:
                case DB.COL_QUESTPART_POSITION:
                    spec.Category = "System";
                    spec.Attributes = new Attribute[] { new ReadOnlyAttribute(true) };
                    break;
                case DB.COL_QUESTPART_DEFAULTNPC:
                    spec.Category = "General";
                    spec.Description = "The default npc which is used if no specific npc is defined in a child element of this questpart.";
                    spec.ConverterTypeName = typeof(NPCConverter).FullName;
                    break;
                case DB.COL_QUESTPART_CATEGORYAUTOGENERATE:
                case DB.COL_QUESTPART_CATEGORY:
                    spec.Category = "General";
                    spec.Description = "A list of categories seperated by \";\" used to filter the given questparts.";
                    //spec.ConverterTypeName = typeof(RegionConverter).FullName;
                    break;
                case DB.COL_QUESTPART_MAXEXECUTIONS:
                    spec.Category = "General";
                    spec.Description = "Maximum number of executions this questpart should be executed during on quest for each player. Attention: Will work only for queststeps AFTER the quest was given to the player. (The player must be doing the quest)";
                    break;

            }

            return spec;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the PropertySpecEventArgs class.
 /// </summary>
 /// <param name="property">The PropertySpec that represents the property whose
 /// value is being requested or set.</param>
 /// <param name="val">The current value of the property.</param>
 internal PropertySpecEventArgs(PropertySpec property, object val)
 {
     this.property = property;
     this.val = val;
 }
Exemplo n.º 7
0
 public PropertySpecDescriptor(PropertySpec item, PropertyBag bag, string name, Attribute[] attrs) :
     base(name, attrs)
 {
     this.bag  = bag;
     this.item = item;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Searches for the specified PropertySpec and returns the zero-based index of the first
 /// occurrence within the entire PropertySpecCollection.
 /// </summary>
 /// <param name="value">The PropertySpec to locate in the PropertySpecCollection.</param>
 /// <returns>The zero-based index of the first occurrence of value within the entire PropertySpecCollection,
 /// if found; otherwise, -1.</returns>
 public int IndexOf(PropertySpec value)
 {
     return innerArray.IndexOf(value);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Inserts a PropertySpec object into the PropertySpecCollection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The PropertySpec to insert.</param>
 public void Insert(int index, PropertySpec value)
 {
     innerArray.Insert(index, value);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the PropertySpecCollection.
 /// </summary>
 /// <param name="obj">The PropertySpec to remove from the PropertySpecCollection.</param>
 public void Remove(PropertySpec obj)
 {
     innerArray.Remove(obj);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Searches for the specified PropertySpec and returns the zero-based index of the first
 /// occurrence within the entire PropertySpecCollection.
 /// </summary>
 /// <param name="value">The PropertySpec to locate in the PropertySpecCollection.</param>
 /// <returns>The zero-based index of the first occurrence of value within the entire PropertySpecCollection,
 /// if found; otherwise, -1.</returns>
 public int IndexOf(PropertySpec value)
 {
     return(innerArray.IndexOf(value));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Determines whether a PropertySpec is in the PropertySpecCollection.
 /// </summary>
 /// <param name="item">The PropertySpec to locate in the PropertySpecCollection. The element to locate
 /// can be a null reference (Nothing in Visual Basic).</param>
 /// <returns>true if item is found in the PropertySpecCollection; otherwise, false.</returns>
 public bool Contains(PropertySpec item)
 {
     return(innerArray.Contains(item));
 }
Exemplo n.º 13
0
            /// <summary>
            /// Adds a PropertySpec to the end of the PropertySpecCollection.
            /// </summary>
            /// <param name="value">The PropertySpec to be added to the end of the PropertySpecCollection.</param>
            /// <returns>The PropertySpecCollection index at which the value has been added.</returns>
            public int Add(PropertySpec value)
            {
                int index = innerArray.Add(value);

                return(index);
            }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the PropertySpecEventArgs class.
 /// </summary>
 /// <param name="property">The PropertySpec that represents the property whose
 /// value is being requested or set.</param>
 /// <param name="val">The current value of the property.</param>
 public PropertySpecEventArgs(PropertySpec property, object val)
 {
     this.property = property;
     this.val      = val;
 }
Exemplo n.º 15
0
 private PropertySpec getLocationProperties(DataColumn col)
 {
     PropertySpec spec = new PropertySpec(col.ColumnName, col.DataType, null, null, col.DefaultValue);
     switch (col.ColumnName)
     {
         case "ID":
             spec.Attributes = new Attribute[] { BrowsableAttribute.No };
             break;
         case "RegionID":
             spec.ConverterTypeName = typeof(RegionConverter).FullName;
             spec.Category = "Location";
             break;
         case "Heading":
         case "X":
         case "Y":
         case "Z":
             spec.Category = "Location";
             break;
     }
     return spec;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Copies the entire PropertySpecCollection to a compatible one-dimensional Array, starting at the
 /// beginning of the target array.
 /// </summary>
 /// <param name="array">The one-dimensional Array that is the destination of the elements copied
 /// from PropertySpecCollection. The Array must have zero-based indexing.</param>
 public void CopyTo(PropertySpec[] array)
 {
     innerArray.CopyTo(array);
 }
Exemplo n.º 17
0
 private PropertySpec getAreaSquareProperties(DataColumn col)
 {
     PropertySpec spec = new PropertySpec(col.ColumnName, col.DataType, null, null, col.DefaultValue);
     switch (col.ColumnName)
     {
         case DB.COL_AREA_REGIONID:
             spec.ConverterTypeName = typeof(RegionConverter).FullName;
             spec.Category = "Location";
             break;
         case DB.COL_AREA_X:
             spec.Description = "X Coordinate of Square";
             spec.Category = "Location";
             break;
         case DB.COL_AREA_Y:
             spec.Description = "Y Coordinate of Square";
             spec.Category = "Location";
             break;
         case DB.COL_AREA_Z:
             spec.Name = "Width";
             spec.Description = "Width of Square";
             spec.Category = "Location";
             break;
         case DB.COL_AREA_R:
             spec.Name = "Height";
             spec.Description = "Height of Square";
             spec.Category = "Location";
             break;
         case DB.COL_AREA_AREATYPE:
             spec.ConverterTypeName = typeof(AreaTypeConverter).FullName;
             break;
         case DB.COL_AREA_SOUND:
         case DB.COL_AREA_CHECKLOS:
         case DB.COL_AREA_CANBROADCAST:
         case DB.COL_AREA_ISSAFEAREA:
         case DB.COL_AREA_DISPLAYMESSAGE:
             spec.Category = "Settings";
             break;
     }
     return spec;
 }
Exemplo n.º 18
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the PropertySpecCollection.
 /// </summary>
 /// <param name="obj">The PropertySpec to remove from the PropertySpecCollection.</param>
 public void Remove(PropertySpec obj)
 {
     innerArray.Remove(obj);
 }
Exemplo n.º 19
0
        private PropertySpec getNPCProperties(DataColumn col)
        {
            PropertySpec spec = new PropertySpec(col.ColumnName, col.DataType, null, null, col.DefaultValue);
            switch (col.ColumnName)
            {
                case DB.COL_NPC_X:
                case DB.COL_NPC_Y:
                case DB.COL_NPC_Z:
                case DB.COL_NPC_HEADING:
                    spec.Category = "Location";
                    break;
                case DB.COL_NPC_REGION:
                    spec.ConverterTypeName = typeof(RegionConverter).FullName;
                    spec.Category = "Location";
                    break;
                case "RespawnInterval":
                    spec.Description = "Insert respawn value in milliseconds, 1000 = 1 second.\n-1 default respawn interval computed based on level and realm.";
                    spec.Category = "Internal";
                    break;
                case "ClassType":
                case "FactionID":
                case "Flags":
                case "MobID":
                case "ObjectName":
                    spec.Category = "Internal";
                    break;
                case "Model":
                case "Size":
                case "EquipmentTemplateID":
                    spec.Category = "Visual";
                    break;
                case DB.COL_NPC_REALM:
                    spec.ConverterTypeName = typeof(RealmConverter).FullName;
                    break;
                case "DamageType":
                    spec.ConverterTypeName = typeof(DamageTypeConverter).FullName;
                    break;
            }

            return spec;
        }
Exemplo n.º 20
0
        private void session_NewTransactionNode(TransactionNode node)
        {
            string id = Convert.ToString(nodes.Count);

            PropertySpec propSpec = new PropertySpec(id, node.GetType(), "Packet");
            propSpec.Description = node.Name;
            propSpec.Attributes = new Attribute[1] { new ReadOnlyAttribute(true) };
            Properties.Add(propSpec);
            this[id] = node;

            nodes.Add(node);

            List<IPPacket> packets = new List<IPPacket>();
            foreach (PacketSlice slice in node.GetAllSlices())
            {
                if (!packetIndexToNodes.ContainsKey(slice.Packet.Index))
                    packetIndexToNodes[slice.Packet.Index] = new List<TransactionNode>(1);

                packetIndexToNodes[slice.Packet.Index].Add(node);

                if (!packets.Contains(slice.Packet))
                    packets.Add(slice.Packet);
            }

            PacketDescriptionReceived(packets.ToArray(),
                (node.Description.Length > 0) ? node.Description : node.Name);
        }
Exemplo n.º 21
0
        public void AddChild(TransactionNode node)
        {
            children.Add(node);
            childrenDict[node.Name] = node;

            PropertySpec propSpec = new PropertySpec(node.Name, typeof(TransactionNode), "Packet");
            propSpec.Description = node.Name;
            propSpec.Attributes = new Attribute[1] { new ReadOnlyAttribute(true) };
            Properties.Add(propSpec);
            this[node.Name] = node;
        }
Exemplo n.º 22
0
            /// <summary>
            /// Adds a PropertySpec to the end of the PropertySpecCollection.
            /// </summary>
            /// <param name="value">The PropertySpec to be added to the end of the PropertySpecCollection.</param>
            /// <returns>The PropertySpecCollection index at which the value has been added.</returns>
            internal int Add(PropertySpec value)
            {
                int index = innerArray.Add(value);

                return index;
            }
Exemplo n.º 23
0
 protected void AddSpecialField(string name, object value, object formattedValue, string description, List<PacketSlice> slices, Type editorType)
 {
     this.fieldNames.Add(name);
     this.fields[name] = value;
     PropertySpec propSpec = new PropertySpec(name, typeof(string), "Packet");
     propSpec.Description = description;
     propSpec.Attributes = new Attribute[2] {
             new System.ComponentModel.EditorAttribute(editorType, typeof(System.Drawing.Design.UITypeEditor)),
             new ReadOnlyAttribute(true)
         };
     Properties.Add(propSpec);
     this[name] = formattedValue;
     AddFieldSlices(name, slices);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Determines whether a PropertySpec is in the PropertySpecCollection.
 /// </summary>
 /// <param name="item">The PropertySpec to locate in the PropertySpecCollection. The element to locate
 /// can be a null reference (Nothing in Visual Basic).</param>
 /// <returns>true if item is found in the PropertySpecCollection; otherwise, false.</returns>
 internal bool Contains(PropertySpec item)
 {
     return innerArray.Contains(item);
 }
Exemplo n.º 25
0
        private PropertySpec getItemProperties(DataColumn col)
        {
            PropertySpec spec = new PropertySpec(col.ColumnName, col.DataType, null, null, col.DefaultValue);
            switch (col.ColumnName)
            {
                case "Bonus":
                case "Bonus1":
                case "Bonus2":
                case "Bonus3":
                case "Bonus4":
                case "Bonus5":
                case "Bonus6":
                case "Bonus7":
                case "Bonus8":
                case "Bonus9":
                case "Bonus10":
                case "ExtraBonus":
                    spec.Category = "Magic";
                    break;
                case "Bonus1Type":
                case "Bonus2Type":
                case "Bonus3Type":
                case "Bonus4Type":
                case "Bonus5Type":
                case "Bonus6Type":
                case "Bonus7Type":
                case "Bonus8Type":
                case "Bonus9Type":
                case "Bonus10Type":
                case "ExtraBonusType":
                    spec.Category = "Magic";
                    spec.ConverterTypeName = typeof(ItemBonusTypeConverter).FullName;
                    break;
                case "SpellID":
                case "ProcSpellID":
                case "SpellID1":
                case "ProcSpellID1":
                case "Charges":
                case "Charges1":
                case "MaxCharges":
                case "MaxCharges1":
                case "PoisonCharges":
                case "PoisonMaxCharges":
                case "PoisonSpellID":
                    spec.Category = "Magic";
                    break;
                case "Extension":
                    spec.Category = "Visual";
                    spec.ConverterTypeName = typeof(ExtensionConverter).FullName;
                    break;
                case "Effect":
                    spec.Category = "Visual";
                    spec.ConverterTypeName = typeof(EffectConverter).FullName;
                    break;
                case "Model":
                case "Emblem":
                    spec.Category = "Visual";
                    break;
                case "Color":
                    spec.ConverterTypeName = typeof(DOL.Tools.QuestDesigner.Converter.ColorConverter).FullName;
                    spec.Category = "Visual";
                    break;
                case "Item_Type":
                    spec.ConverterTypeName = typeof(ItemTypeConverter).FullName;
                    spec.Category = "Internal";
                    break;
                case "Object_Type":
                    spec.ConverterTypeName = typeof(ObjectTypeConverter).FullName;
                    spec.Category = "Internal";
                    break;
                case "Hand":
                    spec.ConverterTypeName = typeof(HandConverter).FullName;
                    spec.Category = "Internal";
                    break;
                case "ItemTemplateID":
                    spec.Category = "Internal";
                    break;

                case "Durability":
                case "MaxDurability":
                case "Quality":
                case "Condition":
                case "MaxCondition":
                case "PackSize":
                case "MaxCount":
                case "Weight":
                    spec.Category = "Stats";
                    break;
                case "Realm":
                    spec.ConverterTypeName = typeof(RealmConverter).FullName;
                    break;
                case "Type_Damage":
                    spec.ConverterTypeName = typeof(DamageTypeConverter).FullName;
                    break;

            }
            return spec;
        }
Exemplo n.º 26
0
 /// <summary>
 /// Copies the PropertySpecCollection or a portion of it to a one-dimensional array.
 /// </summary>
 /// <param name="array">The one-dimensional Array that is the destination of the elements copied
 /// from the collection.</param>
 /// <param name="index">The zero-based index in array at which copying begins.</param>
 internal void CopyTo(PropertySpec[] array, int index)
 {
     innerArray.CopyTo(array, index);
 }
Exemplo n.º 27
0
 /// <summary>
 /// Adds the elements of an array of PropertySpec objects to the end of the PropertySpecCollection.
 /// </summary>
 /// <param name="array">The PropertySpec array whose elements should be added to the end of the
 /// PropertySpecCollection.</param>
 public void AddRange(PropertySpec[] array)
 {
     innerArray.AddRange(array);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Inserts a PropertySpec object into the PropertySpecCollection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which value should be inserted.</param>
 /// <param name="value">The PropertySpec to insert.</param>
 internal void Insert(int index, PropertySpec value)
 {
     innerArray.Insert(index, value);
 }
Exemplo n.º 29
0
 /// <summary>
 /// Determines whether a PropertySpec is in the PropertySpecCollection.
 /// </summary>
 /// <param name="item">The PropertySpec to locate in the PropertySpecCollection. The element to locate
 /// can be a null reference (Nothing in Visual Basic).</param>
 /// <returns>true if item is found in the PropertySpecCollection; otherwise, false.</returns>
 public bool Contains(PropertySpec item)
 {
     return innerArray.Contains(item);
 }
Exemplo n.º 30
0
 internal PropertySpecDescriptor(PropertySpec item, PropertyBag bag, string name, Attribute[] attrs)
     : base(name, attrs)
 {
     this.bag = bag;
     this.item = item;
 }
Exemplo n.º 31
0
 public int Add(PropertySpec value)
 {
     return(innerArray.Add(value));
 }