Example #1
0
        internal void SetNew()
        {
            XmlDocument doc = new XmlDocument();
            doc.PreserveWhitespace = false;
            doc.InnerXml = "<MapData></MapData>";

            _File = null;                           // ok we opened it
            _MapDoc = doc;                          // don't set new one until we know we've loaded the file
            _Undo = new Undo(_MapDoc, 300);
            _Undo.GroupsOnly = true;				// don't record changes that we don't group.
            _Modified = false;
            _SelectedList.Clear();
            SetBackgroundImage(null);
            hScrollBar.Value = 0;
            vScrollBar.Value = 0;
            vScrollBar.Maximum = 1000;
            hScrollBar.Maximum = 1000;

            this.Invalidate();
        }
Example #2
0
 internal UndoGroup(Undo undo, String description)
 {
     _undo = undo;
     this.description = description;
 }
Example #3
0
        internal void SetMapFile(string file)
        {
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.PreserveWhitespace = false;
                doc.Load(file);
                XmlNode xNode = doc.LastChild;
                if (xNode == null || xNode.Name != "MapData")
                    throw new Exception(Strings.DesignXmlDraw_Error_XMLNotMapData);
                
                _File = file;                           // ok we opened it
                _MapDoc = doc;                          // don't set new one until we know we've loaded the file
                _Undo = new Undo(_MapDoc, 300);
                _Undo.GroupsOnly = true;				// don't record changes that we don't group.
                _Modified = false;
                _SelectedList.Clear();
                SignalSelectionChanged();
                SetBackgroundImage(null);
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("{2} {0}\n\n{1}", file, ex.Message, Strings.DesignXmlDraw_SetMapFile_Unable_to_open_file), Strings.DesignXmlDraw_SetMapFile_ErrorOpeningFile);
            }
            hScrollBar.Value = 0;
            vScrollBar.Value = 0;
            vScrollBar.Maximum = 1000;
            hScrollBar.Maximum = 1000;

            this.Invalidate();
        }