/// <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); }
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); } }
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); }
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]); }
public void AddPowershelItem(PSItem item) { var PSItemType = PSItems.GetTypeByName(item.Name); Invoker }
public void UpdatePowershellItem(PSItem updatedItem) { throw new NotImplementedException(); }
public IEnumerable <PSItem> GetPowershellItemsEnumerable(PSItem item) { throw new NotImplementedException(); }
public void DeletePowershelItem(PSItem item) { throw new NotImplementedException(); }
public static string GetFieldValue(PSItem item, string fieldName) { return(GetFieldValue(item.Fields, fieldName)); }