Example #1
0
        public int Generate(string wszInputFilePath, string bstrInputFileContents, string wszDefaultNamespace, IntPtr[] rgbOutputFileContents, out uint pcbOutput, IVsGeneratorProgress pGenerateProgress)
        {
            var file               = wszInputFilePath;
            var namespaces         = wszDefaultNamespace.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            var NameSpace          = namespaces.FirstOrDefault();
            var includedNamespaces = namespaces.Skip(1).ToArray();

            // Generate code
            var bytes = SplitCodeBySchemaSource.GetCodeFileBytes(file, NameSpace, includedNamespaces);

            // OK
            rgbOutputFileContents[0] = Marshal.AllocCoTaskMem(bytes.Length);
            Marshal.Copy(bytes, 0, rgbOutputFileContents[0], bytes.Length);

            pcbOutput = (uint)bytes.Length;
            return(Microsoft.VisualStudio.VSConstants.S_OK);
        }
Example #2
0
 static void Main(string[] args)
 {
     SplitCodeBySchemaSource.BuildCodeFile(args[0], args[1], args.Skip(2).ToArray());
 }