本文整理汇总了C#中System.IO.FileInfo.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.FileInfo.Insert方法的具体用法?C# System.IO.FileInfo.Insert怎么用?C# System.IO.FileInfo.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.FileInfo
的用法示例。
在下文中一共展示了System.IO.FileInfo.Insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(string evt, params object[] data)
{
if (evt == LMSNotifications.ApplicationStart)
{
if (!isRun)
{
//mTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
//mTimer.Start();
string root = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName;
int index = root.IndexOf("\\Plugins");
root = root.Substring(0, index);
serverPath = root.Insert(index, "\\Data\\Index");
RebuildIndex(data[0] as ILmsService);
//var thread = new Thread(startMyTimer);
//thread.Start(((IWindsorContainer)data[0]).Resolve<ILmsService>());
//isRun = true;
}
}
if (evt == UserNotifications.UserCreate)
{
User user = (User)data[0];
Document document = new Document();
document.Add(new Field("Type", "User", Field.Store.YES, Field.Index.NO));
document.Add(new Field("UserID", user.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
document.Add(new Field("User", user.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
AddToIndex(document);
}
if (evt == UserNotifications.UserEdit)
{
Update(UserNotifications.UserDelete, data[0]);
Update(UserNotifications.UserCreate, data[1]);
}
if (evt == UserNotifications.UserDelete)
{
User user = (User)data[0];
Term term = new Term("UserID", user.Id.ToString());
DeleteFromIndex(term);
}
if (evt == DisciplineNotifications.DisciplineCreate)
{
Discipline discipline = (Discipline)data[0];
Document document = new Document();
document.Add(new Field("Type", "Discipline", Field.Store.YES, Field.Index.NO));
document.Add(new Field("DisciplineID", discipline.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
document.Add(new Field("Owner", discipline.Owner, Field.Store.YES, Field.Index.NO));
document.Add(new Field("Discipline", discipline.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
AddToIndex(document);
}
if (evt == DisciplineNotifications.DisciplineEdit)
{
Update(DisciplineNotifications.DisciplineDelete, data[0]);
Update(DisciplineNotifications.DisciplineCreate, data[1]);
}
if (evt == DisciplineNotifications.DisciplineDelete)
{
Discipline discipline = (Discipline)data[0];
Term term = new Term("DisciplineID", discipline.Id.ToString());
DeleteFromIndex(term);
}
if (evt == DisciplineNotifications.TopicCreate)
{
Topic topic = (Topic)data[0];
Document document = new Document();
document = new Document();
document.Add(new Field("Type", "Topic", Field.Store.YES, Field.Index.NO));
document.Add(new Field("TopicID", topic.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED));
document.Add(new Field("Topic", topic.Name.ToString(), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.YES));
if (topic.CourseRef == null)
{
document.Add(new Field("CourseRef", "null", Field.Store.YES, Field.Index.NO));
}
else
{
document.Add(new Field("CourseRef", topic.CourseRef.ToString(), Field.Store.YES, Field.Index.NO));
}
AddToIndex(document);
}
if (evt == DisciplineNotifications.TopicEdit)
{
Update(DisciplineNotifications.TopicDelete, data[0]);
Update(DisciplineNotifications.TopicCreate, data[1]);
}
if (evt == DisciplineNotifications.TopicDelete)
//.........这里部分代码省略.........