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


C# FolderType类代码示例

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


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

示例1: FolderSelectionChanged

 private void FolderSelectionChanged(object sender, EventArgs e)
 {
     if (inboxRadioButton.Checked)
     {
         this.folderSelectionLabel.Text = "Look in Inbox Folder";
         folderTypeSelection = FolderType.Inbox;
     }
     else if (sentRadioButton.Checked)
     {
         this.folderSelectionLabel.Text = "Look in Sent Items Folder";
         folderTypeSelection = FolderType.Sent;
     }
     else if (outboxRadioButton.Checked)
     {
         this.folderSelectionLabel.Text = "Look in Outbox Folder";
         folderTypeSelection = FolderType.Outbox;
     }
     else
     {
         this.folderSelectionLabel.Text = string.Empty;
         folderTypeSelection = FolderType.None;
     }
     BuildWorkflow(WizardStep.None);
     ResetButtons();
 }
开发者ID:ssickles,项目名称:archive,代码行数:25,代码来源:WizardForm.cs

示例2: GetDefaultDirectoryIcon

 /// <summary>
 ///     The current Windows default Folder Icon in the given Size (Large/Small) as System.Drawing.Icon.
 /// </summary>
 /// <param name="size">The Size of the Icon (Small or Large).</param>
 /// <param name="folderType">The folderTypeIcon (closed or Open).</param>
 /// <returns>The Folder Icon as System.Drawing.Icon.</returns>
 public static Icon GetDefaultDirectoryIcon(IconSize size, FolderType folderType)
 {
     var flags = ShgfiIcon | ShgfiUsefileattributes;
     if (FolderType.Open == folderType)
     {
         flags += ShgfiOpenicon;
     }
     if (IconSize.Small == size)
     {
         flags += ShgfiSmallicon;
     }
     else
     {
         flags += ShgfiLargeicon;
     }
     var shfi = new Structs.Shfileinfo();
     var res = DllImports.SHGetFileInfo(@"C:\Windows", FileAttributeDirectory, out shfi, (uint) Marshal.SizeOf(shfi), flags);
     if (res == IntPtr.Zero)
     {
         throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
     }
     Icon.FromHandle(shfi.hIcon);
     var icon = (Icon) Icon.FromHandle(shfi.hIcon).Clone();
     DllImports.DestroyIcon(shfi.hIcon);
     return icon;
 }
开发者ID:Belial09,项目名称:Fesslersoft-WindowsAPI,代码行数:32,代码来源:SHGetFileInfo.cs

示例3: AddFolderIcon

 public int AddFolderIcon(FolderType type)
 {
     string text = "folder_" + type.ToString();
     int result;
     if (this._extensionList.ContainsKey(text))
     {
         result = (int)this._extensionList[text];
     }
     else
     {
         int count = ((ImageList)this._imageLists[0]).Images.Count;
         if (this._manageBothSizes)
         {
             ((ImageList)this._imageLists[0]).Images.Add(IconReader.GetFolderIcon(IconSize.Small, type));
             ((ImageList)this._imageLists[1]).Images.Add(IconReader.GetFolderIcon(IconSize.Large, type));
         }
         else
         {
             ((ImageList)this._imageLists[0]).Images.Add(IconReader.GetFolderIcon(this._iconSize, type));
         }
         this.AddExtension(text, count);
         result = count;
     }
     return result;
 }
开发者ID:postondemand,项目名称:BuildVersionIncrement,代码行数:25,代码来源:IconListManager.cs

示例4: GetFolderIcon

        public static System.Drawing.Icon GetFolderIcon(string name, IconSize size, FolderType folderType)
        {
            Shell32.SHFILEINFO shfi = new Shell32.SHFILEINFO();
            uint flags = Shell32.SHGFI_ICON | Shell32.SHGFI_USEFILEATTRIBUTES;

            if (FolderType.Open == folderType)
            {
                flags += Shell32.SHGFI_OPENICON;
            }

            //if (true == linkOverlay) flags += Shell32.SHGFI_LINKOVERLAY;

            /* Check the size specified for return. */
            if (IconSize.Small == size)
            {
                flags += Shell32.SHGFI_SMALLICON;
            }
            else
            {
                flags += Shell32.SHGFI_LARGEICON;
            }

            Shell32.SHGetFileInfo(name,
                Shell32.FILE_ATTRIBUTE_DIRECTORY,
                ref shfi,
                (uint)System.Runtime.InteropServices.Marshal.SizeOf(shfi),
                flags);

            // Copy (clone) the returned icon to a new object, thus allowing us to clean-up properly
            System.Drawing.Icon icon = (System.Drawing.Icon)System.Drawing.Icon.FromHandle(shfi.hIcon).Clone();
            User32.DestroyIcon(shfi.hIcon);		// Cleanup
            return icon;
        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:33,代码来源:IconHelper.cs

示例5: GetFolderIcon

        /// <summary>
        /// Obtains system folder icon</summary>
        /// <param name="size">Specifies large or small icons</param>
        /// <param name="folderType">Specifies open or closed FolderType</param>
        /// <returns>System folder icon</returns>
        public static Icon GetFolderIcon(IconSize size, FolderType folderType)
        {
            // Need to add size check, although errors generated at present!
            uint flags = Shell32.SHGFI_ICON | Shell32.SHGFI_USEFILEATTRIBUTES;

            if (FolderType.Open == folderType)
            {
                flags += Shell32.SHGFI_OPENICON;
            }

            if (IconSize.Small == size)
            {
                flags += Shell32.SHGFI_SMALLICON;
            }
            else
            {
                flags += Shell32.SHGFI_LARGEICON;
            }

            // Get the folder icon
            Shell32.SHFILEINFO shfi = new Shell32.SHFILEINFO();
            Shell32.SHGetFileInfo(null,
                Shell32.FILE_ATTRIBUTE_DIRECTORY,
                ref shfi,
                (uint)System.Runtime.InteropServices.Marshal.SizeOf(shfi),
                flags);

            Icon.FromHandle(shfi.hIcon);    // Load the icon from an HICON handle

            // Now clone the icon, so that it can be successfully stored in an ImageList
            Icon icon = (Icon)Icon.FromHandle(shfi.hIcon).Clone();

            User32.DestroyIcon(shfi.hIcon);        // Cleanup
            return icon;
        }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:40,代码来源:FileIconUtil.cs

示例6: ListMessages

 public PagedList<TravelerMessage> ListMessages(Guid travelerID, FolderType folder, int index = 0, int count = 10)
 {
     Traveler traveler = _repository.FindBy<Traveler>(t => t.TravelerID == travelerID);
     if (traveler == null) throw new TravelerNotFoundException();
     if (traveler.HasMessagesInFolder(folder))
         return traveler.Messages.Where(m => m.FolderID == (int)folder).ToPagedList(index, count);
     else
         return new PagedList<TravelerMessage>();
 }
开发者ID:Nimrodda,项目名称:TravelersAround,代码行数:9,代码来源:MessageService.cs

示例7: Delete

        /// <summary>
        /// http://apidocs.mailchimp.com/api/2.0/folders/del.php
        /// </summary>
        /// <returns></returns>
        public Task<MailChimpServiceResponse> Delete(string name, int id, FolderType type)
        {
            var url = Urls.Folder + "/del.json";

            var request = new
            {
                fid = id,
                type = type
            };

            return Execute(url, request);
        }
开发者ID:james-andrewsmith,项目名称:mailchimp-net,代码行数:16,代码来源:MailChimpFolderService.cs

示例8: GoogleDriveProviderInfo

        public GoogleDriveProviderInfo(int id, string providerKey, string customerTitle, string token, Guid owner, FolderType rootFolderType, DateTime createOn)
        {
            if (string.IsNullOrEmpty(providerKey)) throw new ArgumentNullException("providerKey");
            if (string.IsNullOrEmpty(token)) throw new ArgumentException("Token can't be null");

            ID = id;
            CustomerTitle = customerTitle;
            Owner = owner == Guid.Empty ? SecurityContext.CurrentAccount.ID : owner;

            ProviderKey = providerKey;
            _token = OAuth20Token.FromJson(token);
            _rootFolderType = rootFolderType;
            _createOn = createOn;
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:14,代码来源:GoogleDriveProviderInfo.cs

示例9: GetStorageDirectory

        /// <summary>
        /// 以 FolderType 查詢實體存放資料夾
        /// </summary>
        /// <param name="folderType">資料夾類型</param>
        /// <param name="isCreate">是否建立資料夾</param>
        /// <returns>實體存放資料夾(絕對路徑)</returns>
        public DirectoryInfo GetStorageDirectory(FolderType folderType, bool isCreate)
        {
            string rootPath = GetStoragePath(FolderType.ROOT);
            string storagePath = GetStoragePath(folderType);
            m_Log.Debug("rootPath = " + rootPath);
            m_Log.Debug("storagePath = " + storagePath);
            DirectoryInfo dir = new DirectoryInfo(Path.Combine(rootPath, storagePath));

            if (isCreate && !dir.Exists)
            {
                dir.Create();
            }

            return dir;
        }
开发者ID:dada2cindy,项目名称:my-case-petemobile,代码行数:21,代码来源:StorageHelper.cs

示例10: GetFolderForType

        public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
        {
            Dictionary<FolderType, InventoryFolderBase> ff = null;
            if (m_FolderTypes.TryGetValue(userID, out ff))
            {
                InventoryFolderBase f = null;

                lock (ff)
                {
                    if (ff.TryGetValue(type, out f))
                        return f;
                }
            }

            return null;
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:16,代码来源:InventoryCache.cs

示例11: SharePointProviderInfo

        public SharePointProviderInfo(int id, string providerKey, string customerTitle, AuthData authData, Guid owner,
                                      FolderType rootFolderType, DateTime createOn)
        {
            if (string.IsNullOrEmpty(providerKey))
                throw new ArgumentNullException("providerKey");
            if (!string.IsNullOrEmpty(authData.Login) && string.IsNullOrEmpty(authData.Password))
                throw new ArgumentNullException("password", "Password can't be null");

            ID = id;
            ProviderKey = providerKey;
            CustomerTitle = customerTitle;
            Owner = owner == Guid.Empty ? SecurityContext.CurrentAccount.ID : owner;
            RootFolderType = rootFolderType;
            CreateOn = createOn;
            RootFolderId = MakeId();

            InitClientContext(authData);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:18,代码来源:SharePointProviderInfo.cs

示例12: Cache

        public void Cache(UUID userID, FolderType type, InventoryFolderBase folder)
        {
            Dictionary<FolderType, InventoryFolderBase> ff = null;
            if (!m_FolderTypes.TryGetValue(userID, out ff))
            {
                ff = new Dictionary<FolderType, InventoryFolderBase>();
                m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS);
            }

            // We need to lock here since two threads could potentially retrieve the same dictionary
            // and try to add a folder for that type simultaneously.  Dictionary<>.Add() is not described as thread-safe in the SDK
            // even if the folders are identical.
            lock (ff)
            {
                if (!ff.ContainsKey(type))
                    ff.Add(type, folder);
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:18,代码来源:InventoryCache.cs

示例13: SharpBoxProviderInfo

        public SharpBoxProviderInfo(int id, string providerKey, string customerTitle, AuthData authData, Guid owner, FolderType rootFolderType, DateTime createOn)
        {
            if (string.IsNullOrEmpty(providerKey))
                throw new ArgumentNullException("providerKey");
            if (string.IsNullOrEmpty(authData.Token) && string.IsNullOrEmpty(authData.Password))
                throw new ArgumentNullException("token", "Both token and password can't be null");
            if (!string.IsNullOrEmpty(authData.Login) && string.IsNullOrEmpty(authData.Password) && string.IsNullOrEmpty(authData.Token))
                throw new ArgumentNullException("password", "Password can't be null");

            ID = id;
            CustomerTitle = customerTitle;
            Owner = owner == Guid.Empty ? SecurityContext.CurrentAccount.ID : owner;

            _providerKey = (nSupportedCloudConfigurations) Enum.Parse(typeof (nSupportedCloudConfigurations), providerKey, true);
            _authData = authData;
            _rootFolderType = rootFolderType;
            _createOn = createOn;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:18,代码来源:SharpBoxProviderInfo.cs

示例14: AddAsync

        /// <summary>
        /// http://apidocs.mailchimp.com/api/2.0/folders/add.php
        /// </summary>
        /// <returns></returns>
        public Task<MailChimpServiceResponse> AddAsync(string name, FolderType type)
        {
            var url = Urls.Folder + "/add.json";

            var request = new
            {
                name = name,
                type = Enum.GetName(typeof(FolderType), type).ToLowerInvariant()
            };

            return Execute(url, request).ContinueWith(t =>
            {
                // add an extra level of validation
                if (t.Result.IsSuccesful)
                    t.Result.IsSuccesful = t.Result.Json["complete"]
                                                   .ToObject<bool>();

                return t.Result;
            });
        }
开发者ID:james-andrewsmith,项目名称:mailchimp-net,代码行数:24,代码来源:MailChimpFolderService.cs

示例15: GetFolderIcon

 public static Icon GetFolderIcon(IconSize size, FolderType folderType)
 {
     uint num = 272u;
     if (FolderType.Open == folderType)
     {
         num |= 2u;
     }
     if (IconSize.Small == size)
     {
         num |= 1u;
     }
     else
     {
         num = num;
     }
     Shell32.SHFILEINFO sHFILEINFO = default(Shell32.SHFILEINFO);
     Shell32.SHGetFileInfo(Environment.CurrentDirectory, 16u, ref sHFILEINFO, (uint)Marshal.SizeOf(sHFILEINFO), num);
     Icon.FromHandle(sHFILEINFO.hIcon);
     Icon result = (Icon)Icon.FromHandle(sHFILEINFO.hIcon).Clone();
     User32.DestroyIcon(sHFILEINFO.hIcon);
     return result;
 }
开发者ID:postondemand,项目名称:BuildVersionIncrement,代码行数:22,代码来源:IconReader.cs


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