private List <VDF.Vault.Currency.Entities.IEntity> DoChangeOrderSearch(SrchCond[] conditions) { string bookmark = string.Empty; SrchStatus status = null; //search for files List <VDF.Vault.Currency.Entities.IEntity> retVal = new List <VDF.Vault.Currency.Entities.IEntity>(); while (status == null || retVal.Count < status.TotalHits) { ChangeOrder[] changeOrders = m_conn.WebServiceManager.ChangeOrderService.FindChangeOrdersBySearchConditions( conditions, null, ref bookmark, out status); if (changeOrders != null) { foreach (ChangeOrder co in changeOrders) { VDF.Vault.Currency.Entities.ChangeOrder vdfCo = new VDF.Vault.Currency.Entities.ChangeOrder(m_conn, co); retVal.Add(vdfCo); } } } return(retVal); }
void cmd_Execute(object sender, CommandItemEventArgs e) { Util.DoAction(delegate { Connection conn = e.Context.Application.Connection; // lookup the server product to see if we are Vault Professional // remember the value so we don't have to look it up again in this session if (m_isVaultPro == null) { Product[] products = conn.WebServiceManager.InformationService.GetSystemProducts(); m_isVaultPro = products.Any(n => n.ProductName == "Autodesk.Productstream"); } FinderDialog dialog = new FinderDialog(m_isVaultPro.Value, conn); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK && dialog.GoToLocation) { LocationContext location = null; if (dialog.GoToEntity.EntityClass.ServerId == VDF.Vault.Currency.Entities.EntityClassIds.ChangeOrders) { VDF.Vault.Currency.Entities.ChangeOrder co = dialog.GoToEntity as VDF.Vault.Currency.Entities.ChangeOrder; if (co != null) { location = new LocationContext(SelectionTypeId.ChangeOrder, co.Number); } } else if (dialog.GoToEntity.EntityClass.ServerId == VDF.Vault.Currency.Entities.EntityClassIds.CustomObject) { VDF.Vault.Currency.Entities.CustomObject custom = dialog.GoToEntity as VDF.Vault.Currency.Entities.CustomObject; if (custom != null) { CustEnt custEnt = custom; SelectionTypeId selectionType = new SelectionTypeId(custom.Definition.SystemName); location = new LocationContext(selectionType, custEnt.Num); } } else if (dialog.GoToEntity.EntityClass.ServerId == VDF.Vault.Currency.Entities.EntityClassIds.Files) { VDF.Vault.Currency.Entities.FileIteration file = dialog.GoToEntity as VDF.Vault.Currency.Entities.FileIteration; if (file != null) { location = new LocationContext(SelectionTypeId.File, file.Parent.FullName + "/" + file.EntityName); } } else if (dialog.GoToEntity.EntityClass.ServerId == VDF.Vault.Currency.Entities.EntityClassIds.Folder) { VDF.Vault.Currency.Entities.Folder folder = dialog.GoToEntity as VDF.Vault.Currency.Entities.Folder; if (folder != null) { location = new LocationContext(SelectionTypeId.Folder, folder.FullName); } } else if (dialog.GoToEntity.EntityClass.ServerId == VDF.Vault.Currency.Entities.EntityClassIds.Items) { VDF.Vault.Currency.Entities.ItemRevision item = dialog.GoToEntity as VDF.Vault.Currency.Entities.ItemRevision; if (item != null) { location = new LocationContext(SelectionTypeId.Item, item.ItemNumber); } } if (location != null) { e.Context.GoToLocation = location; } } }); }