本文整理汇总了C#中IOConnectionInfo.CanProbablyAccess方法的典型用法代码示例。如果您正苦于以下问题:C# IOConnectionInfo.CanProbablyAccess方法的具体用法?C# IOConnectionInfo.CanProbablyAccess怎么用?C# IOConnectionInfo.CanProbablyAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOConnectionInfo
的用法示例。
在下文中一共展示了IOConnectionInfo.CanProbablyAccess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenDatabase
/// <summary>
/// Open a database. This function opens the specified database and updates
/// the user interface.
/// </summary>
public void OpenDatabase(IOConnectionInfo ioc, CompositeKey cmpKey)
{
// Close active db
CloseDatabase ();
if (db != null && db.IsOpen)
return;
//IOConnectionInfo ioc = IOConnectionInfo.FromPath(ConfigurationManager.AppSettings["dbPath"]);
//if (ioConnection == null)
//{
// if (bOpenLocal)
// {
// OpenFileDialog ofdDb = UIUtil.CreateOpenFileDialog(KPRes.OpenDatabaseFile,
// UIUtil.CreateFileTypeFilter(AppDefs.FileExtension.FileExt,
// KPRes.KdbxFiles, true), 1, null, false, false);
// //GlobalWindowManager.AddDialog(ofdDb);
// //DialogResult dr = ofdDb.ShowDialog();
// //GlobalWindowManager.RemoveDialog(ofdDb);
// //if (dr != DialogResult.OK) return;
// ioc = IOConnectionInfo.FromPath(ofdDb.FileName);
// }
// else
// {
// ioc = CompleteConnectionInfo(new IOConnectionInfo(), false,
// true, true, true);
// if (ioc == null) return;
// }
//}
//else // ioConnection != null
//{
// ioc = CompleteConnectionInfo(ioConnection, false, true, true, false);
// if (ioc == null) return;
//}
if (!ioc.CanProbablyAccess ()) {
// TODO
//MessageService.ShowWarning(ioc.GetDisplayName(), KPRes.FileNotFoundError);
//return;
}
//if (OpenDatabaseRestoreIfOpened(ioc)) return;
PwDatabase pwOpenedDb = null;
if (cmpKey == null) {
// get the master key
CompositeKey key = CreateCompositeKey (System.Configuration.ConfigurationManager.AppSettings ["dbKey"]);
pwOpenedDb = OpenDatabaseInternal (ioc, key);
}
else { // cmpKey != null
pwOpenedDb = OpenDatabaseInternal (ioc, cmpKey);
}
//string strName = pwOpenedDb.IOConnectionInfo.GetDisplayName();
//this.Text = strName;
//m_mruList.AddItem(strName, pwOpenedDb.IOConnectionInfo.CloneDeep(), true);
db = pwOpenedDb;
}