예제 #1
0
        /// <summary>
        /// This is responsible for creating the XML file which contains the result
        /// of the type dependency as well as package dependency. The generated xml
        /// file is stored in the debug folder of the client. This file is later used
        /// by the LINQ query to display the result of XML in the GUI
        /// </summary>
        private String createXmlData()
        {
            String     xmlSavedDataString = "";
            XmlDisplay xmlDislay          = new XmlDisplay();

            xmlDislay.SetMergedRepo(repoMerged);
            xmlDislay.generateRelationshipsDetails();
            xmlDislay.generatePackageDependencyDetails();
            xmlSavedDataString = xmlDislay.saveXml();
            return(xmlSavedDataString);
        }
예제 #2
0
        private void ShowXmlDisplayDialog()
        {
            if (_xmlDisplay == null)
            {
                var treeView = (Control)_view;
                var mainForm = treeView.FindForm();

                _xmlDisplay = new XmlDisplay(_model)
                {
                    Owner         = mainForm,
                    Font          = mainForm.Font,
                    StartPosition = FormStartPosition.Manual
                };

                var midForm    = (mainForm.Left + mainForm.Right) / 2;
                var screenArea = Screen.FromHandle(mainForm.Handle).WorkingArea;
                var midScreen  = screenArea.Width / 2;

                var myLeft  = mainForm.Left;
                var myRight = mainForm.Right;

                if (_propertiesDisplay != null)
                {
                    myLeft  = Math.Min(myLeft, _propertiesDisplay.Left);
                    myRight = Math.Max(myRight, _propertiesDisplay.Right);
                }

                _xmlDisplay.Left = myLeft > screenArea.Width - myRight
                    ? Math.Max(0, myLeft - _xmlDisplay.Width)
                    : Math.Min(myRight, screenArea.Width - _xmlDisplay.Width);

                _xmlDisplay.Top = mainForm.Top + (mainForm.Height - _xmlDisplay.Height) / 2;

                _xmlDisplay.Closed += (s, e) => _xmlDisplay = null;
            }

            _xmlDisplay.Display(_view.ContextNode);
        }
예제 #3
0
파일: PlainXml.cs 프로젝트: Break-Neck/fcmd
        public void OpenFile(string url, IFSPlugin fsplugin)
        {
            doc.LoadXml( Encoding.Default.GetString(fsplugin.GetFileContent(url)));

            if (doc.ChildNodes.Count > 0)
            {
                int deep = 0;
                foreach (XmlNode n in doc.ChildNodes)
                {
                    if (n.NodeType != XmlNodeType.XmlDeclaration) //skip "<?xml version=... codepage=..."
                    {
                        XmlDisplay child_xd = new XmlDisplay(n, ht) { Tag = n, MarginLeft = ((deep > 0) ? 12 : 0) };
                        layout.PackStart(child_xd); //обеспечивается рекурсивность
                    }
                }
                sw = new ScrollView(layout);
            }
            else
            {
                XmlDisplay xd = new XmlDisplay(doc.ChildNodes[0], ht);
                sw = new ScrollView(xd);
            }
        }