本文整理汇总了C#中IUser.Open方法的典型用法代码示例。如果您正苦于以下问题:C# IUser.Open方法的具体用法?C# IUser.Open怎么用?C# IUser.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUser
的用法示例。
在下文中一共展示了IUser.Open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenLearningModule
/// <summary>
/// Opens the learning module.
/// </summary>
/// <param name="filename">The filename.</param>
/// <remarks>Documented by Dev08, 2009-07-18</remarks>
public void OpenLearningModule(string filename)
{
string globalConfig = System.IO.Path.Combine(Application.Current.StartupUri.AbsolutePath, Settings.Default.ConfigPath);
string userConfig = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Settings.Default.ConfigurationFolder);
string syncedModulesPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
System.IO.Path.Combine(Settings.Default.AppDataFolder, Settings.Default.SyncedLMFolder));
ThreadStart threadStart = new ThreadStart(delegate()
{
try
{
CloseLearningModule();
MLifter.BusinessLayer.LearningModulesIndex index = new MLifter.BusinessLayer.LearningModulesIndex(globalConfig, userConfig, LoginForm.OpenLoginForm, delegate { return; }, string.Empty);
learningModuleUser = null;
learningModuleUser = UserFactory.Create(LoginForm.OpenLoginForm, new ConnectionStringStruct(DatabaseType.MsSqlCe, filename, -1), delegate { return; }, this);
ConnectionStringStruct css = learningModuleUser.ConnectionString;
css.LmId = MLifter.DAL.User.GetIdOfLearningModule(filename, learningModuleUser);
learningModuleUser.ConnectionString = css;
LearningModule = learningModuleUser.Open();
}
catch (Exception e)
{
context.Post(new SendOrPostCallback(delegate(object state)
{
OnLearningModuleException(this, new ExceptionEventArgs(e, filename));
}), null);
return;
}
context.Post(new SendOrPostCallback(delegate(object state)
{
OnLearningModuleOpened(this, EventArgs.Empty);
}), null);
});
new Thread(threadStart) { Name = "Open LearningModule Thread" }.Start();
}