本文整理汇总了C#中IContainerOwner类的典型用法代码示例。如果您正苦于以下问题:C# IContainerOwner类的具体用法?C# IContainerOwner怎么用?C# IContainerOwner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IContainerOwner类属于命名空间,在下文中一共展示了IContainerOwner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallDeleteActivity
private static bool CallDeleteActivity(string targetObjectID, IContainerOwner owner)
{
Activity activity = Activity.RetrieveFromOwnerContent(owner, targetObjectID);
//Activity.RetrieveFromOwnerContent(owner, )
DeleteInformationObject.Execute(new DeleteInformationObjectParameters { ObjectToDelete = activity });
return false;
}
示例2: EnsureMasterCollections
public static void EnsureMasterCollections(IContainerOwner owner)
{
{
var masterCollection = ProductUsageCollection.GetMasterCollectionInstance(owner);
if(masterCollection == null)
{
masterCollection = ProductUsageCollection.CreateDefault();
masterCollection.RelativeLocation =
ProductUsageCollection.GetMasterCollectionLocation(owner);
StorageSupport.StoreInformation(masterCollection, owner);
}
IInformationCollection collection = masterCollection;
collection.SubscribeToContentSource();
}
{
var masterCollection = ProductCollection.GetMasterCollectionInstance(owner);
if(masterCollection == null)
{
masterCollection = ProductCollection.CreateDefault();
masterCollection.RelativeLocation =
ProductCollection.GetMasterCollectionLocation(owner);
StorageSupport.StoreInformation(masterCollection, owner);
}
IInformationCollection collection = masterCollection;
collection.SubscribeToContentSource();
}
}
示例3: GetTarget_ObjectToDelete
public static IInformationObject GetTarget_ObjectToDelete(IContainerOwner owner, string objectDomainName, string objectName, string objectId)
{
IInformationObject objectToDelete =
StorageSupport.RetrieveInformationObjectFromDefaultLocation(objectDomainName, objectName, objectId,
owner);
return objectToDelete;
}
示例4: ExecuteMethod_InitializeGroupWithDefaultObjects
public static void ExecuteMethod_InitializeGroupWithDefaultObjects(IContainerOwner groupAsOwner)
{
// Initialize nodesummarycontainer
NodeSummaryContainer nodeSummaryContainer = NodeSummaryContainer.CreateDefault();
nodeSummaryContainer.SetLocationAsOwnerContent(groupAsOwner, "default");
nodeSummaryContainer.StoreInformationMasterFirst(groupAsOwner, true);
}
示例5: PutQueryRequestToQueue
public static void PutQueryRequestToQueue(string storageContainerName, string indexName, IContainerOwner owner, string requestID)
{
var queueName = GetQueryRequestQueueName(indexName);
string ownerstring = owner.ToParseableString();
string messageText = storageContainerName + ":" + ownerstring + ":" + requestID;
QueueSupport.PutMessageToQueue(queueName, messageText);
}
示例6: ExecuteMethod_PerformIndexing
public static void ExecuteMethod_PerformIndexing(IContainerOwner owner, IndexingRequest indexingRequest, string luceneIndexFolder)
{
string indexName = indexingRequest.IndexName;
List<Document> documents = new List<Document>();
List<string> removeDocumentIDs = new List<string>();
foreach (var objLocation in indexingRequest.ObjectLocations)
{
IInformationObject iObj = StorageSupport.RetrieveInformation(objLocation, null, owner);
if (iObj == null)
{
var lastSlashIX = objLocation.LastIndexOf('/');
var objectID = objLocation.Substring(lastSlashIX + 1);
removeDocumentIDs.Add(objectID);
continue;
}
IIndexedDocument iDoc = iObj as IIndexedDocument;
if (iDoc != null)
{
var luceneDoc = iDoc.GetLuceneDocument(indexName);
if (luceneDoc == null)
continue;
luceneDoc.RemoveFields("ObjectDomainName");
luceneDoc.RemoveFields("ObjectName");
luceneDoc.RemoveFields("ObjectID");
luceneDoc.RemoveFields("ID");
luceneDoc.Add(new Field("ObjectDomainName", iObj.SemanticDomainName, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO));
luceneDoc.Add(new Field("ObjectName", iObj.Name, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO));
luceneDoc.Add(new Field("ObjectID", iObj.ID, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO));
luceneDoc.Add(new Field("ID", iObj.ID, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO));
documents.Add(luceneDoc);
}
}
FieldIndexSupport.AddAndRemoveDocuments(luceneIndexFolder, documents.ToArray(), removeDocumentIDs.ToArray());
}
示例7: CallDeleteAddressAndLocation
private static bool CallDeleteAddressAndLocation(string addressAndLocationID, IContainerOwner owner)
{
AddressAndLocation addressAndLocation = AddressAndLocation.RetrieveFromOwnerContent(owner,
addressAndLocationID);
addressAndLocation.DeleteInformationObject();
return false;
}
示例8: ExecuteMethod_ExecuteActualOperation
public static bool ExecuteMethod_ExecuteActualOperation(string targetObjectID, string commandName, IContainerOwner owner, InformationSourceCollection informationSources, string[] formSourceNames, NameValueCollection formSubmitContent)
{
switch(commandName)
{
case "RemoveCollaborator":
return CallRemoveGroupMember(targetObjectID, owner);
case "PublishGroupPublicContent":
return CallPublishGroupContentToPublicArea(owner);
case "PublishGroupWwwContent":
return CallPublishGroupContentToWww(owner);
case "AssignCollaboratorRole":
return CallAssignCollaboratorRole(targetObjectID, owner, informationSources.GetDefaultSource(typeof(GroupContainer).FullName) ,formSubmitContent);
case "DeleteBlog":
return CallDeleteBlog(targetObjectID, owner);
case "DeleteActivity":
return CallDeleteActivity(targetObjectID, owner);
case "UnlinkEmailAddress":
return CallUnlinkEmailAddress(targetObjectID, owner,
informationSources.GetDefaultSource(typeof (AccountContainer).FullName));
case "CreateHelloWorld":
return CallCreateHelloWorld(owner, helloText: formSubmitContent["tHelloText"]);
case "DeleteHelloWorld":
return CallDeleteHelloWorld(owner, helloWorldId: formSubmitContent["HelloWorldID"]);
default:
throw new NotImplementedException("Operation mapping for command not implemented: " + commandName);
}
}
示例9: ExecuteOwnerWebPOST
public static object ExecuteOwnerWebPOST(IContainerOwner containerOwner, NameValueCollection form, HttpFileCollection fileContent)
{
bool reloadPageAfter = form["NORELOAD"] == null;
bool isCancelButton = form["btnCancel"] != null;
if (isCancelButton)
return reloadPageAfter;
string operationName = form["ExecuteOperation"];
if (operationName != null)
{
var operationResult = executeOperationWithFormValues(containerOwner, operationName, form, fileContent);
if(operationResult != null)
return operationResult;
return reloadPageAfter;
}
string adminOperationName = form["ExecuteAdminOperation"];
if (adminOperationName != null)
{
var adminResult = executeAdminOperationWithFormValues(containerOwner, adminOperationName, form, fileContent);
if(adminResult != null)
return adminResult;
return reloadPageAfter;
}
string contentSourceInfo = form["ContentSourceInfo"];
var rootSourceAction = form["RootSourceAction"];
if (rootSourceAction != null && rootSourceAction != "Save")
return reloadPageAfter;
var filterFields = new string[] { "ContentSourceInfo", "RootSourceAction", "NORELOAD" };
string[] contentSourceInfos = contentSourceInfo.Split(',');
var filteredForm = filterForm(form, filterFields);
foreach (string sourceInfo in contentSourceInfos)
{
string relativeLocation;
string oldETag;
retrieveDataSourceInfo(sourceInfo, out relativeLocation, out oldETag);
VirtualOwner verifyOwner = VirtualOwner.FigureOwner(relativeLocation);
if (verifyOwner.IsSameOwner(containerOwner) == false)
throw new SecurityException("Mismatch in ownership of data submission");
IInformationObject rootObject = StorageSupport.RetrieveInformation(relativeLocation, oldETag,
containerOwner);
if (oldETag != rootObject.ETag)
{
throw new InvalidDataException("Information under editing was modified during display and save");
}
// TODO: Proprely validate against only the object under the editing was changed (or its tree below)
SetObjectTreeValues.Execute(new SetObjectTreeValuesParameters
{
RootObject = rootObject,
HttpFormData = filteredForm,
HttpFileData = fileContent
});
}
return reloadPageAfter;
}
示例10: GetTarget_CreatedObject
public static IInformationObject GetTarget_CreatedObject(IContainerOwner owner, string objectDomainName, string objectName)
{
string objectTypeName = objectDomainName + "." + objectName;
Type objectType = Type.GetType(objectTypeName);
IInformationObject iObj = (IInformationObject) Activator.CreateInstance(objectType);
var relativeLocation = StorageSupport.GetOwnerContentLocation(owner, objectDomainName + "/" + objectName + "/" + iObj.ID);
iObj.RelativeLocation = relativeLocation;
return iObj;
}
示例11: GetTarget_AuthenticatedAsActiveDevice
public static AuthenticatedAsActiveDevice GetTarget_AuthenticatedAsActiveDevice(IContainerOwner owner, string authenticationDeviceDescription, string negotiationUrl, string connectionUrl)
{
AuthenticatedAsActiveDevice activeDevice = new AuthenticatedAsActiveDevice();
activeDevice.SetLocationAsOwnerContent(owner, activeDevice.ID);
activeDevice.AuthenticationDescription = authenticationDeviceDescription;
//activeDevice.SharedSecret = sharedSecret;
activeDevice.NegotiationURL = negotiationUrl;
activeDevice.ConnectionURL = connectionUrl;
return activeDevice;
}
示例12: RefreshMasterCollections
public static void RefreshMasterCollections(IContainerOwner owner)
{
{
IInformationCollection masterCollection = HelloWorldCollection.GetMasterCollectionInstance(owner);
if (masterCollection == null)
throw new InvalidDataException("Master collection HelloWorldCollection missing for owner");
masterCollection.RefreshContent();
StorageSupport.StoreInformation((IInformationObject) masterCollection, owner);
}
}
示例13: GetTarget_CreatedInformationInput
public static InformationInput GetTarget_CreatedInformationInput(IContainerOwner owner, string inputDescription, string locationUrl, string localContentName, string authenticatedDeviceId)
{
InformationInput informationInput = new InformationInput();
informationInput.SetLocationAsOwnerContent(owner, informationInput.ID);
informationInput.InputDescription = inputDescription;
informationInput.LocationURL = locationUrl;
informationInput.LocalContentName = localContentName;
informationInput.AuthenticatedDeviceID = authenticatedDeviceId;
return informationInput;
}
示例14: ExecuteMethod_RemoveExpiredEntries
public static void ExecuteMethod_RemoveExpiredEntries(IContainerOwner owner, string[] ensureUpdateOnStatusSummaryOutput)
{
foreach (string changeItemID in ensureUpdateOnStatusSummaryOutput)
{
string relativeLocationFromOwner = InformationChangeItem.GetRelativeLocationFromID(changeItemID);
var blob = StorageSupport.GetOwnerBlobReference(owner, relativeLocationFromOwner);
blob.DeleteWithoutFiringSubscriptions();
var jsonBlob = StorageSupport.GetOwnerBlobReference(owner, relativeLocationFromOwner + ".json");
jsonBlob.DeleteWithoutFiringSubscriptions();
}
}
示例15: GetTarget_PublishInfo
public static WebPublishInfo GetTarget_PublishInfo(IContainerOwner owner)
{
WebPublishInfo publishInfo = WebPublishInfo.RetrieveFromOwnerContent(owner, "default");
if (publishInfo == null)
{
publishInfo = WebPublishInfo.CreateDefault();
publishInfo.SetLocationAsOwnerContent(owner, "default");
publishInfo.StoreInformation();
}
return publishInfo;
}