Exemple #1
0
		private void mnuDevelopersDefaultManifest_Click(object sender, EventArgs e)
		{
			XmlDocument xmlDoc = new XmlDocument();
			XmlNode node = xmlDoc.ImportNode(Engine.Storage.Manifest, true);			
			xmlDoc.AppendChild(node);
			xmlDoc.FirstChild.Attributes.RemoveAll();
			xmlDoc.FirstChild.RemoveChild(xmlDoc.SelectSingleNode("//manifest/servers"));
			xmlDoc.FirstChild.RemoveChild(xmlDoc.SelectSingleNode("//manifest/areas"));
			
			using (var sw = new StringWriter())
			{
				using (var xw = new XmlTextWriter(sw))
				{
					xw.Formatting = Formatting.Indented;					
					xw.Indentation = 2; //default is 1. I used 2 to make the indents larger.

					xmlDoc.WriteTo(xw);
				}

				String body = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + sw.ToString();

				Forms.TextViewer dlg = new TextViewer();
				dlg.Title = "Default manifest";
				dlg.Body = body;
				dlg.ShowDialog();
			}

			
		}
Exemple #2
0
		private void lstStats_DoubleClick(object sender, EventArgs e)
		{
			if (lstStats.SelectedItems.Count != 1)
				return;

			ListViewItemStats item = lstStats.SelectedItems[0] as ListViewItemStats;

			if (item.Entry.Key == "VpnGeneratedOVPN")
			{
				if (Engine.IsConnected() == false)
					return;

				Forms.TextViewer Dlg = new TextViewer();
				Dlg.Title = item.Entry.Caption;
				Dlg.Body = Engine.ConnectedOVPN;
				Dlg.ShowDialog();
			}
			else if (item.Entry.Key == "SystemReport")
			{
				Forms.TextViewer Dlg = new TextViewer();
				Dlg.Title = item.Entry.Caption;
				Dlg.Body = Platform.Instance.GenerateSystemReport();
				Dlg.ShowDialog();
			}
			else if (item.Entry.Key == "ManifestLastUpdate")
			{
				Core.Threads.Manifest.Instance.ForceUpdate = true;
			}
		}
Exemple #3
0
		private void mnuDevelopersManBBCode_Click(object sender, EventArgs e)
		{
			Forms.TextViewer Dlg = new TextViewer();
			Dlg.Title = "Man";
			Dlg.Body = Core.UI.Actions.GetMan("bbc");
			Dlg.ShowDialog();
		}