コード例 #1
0
        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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: Functions.cs プロジェクト: laguiarz/Cabbage
        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);
                }
            }
        }