예제 #1
0
 private void Profile_OnUnknownProfileElement(object sender, UnknownProfileElementEventArgs e)
 {
     if (e.Element.Ancestors("Professionbuddy").Any())
     {
         e.Handled = true;
     }
 }
예제 #2
0
        public void Profile_OnUnknownProfileElement(object sender, UnknownProfileElementEventArgs e)
        {
            // hackish way to set variables to default states before loading new profile... wtb OnNewOuterProfileLoading event
            if (_loadProfileTimer.IsFinished)
            {
                _poolsToFish.Clear();
                _pathingType = PathingType.Circle;
                _loadProfileTimer.Reset();
            }

            if (e.Element.Name == "FishingSchool")
            {
                XAttribute entryAttrib = e.Element.Attribute("Entry");
                if (entryAttrib != null)
                {
                    uint entry;
                    UInt32.TryParse(entryAttrib.Value, out entry);
                    if (!_poolsToFish.Contains(entry))
                    {
                        _poolsToFish.Add(entry);
                        XAttribute nameAttrib = e.Element.Attribute("Name");
                        if (nameAttrib != null)
                        {
                            Log("Adding Pool Entry: {0} to the list of pools to fish from", nameAttrib.Value);
                        }
                        else
                        {
                            Log("Adding Pool Entry: {0} to the list of pools to fish from", entry);
                        }
                    }
                }
                else
                {
                    Err(
                        "<FishingSchool> tag must have the 'Entry' Attribute, e.g <FishingSchool Entry=\"202780\"/>\nAlso supports 'Name' attribute but only used for display purposes");
                }
                e.Handled = true;
            }
            else if (e.Element.Name == "Pathing")
            {
                XAttribute typeAttrib = e.Element.Attribute("Type");
                if (typeAttrib != null)
                {
                    _pathingType = (PathingType)
                                   Enum.Parse(typeof(PathingType), typeAttrib.Value, true);

                    Log("Setting Pathing Type to {0} Mode", _pathingType);
                }
                else
                {
                    Err(
                        "<Pathing> tag must have the 'Type' Attribute, e.g <Pathing Type=\"Circle\"/>");
                }
                e.Handled = true;
            }
        }
예제 #3
0
 public static void Profile_OnUnknownProfileElement(object sender, UnknownProfileElementEventArgs e)
 {
     if (e.Element.Name == "FishingSchool")
     {
         // hackish way to clear my list of pool before loading new profile... wtb OnNewOuterProfileLoading event
         if (Environment.TickCount - _lastUkTagCallTime > 4000)
         {
             PoolsToFish.Clear();
         }
         _lastUkTagCallTime = Environment.TickCount;
         XAttribute entryAttrib = e.Element.Attribute("Entry");
         if (entryAttrib != null)
         {
             uint entry;
             UInt32.TryParse(entryAttrib.Value, out entry);
             if (!PoolsToFish.Contains(entry))
             {
                 PoolsToFish.Add(entry);
                 XAttribute nameAttrib = e.Element.Attribute("Name");
                 if (nameAttrib != null)
                 {
                     Instance.Log("Adding Pool Entry: {0} to the list of pools to fish from",
                                  nameAttrib.Value);
                 }
                 else
                 {
                     Instance.Log("Adding Pool Entry: {0} to the list of pools to fish from", entry);
                 }
             }
         }
         else
         {
             Instance.Err(
                 "<FishingSchool> tag must have the 'Entry' Attribute, e.g <FishingSchool Entry=\"202780\"/>\nAlso supports 'Name' attribute but only used for display purposes");
         }
         e.Handled = true;
     }
     else if (e.Element.Name == "Pathing")
     {
         XAttribute typeAttrib = e.Element.Attribute("Type");
         if (typeAttrib != null)
         {
             Instance.MySettings.PathingType = (PathingType)
                                               Enum.Parse(typeof(PathingType), typeAttrib.Value, true);
             Instance.Log("Setting Pathing Type to {0} Mode",
                          Instance.MySettings.PathingType);
         }
         else
         {
             Instance.Err(
                 "<Pathing> tag must have the 'Type' Attribute, e.g <Pathing Type=\"Circle\"/>");
         }
         e.Handled = true;
     }
 }
 void Profile_OnUnknownProfileElement(object sender, UnknownProfileElementEventArgs e)
 {
     if (e.Element.Name == "FishingSchool")
     {
         // hackish way to clear my list of pool before loading new profile... wtb OnNewOuterProfileLoading event
         if (Environment.TickCount - _lastUkTagCallTime > 4000)
             AutoAngler.PoolsToFish.Clear();
         _lastUkTagCallTime = Environment.TickCount;
         var entryAttrib = e.Element.Attribute("Entry");
         if (entryAttrib != null)
         {
             uint entry;
             uint.TryParse(entryAttrib.Value, out entry);
             if (!AutoAngler.PoolsToFish.Contains(entry))
             {
                 AutoAngler.PoolsToFish.Add(entry);
                 var nameAttrib = e.Element.Attribute("Name");
                 if (nameAttrib != null)
                     AutoAngler.Instance.Log("Adding Pool Entry: {0} to the list of pools to fish from", nameAttrib.Value);
                 else
                     AutoAngler.Instance.Log("Adding Pool Entry: {0} to the list of pools to fish from", entry);
             }
         }
         else
         {
             AutoAngler.Instance.Err("<FishingSchool> tag must have the 'Entry' Attribute, e.g <FishingSchool Entry=\"202780\"/>\nAlso supports 'Name' attribute but only used for display purposes");
         }
         e.Handled = true;
     }
     else if (e.Element.Name == "Pathing")
     {
         var typeAttrib = e.Element.Attribute("Type");
         if (typeAttrib != null)
         {
             AutoAngler.Instance.MySettings.PathingType = (PathingType)
                 Enum.Parse(typeof(PathingType), typeAttrib.Value, true);
             AutoAngler.Instance.Log("Setting Pathing Type to {0} Mode", 
                 AutoAngler.Instance.MySettings.PathingType);
         }
         else
         {
             AutoAngler.Instance.Err("<Pathing> tag must have the 'Type' Attribute, e.g <Pathing Type=\"Circle\"/>");
         }
         e.Handled = true;
     }
 }