コード例 #1
0
        public static void Run(this XmlPort xmlPort, string roleTailoredClient, string serverName, int?serverPort, string serverInstance, string companyName)
        {
            var commands = new StringBuilder();

            commands.AppendFormat("runxmlport?xmlport={0}", xmlPort.ID);

            RoleTailoredClient.Run(roleTailoredClient, BuildHyperlink(serverName, serverPort, serverInstance, companyName, commands.ToString()));
        }
コード例 #2
0
        public static FileInfo Write(this XmlPort xmlPort, string fileName)
        {
            using (var streamWriter = new StreamWriter(fileName, false, Encoding.GetEncoding("ibm850")))
            {
                xmlPort.Write(streamWriter);
            }

            return(new FileInfo(fileName));
        }
コード例 #3
0
 public static void Write(this XmlPort xmlPort, CSideWriter writer)
 {
     writer.BeginSection(xmlPort.GetObjectSignature());
     xmlPort.ObjectProperties.Write(writer);
     xmlPort.Properties.Write(writer);
     xmlPort.Nodes.Write(writer);
     WriteEvents(writer);
     xmlPort.RequestPage.Write(writer);
     xmlPort.Code.Write(writer);
     writer.EndSection();
     writer.InnerWriter.WriteLine();
 }
コード例 #4
0
        public static Invocation ToInvocation(this XmlPort xmlPort)
        {
            IEnumerable <ParameterBase> signature = new[] {
                new SimpleParameter("ID", xmlPort.ID),
                new SimpleParameter("Name", xmlPort.Name)
            };

            IEnumerable <ParameterBase> objectProperties = xmlPort
                                                           .ObjectProperties
                                                           .Where(p => p.HasValue)
                                                           .SelectMany(p => p.ToParameters());

            IEnumerable <ParameterBase> properties = xmlPort
                                                     .Properties
                                                     .Where(p => p.HasValue)
                                                     .SelectMany(p => p.ToParameters());

            IEnumerable <ParameterBase> requestPageProperties = xmlPort
                                                                .RequestPage
                                                                .Properties
                                                                .Where(p => p.HasValue)
                                                                .SelectMany(p => p.ToParameters("RequestPage"));

            IEnumerable <ParameterBase> subObjects = new[] {
                new ScriptBlockParameter(
                    "SubObjects",
                    xmlPort.Nodes.ToInvocations().Cast <Statement>()
                    .Concat(xmlPort.Code.Variables.ToInvocations().Cast <Statement>())
                    .Concat(xmlPort.Code.Functions.ToInvocations().Cast <Statement>())
                    .Concat(xmlPort.Code.Events.ToInvocations().Cast <Statement>())
                    .Concat(xmlPort.Code.Documentation.CodeLines.ToInvocation().Cast <Statement>())
                    )
            };

            IEnumerable <ParameterBase> requestPageSubObjects = new[] {
                new ScriptBlockParameter(
                    "RequestPageSubObjects",
                    xmlPort.RequestPage.Controls.ToInvocations().Cast <Statement>()
                    )
            };

            return(new Invocation(
                       "New-CBreezeXmlPort",
                       signature
                       .Concat(objectProperties)
                       .Concat(properties)
                       .Concat(requestPageProperties)
                       .Concat(requestPageSubObjects)
                       .Concat(subObjects)
                       ));
        }
コード例 #5
0
 protected void AddItemToInputObject(Event item, XmlPort xmlPort) => AddItemToInputObject(item, xmlPort.Code);
コード例 #6
0
 public static void Write(this XmlPort xmlPort, TextWriter textWriter) => xmlPort.Write(new CSideWriter(textWriter));
コード例 #7
0
 public static FileInfo WriteToFolder(this XmlPort xmlPort, string folderName) => xmlPort.Write(Path.Combine(folderName, $"xml{xmlPort.ID}.txt"));