本文整理汇总了C#中SessionBase.NewLocation方法的典型用法代码示例。如果您正苦于以下问题:C# SessionBase.NewLocation方法的具体用法?C# SessionBase.NewLocation怎么用?C# SessionBase.NewLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionBase
的用法示例。
在下文中一共展示了SessionBase.NewLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: moveDatabaseLocations
public void moveDatabaseLocations(SessionBase session, string updatedHostName, string newPath)
{
session.BeginUpdate(false);
DatabaseLocation bootLocation = session.DatabaseLocations.LocationForDb(0);
DatabaseLocation locationNew = new DatabaseLocation(updatedHostName, newPath, bootLocation.StartDatabaseNumber, bootLocation.EndDatabaseNumber, session,
bootLocation.CompressPages, bootLocation.PageEncryption, bootLocation.IsBackupLocation, bootLocation.BackupOfOrForLocation);
bootLocation = session.NewLocation(locationNew);
session.Commit(false);
}
示例2: AddDatabaseLocation
void AddDatabaseLocation(SessionBase session, string directory)
{
DatabaseLocationMutable newLocationMutable = new DatabaseLocationMutable(session);
newLocationMutable.DirectoryPath = directory;
var popup = new NewDatabaseLocationDialog(newLocationMutable, null);
bool? result = popup.ShowDialog();
if (result != null && result.Value)
{
try
{
DatabaseLocation newLocation = new DatabaseLocation(newLocationMutable.HostName, newLocationMutable.DirectoryPath, newLocationMutable.StartDatabaseNumber,
newLocationMutable.EndDatabaseNumber, session, newLocationMutable.CompressPages, newLocationMutable.PageEncryption, newLocationMutable.BackupOfOrForLocation != null,
newLocationMutable.BackupOfOrForLocation);
if (session.InTransaction)
session.Commit();
session.BeginUpdate();
session.NewLocation(newLocation);
session.Commit();
m_viewModel = new AllFederationsViewModel();
base.DataContext = m_viewModel;
}
catch (Exception ex)
{
session.Abort();
MessageBox.Show(ex.Message);
}
}
}