internal void Set(ItemOwnershipInternal?other)
 {
     if (other != null)
     {
         Id = other.Value.Id;
         OwnershipStatus = other.Value.OwnershipStatus;
     }
 }
Exemplo n.º 2
0
 private static void OnEOSQueryOwnershipComplete(QueryOwnershipCallbackInfo data)
 {
     if (data.ResultCode == Result.Success)
     {
         _epicDlcOwnershipStatus = data.ItemOwnership[0].OwnershipStatus;
         _epicResultReceived     = true;
         Program.Log($"[EOS] Query DLC ownership complete: {_epicDlcOwnershipStatus}");
     }
 }
 public void Set(ItemOwnership other)
 {
     if (other != null)
     {
         m_ApiVersion    = EcomInterface.ItemownershipApiLatest;
         Id              = other.Id;
         OwnershipStatus = other.OwnershipStatus;
     }
 }
Exemplo n.º 4
0
        public async Task <bool> CommandResultsInDuplicateEntryAsync(OwnershipStatus ownershipStatus)
        {
            var duplicateOwnershipStatus = await context.OwnershipStatuses
                                           .Where(os =>
                                                  os.ID != ownershipStatus.ID &&
                                                  (os.Name == ownershipStatus.Name || os.OrdinalNumber == ownershipStatus.OrdinalNumber))
                                           .FirstOrDefaultAsync();

            if (duplicateOwnershipStatus != null)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.ControlChannel)
            .Throws(new DivideByZeroException());

            var task = thePeer.TakeOwnership(theSubject);

            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }
Exemplo n.º 6
0
        // Called when ownership status changed.
        static public void onOwnershipStatusChanged(OwnershipStatus status, Company sender)
        {
            IEnumerator e;

            e = retainList.GetEnumerator();
            while (e.MoveNext())
            {
                ListView     list = (ListView)e.Current;
                ListViewItem item;
                if (status == OwnershipStatus.NEW_OWNERSHIP)
                {
                    item = new ListViewItem();
                    rebuildRetainStockItem(item, sender);
                    list.Items.Add(item);
                }
                else
                {
                    item = findItem(list, sender);
                    if (item != null)
                    {
                        switch (status)
                        {
                        case OwnershipStatus.LOST_OWNERSHIP:
                            list.Items.Remove(item);
                            break;

                        default:
                            rebuildRetainStockItem(item, sender);
                            break;
                        }
                    }
                }
            }
            e = marketList.GetEnumerator();
            while (e.MoveNext())
            {
                ListView     list = (ListView)e.Current;
                ListViewItem item = findItem(list, sender);
                if (item != null)
                {
                    rebuildMarketStockItem(item, sender);
                }
            }
        }
Exemplo n.º 7
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.ControlChannel)
            .Returns(new TakeOwnershipResponse
            {
                Status = OwnershipStatus.UnknownSubject
            });

            var task = thePeer.TakeOwnership(theSubject);

            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }
Exemplo n.º 8
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.Addresses.FirstOrDefault())
            .Returns(new TakeOwnershipResponse
            {
                Status = OwnershipStatus.Exception
            });

            var task = thePeer.TakeOwnership(theSubject);

            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }
 public RiggedTransportPeer(string nodeId, OwnershipStatus status)
 {
     NodeId         = nodeId;
     StatusToReturn = status;
 }
Exemplo n.º 10
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.Addresses.FirstOrDefault())
            .Throws(new DivideByZeroException());

            var task = thePeer.TakeOwnership(theSubject);
            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }
Exemplo n.º 11
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.Addresses.FirstOrDefault())
            .Returns(new TakeOwnershipResponse
            {
                Status = OwnershipStatus.OwnershipActivated
            });

            var task = thePeer.TakeOwnership(theSubject);
            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }
Exemplo n.º 12
0
 public RiggedTransportPeer(string nodeId, OwnershipStatus status)
 {
     NodeId = nodeId;
     StatusToReturn = status;
 }
Exemplo n.º 13
0
        public async Task UpdateAsync(OwnershipStatus ownershipStatus)
        {
            context.Update(ownershipStatus);

            await context.SaveChangesAsync();
        }
Exemplo n.º 14
0
        public async Task CreateAsync(OwnershipStatus ownershipStatus)
        {
            context.Add(ownershipStatus);

            await context.SaveChangesAsync();
        }
 public House(OwnershipStatus ownershipStatus)
 {
     OwnershipStatus = ownershipStatus;
 }
Exemplo n.º 16
0
        protected override void theContextIs()
        {
            var request = new TakeOwnershipRequest
            {
                Subject = theSubject
            };

            theServiceBus.ExpectMessage(request)
            .AtDestination(theNode.ControlChannel)
            .Returns(new TakeOwnershipResponse
            {
                Status = OwnershipStatus.UnknownSubject
            });

            var task = thePeer.TakeOwnership(theSubject);
            task.Wait(1.Minutes()); // for debugging
            theStatus = task.Result;
        }