Exemplo n.º 1
0
        private void On_MenuClick(object sender, EventArgs e)
        {
            MenuItem m = sender as MenuItem;

            if (m != null && m.Text.Trim().Equals("&Properties"))
            {
                ListViewItem Item = GetSelectedItem();

                if (Item == null)
                {
                    return;
                }

                string   sShare    = (string)Item.SubItems[0].Text;
                string[] Shareinfo = null;
                Hostinfo hn        = ctx as Hostinfo;

                if (plugin.fileHandle != null)
                {
                    Shareinfo = SharesAPI.GetShareInfo(plugin.fileHandle.Handle, sShare, hn.hostName);
                }
                else
                {
                    Shareinfo = SharesAPI.GetShareInfo(IntPtr.Zero, sShare, hn.hostName);
                }

                if (Shareinfo != null && Shareinfo.Length != 0)
                {
                    if (Shareinfo[0].Equals("share"))
                    {
                        SharePropertiesDlg shareDlg = new SharePropertiesDlg(container, this, plugin, hn);
                        shareDlg.SetData(hn.creds, sShare, Shareinfo);
                        shareDlg.ShowDialog(this);
                    }
                    else
                    {
                        string sMsg = "This has been shared for administrative purposes.\n The Share permissions and file security cannot be set";
                        container.ShowMessage(sMsg);
                    }
                }
            }

            if (m != null && m.Text.Trim().Equals("&Help"))
            {
                ProcessStartInfo psi = new ProcessStartInfo();
                psi.UseShellExecute = true;
                psi.FileName        = CommonResources.GetString("LAC_Help");
                psi.Verb            = "open";
                psi.WindowStyle     = ProcessWindowStyle.Normal;
                Process.Start(psi);
                return;
            }

            if (m != null && m.Text.Trim().Equals("&Refresh"))
            {
                treeNode.sc.ShowControl(treeNode);
            }
        }
Exemplo n.º 2
0
    private void On_MenuClick(object sender, EventArgs e)
    {
        MenuItem m = sender as MenuItem;

        if (m != null && m.Text.Trim().Equals("&Properties"))
        {
            ListViewItem Item = GetSelectedItem();

            if (Item == null)
            {
                return;
            }

            string sShare = (string)Item.SubItems[0].Text;
            string[] Shareinfo = null;
            Hostinfo hn = ctx as Hostinfo;

            if (plugin.fileHandle != null)
                Shareinfo = SharesAPI.GetShareInfo(plugin.fileHandle.Handle, sShare, hn.hostName);
            else
                Shareinfo = SharesAPI.GetShareInfo(IntPtr.Zero, sShare, hn.hostName);

            if (Shareinfo != null && Shareinfo.Length != 0)
            {
                if (Shareinfo[0].Equals("share"))
                {
                    SharePropertiesDlg shareDlg = new SharePropertiesDlg(container, this, plugin, hn);
                    shareDlg.SetData(hn.creds, sShare, Shareinfo);
                    shareDlg.ShowDialog(this);
                }
                else
                {
                    string sMsg = "This has been shared for administrative purposes.\n The Share permissions and file security cannot be set";
                    container.ShowMessage(sMsg);
                }
            }
        }

        if (m != null && m.Text.Trim().Equals("&Help"))
        {
            ProcessStartInfo psi = new ProcessStartInfo();
            psi.UseShellExecute = true;
            psi.FileName = CommonResources.GetString("LAC_Help");
            psi.Verb = "open";
            psi.WindowStyle = ProcessWindowStyle.Normal;
            Process.Start(psi);
            return;
        }

        if (m != null && m.Text.Trim().Equals("&Refresh"))
        {
            treeNode.sc.ShowControl(treeNode);
        }
    }