private void FindShares() { dataGridView1.Rows.Clear(); Enabled = false; UseWaitCursor = true; mountedPoints.Text = shareDetails.VolumeLabel + " (" + shareDetails.DriveLetter + ")"; ChannelFactory <ILiquesce> factory = new ChannelFactory <ILiquesce>("LiquesceFacade"); ILiquesce remoteIF = factory.CreateChannel(); lmsd = remoteIF.GetPossibleShares(); foreach (string[] row in lmsd.SelectMany(share => share.UserAccessRules.Select(fsare => new string[] { share.Path, share.Name + " : " + share.Description, GetAceInformation(fsare) }))) { dataGridView1.Rows.Add(row); } Enabled = true; UseWaitCursor = false; progressBar1.Style = ProgressBarStyle.Continuous; progressBar1.Value = 0; }
private bool GetConfig() { bool value = true; try { ChannelFactory <ILiquesce> factory = new ChannelFactory <ILiquesce>("LiquesceFacade"); ILiquesce remoteIF = factory.CreateChannel(); config = remoteIF.ConfigDetails; } catch { value = false; } return(value); }
private void MainForm_Shown(object sender, EventArgs e) { Enabled = false; UseWaitCursor = true; StartTree(); PopulatePoolSettings(); ServiceControllerStatus serviceStatus = ServiceControllerStatus.Stopped; try { serviceStatus = serviceController1.Status; } catch (Exception ex) { Log.ErrorException("Service is probably not installed", ex); } if (serviceStatus != ServiceControllerStatus.Running) { currentSharesToolStripMenuItem.ToolTipText = commitToolStripMenuItem.ToolTipText = "Service is not running"; currentSharesToolStripMenuItem.Enabled = commitToolStripMenuItem.Enabled = false; } else { try { currentSharesToolStripMenuItem.Enabled = commitToolStripMenuItem.Enabled = true; ChannelFactory <ILiquesce> factory = new ChannelFactory <ILiquesce>("LiquesceFacade"); ILiquesce remoteIF = factory.CreateChannel(); cd = remoteIF.ConfigDetails; } catch (Exception ex) { Log.ErrorException("Unable to attach to the service, even tho it is running", ex); UseWaitCursor = false; Enabled = true; MessageBox.Show(this, ex.Message, "Has the firewall blocked the communications ?", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } InitialiseWith(); UseWaitCursor = false; Enabled = true; }
private void commitToolStripMenuItem_Click(object sender, EventArgs e) { try { if (DialogResult.Yes == MessageBox.Show(this, "Performing this action will \"Remove the Mounted drive(s)\" on this machine.\n All open files will be forceably closed by this.\nDo you wish to continue ?", "Caution..", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { SetProgressBarStyle(ProgressBarStyle.Marquee); cd.DriveLetter = MountPoint.Text; cd.VolumeLabel = VolumeLabel.Text; cd.SourceLocations = new List <string>(mergeList.Nodes.Count); // if (mergeList.Nodes != null) // Apperently always true foreach (TreeNode node in mergeList.Nodes) { cd.SourceLocations.Add(node.Text); } ChannelFactory <ILiquesce> factory = new ChannelFactory <ILiquesce>("LiquesceFacade"); ILiquesce remoteIF = factory.CreateChannel(); Log.Info("Didn't go bang so stop"); remoteIF.Stop(); Log.Info("Send the new details"); remoteIF.ConfigDetails = cd; Log.Info("Now start, may need a small sleep to allow things to settle"); Thread.Sleep(2500); remoteIF.Start(); } } catch (Exception ex) { Log.ErrorException("Unable to attach to the service, even tho it is running", ex); MessageBox.Show(this, ex.Message, "Has the firewall blocked the communications ?", MessageBoxButtons.OK, MessageBoxIcon.Stop); } finally { SetProgressBarStyle(ProgressBarStyle.Continuous); } }