示例#1
0
 private void MouserOverObjectExecute(IUniqueObject widget)
 {
     if (widget != null)
     {
         _ListEventAggregator.GetEvent <MouseOverInteractionObject>().Publish(widget);
     }
 }
示例#2
0
 internal WidgetNode(InteractionTabVM tabVM, IUniqueObject target, ObjectType type, bool isSelected)
 {
     _targetObject = target as IRegion;
     _tabVM        = tabVM;
     _objectType   = type;
     _isSelected   = isSelected;
 }
示例#3
0
        public void AddTarget(IUniqueObject targetObject)
        {
            if (WidgetShowHideAction != null)
            {
                WidgetShowHideAction.AddTargetObject(targetObject.Guid);

                SetShowHideAction();

                //current action is not "Check All"
                if (!_isCheckAllAction)
                {
                    if (CurrentUndoManager != null)
                    {  //widget
                        AddTargetCommand cmd = new AddTargetCommand(this, targetObject.Guid, _selectedWidget == null ? Guid.Empty : _selectedWidget.Guid);
                        CurrentUndoManager.Push(cmd);
                    }

                    //if all is checked , set IsCheckAll to true.
                    var node = WidgetList.FirstOrDefault(a => a.IsSelected == false);
                    if (node == null)
                    {
                        _isCheckAll = true;
                        FirePropertyChanged("IsCheckAll");
                    }
                }
                FirePropertyChanged("ShowHideType");
                FirePropertyChanged("AnimateType");
                FirePropertyChanged("AnimateTime");
                FirePropertyChanged("IsShowHideEnabled");
            }
        }
示例#4
0
        public IStockManager[] GetStockManagers(string productFamily, IUniqueObject sender)
        {
            if (familiesMap.ContainsKey(productFamily))
            {
                return((from sm in familiesMap[productFamily]
                        where sm.Key != sender.GetUID()
                        select sm.Value).ToArray());
            }

            return(new IStockManager[0]);
        }
示例#5
0
 public virtual bool Equals(IUniqueObject <int> other)
 {
     if (((this.GetKey != -1) &&
          (other.GetKey != -1)))
     {
         return(this.GetKey == other.GetKey);
     }
     else
     {
         return(object.ReferenceEquals(this, other));
     }
 }
示例#6
0
        public PropagateToken AddHop(IUniqueObject uid)
        {
            if (HasHopedOnObject(uid))
            {
                return(this);
            }

            string[] newHops = new string[hops.Length + 1];
            Array.Copy(hops, newHops, hops.Length);
            newHops[hops.Length] = uid.GetUID();
            hops = newHops;
            return(this);
        }
示例#7
0
        public void DeleteTaget(IUniqueObject targetObject)
        {
            if (WidgetShowHideAction != null)
            {
                WidgetShowHideAction.DeleteTagetObject(targetObject.Guid);

                //current action is not "Check All"
                if (!_isCheckAllAction)
                {
                    if (CurrentUndoManager != null)
                    {
                        DeleteTargetCommand cmd = new DeleteTargetCommand(this, targetObject.Guid, _selectedWidget == null ? Guid.Empty : _selectedWidget.Guid);
                        CurrentUndoManager.Push(cmd);
                    }

                    SetShowHideAction();

                    // Set IsCheckAll to false if one widget is unchecked.
                    _isCheckAll = false;
                    FirePropertyChanged("IsCheckAll");
                }
                FirePropertyChanged("IsShowHideEnabled");
            }
        }
示例#8
0
 public static IUniqueObject copyOf(IUniqueObject original)
 {
     return(new UniqueObject(original.GetUID()));
 }
示例#9
0
        //public RegularNation[] Adjacency { get; set; } = new RegularNation[NUM_ADJACENT_NATIONS];

        //public List<RegularNation> SateliteNations { get; set; } = new List<RegularNation>();

        public void SendToReserve(IUniqueObject uniqueObject)
        {
            _Reserve.Add(uniqueObject.UID, uniqueObject);
        }
示例#10
0
 public bool HasHopedOnObject(IUniqueObject uid)
 {
     return(hops.Contains(uid.GetUID()));
 }