コード例 #1
0
ファイル: Program.cs プロジェクト: jayakumargithub/tjg
        static void Main(string[] args)
        {
            StdLibraryOne.StdLibraryClass one = new StdLibraryClass();
            one.Test();
            one.Name();

            DotNetFrameworkProj.FrameworkClass proj = new FrameworkClass();

            proj.Name();


            Console.WriteLine("Hello World!");
        }
コード例 #2
0
        public bool CheckFunction(string functionName, Gtk.Window parentError)
        {
            string userLicenceId = "-100";

            if (MainClass.User != null)
            {
                userLicenceId = MainClass.User.LicenseId;
            }

            int iTyp = 0;

            if (!Int32.TryParse(userLicenceId, out iTyp))
            {
                iTyp = -100;
            }

            FrameworkClass fc = ListFrameworkClass.Find(x => x.Name == functionName);

            if (fc != null)
            {
                if (iTyp <= (int)fc.Typ)
                {
                    return(true);
                }
                else
                {
                    BuyDialog ld = new BuyDialog((int)fc.Typ, fc.Title, parentError);
                    if (ld.Run() == (int)Gtk.ResponseType.Ok)
                    {
                    }
                    ld.Destroy();
                    return(true);
                    //return false;
                }
            }

            return(true);
        }
コード例 #3
0
        /// <summary>
        ///   Generate an XML fragment ready to be included in the entities list of the generator.
        /// </summary>
        private void GenerateDescriptor(String baseFolder, Framework f)
        {
            this.Log(Level.Info, "Placing Doxygen files for '{0}'...", f.name);

            // Set file names
            String doxygenFolder  = Path.Combine(baseFolder, f.name, DocumentType.Doxygen.ToString());
            String indexPath      = Path.Combine(doxygenFolder, "index.xml");
            String descriptorPath = Path.Combine(baseFolder, f.name, f.name + ".xml");

            // Deserialize Doxygen index
            DoxygenType   index;
            XmlSerializer serializer = new XmlSerializer(typeof(DoxygenType));

            using (StreamReader reader = new StreamReader(indexPath)) {
                index = (DoxygenType)serializer.Deserialize(reader);
            }

            // Collect entities
            List <FrameworkType>        types        = new List <FrameworkType> ();
            List <FrameworkClass>       classes      = new List <FrameworkClass> ();
            List <FrameworkProtocol>    protocols    = new List <FrameworkProtocol> ();
            List <FrameworkStructure>   structures   = new List <FrameworkStructure> ();
            List <FrameworkEnumeration> enumerations = new List <FrameworkEnumeration> ();

            foreach (CompoundType compound in index.compound.Where(c => c.kind == CompoundKind.@class))
            {
                String name         = compound.name;
                String categoryName = name.Replace('(', '_').Trim(')');
                int    pos          = name.IndexOf("(");
                String className    = (pos != -1) ? name.Substring(0, pos) : name;

                FrameworkClass entity = new FrameworkClass();
                entity.Framework = f;
                entity.name      = categoryName;
                if (className != categoryName)
                {
                    Patch patch = new Patch();
                    patch.type   = DocumentType.Model;
                    patch.Change = new String[] { "<![CDATA[AdditionFor=\"" + className + "\"]]>" };
                    entity.Patch = new Patch[] { patch };
                }
                classes.Add(entity);

                // Place the xml file in the right folder
                String inputFile  = Path.Combine(doxygenFolder, compound.refid + ".xml");
                String outputFile = entity.GetPath(baseFolder, DocumentType.Xhtml);
                File.Copy(inputFile, outputFile, true);
            }

            foreach (CompoundType compound in index.compound.Where(c => c.kind == CompoundKind.category))
            {
                String name         = compound.name;
                String categoryName = name.Replace('(', '_').Trim(')');
                String className    = name.Substring(0, name.IndexOf("("));

                FrameworkClass entity = new FrameworkClass();
                entity.Framework = f;
                entity.name      = categoryName;
                Patch patch = new Patch();
                patch.type   = DocumentType.Model;
                patch.Change = new String[] { "<![CDATA[AdditionFor=\"" + className + "\"]]>" };
                entity.Patch = new Patch[] { patch };
                classes.Add(entity);

                // Place the xml file in the right folder
                String inputFile  = Path.Combine(doxygenFolder, compound.refid + ".xml");
                String outputFile = entity.GetPath(baseFolder, DocumentType.Xhtml);
                File.Copy(inputFile, outputFile, true);
            }

            foreach (CompoundType compound in index.compound.Where(c => c.kind == CompoundKind.file))
            {
                String name = compound.name;
                if (!name.EndsWith(".h"))
                {
                    continue;
                }
                name = name.Replace("+", "_").Replace(".h", String.Empty);
                String className = name + "_Definitions";

                FrameworkClass entity = new FrameworkClass();
                entity.Framework = f;
                entity.name      = className;
                Patch patch = new Patch();
                patch.type   = DocumentType.Model;
                patch.Change = new String[] { "<![CDATA[AdditionFor=\"" + className + "\"]]>" };
                entity.Patch = new Patch[] { patch };
                classes.Add(entity);

                // Place the xml file in the right folder
                String inputFile  = Path.Combine(doxygenFolder, compound.refid + ".xml");
                String outputFile = entity.GetPath(baseFolder, DocumentType.Xhtml);
                File.Copy(inputFile, outputFile, true);
            }

            foreach (CompoundType compound in index.compound.Where(c => c.kind == CompoundKind.protocol))
            {
                String name = compound.name;
                if (name.EndsWith("-p"))
                {
                    name = name.Replace("-p", String.Empty);
                }

                FrameworkProtocol entity = new FrameworkProtocol();
                entity.Framework = f;
                entity.name      = name;
                protocols.Add(entity);

                // Place the xml file in the right folder
                String inputFile  = Path.Combine(doxygenFolder, compound.refid + ".xml");
                String outputFile = entity.GetPath(baseFolder, DocumentType.Xhtml);
                File.Copy(inputFile, outputFile, true);
            }

            foreach (CompoundType compound in index.compound.Where(c => c.kind == CompoundKind.@struct))
            {
                String name = compound.name;
                name = name.TrimStart('_');

                FrameworkStructure entity = new FrameworkStructure();
                entity.Framework = f;
                entity.name      = name;
                structures.Add(entity);

                // Place the xml file in the right folder
                String inputFile  = Path.Combine(doxygenFolder, compound.refid + ".xml");
                String outputFile = entity.GetPath(baseFolder, DocumentType.Xhtml);
                File.Copy(inputFile, outputFile, true);
            }

            // Save the framework descriptor
            Framework framework = new Framework(f);

            framework.Types        = types.ToArray();
            framework.Classes      = classes.ToArray();
            framework.Protocols    = protocols.ToArray();
            framework.Structures   = structures.ToArray();
            framework.Enumerations = enumerations.ToArray();
            framework.SaveToFile(descriptorPath);
        }
コード例 #4
0
        public void ComplexOperation()
        {
            FrameworkClass b = new FrameworkClass();

            b.PerformComplexOperation();
        }