Пример #1
0
 public void GenerateRemoteServiceConfig(VSNetCSharpProject bdProj)
 {
     string hostingConfigFileName = GenerationHelper.GetHostingConfigFileName();
       string path = m_Arch.BusinessDocsLayer.FullPath + hostingConfigFileName;
       bdProj.AddSimpleFile(hostingConfigFileName);
       TextWriter writer = File.CreateText(path);
       writer.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
       writer.WriteLine("<configuration>");
       writer.WriteLine();
       writer.WriteLine("  <configSections>");
       writer.WriteLine(
     "    <section name=\"DbConnections\" type=\"System.Configuration.NameValueFileSectionHandler\" />");
       writer.WriteLine("  </configSections>");
       writer.WriteLine();
       writer.WriteLine("  <system.runtime.remoting>");
       writer.WriteLine("    <application>");
       writer.WriteLine("      <!--");
       writer.WriteLine("        Configures the channel that the application uses to communicate with remote objects");
       writer.WriteLine("        Formatter come first so that the message can be reconstituted before we try to");
       writer.WriteLine("        examine it to get our data out of the call context.");
       writer.WriteLine("      -->");
       writer.WriteLine("      <channels>");
       writer.WriteLine("      </channels>");
       writer.WriteLine("      <!--");
       writer.WriteLine("        Configures the channel that the application uses to communicate with remote objects");
       writer.WriteLine("      -->");
       writer.WriteLine();
       foreach (ServiceLayerModel model in m_Arch.ServiceLayers)
       {
     foreach (ServiceModel model2 in model.Services)
     {
       writer.WriteLine("      <service>");
       writer.WriteLine("        <wellknown mode=\"SingleCall\"");
       writer.WriteLine(string.Format("          type=\"{0}.{1}, {0}\"", model.NameSpace, model2.MappingName));
       writer.WriteLine(string.Format("          objectUri=\"{0}/{1}\" />", model.NameSpace, model2.MappingName));
       writer.WriteLine("      </service>");
     }
       }
       writer.WriteLine("    </application>");
       writer.WriteLine("  </system.runtime.remoting>");
       writer.WriteLine("  <DbConnections>");
       foreach (DataAccessModel model3 in m_Arch.DataLayers)
       {
     writer.WriteLine(string.Format("    <add key=\"{0}\" value=\"{1}\" />", model3.ConfigKeyName,                                       model3.ConnectionString));
       }
       writer.WriteLine("  </DbConnections>");
       writer.WriteLine("</configuration>");
       writer.Close();
 }
Пример #2
0
 public void GenerateServiceInstaller(VSNetCSharpProject bdProj)
 {
     string hostingInstallerFileName = GenerationHelper.GetHostingInstallerFileName();
       string path = m_Arch.BusinessDocsLayer.FullPath + hostingInstallerFileName;
       bdProj.AddSimpleFile(hostingInstallerFileName);
       TextWriter writer = File.CreateText(path);
       string str3 = CSharpGenerator.CodeBlock("CSharpServiceInstaller");
       string newValue = string.Format("{0}.{1}", m_Arch.SolutionName, GenerationHelper.HostingServiceName);
       str3 =
     str3.Replace("%timestamp%", DateTime.Now.ToString()).Replace("%namespace%", newValue).Replace("%solutionname%",                                                                                                      m_Arch.
                                                                                                 SolutionName).
       Replace("%description%", string.Format("Business hosting service for {0}.", newValue)).Replace(
       "%displayname%", newValue).Replace("%servicename%", newValue);
       writer.WriteLine(str3);
       writer.Close();
 }
Пример #3
0
 public void GenerateReadMe(VSNetCSharpProject bdProj)
 {
     string hostReadMeFileName = GenerationHelper.GetHostReadMeFileName();
       string path = m_Arch.BusinessDocsLayer.FullPath + hostReadMeFileName;
       bdProj.AddSimpleFile(hostReadMeFileName);
       TextWriter writer = File.CreateText(path);
       string str3 = CSharpGenerator.CodeBlock("HostServiceReadme");
       string newValue = string.Format("{0}.{1}", m_Arch.SolutionName, GenerationHelper.HostingServiceName);
       str3 = str3.Replace("%servicename%", newValue);
       writer.WriteLine(str3);
       writer.Close();
 }