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

C# IFolder类代码示例

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

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



IFolder类属于命名空间,在下文中一共展示了IFolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DescendantsCrawler

        /// <summary>
        /// Initializes a new instance of the <see cref="DescendantsCrawler"/> class.
        /// </summary>
        /// <param name="queue">Sync Event Queue.</param>
        /// <param name="remoteFolder">Remote folder.</param>
        /// <param name="localFolder">Local folder.</param>
        /// <param name="storage">Meta data storage.</param>
        /// <param name="filter">Aggregated filter.</param>
        /// <param name="activityListener">Activity listner.</param>
        public DescendantsCrawler(
            ISyncEventQueue queue,
            IFolder remoteFolder,
            IDirectoryInfo localFolder,
            IMetaDataStorage storage,
            IFilterAggregator filter,
            IActivityListener activityListener,
            IIgnoredEntitiesStorage ignoredStorage)
            : base(queue)
        {
            if (remoteFolder == null) {
                throw new ArgumentNullException("remoteFolder");
            }

            if (localFolder == null) {
                throw new ArgumentNullException("localFolder");
            }

            if (storage == null) {
                throw new ArgumentNullException("storage");
            }

            if (filter == null) {
                throw new ArgumentNullException("filter");
            }

            if (activityListener == null) {
                throw new ArgumentNullException("activityListener");
            }

            this.activityListener = activityListener;
            this.treebuilder = new DescendantsTreeBuilder(storage, remoteFolder, localFolder, filter, ignoredStorage);
            this.eventGenerator = new CrawlEventGenerator(storage);
            this.notifier = new CrawlEventNotifier(queue);
        }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:44,代码来源:DescendantsCrawler.cs


示例2: With

        public NodeTreeParserConfig With(IFolder folder)
        {
            this.folders.Add(folder);
            this.locators.Add(new LinkedTextLocator(folder));

            return this;
        }
开发者ID:MatanShahar,项目名称:IntelliSun,代码行数:7,代码来源:NodeTreeParserConfig.cs


示例3: _EnsureFolderExistsAsync

 private  static async Task<IFolder> _EnsureFolderExistsAsync(string name, IFolder parent)
 {
     if (parent == null) throw new ArgumentNullException("parent");
     return
         await
             parent.CreateFolderAsync(name, CreationCollisionOption.OpenIfExists).ConfigureAwait(false);
 }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:7,代码来源:StorageHelper.cs


示例4: MessageListCommand

        /// <summary>
        /// Create a new MessageListCommand for the specified folder
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="callback"></param>
        public MessageListCommand(IFolder folder, CommandDataReceivedCallback callback)
            : base(callback)
        {
            _parameterObjs.Add(folder);

            CommandString = String.Format("UID SEARCH all");
        }
开发者ID:gavioto,项目名称:evimsync,代码行数:12,代码来源:MessageListCommand.cs


示例5: Start

 /// <summary>
 /// Search for messages within the specified folders. The NewMessageRequestCompleted event will be fired once for each folder.
 /// </summary>
 /// <param name="folders"></param>
 public void Start(IFolder[] folders)
 {
     foreach (IFolder folder in folders)
     {
         Start(folder);
     }
 }
开发者ID:gavioto,项目名称:evimsync,代码行数:11,代码来源:NewMessagesRequest.cs


示例6: UploadRandomDocumentTo

        private static void UploadRandomDocumentTo(IFolder folder)
        {
            string filename = "file_" + Guid.NewGuid() + ".bin";

            //byte[] content = UTF8Encoding.UTF8.GetBytes("Hello World!");
            int sizeInMb = 40;
            byte[] data = new byte[sizeInMb * 1024 * 1024];
            Random rng = new Random();
            rng.NextBytes(data);

            IDictionary<string, object> properties = new Dictionary<string, object>();
            properties[PropertyIds.Name] = filename;
            properties[PropertyIds.ObjectTypeId] = "cmis:document";

            ContentStream contentStream = new ContentStream();
            contentStream.FileName = filename;
            contentStream.MimeType = "application/octet-stream";
            contentStream.Length = data.Length;
            contentStream.Stream = new MemoryStream(data);

            Console.Write("Uploading " + filename + " ... ");
            folder.CreateDocument(properties, contentStream, null);
            Console.WriteLine(" Done.");

            contentStream.Stream.Close();
            contentStream.Stream.Dispose();
        }
开发者ID:nicolas-raoul,项目名称:dotcmis-upload,代码行数:27,代码来源:Program.cs


示例7: CopyMessageRequest

 /// <summary>
 /// Initializes a new instance of the <see cref="MoveMessageRequest"/> class.
 /// </summary>
 /// <param name="message">The messagy to copy.</param>
 /// <param name="destFolder">The destination folder.</param>
 /// <param name="callback">The callback to call when copy operation is completed.</param>
 public CopyMessageRequest(IMessage message, IFolder destFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(message.Folder, null);
     Command = new CopyMessageCommand(message, destFolder, null);
     ProcessorType = typeof(CopyMessageProcessor);
 }
开发者ID:gavioto,项目名称:evimsync,代码行数:13,代码来源:CopyMessageRequest.cs


示例8: CrawlSync

            /// <summary>
            /// Synchronize by checking all folders/files one-by-one.
            /// This strategy is used if the CMIS server does not support the ChangeLog feature.
            /// 
            /// for all remote folders:
            ///     if exists locally:
            ///       recurse
            ///     else
            ///       if in database:
            ///         delete recursively from server // if BIDIRECTIONAL
            ///       else
            ///         download recursively
            /// for all remote files:
            ///     if exists locally:
            ///       if remote is more recent than local:
            ///         download
            ///       else
            ///         upload                         // if BIDIRECTIONAL
            ///     else:
            ///       if in database:
            ///         delete from server             // if BIDIRECTIONAL
            ///       else
            ///         download
            /// for all local files:
            ///   if not present remotely:
            ///     if in database:
            ///       delete
            ///     else:
            ///       upload                           // if BIDIRECTIONAL
            ///   else:
            ///     if has changed locally:
            ///       upload                           // if BIDIRECTIONAL
            /// for all local folders:
            ///   if not present remotely:
            ///     if in database:
            ///       delete recursively from local
            ///     else:
            ///       upload recursively               // if BIDIRECTIONAL
            /// </summary>
            private void CrawlSync(IFolder remoteFolder, string localFolder)
            {
                sleepWhileSuspended();

                // Lists of files/folders, to delete those that have been removed on the server.
                IList remoteFiles = new ArrayList();
                IList remoteSubfolders = new ArrayList();

                try
                {
                    // Crawl remote children.
                    // Logger.LogInfo("Sync", String.Format("Crawl remote folder {0}", this.remoteFolderPath));
                    CrawlRemote(remoteFolder, localFolder, remoteFiles, remoteSubfolders);

                    // Crawl local files.
                    // Logger.LogInfo("Sync", String.Format("Crawl local files in the local folder {0}", localFolder));
                    CrawlLocalFiles(localFolder, remoteFolder, remoteFiles);

                    // Crawl local folders.
                    // Logger.LogInfo("Sync", String.Format("Crawl local folder {0}", localFolder));
                    CrawlLocalFolders(localFolder, remoteFolder, remoteSubfolders);
                }
                catch (CmisBaseException e)
                {
                    ProcessRecoverableException("Could not crawl folder: " + remoteFolder.Path, e);
                }
            }
开发者ID:keithwharrison,项目名称:Oris4Sync,代码行数:66,代码来源:CrawlStrategy.cs


示例9: DeleteFolderRequest

 public DeleteFolderRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     /*
      * Process for deleting a folder:
      * the IMAP spec states that deleting a folder should NOT delete any sub folders.
      * So in that case we must rename any and all sub folders to include the name of the 
      * parent folder that is being deleted. for example:
      * 
      * INBOX/Sub1/SubSub1
      *           /SubSub2
      *           /SubSub3
      *           
      * if we delete Sub1, Sub1's sub folders become:
      * 
      * INBOX/Sub1_SubSub1
      * INBOX/Sub1_SubSub2
      * INBOX/Sub1_SubSub3
      * 
      * This request is ONLY for deleting the folder on the server. A higher level construct
      * is needed to facilitate the renaming of sub folders.
      * 
      * */
     Command = new DeleteFolderCommand(folder, null);
     ProcessorType = typeof (DeleteFolderProcessor);
 }
开发者ID:gavioto,项目名称:evimsync,代码行数:26,代码来源:DeleteFolderRequest.cs


示例10: MoveAsync

 public static Task MoveAsync( this IFile file, IFolder destinationFolder )
 {
     Arg.NotNull( file, nameof( file ) );
     Arg.NotNull( destinationFolder, nameof( destinationFolder ) );
     Contract.Ensures( Contract.Result<Task>() != null );
     return file.MoveAsync( destinationFolder, file.Name );
 }
开发者ID:WaffleSquirrel,项目名称:More,代码行数:7,代码来源:IFileExtensions.cs


示例11: MessageListRequest

 /// <summary>
 /// Retreives the list of message UIDs for the specified folder from the server.
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public MessageListRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new ExamineFolderCommand(folder, null);
     Command = new MessageListCommand(folder, null);
     ProcessorType = typeof (MessageListProcessor);
 }
开发者ID:gavioto,项目名称:evimsync,代码行数:12,代码来源:MessageListRequest.cs


示例12: SearchRequest

 public SearchRequest(IFolder folder, SearchCriteria criteria, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(folder, null);
     Command = new SearchCommand(criteria, null);
     ProcessorType = typeof (SearchProcessor);
 }
开发者ID:gavioto,项目名称:evimsync,代码行数:7,代码来源:SearchRequest.cs


示例13: CreateFolderCommand

        public CreateFolderCommand(string folderName, IFolder parentFolder, CommandDataReceivedCallback callback)
            : base(callback)
        {
            System.Text.StringBuilder b = new System.Text.StringBuilder(folderName);
            for (int i = 0; i < b.Length; ++i)
            {
                if (b[i] == '+')
                    b[i] = '&';
                else if (b[i] == '&')
                    b[i] = '+';
            }
            folderName = b.ToString();
            byte[] utf7String = System.Text.Encoding.UTF7.GetBytes(folderName);
            folderName = System.Text.Encoding.ASCII.GetString(utf7String);
            folderName = folderName.Replace('/', ',').Replace('+', '&');

            string fullFolder = parentFolder != null
                                    ? String.Format("{0}/{1}", parentFolder.FullEncodedPath, folderName)
                                    : folderName;

            fullFolder = fullFolder.Replace("\"", "");

            _parameters.Add(fullFolder);
            CommandString = String.Format("CREATE \"{0}\"", fullFolder);
        }
开发者ID:gavioto,项目名称:evimsync,代码行数:25,代码来源:CreateFolderCommand.cs


示例14: ValidateFileNames

        public bool ValidateFileNames(string folderName, IFolder folder, IScriptBaseObject thisLevelRootObject, out IEnumerable<FilenameInfo> duplicates)
        {
            log.Info("Validating generated files.");

            List<FilenameInfo> generatedPaths = new List<FilenameInfo>();

            ValidateFileNames(generatedPaths, folder, thisLevelRootObject, folderName);

            Dictionary<string, FilenameInfo> generatedPathSet = new Dictionary<string, FilenameInfo>();
            HashSet<FilenameInfo> tempduplicates = new HashSet<FilenameInfo>();

            foreach (var path in generatedPaths)
            {
                if (generatedPathSet.ContainsKey(path.ProcessedFilename) == false)
                {
                    generatedPathSet.Add(path.ProcessedFilename, path);
                }
                else
                {
                    tempduplicates.Add(generatedPathSet[path.ProcessedFilename]);
                    tempduplicates.Add(path);
                }
            }

            if (tempduplicates.Count > 0)
            {
                duplicates = tempduplicates;
                return false;
            }
            duplicates = new List<FilenameInfo>();
            return true;
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:32,代码来源:DuplicateFileNameChecker.cs


示例15: SelectFolderCommand

 /// <summary>
 /// Create a new SelectFolderCommand for the specified folder
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public SelectFolderCommand(IFolder folder, CommandDataReceivedCallback callback)
     : base(callback)
 {
     _parameters.Add(folder.FullPath);
     _parameterObjs.Add(folder);
     CommandString = String.Format("SELECT \"{0}\"", Parameters);
 }
开发者ID:ResNet,项目名称:UnifiedManagmentSystem,代码行数:12,代码来源:SelectFolderCommand.cs


示例16: DescendantsTreeBuilder

        /// <summary>
        /// Initializes a new instance of the <see cref="CmisSync.Lib.Producer.Crawler.DescendantsTreeBuilder"/> class.
        /// </summary>
        /// <param name='storage'>
        /// The MetadataStorage.
        /// </param>
        /// <param name='remoteFolder'>
        /// Remote folder.
        /// </param>
        /// <param name='localFolder'>
        /// Local folder.
        /// </param>
        /// <param name='filter'>
        /// Aggregated Filters.
        /// </param>
        /// <exception cref='ArgumentNullException'>
        /// <attribution license="cc4" from="Microsoft" modified="false" /><para>The exception that is thrown when a
        /// null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. </para>
        /// </exception>
        public DescendantsTreeBuilder(
            IMetaDataStorage storage,
            IFolder remoteFolder,
            IDirectoryInfo localFolder,
            IFilterAggregator filter,
            IIgnoredEntitiesStorage ignoredStorage)
        {
            if (remoteFolder == null) {
                throw new ArgumentNullException("remoteFolder");
            }

            if (localFolder == null) {
                throw new ArgumentNullException("localFolder");
            }

            if (storage == null) {
                throw new ArgumentNullException("storage");
            }

            if (filter == null) {
                throw new ArgumentNullException("filter");
            }

            if (ignoredStorage == null) {
                throw new ArgumentNullException("ignoredStorage");
            }

            this.storage = storage;
            this.remoteFolder = remoteFolder;
            this.localFolder = localFolder;
            this.filter = filter;
            this.matcher = new PathMatcher(localFolder.FullName, remoteFolder.Path);
            this.ignoredStorage = ignoredStorage;
        }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:53,代码来源:DescendantsTreeBuilder.cs


示例17: ExamineFolderCommand

 /// <summary>
 /// Create a new ExamineFolderCommand for the specified folder
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public ExamineFolderCommand(IFolder folder, CommandDataReceivedCallback callback)
     : base(callback)
 {
     _parameters.Add(folder.FullPath);
     _parameterObjs.Add(folder);
     CommandString = String.Format("EXAMINE \"{0}\"", Parameters);
 }
开发者ID:ResNet,项目名称:UnifiedManagmentSystem,代码行数:12,代码来源:ExamineFolderCommand.cs


示例18: CreateByBinary

        public static File CreateByBinary(IFolder parent, BinaryData binaryData)
        {
            if (parent == null)
                throw new ArgumentNullException("parent");

            if (binaryData == null)
                return new File(parent as Node);

            File file;
            // Resolve filetype by binary-config matching
            BinaryTypeResolver resolver = new BinaryTypeResolver();
            if (!resolver.ParseBinary(binaryData))
            {
                // Unknown file type
                file = new File(parent as Node);
            }
            else
            {
                // Specific File subtype has been found
                file = TypeHandler.CreateInstance<File>(resolver.NodeType.ClassName, parent);

                var fname = binaryData.FileName.FileNameWithoutExtension;
                if (string.IsNullOrEmpty(fname))
                    fname = file.Name;
                else if (fname.Contains("\\"))
                    fname = System.IO.Path.GetFileNameWithoutExtension(fname);

                binaryData.FileName = new BinaryFileName(fname, resolver.FileNameExtension);
                binaryData.ContentType = resolver.ContentType;
            }

            file.Binary = binaryData;
            return file;
        }
开发者ID:jhuntsman,项目名称:FlexNet,代码行数:34,代码来源:File.cs


示例19: WixScriptBuilder

	public WixScriptBuilder(XmlWriter writer, IFolder basePath, WixBuilderParameters parameters)
	{
		parameters.Validate();
		_writer = writer;
		_basePath = basePath;
		_parameters = parameters;
		InitializeFileIdMappings(parameters);
	}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:WixScriptBuilder.cs


示例20: CrawlRequestEvent

        /// <summary>
        /// Initializes a new instance of the <see cref="CmisSync.Lib.Events.CrawlRequestEvent"/> class.
        /// </summary>
        /// <param name='localFolder'>
        /// Local folder.
        /// </param>
        /// <param name='remoteFolder'>
        /// Remote folder.
        /// </param>
        public CrawlRequestEvent(IDirectoryInfo localFolder, IFolder remoteFolder) {
            if (localFolder == null) {
                throw new ArgumentNullException("localFolder");
            }

            this.RemoteFolder = remoteFolder;
            this.LocalFolder = localFolder;
        }
开发者ID:OpenDataSpace,项目名称:CmisSync,代码行数:17,代码来源:CrawlRequestEvent.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IFolderInfo类代码示例发布时间:2022-05-24
下一篇:
C# IFn类代码示例发布时间: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