当前位置: 首页>>代码示例>>C#>>正文


C# ISession.CreateOperationContext方法代码示例

本文整理汇总了C#中ISession.CreateOperationContext方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.CreateOperationContext方法的具体用法?C# ISession.CreateOperationContext怎么用?C# ISession.CreateOperationContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISession的用法示例。


在下文中一共展示了ISession.CreateOperationContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Connect

 /// <summary>
 /// Connect to the CMIS repository.
 /// </summary>
 public void Connect()
 {
     // Create session.
     session = Auth.Auth.GetCmisSession(repoinfo.Address.ToString(), repoinfo.User, repoinfo.Password.ToString(), repoinfo.RepoID);
     Logger.Debug("Created CMIS session: " + session.ToString());
     
     // Detect repository capabilities.
     ChangeLogCapability = session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All
             || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.ObjectIdsOnly;
     IsGetDescendantsSupported = session.RepositoryInfo.Capabilities.IsGetDescendantsSupported == true;
     IsGetFolderTreeSupported = session.RepositoryInfo.Capabilities.IsGetFolderTreeSupported == true;
     Config.SyncConfig.Folder folder = ConfigManager.CurrentConfig.GetFolder(this.repoinfo.Name);
     if (folder != null)
     {
         Config.Feature features = folder.SupportedFeatures;
         if (features != null)
         {
             if (IsGetDescendantsSupported && features.GetDescendantsSupport == false)
                 IsGetDescendantsSupported = false;
             if (IsGetFolderTreeSupported && features.GetFolderTreeSupport == false)
                 IsGetFolderTreeSupported = false;
             if (ChangeLogCapability && features.GetContentChangesSupport == false)
                 ChangeLogCapability = false;
             if (ChangeLogCapability && session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All 
                 || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.Properties)
                 IsPropertyChangesSupported = true;
         }
     }
     Logger.Debug("ChangeLog capability: " + ChangeLogCapability.ToString());
     Logger.Debug("Get folder tree support: " + IsGetFolderTreeSupported.ToString());
     Logger.Debug("Get descendants support: " + IsGetDescendantsSupported.ToString());
     if (repoinfo.ChunkSize > 0)
     {
         Logger.Debug("Chunked Up/Download enabled: chunk size = " + repoinfo.ChunkSize.ToString() + " byte");
     }
     else
     {
         Logger.Debug("Chunked Up/Download disabled");
     }
     HashSet<string> filters = new HashSet<string>();
     filters.Add("cmis:objectId");
     filters.Add("cmis:name");
     filters.Add("cmis:contentStreamFileName");
     filters.Add("cmis:contentStreamLength");
     filters.Add("cmis:lastModificationDate");
     filters.Add("cmis:lastModifiedBy");
     filters.Add("cmis:path");
     filters.Add("cmis:changeToken"); // Needed to send update commands, see https://github.com/aegif/CmisSync/issues/516
     session.DefaultContext = session.CreateOperationContext(filters, false, true, false, IncludeRelationshipsFlag.None, null, true, null, true, 100);
 }
开发者ID:jelacote,项目名称:CmisSync,代码行数:53,代码来源:SynchronizedFolder.cs

示例2: Connect

 /// <summary>
 /// Connect to the CMIS repository.
 /// </summary>
 public void Connect()
 {
     // Create session factory.
     SessionFactory factory = SessionFactory.NewInstance();
     session = factory.CreateSession(cmisParameters);
     // Detect whether the repository has the ChangeLog capability.
         Logger.Debug("Created CMIS session: " + session.ToString());
     ChangeLogCapability = session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All
             || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.ObjectIdsOnly;
         IsGetDescendantsSupported = session.RepositoryInfo.Capabilities.IsGetDescendantsSupported == true;
         IsGetFolderTreeSupported = session.RepositoryInfo.Capabilities.IsGetFolderTreeSupported == true;
         Config.SyncConfig.Folder folder = ConfigManager.CurrentConfig.getFolder(this.repoinfo.Name);
         if (folder != null)
         {
             Config.Feature features = folder.SupportedFeatures;
             if (features != null)
             {
                 if (IsGetDescendantsSupported && features.GetDescendantsSupport == false)
                     IsGetDescendantsSupported = false;
                 if (IsGetFolderTreeSupported && features.GetFolderTreeSupport == false)
                     IsGetFolderTreeSupported = false;
                 if (ChangeLogCapability && features.GetContentChangesSupport == false)
                     ChangeLogCapability = false;
                 if(ChangeLogCapability && session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All 
                     || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.Properties)
                     IsPropertyChangesSupported = true;
             }
         }
         Logger.Debug("ChangeLog capability: " + ChangeLogCapability.ToString());
         Logger.Debug("Get folder tree support: " + IsGetFolderTreeSupported.ToString());
         Logger.Debug("Get descendants support: " + IsGetDescendantsSupported.ToString());
         if(repoinfo.ChunkSize>0) {
             Logger.Debug("Chunked Up/Download enabled: chunk size = "+ repoinfo.ChunkSize.ToString() + " byte");
         }else {
             Logger.Debug("Chunked Up/Download disabled");
         }
         HashSet<string> filters = new HashSet<string>();
         filters.Add("cmis:objectId");
         filters.Add("cmis:name");
         filters.Add("cmis:contentStreamFileName");
         filters.Add("cmis:contentStreamLength");
         filters.Add("cmis:lastModificationDate");
         filters.Add("cmis:lastModifiedBy");
         filters.Add("cmis:path");
         session.DefaultContext = session.CreateOperationContext(filters, false, true, false, IncludeRelationshipsFlag.None, null, true, null, true, 100);
 }
开发者ID:pcreignou,项目名称:CmisSync,代码行数:49,代码来源:SynchronizedFolder.cs

示例3: CreateContext

 /// <summary>
 /// Creates an operation context.
 /// </summary>
 /// <returns>The context.</returns>
 /// <param name="session">Cmis session.</param>
 /// <param name="cacheEnabled">If set to <c>true</c> cache enabled.</param>
 /// <param name="includePathSegments">If set to <c>true</c> include path segments.</param>
 /// <param name="elements">Requested cmis elements.</param>
 public static IOperationContext CreateContext(ISession session, bool cacheEnabled, bool includePathSegments, params string[] elements) {
     HashSet<string> filter = CreateFilter(elements);
     HashSet<string> renditions = new HashSet<string>();
     renditions.Add("cmis:none");
     return session.CreateOperationContext(
         filter: filter,
         includeAcls: false,
         includeAllowableActions: true,
         includePolicies: false,
         includeRelationships: IncludeRelationshipsFlag.None,
         renditionFilter: renditions,
         includePathSegments: includePathSegments,
         orderBy: null,
         cacheEnabled: cacheEnabled,
         maxItemsPerPage: MaximumItemsPerPage);
 }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:24,代码来源:OperationContextFactory.cs

示例4: Connect

        /// <summary>
        /// Connect to the CMIS repository.
        /// </summary>
        public void Connect()
        {
            if (_session == null)
            {
                // Create session.
                _session = Auth.Auth.GetCmisSession(SyncFolderInfo.Account.RemoteUrl, SyncFolderInfo.Account.Credentials, SyncFolderInfo.RepositoryId);
                Logger.Debug("Created CMIS session: " + _session.ToString());

                // Detect repository capabilities.
                ChangeLogCapability = _session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All
                        || _session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.ObjectIdsOnly;
                IsGetDescendantsSupported = _session.RepositoryInfo.Capabilities.IsGetDescendantsSupported == true;
                IsGetFolderTreeSupported = _session.RepositoryInfo.Capabilities.IsGetFolderTreeSupported == true;

                Config.Feature features = SyncFolderInfo.SupportedFeatures;
                if (features != null)
                {
                    if (IsGetDescendantsSupported && features.GetDescendantsSupport == false)
                        IsGetDescendantsSupported = false;
                    if (IsGetFolderTreeSupported && features.GetFolderTreeSupport == false)
                        IsGetFolderTreeSupported = false;
                    if (ChangeLogCapability && features.GetContentChangesSupport == false)
                        ChangeLogCapability = false;
                    if (ChangeLogCapability && _session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All
                        || _session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.Properties)
                        IsPropertyChangesSupported = true;
                }
                Logger.Debug("ChangeLog capability: " + ChangeLogCapability.ToString());
                Logger.Debug("Get folder tree support: " + IsGetFolderTreeSupported.ToString());
                Logger.Debug("Get descendants support: " + IsGetDescendantsSupported.ToString());

                if (SyncFolderInfo.ChunkSize > 0)
                {
                    Logger.Debug("Chunked Up/Download enabled: chunk size = " + SyncFolderInfo.ChunkSize.ToString() + " byte");
                }
                else
                {
                    Logger.Debug("Chunked Up/Download disabled");
                }
                HashSet<string> filters = new HashSet<string>();
                filters.Add("cmis:objectId");
                filters.Add("cmis:name");
                filters.Add("cmis:contentStreamFileName");
                filters.Add("cmis:contentStreamLength");
                filters.Add("cmis:lastModificationDate");
                filters.Add("cmis:lastModifiedBy");
                filters.Add("cmis:path");
                filters.Add("cmis:changeToken"); // Needed to send update commands, see https://github.com/aegif/CmisSync/issues/516
                _session.DefaultContext = _session.CreateOperationContext(filters, false, true, false, IncludeRelationshipsFlag.None, null, true, null, true, 100);
            }
            else
            {
                Logger.Warn("Connect() called, but the session is yet present");
            }
        }
开发者ID:lelmarir,项目名称:CmisSync,代码行数:58,代码来源:SyncFolderSyncronizer.cs


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