private static void SetSemanticItem(this List<SemanticInformationItem> semanticItems, SemanticInformationItem semanticInformationItem) { string itemFullTypeToSet = semanticInformationItem.ItemFullType; var currItem = semanticItems.GetSemanticItem(itemFullTypeToSet); if (currItem != null) semanticItems.Remove(currItem); semanticItems.Add(semanticInformationItem); }
private static void SetSemanticItemValue(this List<SemanticInformationItem> semanticItems, string itemFullType, string itemValue) { var currItem = semanticItems.GetSemanticItem(itemFullType); if (currItem != null) currItem.ItemValue = itemValue; else { currItem = new SemanticInformationItem(itemFullType, itemValue); semanticItems.SetSemanticItem(currItem); } }
public static Process GetTarget_Process(string processDescription, string executingOperationName, SemanticInformationItem[] initialArguments) { Process process = new Process { ProcessDescription = processDescription, ExecutingOperation = new SemanticInformationItem(executingOperationName, null), }; process.InitialArguments.AddRange(initialArguments); process.SetLocationAsOwnerContent(InformationContext.CurrentOwner, process.ID); return process; }
public static void ExecuteMethod_SetContentsAsProcessOutput(Process process, string[] callPickCategorizedContentConnectionOutput) { /* * var contentLocation = processItem.Outputs.First(item => item.ItemFullType == "ContentLocation").ItemValue; var contentMD5 = processItem.Outputs.First(item => item.ItemFullType == "ContentMD5").ItemValue; */ process.ProcessItems.Clear(); foreach (string contentLocation in callPickCategorizedContentConnectionOutput) { bool isMediaContentType = InformationObjectSupport.IsContentGivenType(contentLocation, typeof (MediaContent).FullName); if (isMediaContentType) { string extension = Path.GetExtension(contentLocation); string fullLocationWithoutExtension = contentLocation.Substring(0, contentLocation.Length - extension.Length); var mediaContentBlobs = InformationContext.CurrentOwner.GetOwnerBlobListing(fullLocationWithoutExtension, true); foreach (CloudBlockBlob mediaContentBlob in mediaContentBlobs) { SemanticInformationItem semanticItemForLocation = new SemanticInformationItem { ItemFullType = "ContentLocation", ItemValue = mediaContentBlob.Name }; SemanticInformationItem semanticItemForMD5 = new SemanticInformationItem { ItemFullType = "ContentMD5", ItemValue = mediaContentBlob.Properties.ContentMD5 }; ProcessItem processItem = new ProcessItem(); processItem.Outputs.Add(semanticItemForLocation); processItem.Outputs.Add(semanticItemForMD5); process.ProcessItems.Add(processItem); } } else { var blob = StorageSupport.GetOwnerBlobReference(InformationContext.CurrentOwner, contentLocation); blob.FetchAttributes(); SemanticInformationItem semanticItemForLocation = new SemanticInformationItem { ItemFullType = "ContentLocation", ItemValue = contentLocation }; SemanticInformationItem semanticItemForMD5 = new SemanticInformationItem { ItemFullType = "ContentMD5", ItemValue = blob.Properties.ContentMD5 }; ProcessItem processItem = new ProcessItem(); processItem.Outputs.Add(semanticItemForLocation); processItem.Outputs.Add(semanticItemForMD5); process.ProcessItems.Add(processItem); } } }
private void CopyContentFrom(SemanticInformationItem sourceObject) { ItemFullType = sourceObject.ItemFullType; ItemValue = sourceObject.ItemValue; }
partial static void CreateCustomDemo(ref SemanticInformationItem customDemoObject);
public static SemanticInformationItem CreateDefault() { var result = new SemanticInformationItem(); return result; }