Пример #1
0
		void Init()
		{
			var label1 = new Label
			{
				Text = "Welcome to",
				Font = new Font(FontFamilies.Monospace, 30)
			};
			var labelTitle = new Label
			{
				Text = "Altman3",
				Font = new Font(FontFamilies.Monospace, 60)
			};

			var layout = new PixelLayout();
			layout.Add(label1, new Point(70, 50));
			layout.Add(labelTitle, new Point(100, 120));

			var logo = PluginServiceProvider.GetService("ToFingerBinary");
			if (logo != null)
			{
				var rnd = new Random();
				var par = new PluginParameter();
				par.AddParameter("str", rnd.Next(1, 1023));
				var ret = logo(par);
				var tmp = new Label
				{
					Text = ret,
					Font = new Font(FontFamilies.Monospace, 10)
				};
				layout.Add(tmp, new Point(300, 220));
			}

			Content = layout;
		}
Пример #2
0
		void pluginItem_Click(object sender, EventArgs e)
		{
			if (_gridViewShell.SelectedItems.Any())
			{
				var item = sender as MenuItem;
				if (item != null)
				{
					var plugin = item.Tag as IPlugin;

					var shell = (Shell)_gridViewShell.SelectedItem;
					shell.TimeOut = 8000;

					var param = new PluginParameter();
					param.AddParameter("shell", shell);

					if (plugin is IControlPlugin)
					{
						object view = (plugin as IControlPlugin).Show(param);
						//创建新的tab标签
						//设置标题为FileManager|TargetId
						string title = plugin.PluginInfo.Name + "|" + shell.TargetId;
						ShellManager.Host.Ui.OpenTabPage(title, view);
					}
					else if (plugin is IFormPlugin)
					{
						var form = (Form)(plugin as IFormPlugin).Show(param);
						form.Show();
					}
				}
			}
		}
Пример #3
0
		public static PluginParameter ConvertShellStructToPluginParameter(Shell shell)
		{
			var param = new PluginParameter();
			param.AddParameter("id", shell.Id);
			param.AddParameter("target_id", shell.TargetId);
			param.AddParameter("target_level", shell.TargetLevel);
			param.AddParameter("status", shell.Status);

			param.AddParameter("shell_url", shell.ShellUrl);
			param.AddParameter("shell_pwd", shell.ShellPwd);
			param.AddParameter("shell_type", shell.ShellType);
			param.AddParameter("shell_extra_setting", shell.ShellExtraString);
			param.AddParameter("server_coding", shell.ServerCoding);
			param.AddParameter("web_coding", shell.WebCoding);

			param.AddParameter("area", shell.Area);
			param.AddParameter("remark", shell.Remark);
			param.AddParameter("add_time", shell.AddTime);

			return param;
		}