Ejemplo n.º 1
0
 private void unmountNetworkDrivesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!PublishManager.UnmapAllDrives())
     {
         MessageBox.Show("No Drives to unmap.");
     }
 }
Ejemplo n.º 2
0
        private void syncWithRemoteDefinitionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ctxPublishes.Tag == null)
            {
                return;
            }
            int rownum = (int)ctxPublishes.Tag;

            string[] m;
            if (!GetMachineNameAndSelectedPub(rownum, out m))
            {
                return;
            }

            RemotePublishLocation rpl;

            if (!PublishManager.GetRemotePublishLocationByComputerName(m[0], out rpl))
            {
                MessageBox.Show(this, "Could not find a remote publish location for " + m[0] + ".", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (MessageBox.Show(this, "Are you sure you want to replace your definition for Publish " + m[1] + " with the one from " + m[0] + "?", "Publisher", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                PublishManager.SyncPublishWithRemotePublishDefinition(m[1], pubRoot, rpl);
                UpdateLocalPublishes();
            }
        }
Ejemplo n.º 3
0
 private void mountNetworkDriveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!PublishManager.MapAllDrives())
     {
         MessageBox.Show("You must unmap the existing drives first.");
     }
 }
Ejemplo n.º 4
0
        private void dgPublishes_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            string[] m;
            if (!GetMachineNameAndSelectedPub(e.RowIndex, out m))
            {
                return;
            }

            PublishManager.LaunchVNCViewer(m[0]);
        }
Ejemplo n.º 5
0
        private void deployToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmNewWatchdog wd = new frmNewWatchdog();

            if (wd.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            PublishManager.DeployWatchdog(wd.SelectedFiles);
        }
Ejemplo n.º 6
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (PublishManager.IsDrivesMapped())
     {
         if (MessageBox.Show(this, "You still have network drives mapped by the Publisher. Would you like them disconnected?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             PublishManager.UnmapAllDrives();
         }
     }
 }
Ejemplo n.º 7
0
        private void launchVNCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ctxPublishes.Tag == null)
            {
                return;
            }
            int rownum = (int)ctxPublishes.Tag;

            string[] m;
            if (!GetMachineNameAndSelectedPub(rownum, out m))
            {
                return;
            }
            PublishManager.LaunchVNCViewer(m[0]);
        }
Ejemplo n.º 8
0
        void DoRePublish(string machineName, string publishName)
        {
            RemotePublishLocation rpl;

            if (!PublishManager.GetRemotePublishLocationByComputerName(machineName, out rpl))
            {
                MessageBox.Show(this, "Could not find a remote publish location for " + machineName + ".", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (computerStatus[machineName.ToLower()].isPublishing == true)
            {
                MessageBox.Show(this, "A Publish is already in progress for this computer. Wait for it to complete...", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            computerStatus[machineName.ToLower()].isPublishing = true;
            bool dobackup = false;

            if (Properties.Settings.Default.autoBackupPublishes)
            {
                dobackup = true;
            }
            else
            {
                DialogResult r = MessageBox.Show(this, "Create backup of publish " + publishName + " on computer " + machineName + "?", "Backup Exiting Publish", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                dobackup = (r == DialogResult.Yes);
                if (r == DialogResult.Cancel)
                {
                    computerStatus[machineName.ToLower()].isPublishing = false;
                    return;
                }
            }
            PublishManager.SendPublishToRemoteComputer(Publish.Load(publishName, pubRoot), rpl, pubRoot, new EventHandler <Publisher.PublishManager.SendPublishEventArgs>(delegate(object o, Publisher.PublishManager.SendPublishEventArgs args)
            {
                this.BeginInvoke(new MethodInvoker(delegate()
                {
                    computerStatus[machineName.ToLower()].isPublishing = false;
                    Publish p = o as Publish;
                    if (args.ok)
                    {
                        MessageBox.Show(this, "The Publish " + p.name + " Succeeded.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(this, "The Publish Failed. Check Trace for more info.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }));
            }), dobackup);
        }
Ejemplo n.º 9
0
        private void importSettingsFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.Multiselect      = false;
            openFileDialog1.InitialDirectory = PublishManager.settings.RepoRoot;
            openFileDialog1.Filter           = "Publisher Settings Files (*.xml)|*.xml|All Files (*.*)|*.*";
            if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            string settings = openFileDialog1.FileName;

            PublishManager.ImportSettingsFile(settings, pubRoot);

            //microcontrollerListView1.SetConfig(PublishManager.settings.microcontrollers);
            //AysncGetSyncPulse();
            UpdateLocalPublishes();
        }
Ejemplo n.º 10
0
        private void btnPublish_Click(object sender, EventArgs e)
        {
            if ((cmbPublishes.SelectedItem == null) || (cmbRemoteLocations.SelectedItem == null))
            {
                return;
            }
            RemotePublishLocation rpl = (RemotePublishLocation)cmbRemoteLocations.SelectedItem;

            Trace.WriteLine("Starting to publish : " + (string)cmbPublishes.SelectedItem);
            bool dobackup = false;

            if (Properties.Settings.Default.autoBackupPublishes)
            {
                dobackup = true;
            }
            else
            {
                DialogResult r = MessageBox.Show(this, "Create backup of publish " + cmbPublishes.SelectedItem + " on computer " + rpl.ToString() + "?", "Backup Exiting Publish", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                dobackup = (r == DialogResult.Yes);
                if (r == DialogResult.Cancel)
                {
                    return;
                }
            }
            PublishManager.SendPublishToRemoteComputer(Publish.Load((string)cmbPublishes.SelectedItem, pubRoot), rpl, pubRoot, new EventHandler <Publisher.PublishManager.SendPublishEventArgs>(delegate(object o, Publisher.PublishManager.SendPublishEventArgs args)
            {
                this.BeginInvoke(new MethodInvoker(delegate()
                {
                    Publish p = o as Publish;
                    if (args.ok)
                    {
                        MessageBox.Show(this, "The Publish " + p.name + " Succeeded.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(this, "The Publish Failed. Check Trace for more info.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }));
            }), dobackup);
            //			MessageBox.Show(this, "The Publish Failed. Check Trace for more info.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
Ejemplo n.º 11
0
        public frmMain()
        {
            InitializeComponent();
            PublishManager.Initialize(pubRoot);
            UpdateLocalPublishes();
            UpdateLocalPublishLocations();
            //microcontrollerListView1.SetConfig(PublishManager.settings.microcontrollers);
            //AysncGetSyncPulse();

            try
            {
                comm.Init();
            }
            catch
            {
                MessageBox.Show(this, "No Network Detected!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            comm.GotWatchdogStatusMessage    += new EventHandler <WatchdogMessageEventArgs <WatchdogStatusMessage> >(comm_GotWatchdogStatusMessage);
            comm.GotStartPublishMessageReply += new EventHandler <WatchdogMessageEventArgs <StartStopPublishMessageReply> >(comm_GotStartPublishMessageReply);
            Trace.Listeners.Add(new DebugTextObject(txtDebug));
        }
Ejemplo n.º 12
0
        private void publishDefitionOnlyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ctxPublishes.Tag == null)
            {
                return;
            }
            int rownum = (int)ctxPublishes.Tag;

            string[] m;
            if (!GetMachineNameAndSelectedPub(rownum, out m))
            {
                return;
            }

            RemotePublishLocation rpl;

            if (!PublishManager.GetRemotePublishLocationByComputerName(m[0], out rpl))
            {
                MessageBox.Show(this, "Could not find a remote publish location for " + m[0] + ".", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            PublishManager.SendPublishDefinitionOnly(Publish.Load(m[1], pubRoot), rpl, pubRoot);
        }
Ejemplo n.º 13
0
 private void jumpstartHealthMonitorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PublishManager.JumpstartHealthmonitor();
 }
Ejemplo n.º 14
0
 private void killHealthMonitorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PublishManager.KillHealthMonitor();
 }
Ejemplo n.º 15
0
        void tsmi_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi = sender as ToolStripMenuItem;

            if (tsmi == null || tsmi.Tag == null)
            {
                return;
            }
            if (ctxPublishes.Tag == null)
            {
                return;
            }
            int rownum = (int)ctxPublishes.Tag;

            string[] m;
            if (!GetMachineNameAndSelectedPub(rownum, out m))
            {
                return;
            }
            string machineName = m[0];
            RemotePublishLocation rpl;

            if (!PublishManager.GetRemotePublishLocationByComputerName(machineName, out rpl))
            {
                MessageBox.Show(this, "Could not find a remote publish location for " + machineName + ".", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (computerStatus[machineName.ToLower()].isPublishing == true)
            {
                MessageBox.Show(this, "A Publish is already in progress for this computer. Wait for it to complete...", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            computerStatus[machineName.ToLower()].isPublishing = true;
            Trace.WriteLine("Starting to publish : " + (string)cmbPublishes.SelectedItem);
            bool dobackup = false;



            if (Properties.Settings.Default.autoBackupPublishes)
            {
                dobackup = true;
            }
            else
            {
                DialogResult r = MessageBox.Show(this, "Create backup of publish " + (string)tsmi.Tag + " on computer " + machineName + "?", "Backup Exiting Publish", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                dobackup = (r == DialogResult.Yes);
                if (r == DialogResult.Cancel)
                {
                    computerStatus[machineName.ToLower()].isPublishing = false;
                    return;
                }
            }


            PublishManager.SendPublishToRemoteComputer(Publish.Load((string)tsmi.Tag, pubRoot), rpl, pubRoot, new EventHandler <Publisher.PublishManager.SendPublishEventArgs>(delegate(object o, Publisher.PublishManager.SendPublishEventArgs args)
            {
                this.BeginInvoke(new MethodInvoker(delegate()
                {
                    computerStatus[machineName.ToLower()].isPublishing = false;
                    Publish p = o as Publish;
                    if (args.ok)
                    {
                        MessageBox.Show(this, "The Publish " + p.name + " Succeeded.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(this, "The Publish Failed. Check Trace for more info.", "Publisher", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }));
            }), dobackup);
        }
Ejemplo n.º 16
0
 private void jumpstartAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PublishManager.JumpstartWatchdogs();
 }
Ejemplo n.º 17
0
 private void killAllWatchdogsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PublishManager.KillAllWatchdogs();
 }
Ejemplo n.º 18
0
 private void clearAllPublishesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     PublishManager.ClearAllPublishDirs();
 }