private void PopulateListBox()
 {
     if (!DesignMode)
     {
         listBoxControl1.DataSource = DiagramRepository.GetDiagramNames();
     }
 }
예제 #2
0
        void OnCustomSaveDocument(object sender, DiagramCustomSaveDocumentEventArgs e)
        {
            var diagramName = (string)e.DocumentSource;

            Text = diagramName;
            var stream = new MemoryStream();

            diagramControl1.SaveDocument(stream);
            var diagramData = stream.ToArray();

            DiagramRepository.SaveDiagramData(diagramName, diagramData);
            e.Handled = true;
        }
예제 #3
0
        void OnCustomLoadDocument(object sender, DiagramCustomLoadDocumentEventArgs e)
        {
            if (e.DocumentSource == null)
            {
                diagramControl1.NewDocument();
                Text = "(New Document)";
                return;
            }
            var diagramName = (string)e.DocumentSource;

            Text = diagramName;
            var diagramData = DiagramRepository.GetDiagramData(diagramName);

            if (diagramData != null)
            {
                diagramControl1.LoadDocument(new MemoryStream(diagramData));
            }
            e.Handled = true;
        }