本文整理汇总了C#中IProfile.ParseAsync方法的典型用法代码示例。如果您正苦于以下问题:C# IProfile.ParseAsync方法的具体用法?C# IProfile.ParseAsync怎么用?C# IProfile.ParseAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProfile
的用法示例。
在下文中一共展示了IProfile.ParseAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bootstrapper
//public string FileFilter { get { return _fileFilter; } set { _fileFilter = value; NotifyOfPropertyChange(() => FileFilter); } }
#endregion
public Bootstrapper()
{
InitializeComponent();
_profile = new FileSystemInfoProfile(_events);
_profileEx = new FileSystemInfoExProfile(_events, _windowManager, new FileExplorer.Models.SevenZipSharp.SzsProfile(_events));
Func<string> loginSkyDrive = () =>
{
var login = new SkyDriveLogin(AuthorizationKeys.SkyDrive_Client_Id);
if (_windowManager.ShowDialog(new LoginViewModel(login)).Value)
{
return login.AuthCode;
}
return null;
};
if (AuthorizationKeys.SkyDrive_Client_Secret != null)
_profileSkyDrive = new SkyDriveProfile(_events, AuthorizationKeys.SkyDrive_Client_Id, loginSkyDrive, skyDriveAliasMask);
Func<UserLogin> loginDropBox = () =>
{
var login = new DropBoxLogin(AuthorizationKeys.DropBox_Client_Id,
AuthorizationKeys.DropBox_Client_Secret);
if (_windowManager.ShowDialog(new LoginViewModel(login)).Value)
{
return login.AccessToken;
}
return null;
};
if (AuthorizationKeys.DropBox_Client_Secret != null)
_profileDropBox = new DropBoxProfile(_events,
AuthorizationKeys.DropBox_Client_Id,
AuthorizationKeys.DropBox_Client_Secret,
loginDropBox);
if (System.IO.File.Exists("gapi_client_secret.json"))
using (var gapi_secret_stream = System.IO.File.OpenRead("gapi_client_secret.json")) //For demo only.
{
_profileGoogleDrive = new GoogleDriveProfile(_events, gapi_secret_stream);
}
RootModels.Add(AsyncUtils.RunSync(() => _profileEx.ParseAsync(System.IO.DirectoryInfoEx.DesktopDirectory.FullName)));
_profiles = new IProfile[] {
_profileEx, _profileSkyDrive, _profileDropBox, _profileGoogleDrive }.Where(p => p != null).ToArray();
}