Beispiel #1
0
        /// <summary>
        /// Imports data from the given deserialization object
        /// </summary>
        /// <param name="plans"></param>
        internal void Import(IEnumerable <SerializablePlan> plans)
        {
            List <Plan> newPlanList = new List <Plan>();

            // We first update existing plans
            foreach (var serialPlan in plans)
            {
                // Filter plans which belong to this owner
                if (serialPlan.Owner != m_owner.Guid)
                {
                    continue;
                }

                // If a plan with the same name already exists, we update it
                var plan = this[serialPlan.Name];

                if (plan != null)
                {
                    plan.Import(serialPlan);
                }
                else
                {
                    plan = new Plan(m_owner, serialPlan);
                }

                newPlanList.Add(plan);
            }

            // We now add the new plans
            m_items.Clear();
            foreach (var plan in newPlanList)
            {
                m_items.Add(plan);
                plan.IsConnected = true;
            }

            // Fire the global event
            EveClient.OnCharacterPlanCollectionChanged(m_owner);
        }
Beispiel #2
0
 /// <summary>
 /// When the collection changed, the global event is fired
 /// </summary>
 protected override void OnChanged()
 {
     EveClient.OnCharacterPlanCollectionChanged(m_owner);
 }