本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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>();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
});
}
示例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;
}