Пример #1
0
        static void ExpandArchive(string archiveName)
        {
            if (File.Exists(archiveName))
            {
                // Determine if the hub/service names are set.  If not, default them.
                DnrManifestReader dr = new DnrManifestReader(archiveName);
                for (int i = 0; i < dr.ManifestCount; i++)
                {
                    string hubDirectory = "";
                    string assemblyDirectory = "";
                    string requestQ = @".\private$\{0}.{1}.request";
                    if (string.IsNullOrEmpty(dr[i].HubName))
                        dr[i].HubName = dr[i].CurrentAssembly.Name;
                    hubDirectory = string.Format("{0}\\{1}", Path.GetDirectoryName(archiveName), dr[i].HubName);
                    assemblyDirectory = string.Format("{0}\\{1}", hubDirectory, dr[i].CurrentAssembly.AssemblyVersion);
                    foreach (var item in dr[i].GetAvailableServices())
                    {
                        //if (!(MessageQueue.Exists(string.Format(requestQ, dr[i].HubName, item))))
                        //    MessageQueue.Create(string.Format(requestQ, dr[i].HubName, item), true);
                    }
                    Console.WriteLine("Hub path: " + hubDirectory);
                    Console.WriteLine("Assembly path: " + assemblyDirectory);
                    if (!(Directory.Exists(hubDirectory)))
                        Directory.CreateDirectory(hubDirectory);
                    if (!(Directory.Exists(assemblyDirectory)))
                        Directory.CreateDirectory(assemblyDirectory);
                    dr[i].Extract(assemblyDirectory);

                }

            }
        }
Пример #2
0
 public frmMain()
 {
     InitializeComponent();
     writer = new DnrManifestWriter();
     reader = new DnrManifestReader();
     writer.ManifestAdded += new DnrManifestWriter.OnManifestAdd(writer_ManifestAdded);
 }
Пример #3
0
 static void DisplayArchive(string archiveName)
 {
     if (File.Exists(archiveName))
     {
         DnrManifestReader dr = new DnrManifestReader(archiveName);
         for (int i = 0; i < dr.ManifestCount;i++ )
         {
             foreach (var item in dr[i].GetAvailableServices())
             {
                 Console.WriteLine("Found service: " + item);
             }
             Console.WriteLine("Hub name: " + dr[i].HubName);
             Console.WriteLine("Destination service endpoint name: " + dr[i].DefaultSpoke);
             Console.WriteLine("Processing output:\r\n"+dr[i].Output);
             if(dr[i].AssemblyErrors != null)
                 if(dr[i].AssemblyErrors.Count > 0)
                     dr[i].AssemblyErrors.ForEach(x=>Console.WriteLine(x.Message +
                         Environment.NewLine + x.StackTrace));
         }
     }
 }
Пример #4
0
 private void openDNRToolStripMenuItem_Click(object sender, EventArgs e)
 {
     openDialog.Title = "Open DNR";
     openDialog.Filter = "DNR archive files|*.dnr";
     openDialog.ShowDialog();
     if (openDialog.FileName != string.Empty)
     {
         reader = new DnrManifestReader(openDialog.FileName);
         TreeNode thisDnr = new TreeNode(openDialog.FileName,3,3);
         tvwBrowser.Nodes.Add(thisDnr);
         tvwBrowser.SelectedNode = thisDnr;
         writer.Manifests.Clear();
         for (int i = 0; i < reader.ManifestCount; i++)
         {
             writer.Manifests.Add(reader[i]);
             ProcessManifest(writer.Manifests[i], writer.Manifests[i].CurrentAssembly.AssemblyName);
         }
         tvwBrowser.Enabled = true;
         tvwBrowser.SelectedNode = null;
     }
 }