public static CommandMapper CreateInstance(ICommandTarget o, Stream s) { try { BinaryFormatter bf = new BinaryFormatter(); bf.AssemblyFormat = FormatterAssemblyStyle.Simple; CommandMapper km = (CommandMapper)bf.Deserialize(s); km.target = o; return(km); } finally { s.Close(); } }
public static CommandMapper CreateInstance(ICommandTarget o, XmlTextReader xtr) { SimpleXmlSerializer serializer = new SimpleXmlSerializer(typeof(CommandMapper)); try { CommandMapper km = (CommandMapper)serializer.Deserialize(xtr); km.target = o; return(km); } finally { xtr.Close(); } }
/// <summary> /// The main control for XEditNet applications. /// </summary> // TODO: D: add remarks section public XEditNetCtrl() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // if ( !this.DesignMode ) // { // Application.EnableVisualStyles(); // Application.DoEvents(); // } SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); nodocWnd=new NoDocumentControl(); nodocWnd.Parent=this; findWindow=new FindPopup(this); if ( this.DesignMode ) return; caret=grFactory.CreateCaret(this); caret.Visible=true; quickFixIndicator=new QuickFixIndicator(this, caret); Stylesheet=new Stylesheet(); undoManager=new UndoManager(this); commandMapper=CommandMapper.CreateInstance(this); }