Exemplo n.º 1
0
        /// <summary>
        /// Retrieves an array of PSItem objects representing the content items
        /// specified in the idList argument.
        /// </summary>
        /// <param name="contentSvc">The proxy of the content service.</param>
        /// <param name="id">The ID of the Content Item to be loaded.</param>
        /// <returns>An array of PSItem objects, listed in the same order as the
        /// entries in idList. Never null or empty.</returns>
        /// <remarks>The returned items are not editable.</remarks>
        public static PSItem[] LoadItems(contentSOAP contentSvc, long[] idList)
        {
            LoadItemsRequest req = new LoadItemsRequest();

            PSItem[] items;
            try
            {
                if (idList.Length > 0)
                {
                    req.Id = idList;
                    req.IncludeFolderPath = true;
                    req.IncludeChildren   = true;
                    items = contentSvc.LoadItems(req);
                }
                else
                {
                    items = new PSItem[] { };
                }
            }
            catch (SoapException ex)
            {
                throw new CMSSoapException("Percussion Error in LoadItem.", ex);
            }

            return(items);
        }
Exemplo n.º 2
0
 public static void ConvertStarbuxToResources(PSItem item1, int amount1, PSItem item2, int amount2, int starbuxCost, Action <PSServerMessage> endAction)
 {
     if (starbuxCost <= UserManager.Starbux)
     {
         AlertController.ShowWaitPanel(SingletonManager <LocalizationManager> .Instance.GetLocalizedText("Please wait..."));
         SingletonManager <UserManager> .Instance.BuyItemsWithStarbux(item1.ItemDesignId, amount1, item2.ItemDesignId, amount2, endAction, (Action)(() => AlertController.HideWaitPanel()));
     }
     else
     {
         SharedManager.ShowInsufficientStarbuxDialogue(starbuxCost);
     }
 }
Exemplo n.º 3
0
        public static string[] GetChildFieldValues(PSItem item, string collectionName, string subfieldName)
        {
            string[] foundValues = new string[] { };

            if (item.Children != null && item.Children.Length > 0)
            {
                PSItemChildren targetedField = Array.Find(item.Children, childField => childField.Name == collectionName);
                if (targetedField != null && targetedField.PSChildEntry != null)
                {
                    List <string> resultBuilder = new List <string>();
                    Array.ForEach(targetedField.PSChildEntry, childFieldset =>
                    {
                        resultBuilder.Add(GetFieldValue(childFieldset.PSField, subfieldName));
                    });
                    foundValues = resultBuilder.ToArray();
                }
            }

            return(foundValues);
        }
Exemplo n.º 4
0
 public static long SaveItem(contentSOAP contentSvc, PSItem item)
 {
     //TODO: Refactor SaveItem() and its callers to receive an array of PSItem objects.
     PSItem[] itemArray = new PSItem[] { item };
     return(SaveItem(contentSvc, itemArray)[0]);
 }
Exemplo n.º 5
0
        public void AddPowershelItem(PSItem item)
        {
            var PSItemType = PSItems.GetTypeByName(item.Name);

            Invoker
        }
Exemplo n.º 6
0
 public void UpdatePowershellItem(PSItem updatedItem)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 public IEnumerable <PSItem> GetPowershellItemsEnumerable(PSItem item)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public void DeletePowershelItem(PSItem item)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public static string GetFieldValue(PSItem item, string fieldName)
 {
     return(GetFieldValue(item.Fields, fieldName));
 }