本文整理汇总了C#中Altaxo.EndReading方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.EndReading方法的具体用法?C# Altaxo.EndReading怎么用?C# Altaxo.EndReading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo
的用法示例。
在下文中一共展示了Altaxo.EndReading方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestoreWindowStateFromZippedFile
/// <summary>
/// Restores the state of the main window from a zipped Altaxo project file.
/// </summary>
/// <param name="zipFile">The zip file where the state file can be found into.</param>
/// <param name="info">The deserialization info used to retrieve the data.</param>
/// <param name="restoredDoc">The previously (also from the zip file!) restored Altaxo document.</param>
public void RestoreWindowStateFromZippedFile(ZipFile zipFile, Altaxo.Serialization.Xml.XmlStreamDeserializationInfo info, AltaxoDocument restoredDoc)
{
System.Collections.ArrayList restoredControllers = new System.Collections.ArrayList();
foreach (ZipEntry zipEntry in zipFile)
{
if (!zipEntry.IsDirectory && zipEntry.Name.StartsWith("Workbench/Views/"))
{
System.IO.Stream zipinpstream = zipFile.GetInputStream(zipEntry);
info.BeginReading(zipinpstream);
object readedobject = info.GetValue("Table", this);
if (readedobject is ICSharpCode.SharpDevelop.Gui.IViewContent)
restoredControllers.Add(readedobject);
info.EndReading();
}
}
info.AnnounceDeserializationEnd(restoredDoc);
info.AnnounceDeserializationEnd(this);
// now give all restored controllers a view and show them in the Main view
foreach (IViewContent viewcontent in restoredControllers)
{
IMVCControllerWrapper wrapper = viewcontent as IMVCControllerWrapper;
if (wrapper != null && wrapper.MVCController.ViewObject==null)
Current.Gui.FindAndAttachControlTo(wrapper.MVCController);
if (viewcontent.Control != null)
{
Current.Workbench.ShowView(viewcontent);
}
}
}
示例2: RestoreWindowStateFromZippedFile
/// <summary>
/// Restores the state of the main window from a zipped Altaxo project file.
/// </summary>
/// <param name="zipFile">The zip file where the state file can be found into.</param>
/// <param name="info">The deserialization info used to retrieve the data.</param>
/// <param name="restoredDoc">The previously (also from the zip file!) restored Altaxo document.</param>
public void RestoreWindowStateFromZippedFile(ZipFile zipFile, Altaxo.Serialization.Xml.XmlStreamDeserializationInfo info, AltaxoDocument restoredDoc)
{
System.Collections.ArrayList restoredControllers = new System.Collections.ArrayList();
foreach (ZipEntry zipEntry in zipFile)
{
if (!zipEntry.IsDirectory && zipEntry.Name.StartsWith("Workbench/Views/"))
{
System.IO.Stream zipinpstream = zipFile.GetInputStream(zipEntry);
info.BeginReading(zipinpstream);
object readedobject = info.GetValue("Table", null);
if (readedobject is ICSharpCode.SharpDevelop.Gui.IViewContent)
restoredControllers.Add(readedobject);
else if (readedobject is GraphViewLayout)
restoredControllers.Add(readedobject);
else if (readedobject is Altaxo.Graph.Graph3D.GuiModels.GraphViewOptions)
restoredControllers.Add(readedobject);
else if (readedobject is Altaxo.Worksheet.WorksheetViewLayout)
restoredControllers.Add(readedobject);
info.EndReading();
}
}
info.AnnounceDeserializationEnd(restoredDoc, false);
info.AnnounceDeserializationEnd(restoredDoc, false);
// now give all restored controllers a view and show them in the Main view
foreach (object o in restoredControllers)
{
if (o is GraphViewLayout)
{
var ctrl = new GraphControllerWpf();
ctrl.InitializeDocument(o as GraphViewLayout);
Current.Gui.FindAndAttachControlTo(ctrl);
Current.Workbench.ShowView(new Altaxo.Gui.SharpDevelop.SDGraphViewContent(ctrl));
}
else if (o is Altaxo.Graph.Graph3D.GuiModels.GraphViewOptions)
{
var so = (o as Altaxo.Graph.Graph3D.GuiModels.GraphViewOptions);
if (so.GraphDocument != null)
{
var viewContent = this.OpenOrCreateViewContentForDocument(so.GraphDocument) as IMVCANController;
if (null != viewContent)
viewContent.InitializeDocument(so);
}
}
else if (o is Altaxo.Worksheet.WorksheetViewLayout)
{
var wksViewLayout = (Altaxo.Worksheet.WorksheetViewLayout)o;
if (null != wksViewLayout.WorksheetLayout && null != wksViewLayout.WorksheetLayout.DataTable)
{
var ctrl = new Altaxo.Gui.Worksheet.Viewing.WorksheetControllerWpf();
ctrl.InitializeDocument(wksViewLayout);
Current.Gui.FindAndAttachControlTo(ctrl);
Current.Workbench.ShowView(new Altaxo.Gui.SharpDevelop.SDWorksheetViewContent(ctrl));
}
}
else if (o is IViewContent)
{
var viewcontent = o as IViewContent;
IMVCControllerWrapper wrapper = viewcontent as IMVCControllerWrapper;
if (wrapper != null && wrapper.MVCController.ViewObject == null)
Current.Gui.FindAndAttachControlTo(wrapper.MVCController);
if (viewcontent.Control != null)
{
Current.Workbench.ShowView(viewcontent);
}
}
}
}