public Systray(ParseArgs parser) { this.parser = parser; this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Systray)); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.notifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.exit = new System.Windows.Forms.ToolStripMenuItem(); this.unmount = new System.Windows.Forms.ToolStripMenuItem(); this.mount = new System.Windows.Forms.ToolStripMenuItem(); this.notifyMenu.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.ContextMenuStrip = this.notifyMenu; this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "SSHFS"; this.notifyIcon1.Visible = true; // // notifyMenu // this.notifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exit, this.unmount, this.mount }); this.notifyMenu.Name = "Exit"; this.notifyMenu.ShowImageMargin = false; this.notifyMenu.Size = new System.Drawing.Size(91, 70); // // exit // this.exit.Name = "exit"; this.exit.Size = new System.Drawing.Size(90, 22); this.exit.Text = "Exit"; this.exit.Click += new System.EventHandler(this.exit_Click); // // unmount // this.unmount.Name = "unmount"; this.unmount.Size = new System.Drawing.Size(90, 22); this.unmount.Text = "Unmount"; this.unmount.Visible = false; this.unmount.Click += new System.EventHandler(this.unmount_Click); // // mount // this.mount.Name = "mount"; this.mount.Size = new System.Drawing.Size(90, 22); this.mount.Text = "Mount"; this.mount.Click += new System.EventHandler(this.mount_Click); // this.notifyMenu.ResumeLayout(false); this.PerformLayout(); }
public Systray(ParseArgs parser) { this.parser = parser; this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Systray)); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.notifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.exit = new System.Windows.Forms.ToolStripMenuItem(); this.unmount = new System.Windows.Forms.ToolStripMenuItem(); this.mount = new System.Windows.Forms.ToolStripMenuItem(); this.notifyMenu.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.ContextMenuStrip = this.notifyMenu; this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "SSHFS"; this.notifyIcon1.Visible = true; // // notifyMenu // this.notifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exit, this.unmount, this.mount}); this.notifyMenu.Name = "Exit"; this.notifyMenu.ShowImageMargin = false; this.notifyMenu.Size = new System.Drawing.Size(91, 70); // // exit // this.exit.Name = "exit"; this.exit.Size = new System.Drawing.Size(90, 22); this.exit.Text = "Exit"; this.exit.Click += new System.EventHandler(this.exit_Click); // // unmount // this.unmount.Name = "unmount"; this.unmount.Size = new System.Drawing.Size(90, 22); this.unmount.Text = "Unmount"; this.unmount.Visible = false; this.unmount.Click += new System.EventHandler(this.unmount_Click); // // mount // this.mount.Name = "mount"; this.mount.Size = new System.Drawing.Size(90, 22); this.mount.Text = "Mount"; this.mount.Click += new System.EventHandler(this.mount_Click); // this.notifyMenu.ResumeLayout(false); this.PerformLayout(); }
static void Main() { //ConsoleWin.Open(); string[] args = System.Environment.GetCommandLineArgs(); foreach (string arg in args) { if (arg == "-sd") { SSHDebug = true; } if (arg == "-dd") { DokanDebug = true; } if (arg.Length >= 3 && arg[0] == '-' && arg[1] == 't') { DokanThread = ushort.Parse(arg.Substring(2)); } if (arg == "-no") { UseOffline = false; } } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Application.Run(new SettingForm()); // /* ParseArgs parser = new ParseArgs(); parser.parse(args); if (!parser.CheckParam()) { parser.help(); return; } Application.Run(new Systray(parser)); // DokanOptions opt = new DokanOptions(); // // opt.DebugMode = parser.debug; // opt.MountPoint = parser.drive; // opt.ThreadCount = parser.threads; // // // // string user, string host, int port, string password, string identity, // // string passphrase, string root, bool debug // SSHFS sshfs = new SSHFS(); // sshfs.Initialize(parser.user, // parser.host, parser.port, null, parser.identity, null, parser.root, parser.debug); // // if (sshfs.SSHConnect()) // { // DokanNet.DokanMain(opt, sshfs); // } // else // { // Console.Error.WriteLine("failed to connect"); // } // Console.Error.WriteLine("sshfs exit"); // */ }