Ejemplo n.º 1
0
        private static void GetFormFromListAndPublishToList(NfClientContext sourceContext, string sourceContentTypeId, string sourceListId, NfClientContext destinationContext, string destinationContentTypeId, string destinationListId)
        {
            // Read the form definition XML by invoking the GetFormXml method
            // from the client context for the source environment.
            Console.WriteLine("Getting form...");
            string formXml = sourceContext.GetFormXml(sourceListId, sourceContentTypeId);

            // Publish the form definition XML by invoking the PublishForm method
            // from the client context for the destination environment.
            Console.WriteLine("Publishing form...");
            var result = destinationContext.PublishForm(destinationListId, destinationContentTypeId, formXml);

            // Display the version number of the published form to the console.
            Console.WriteLine("Successfully published version: {0}", result.Version);
        }
Ejemplo n.º 2
0
        private static void GetFormFromFileAndPublishToList(string fullFilePath, NfClientContext destinationCtx, string destinationListId, string destinationContentTypeId)
        {
            // Read the form definition XML by reading the contents of the
            // specified file.
            Console.WriteLine("Getting form...");
            string formXml = File.ReadAllText(fullFilePath, Encoding.Unicode);

            // Publish the form definition XML by invoking the PublishForm method
            // from the client context for the destination environment. In turn, the
            // client context invokes the PublishFormXml REST operation.
            Console.WriteLine("Publishing form...");
            var result = destinationCtx.PublishForm(destinationListId, destinationContentTypeId, formXml);

            // Display the version number of the published form to the console.
            Console.WriteLine("Successfully published version: {0}", result.Version);
        }