public static XmlDocument GetObjectNavigationXML(KBObject obj)
        {
            XmlDocument doc              = new XmlDocument();
            IKBService  kbserv           = UIServices.KB;
            string      fileWildcard     = @"" + obj.Name + ".xml";
            var         searchSubDirsArg = System.IO.SearchOption.AllDirectories;
            string      specpath         = Functions.SpcDirectory(kbserv);

            string[] xFiles = System.IO.Directory.GetFiles(specpath, fileWildcard, searchSubDirsArg);

            foreach (string x in xFiles)
            {
                if (Path.GetFileNameWithoutExtension(x).Equals(obj.Name))
                {
                    string xmlstring = NavigationHelper.AddXMLHeader(x);

                    if (!ObjectsHelper.isGeneratedbyPattern(obj))
                    {
                        doc.LoadXml(xmlstring);
                    }
                }
            }

            return(doc);
        }
Exemplo n.º 2
0
        public static string GetSourceCode(KBObject obj)
        {
            string source = "";

            if (obj is Transaction || obj is WebPanel || obj is Procedure || obj is WorkPanel)
            {
                if (ObjectsHelper.isGenerated(obj) && !ObjectsHelper.isGeneratedbyPattern(obj))
                {
                    source = ObjectsHelper.ObjectSourceUpper(obj);
                    source = Functions.RemoveEmptyLines(source);
                }
            }
            return(source);
        }
Exemplo n.º 3
0
        public static void ObjStats_Comments(KBObject obj, out int linesSource, out int linesComment, out float PercentComment)
        {
            linesSource    = 0;
            linesComment   = 0;
            PercentComment = 0;

            if (obj is Transaction || obj is WebPanel || obj is Procedure || obj is WorkPanel)
            {
                if (ObjectsHelper.isGenerated(obj) && !ObjectsHelper.isGeneratedbyPattern(obj))
                {
                    string sourceWOComments = ObjectsHelper.GetSourceCodeWithoutComments(obj);
                    string source           = ObjectsHelper.GetSourceCode(obj);

                    CountCommentsLines(source, sourceWOComments, out linesSource, out linesComment, out PercentComment);
                }
            }
        }