• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IContainerOwner类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IContainerOwner的典型用法代码示例。如果您正苦于以下问题:C# IContainerOwner类的具体用法?C# IContainerOwner怎么用?C# IContainerOwner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IContainerOwner类属于命名空间,在下文中一共展示了IContainerOwner类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:rodmjay,项目名称:TheBallOnAzure,代码行数:7,代码来源:PerformWebActionImplementation.cs


示例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();
         }
 }
开发者ID:kallex,项目名称:Caloom,代码行数:27,代码来源:CaloomCore.designer.cs


示例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;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:7,代码来源:DeleteSpecifiedInformationObjectImplementation.cs


示例4: ExecuteMethod_InitializeGroupWithDefaultObjects

 public static void ExecuteMethod_InitializeGroupWithDefaultObjects(IContainerOwner groupAsOwner)
 {
     // Initialize nodesummarycontainer
     NodeSummaryContainer nodeSummaryContainer = NodeSummaryContainer.CreateDefault();
     nodeSummaryContainer.SetLocationAsOwnerContent(groupAsOwner, "default");
     nodeSummaryContainer.StoreInformationMasterFirst(groupAsOwner, true);
 }
开发者ID:kallex,项目名称:Caloom,代码行数:7,代码来源:CreateGroupWithTemplatesImplementation.cs


示例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);
 }
开发者ID:kallex,项目名称:Caloom,代码行数:7,代码来源:IndexSupport.cs


示例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());
 }
开发者ID:kallex,项目名称:Caloom,代码行数:34,代码来源:IndexInformationImplementation.cs


示例7: CallDeleteAddressAndLocation

 private static bool CallDeleteAddressAndLocation(string addressAndLocationID, IContainerOwner owner)
 {
     AddressAndLocation addressAndLocation = AddressAndLocation.RetrieveFromOwnerContent(owner,
                                                                                         addressAndLocationID);
     addressAndLocation.DeleteInformationObject();
     return false;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:7,代码来源:PerformWebActionImplementation.cs


示例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);
     }
 }
开发者ID:rodmjay,项目名称:TheBallOnAzure,代码行数:27,代码来源:PerformWebActionImplementation.cs


示例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;
        }
开发者ID:kallex,项目名称:Caloom,代码行数:58,代码来源:ModifyInformationSupport.cs


示例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;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:9,代码来源:CreateSpecifiedInformationObjectWithValuesImplementation.cs


示例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;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:10,代码来源:CreateAuthenticatedAsActiveDeviceImplementation.cs


示例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);
         }
 }
开发者ID:rodmjay,项目名称:TheBallOnAzure,代码行数:10,代码来源:TheBallDemo.designer.cs


示例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;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:10,代码来源:CreateInformationInputImplementation.cs


示例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();
     }
 }
开发者ID:kallex,项目名称:Caloom,代码行数:11,代码来源:UpdateStatusSummaryImplementation.cs


示例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;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:11,代码来源:ChooseActivePublicationImplementation.cs


示例16: PackageOwnerContentToZip_GetParameters

 public static PackageOwnerContentParameters PackageOwnerContentToZip_GetParameters(IContainerOwner owner, string packageRootFolder, string[] includedFolders)
 {
     return new PackageOwnerContentParameters
         {
             Owner = owner,
             PackageName = "Full export",
             Description = "Full export done by ExportOwnerContentToZip",
             PackageType = "FULLEXPORT",
             IncludedFolders = includedFolders,
             PackageRootFolder = packageRootFolder
         };
 }
开发者ID:kallex,项目名称:Caloom,代码行数:12,代码来源:ExportOwnerContentToZipImplementation.cs


示例17: ExecuteMethod_EnsureUpdateOnStatusSummary

        public static void ExecuteMethod_EnsureUpdateOnStatusSummary(IContainerOwner owner, DateTime updateTime, string[] changedIdList, int removeExpiredEntriesSeconds)
        {
            int retryCount = 10;
            while (retryCount-- >= 0)
            {
                try
                {
                    var statusSummary = StatusSummary.RetrieveFromOwnerContent(owner, "default");
                    if (statusSummary == null)
                    {
                        statusSummary = new StatusSummary();
                        statusSummary.SetLocationAsOwnerContent(owner, "default");
                    }
                    string latestTimestampEntry = statusSummary.ChangeItemTrackingList.FirstOrDefault();
                    long currentTimestampTicks = updateTime.ToUniversalTime().Ticks;
                    if (latestTimestampEntry != null)
                    {
                        long latestTimestampTicks = Convert.ToInt64(latestTimestampEntry.Substring(2));
                        if (currentTimestampTicks <= latestTimestampTicks)
                            currentTimestampTicks = latestTimestampTicks + 1;
                    }
                    string currentTimestampEntry = "T:" + currentTimestampTicks;
                    var timestampedList = statusSummary.ChangeItemTrackingList;
                    // Remove possible older entries of new IDs
                    timestampedList.RemoveAll(changedIdList.Contains);
                    // Add Timestamp and new IDs
                    timestampedList.Insert(0, currentTimestampEntry);
                    timestampedList.InsertRange(1, changedIdList);
                    var removeOlderThanTicks = currentTimestampTicks -
                                               TimeSpan.FromSeconds(removeExpiredEntriesSeconds).Ticks;
                    int firstBlockToRemoveIX = timestampedList.FindIndex(candidate =>
                        {
                            if (candidate.StartsWith("T:"))
                            {
                                long candidateTicks = Convert.ToInt64(candidate.Substring(2));
                                return candidateTicks < removeOlderThanTicks;
                            }
                            return false;
                        });
                    if (firstBlockToRemoveIX > -1)
                    {
                        timestampedList.RemoveRange(firstBlockToRemoveIX, timestampedList.Count - firstBlockToRemoveIX);
                    }
                    statusSummary.StoreInformation();
                    return; // Break from while loop
                }
                catch (Exception ex)
                {

                }
            }
        }
开发者ID:kallex,项目名称:Caloom,代码行数:52,代码来源:UpdateStatusSummaryImplementation.cs


示例18: CreateDefaultViewRelativeToRequester

        /// <summary>
        /// Creates default views and returns the one relative to the requester
        /// </summary>
        /// <param name="requesterLocation">Requester relative location</param>
        /// <param name="informationObject">Information object to create the view for</param>
        /// <param name="owner">Container owner</param>
        /// <returns></returns>
        public static CloudBlob CreateDefaultViewRelativeToRequester(string requesterLocation, IInformationObject informationObject, IContainerOwner owner)
        {
            bool isAccountOwner = owner.IsAccountContainer();
            bool isGroupOwner = owner.IsGroupContainer();
            bool isDeveloperView = owner.ContainerName == "dev";
            string[] viewLocations;
            if (isAccountOwner)
                viewLocations = FixedAccountSiteLocations;
            else if (isGroupOwner)
                viewLocations = FixedGroupSiteLocations;
            else throw new NotSupportedException("Invalid owner container type for default view (non acct, non group): " + owner.ContainerName);

            string requesterDirectory = StorageSupport.GetLocationParentDirectory(requesterLocation);
            FileInfo fileInfo = new FileInfo(requesterLocation);
            //string viewRoot = fileInfo.Directory.Parent != null
            //                      ? fileInfo.Directory.Parent.Name
            //                      : fileInfo.Directory.Name;
            CloudBlob relativeViewBlob = null;
            bool hasException = false;
            bool allException = true;
            foreach (string viewLocation in viewLocations)
            {
                try
                {
                    string viewRoot = isDeveloperView ? "developer-00000000000000000000000000" : GetViewRoot(viewLocation);
                    string viewItemDirectory = Path.Combine(viewRoot, viewLocation).Replace("\\", "/") + "/";
                    string viewName = GetDefaultStaticViewName(informationObject);
                    string viewTemplateName = GetDefaultStaticTemplateName(informationObject);
                    // TODO: Relative from xyzsite => xyztemplate; now we only have website - also acct/grp specific
                    //string viewTemplateLocation = "webtemplate/oip-viewtemplate/" + viewTemplateName;
                    string viewTemplateLocation = viewItemDirectory + viewTemplateName;
                    CloudBlob viewTemplate = StorageSupport.CurrActiveContainer.GetBlob(viewTemplateLocation, owner);
                    string renderedViewLocation = viewItemDirectory + viewName;
                    CloudBlob renderTarget = StorageSupport.CurrActiveContainer.GetBlob(renderedViewLocation, owner);
                    InformationSource defaultSource = InformationSource.GetAsDefaultSource(informationObject);
                    RenderWebSupport.RenderTemplateWithContentToBlob(viewTemplate, renderTarget, defaultSource);
                    if (viewItemDirectory == requesterDirectory)
                        relativeViewBlob = renderTarget;
                    allException = false;
                }
                catch (Exception ex)
                {
                    hasException = true;
                }

            }
            if (relativeViewBlob == null && hasException == false && false)
                throw new InvalidDataException(
                    String.Format("Default view with relative location {0} not found for owner type {1}",
                                  requesterLocation, owner.ContainerName));
            return relativeViewBlob;
        }
开发者ID:kallex,项目名称:Caloom,代码行数:59,代码来源:DefaultViewSupport.cs


示例19: GetTarget_RequestEnvelope

 public static QueueEnvelope GetTarget_RequestEnvelope(string processId, IContainerOwner owner, string activeContainerName)
 {
     var envelope = new QueueEnvelope
         {
             OwnerPrefix = owner.ToFolderName(),
             ActiveContainerName = activeContainerName,
             SingleOperation = new OperationRequest
                 {
                     ProcessIDToExecute = processId
                 }
         };
     return envelope;
 }
开发者ID:kallex,项目名称:Caloom,代码行数:13,代码来源:RequestProcessExecutionImplementation.cs


示例20: SetMediaContent

 public void SetMediaContent(IContainerOwner containerOwner, string contentObjectID, object mediaContent)
 {
     if(ID != contentObjectID)
         return;
     ClearCurrentContent(containerOwner);
     HttpPostedFile postedContent = (HttpPostedFile) mediaContent;
     FileExt = Path.GetExtension(postedContent.FileName);
     ContentLength = postedContent.ContentLength;
     string locationFileName = ID + FileExt;
     SetLocationAsOwnerContent(containerOwner, locationFileName);
     postedContent.InputStream.Seek(0, SeekOrigin.Begin);
     StorageSupport.CurrActiveContainer.UploadBlobStream(RelativeLocation, postedContent.InputStream, StorageSupport.InformationType_GenericContentValue);
     UpdateAdditionalMediaFormats();
 }
开发者ID:abstractiondev,项目名称:TheBallOnAzure,代码行数:14,代码来源:MediaContent.cs



注:本文中的IContainerOwner类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IContent类代码示例发布时间:2022-05-24
下一篇:
C# IContainerAdapter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap