Exemple #1
0
        private void ShowAboutMsg(object sender, System.EventArgs e)
        {
            Assembly        reflector = Assembly.GetExecutingAssembly();
            FileVersionInfo fvi       = FileVersionInfo.GetVersionInfo(reflector.Location);
            string          version   = reflector.GetName().Name + " : " + fvi.FileVersion;

            RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                        Strings.AboutCxpReflectorServiceText, version), Strings.AboutCxpReflectorServiceTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
        }
Exemple #2
0
        /// <summary>
        /// Asks the user if he/she would like to overwrite and existing file, or keep it
        /// </summary>
        internal bool ShowOverwriteFileQuestion(string file)
        {
            // We'll use a simple MessageBox for this.  Customarily apps don't allow users
            // to save the "overwrite file" setting, so we won't either.
            DialogResult dr = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                          Strings.SameTitleError, file), Strings.OverwiteFile, MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                                      MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            return(dr == DialogResult.Yes);
        }
Exemple #3
0
        private void aboutBtn_Click(object sender, System.EventArgs e)
        {
            string versions =
                GetAssemblyDescription(Assembly.GetExecutingAssembly()) + "\n" +
                GetAssemblyDescription(Assembly.Load("Storage"));

            RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                        Strings.AboutConferencexpVenueServiceText, versions), Strings.AboutConferencexpVenueServiceTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
        }
        private void btnSend_Click(object sender, System.EventArgs e)
        {
            this.Hide();

            foreach (ListViewItem lvItem in listView.Items)
            {
                string fileName = lvItem.SubItems[1].Text + Path.DirectorySeparatorChar + lvItem.SubItems[0].Text;

retry:
                if (!File.Exists(fileName))
                {
                    DialogResult dlgFNFResult = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                                            Strings.FileNoLongerExists, fileName, Environment.NewLine), Strings.FileNotFound,
                                                                        MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1,
                                                                        (MessageBoxOptions)0);
                    if (dlgFNFResult == DialogResult.Yes)
                    {
                        continue;
                    }
                    else if (dlgFNFResult == DialogResult.Cancel)
                    {
                        return;
                    }
                    else
                    {
                        goto retry;
                    }
                }

                Label lblMessage = new Label();
                lblMessage.Font     = new Font("Tahoma", 10f);
                lblMessage.AutoSize = true;
                lblMessage.Text     = string.Format(CultureInfo.CurrentCulture, Strings.SendingFilePleaseWait, fileName);
                lblMessage.Location = new Point(10, 5);

                Form frmMessage = new Form();
                frmMessage.ClientSize      = new Size(lblMessage.Width + 20, lblMessage.Height + 10);
                frmMessage.StartPosition   = FormStartPosition.CenterScreen;
                frmMessage.FormBorderStyle = FormBorderStyle.FixedToolWindow;
                frmMessage.Text            = Strings.SendingFile;
                frmMessage.Controls.Add(lblMessage);
                frmMessage.Show();
                Application.DoEvents();

                FileObject fileObject = new FileObject(fileName);
                fileTransferCapability.SendObject(fileObject);

                frmMessage.Close();
            }

            this.Close();
            RtlAwareMessageBox.Show(this, Strings.FileTransferCompleted,
                                    Strings.SendDone, MessageBoxButtons.OK, MessageBoxIcon.Information,
                                    MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
        }
        /// <summary>
        /// Populate the conferences in the list view lvwConferences
        /// </summary>
        private void PopulateConferences()
        {
            try
            {
                conferences = archiver.GetConferences();

                if (conferences.Length > 0)
                {
                    lvwConferences.Enabled = true;

                    for (int i = 0; i < conferences.Length; i++)
                    {
                        TimeSpan duration          = conferences[i].End - conferences[i].Start;
                        string   formattedDuration = duration.Hours.ToString("00", CultureInfo.InvariantCulture) +
                                                     ":" + duration.Minutes.ToString("00", CultureInfo.InvariantCulture) + ":" +
                                                     duration.Seconds.ToString("00", CultureInfo.InvariantCulture);

                        // Add conferences to the list view
                        // TODO: Uses something like Enum.GetNames(ColumnsLvwConferences).Length instead of hardcoded value 5
                        string[] cols = new string[5];

                        cols[(int)ColumnsLvwConferences.Name]         = conferences[i].Description;
                        cols[(int)ColumnsLvwConferences.Date]         = conferences[i].Start.ToShortDateString();
                        cols[(int)ColumnsLvwConferences.Time]         = conferences[i].Start.ToLongTimeString();
                        cols[(int)ColumnsLvwConferences.Duration]     = formattedDuration;
                        cols[(int)ColumnsLvwConferences.ConferenceID] = conferences[i].ConferenceID.ToString(CultureInfo.InvariantCulture);
                        ListViewItem conferenceItem = new ListViewItem(cols);
                        // TODO: use the LVI.Tag feature and remove the private variable 'conferences'
                        conferenceItem.Tag = conferences[i];
                        lvwConferences.Items.Add(conferenceItem);
                    }
                }
                else
                {
                    lvwConferences.Enabled = false;
                }
            }
            catch (System.Net.Sockets.SocketException ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceUnavailableText, ex.Message), Strings.ArchiveServiceUnavailableTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
                this.Close();
            }
            catch (Exception ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceErrorText, ex.ToString()), Strings.ArchiveServiceErrorTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
                this.Close();
            }
        }
        private void CheckAdministratorRole()
        {
            WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());

            if (wp.IsInRole(WindowsBuiltInRole.Administrator) == false)
            {
                RtlAwareMessageBox.Show(null, Strings.AdministratorRoleIsRequired, Strings.ConferencexpReflector,
                                        MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Application.Exit();
            }
        }
        private void cmdClearIcon_Click(object sender, System.EventArgs e)
        {
            DialogResult dr = RtlAwareMessageBox.Show(this, Strings.ConfirmDefaultIconRestoreText,
                                                      Strings.ConfirmDefaultIconRestoreTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
                                                      MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            if (dr == DialogResult.Yes)
            {
                IconAsBytes = null;  // sets the default icon
            }
        }
Exemple #8
0
        private bool ValidateUniqueHost(string host)
        {
            if (this.listBoxServices.Items.Contains(host))
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture, Strings.DuplicateHostNameText,
                                                            serviceText.ConnectionType), Strings.DuplicateHostNameTitle, MessageBoxButtons.OK,
                                        MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                return(false);
            }

            return(true);
        }
Exemple #9
0
        private void OptionsDialog_Closing(object sender, CancelEventArgs e)
        {
            // Verify the user has selected something permissible
            if (options.SelectedText.Trim() == null)
            {
                RtlAwareMessageBox.Show(this, Strings.PleaseEnterAValidResponse, string.Empty, MessageBoxButtons.OK,
                                        MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                return;
            }

            this.DialogResult = DialogResult.OK;
        }
Exemple #10
0
        private void buttonDelete_Click(object sender, System.EventArgs e)
        {
            string key = listBoxServices.SelectedItem.ToString();

            DialogResult dr = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                          Strings.ConfirmDeleteServiceHost, key), Strings.ConfirmDelete, MessageBoxButtons.OKCancel,
                                                      MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            if (dr == DialogResult.OK)
            {
                listBoxServices.Items.Remove(key);
            }
        }
Exemple #11
0
        private void deleteBtn_Click(object sender, System.EventArgs e)
        {
            DialogResult dr = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                          Strings.ConfirmDeleteText, expressionList.SelectedItem.ToString()), Strings.ConfirmDeleteTitle,
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1,
                                                      (MessageBoxOptions)0);

            if (dr == DialogResult.Yes)
            {
                int selected = expressionList.SelectedIndex;
                expressionList.Items.RemoveAt(selected);
            }
        }
Exemple #12
0
        private void DuplicateCNameDetected(object sender, RtpEvents.DuplicateCNameDetectedEventArgs ea)
        {
            if (sender == rtpSession)
            {
                string msg = string.Format(CultureInfo.CurrentCulture, Strings.DuplicateCnameWasDetected,
                                           ea.IPAddresses[0].ToString(), ea.IPAddresses[1].ToString());

                eventLog.WriteEntry(msg, EventLogEntryType.Error, 0);
                RtlAwareMessageBox.Show(null, msg, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

                Dispose();
            }
        }
Exemple #13
0
        private void replaceBtn_Click(object sender, System.EventArgs e)
        {
            DialogResult dr = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                          Strings.ConfirmReplaceText, expressionList.SelectedItem.ToString(), expressionInput.Text),
                                                      Strings.ConfirmReplaceTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning,
                                                      MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            if (dr == DialogResult.Yes)
            {
                int selected = expressionList.SelectedIndex;
                expressionList.Items[selected] = expressionInput.Text;
                expressionInput.Text           = string.Empty;
            }
        }
        /// <summary>
        /// Returns whether this machine meets all of the software requirements to run the OneNoteCapability
        /// </summary>
        public static new bool IsRunable(string regInstallRoot, int major, int minor, int build,
                                         string warningKey, string msg)
        {
            try
            {
                string oneNoteLocation;
                using (RegistryKey oneNoteKey = Registry.LocalMachine.OpenSubKey(regInstallRoot))
                {
                    oneNoteLocation = (string)oneNoteKey.GetValue("Path") + "OneNote.exe";
                }

                if (oneNoteLocation == null)
                {
                    // OneNote is not installed, so it will not be listed
                    // as an available capability viewer
                    return(false);
                }

                FileVersionInfo oneNoteVersionInfo = FileVersionInfo.GetVersionInfo(oneNoteLocation);
                if (!(oneNoteVersionInfo.ProductMajorPart == major &&
                      oneNoteVersionInfo.ProductMinorPart >= minor &&
                      oneNoteVersionInfo.ProductBuildPart >= build))
                {
                    // Check to make sure we haven't done this before
                    using (RegistryKey cxpKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft Research\ConferenceXP"))
                    {
                        string oneNoteWarning = (string)cxpKey.GetValue("OneNote Warning");

                        if (oneNoteWarning == null)
                        {
                            // Write the reg key to make sure we only say this once...
                            cxpKey.SetValue(warningKey, "true");

                            RtlAwareMessageBox.Show(null, msg, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None,
                                                    MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

                            return(false);
                        }
                    }
                }

                // If all of that worked, we're golden
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #15
0
        private void deleteBtn_Click(object sender, System.EventArgs e)
        {
            if (conferencesTreeView.SelectedNode == null)
            {
                return;
            }

            StringBuilder str = new StringBuilder();

            str.Append(Strings.AreYouSureYouWantToDelete);

            if (conferencesTreeView.SelectedNode.Tag is Conference)
            {
                Conference conf = (conferencesTreeView.SelectedNode.Tag as Conference);
                str.AppendFormat(Strings.DeleteConference, conf.Description);
            }
            else if (conferencesTreeView.SelectedNode.Tag is Participant)
            {
                Participant part = (conferencesTreeView.SelectedNode.Tag as Participant);
                str.AppendFormat(Strings.DeleteParticipant, part.Name);
            }
            else if (conferencesTreeView.SelectedNode.Tag is Stream)
            {
                Stream stream = (conferencesTreeView.SelectedNode.Tag as Stream);
                str.AppendFormat(Strings.DeleteStream, stream.Name);
            }
            else
            {
                str.AppendFormat(Strings.DeleteFolder, conferencesTreeView.SelectedNode.Text);
            }

            // Ask "are you sure?"
            DialogResult result = RtlAwareMessageBox.Show(this, str.ToString(), Strings.ConfirmDeleteTitle,
                                                          MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            if (result != DialogResult.Yes)
            {
                return;
            }

            // Display wait cursor
            Cursor.Current = Cursors.WaitCursor;

            // Delete node
            conferencesTreeView.DeleteNode(conferencesTreeView.SelectedNode);

            // Return to normal cursor
            Cursor.Current = Cursors.Default;
        }
Exemple #16
0
        private void AdminUI_Load(object sender, System.EventArgs e)
        {
            this.databaseLbl.Font         = UIFont.StringFont;
            this.cleanUpBtn.Font          = UIFont.StringFont;
            this.deleteRangeBtn.Font      = UIFont.StringFont;
            this.deleteBtn.Font           = UIFont.StringFont;
            this.conferencesTreeView.Font = UIFont.StringFont;
            this.refreshBtn.Font          = UIFont.StringFont;
            this.basicButtons.Font        = UIFont.StringFont;
            this.serviceButtons.Font      = UIFont.StringFont;

            this.databaseLbl.Text    = Strings.ArchiveDatabase;
            this.cleanUpBtn.Text     = Strings.CleanUp;
            this.deleteRangeBtn.Text = Strings.DeleteRangeEllipsis;
            this.deleteBtn.Text      = Strings.Delete;
            this.refreshBtn.Text     = Strings.Refresh;
            this.Text = Strings.CXPArchiveServiceManager;

            // Connect to service
            string name = ConfigurationManager.AppSettings["ServiceName"];

            if (name != null)
            {
                serviceButtons.ServiceName = name;
            }
            bool serviceFound = serviceButtons.ConnectToService();

            // Verify that we're connected to the service
            if (!serviceFound)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ErrorConnectingToServiceText, this.Text), Strings.ErrorConnectingToServiceTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Close();
                return; // early return to skip the code below
            }

            // Connect to the DB
            conferencesTreeView.Connect();

            // Report errors about both connections in one dialog
            if (!conferencesTreeView.Connected)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ErrorConnectingToDatabaseText, this.Text), Strings.ErrorConnectingToDatabaseTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Close();
            }
        }
Exemple #17
0
        private void okayClicked(object sender, System.EventArgs e)
        {
            // Verify the user has selected something permissible
            string trimmedText = options.Text.Trim();

            if (trimmedText == null || trimmedText.Length == 0)
            {
                RtlAwareMessageBox.Show(this, Strings.PleaseEnterAValidResponse, string.Empty, MessageBoxButtons.OK,
                                        MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                return;
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 private void RemoveFirewallPorts()
 {
     try
     {
         MSR.LST.Net.FirewallUtility.RemoveFirewallException(portMapName,
                                                             ports, portTypes, Context.Parameters["assemblypath"]);
     }
     catch (NotSupportedException ex)
     {
         RtlAwareMessageBox.Show(null, string.Format(CultureInfo.CurrentCulture,
                                                     Strings.FirewallExceptionFailedRemovingApplication, ex.Message),
                                 Strings.FirewallExceptionFailedTitle, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                 MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
     }
 }
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            Participant selectedParticipant = ((Participant)list.SelectedItems[0].Tag);
            string      removeStr           = string.Format(CultureInfo.CurrentCulture, Strings.ConfirmParticipantDeleteText,
                                                            selectedParticipant.Name);
            DialogResult dr = RtlAwareMessageBox.Show(this, removeStr, Strings.ConfirmParticipantDeleteTitle,
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

            if (dr == DialogResult.Yes)
            {
                StorageFile.DeleteParticipant(selectedParticipant.Identifier);
                // don't remove the image; it will screw up the images for all of the other participants
                list.Items.RemoveAt(list.SelectedIndices[0]);
            }
        }
 /// <summary>
 /// Delete all the strokes on the picture box.
 /// </summary>
 public void DeleteAllStrokes()
 {
     try
     {
         inkOverlay.Ink.DeleteStrokes(inkOverlay.Ink.Strokes);
         OnEraseAllClicked();
     }
     catch (System.ArgumentException)
     {
         RtlAwareMessageBox.Show(this, Strings.TryingToDrawError,
                                 Strings.Information, MessageBoxButtons.OK, MessageBoxIcon.Information,
                                 MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
         inkOverlay.Ink.DeleteStrokes(inkOverlay.Ink.Strokes);
     }
     this.Refresh();
 }
Exemple #21
0
        private void deleteRangeBtn_Click(object sender, System.EventArgs e)
        {
            // Show DeleteRangeForm as Dialog
            DeleteRange  rangeDialog = new DeleteRange();
            DialogResult dr          = rangeDialog.ShowDialog(this);

            if (dr != DialogResult.OK)
            {
                return;
            }

            // Find all of the conferences we will delete (in an ineffecient manner)
            DateTime start = rangeDialog.StartDateTime;
            DateTime end   = rangeDialog.EndDateTime;

            TreeNode[] confs = conferencesTreeView.GetConferencesInRange(start, end);

            // Check for no conferences found
            if (confs.Length == 0)
            {
                RtlAwareMessageBox.Show(this, Strings.InvalidRangeText, Strings.InvalidRangeTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }
            else
            {
                // Are you sure?
                String areYouSure = String.Format(CultureInfo.CurrentCulture, Strings.ConfirmDeleteText, confs.Length,
                                                  start.ToLongDateString(), start.ToShortTimeString(), end.ToLongDateString(), end.ToShortTimeString());

                dr = RtlAwareMessageBox.Show(this, areYouSure, Strings.ConfirmDeleteTitle, MessageBoxButtons.YesNo,
                                             MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);

                if (dr != DialogResult.Yes)
                {
                    return;
                }

                // Display wait cursor
                Cursor.Current = Cursors.WaitCursor;

                // Delete the conferences
                conferencesTreeView.DeleteConferences(confs);

                // Return to normal cursor
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #22
0
        private bool ValidateUriAndShowError(string input)
        {
            input = input.ToLower(CultureInfo.CurrentCulture);
            Uri  validatedUri = ValidateUri(input);
            bool valid        = (validatedUri != null);

            if (valid)
            {
                System.Diagnostics.Debug.WriteLine(validatedUri.ToString());

                // The Reflector service does not accept a protocol scheme (e.g., http://) or folders (e.g., .../MyFolder/...).
                if (this.serviceText == frmServices.ServicesUIText.ReflectorService)
                {
                    if (input.IndexOf('/') >= 0)
                    {
                        valid = false;
                    }
                }
                // The Archiver service does not accept a protocol scheme or IPv6 addresses
                else if (this.serviceText == frmServices.ServicesUIText.ArchiveService)
                {
                    if (input.IndexOf("://") >= 0 || validatedUri.Host.IndexOf('[') >= 0)
                    {
                        valid = false;
                    }
                }
                // The Venue service only accepts a Uri begining with http:// or https://
                else if (this.serviceText == frmServices.ServicesUIText.VenueService)
                {
                    if (!(input.StartsWith("http://") || input.StartsWith("https://")))
                    {
                        valid = false;
                    }
                }
            }

            if (!valid)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.EnterValidConnectionType, serviceText.ConnectionType),
                                        string.Format(CultureInfo.CurrentCulture, Strings.InvalidConnectionType,
                                                      serviceText.ConnectionType), MessageBoxButtons.OK, MessageBoxIcon.Warning,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }

            return(valid);
        }
        public override void Uninstall(IDictionary savedState)
        {
            #region Check to make sure we're in an Administrator role
            WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            if (wp.IsInRole(WindowsBuiltInRole.Administrator) == false)
            {
                RtlAwareMessageBox.Show(null, Strings.YouMustBeAnAdministratorToUninstall,
                                        Strings.AdministratorPrivilegesRequired, MessageBoxButtons.OK, MessageBoxIcon.Stop,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Application.Exit();
            }
            #endregion
            #region Basic Installer stuff
            base.Uninstall(savedState);
            #endregion
            #region Whack the Event Logs
            ConferenceEventLog.Uninstall();
            #endregion
            #region Whack registry entries
            try
            {
                using (RegistryKey pcaKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft Research\\ConferenceXP", true))
                {
                    if (pcaKey != null)
                    {
                        pcaKey.DeleteSubKeyTree("Client");
                    }
                }
            }
            catch {}

            try
            {
                using (RegistryKey pcaKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft Research\\ConferenceXP", true))
                {
                    if (pcaKey != null)
                    {
                        pcaKey.DeleteSubKeyTree("Client");
                    }
                }
            }
            catch {}

            Installed = false;
            #endregion
        }
 /// <summary>
 /// Starts the Archive Service after the installation has committed.
 /// </summary>
 private void archiveInstaller_Committed(object sender, InstallEventArgs e)
 {
     // Start the archive service at the end of installation
     try
     {
         ServiceController sc = new ServiceController(ArchiveWindowsService.ShortName);
         sc.Start();
     }
     catch (Exception ex)
     {
         // Don't except - that would cause a rollback.  Instead, just tell the user.
         RtlAwareMessageBox.Show(null, string.Format(CultureInfo.CurrentCulture,
                                                     Strings.ServiceStartFailureText, ex.ToString()), Strings.ServiceStartFailureTitle,
                                 MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1,
                                 (MessageBoxOptions)0);
     }
 }
Exemple #25
0
        /// <summary>
        /// Shows the form's camera configuration dialog
        /// </summary>
        public void ShowCameraConfiguration()
        {
            if (cg is VideoCaptureGraph)
            {
                VideoCaptureGraph vcg = (VideoCaptureGraph)cg;
                if (vcg.VideoSource.IsVfw)
                {
                    RtlAwareMessageBox.Show(null, Strings.CanNotConfigureCamera, string.Empty, MessageBoxButtons.OK,
                                            MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                    return;
                }

                if (cg != null && vcg.VideoSource.HasSourceDialog)
                {
                    vcg.VideoSource.ShowSourceDialog(form.Handle);
                }
            }
        }
Exemple #26
0
        /// <summary>
        /// When the edit form is closing, check to make sure the IP is unique.
        /// </summary>
        private void CheckForDupID(object sender, CancelEventArgs e)
        {
            VenueEditor editor = (VenueEditor)sender;

            if (editor.DialogResult != DialogResult.OK)
            {
                return;
            }

            Venue  ven = editor.GetVenue();
            string id  = ven.Identifier.ToLower(CultureInfo.InvariantCulture).Trim();

            // First check to see if the ID changed from the selected venue
            //  If it changed, we have to check against all of the venue IDs
            Venue original = editor.OriginalVenue;

            if (original.Identifier == null || original.Identifier.ToLower(CultureInfo.InvariantCulture).Trim() != id)
            {
                Venue dupIDVenue = null;

                // The IP has changed, so check to make sure it's not a dup
                foreach (ListViewItem item in list.Items)
                {
                    VenueState currentVenueState = (VenueState)item.Tag;
                    Venue      currentVen        = currentVenueState.Venue;

                    if (currentVen.Identifier.ToLower(CultureInfo.InvariantCulture).Trim() == id)
                    {
                        dupIDVenue = currentVen;
                        break;
                    }
                }

                // If the ID is a duplicate, show an error and prevent the dialog from closing
                if (dupIDVenue != null)
                {
                    RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                                Strings.DuplicateOwnerText, dupIDVenue.Name), Strings.DuplicateOwnerTitle,
                                            MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                            (MessageBoxOptions)0);
                    e.Cancel = true;
                }
            }
        }
        /// <summary>
        /// lvwConferences_Click get the streams information of the selected conference and
        /// display it in the lvwStreams list view.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void lvwConferences_Click(object sender, System.EventArgs e)
        {
            try
            {
                ArchiveService.Conference conf = (ArchiveService.Conference)lvwConferences.SelectedItems[0].Tag;
                Debug.Assert(conf != null);

                if (conf != null)
                {
                    ArchiveService.Participant[] participants = archiver.GetParticipants(conf.ConferenceID);
                    lvwStreams.Items.Clear();
                    foreach (ArchiveService.Participant participant in participants)
                    {
                        ArchiveService.Stream[] streams = archiver.GetStreams(participant.ParticipantID);

                        foreach (ArchiveService.Stream s in streams)
                        {
                            // TODO: Create the string array with enum (same as frmArchiveConf)
                            // TODO: Eventually use Tag to set to the stream
                            ListViewItem stream = new ListViewItem(new string[] { participant.Name, s.Name, s.Payload,
                                                                                  s.Frames.ToString(CultureInfo.CurrentCulture), s.StreamID.ToString(CultureInfo.CurrentCulture) });
                            stream.Checked = true;
                            lvwStreams.Items.Add(stream);
                        }
                    }
                }

                UpdateSelectButtonState();
            }
            catch (System.Net.Sockets.SocketException ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceUnavailableText, ex.Message), Strings.ArchiveServiceUnavailableTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
            catch (Exception ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceErrorText, ex.ToString()), Strings.ArchiveServiceErrorTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
        }
Exemple #28
0
 private void buttonAccept_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(this.textBoxNewPassword.Text.Trim()))
     {
         RtlAwareMessageBox.Show(this, "¡Indique la nueva contraseña!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.textBoxNewPassword.Focus();
         return;
     }
     if (this.textBoxNewPassword.Text.Trim() != this.textBoxConfirmNewPassword.Text.Trim())
     {
         RtlAwareMessageBox.Show(this, "La contraseña de acceso no coincide con la confirmación de la contraseña de acceso", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.textBoxNewPassword.Focus();
         return;
     }
     OfficeApplication.OfficeApplicationProxy.changePassword(this.textBoxNewPassword.Text.Trim());
     OfficeApplication.OfficeApplicationProxy.Credentials.Password = this.textBoxNewPassword.Text.Trim();
     OfficeApplication.OfficeDocumentProxy.Credentials.Password    = this.textBoxNewPassword.Text.Trim();
     this.Close();
 }
        public override void Install(IDictionary savedState)
        {
            CheckAdministratorRole();

            #region Add the firewall punchthrough
            try
            {
                MSR.LST.Net.FirewallUtility.AddFirewallException(portMapName,
                                                                 ports, portTypes, Context.Parameters["assemblypath"]);
            }
            catch (NotSupportedException ex)
            {
                RtlAwareMessageBox.Show(null, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.FirewallExceptionAddingText, ex.Message), Strings.FirewallExceptionFailedTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
            #endregion

            #region Check for no SQL and show the error message here

            if (!this.sqlFound) // Show the error msg here that we couldn't show earlier
            {
                RtlAwareMessageBox.Show(null, Strings.SqlServerNotFoundText, Strings.SqlServerNotFoundTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }
            else // only try to create the database if we know SQL is installed
            {
                CreateDatabase();
                try {
                    DBSetupHelper.SetConfigFiles(InstallPath, this.sqlInstanceName);
                }
                catch (Exception ex) {
                    RtlAwareMessageBox.Show(null, ex.ToString(), Strings.ConfigurationFileCustomizationFailed,
                                            MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                            (MessageBoxOptions)0);
                }
            }

            #endregion

            base.Install(savedState);
        }
Exemple #30
0
        /// <summary>
        /// tbPlayBack MouseUp event handler, jump within the play back.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void tbPlayBack_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            try
            {
                // The user is jumping back and forth, in the playback

                // Translate the cursor position to a time to jump to (in ticks)
                long deltaJump = (long)(tbPlayBack.Value * ratioTickBySlider);
                long absJump   = conference.Start.Ticks + deltaJump;
                Debug.Assert(absJump < conference.End.Ticks);

                // Jump to the right place in the playback from Archive Service
                archiver.JumpTo(playBackIP, absJump);

                // Readjust the startPlayBackTicks value
                startPlayBackTicks = DateTime.Now.Ticks - deltaJump;
                // Note: The difference should never be negative (unless
                //       calculation error in deltaJump) since
                //       ticks are 100-nanosecond intervals that have
                //       elapsed since 12:00 A.M., January 1, 0001
                //       There are 10 million ticks per second (TimeSpan.TicksPerSecond)

                // Re-enable the timer (disabled on MouseDown event)
                timerSliderUpdate.Enabled = true;
            }
            catch (ArgumentException argEx)
            {
                // TODO: Find a better message
                // "There is a problem moving in the play back. Please ensure that the play back is currently running."
                // + System.Environment.NewLine + "Message: " +
                RtlAwareMessageBox.Show(this, argEx.Message, Strings.ArchivePlayBackTitle, MessageBoxButtons.OK,
                                        MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                disablePlayBackUI();
            }
            catch (Exception ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchivePlayBackText, ex.ToString()), Strings.ArchivePlayBackTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
                disablePlayBackUI();
            }
        }