//-----------------------------------------------------------------------------
        // Function: DeleteIdentity
        //
        // Purpose: Deletes an identity
        //
        // Parameters:
        // pwzIdentity : The peer identity to delete
        //
        // Returns: HRESULT //
        HRESULT DeleteIdentity(string pwzIdentity)
        {
            HRESULT hr = HRESULT.S_OK;

            if (string.IsNullOrEmpty(pwzIdentity))
            {
                GroupChat.DisplayHrError("Please select an identity.", hr = HRESULT.E_INVALIDARG);
            }

            if (hr.Succeeded)
            {
                GroupChat.Main.CleanupGroup();

                hr = PeerIdentityDelete(pwzIdentity);

                if (hr.Failed)
                {
                    GroupChat.DisplayHrError("Failed to delete identity.", hr);
                }
            }

            if (hr.Succeeded)
            {
                GroupChat.Main.SetStatus("Deleted identity");
            }

            return(hr);
        }
 private void IDOK_Click(object sender, EventArgs e)
 {
     if (DeleteIdentity(GroupChat.GetSelectedIdentity(IDC_CB_IDENTITY)).Succeeded)
     {
         Close();
     }
 }
Beispiel #3
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     GroupChat.InitSystem().ThrowIfFailed();
     Application.Run(new GroupChat());
     GroupChat.CleanupSystem();
 }
 private void IDOK_Click(object sender, EventArgs e)
 {
     if (GroupChat.Main.CreateGroup(IDC_EDT_GROUPNAME.Text, GroupChat.GetSelectedIdentity(IDC_CB_IDENTITY),
                                    IDC_EDIT_PASSWORD.Text, IDC_RADIO_AUTH_PASSW.Checked, IDC_RADIO_GLOBAL_SCOPE.Checked).Succeeded)
     {
         GroupChat.Main.SetStatus("Group created");
         Close();
     }
 }
        //-----------------------------------------------------------------------------
        // Function: HandleCreateIdentity
        //
        // Purpose:  Extracts the friendly name from the dialog and
        //           creates a new identity.
        //
        // Returns:  HRESULT
        //
        private void IDOK_Click(object sender, EventArgs e)
        {
            if (0 == IDC_EDT_FRIENDLYNAME.TextLength)
            {
                GroupChat.DisplayError("Please type a name for the identity.");
                return;
            }

            var hr = PeerIdentityCreate("GroupChatMember", IDC_EDT_FRIENDLYNAME.Text, default, out var pwzIdentity);
 private void IDC_CB_IDENTITY_SelectedIndexChanged(object sender, EventArgs e)
 {
     GroupChat.RefreshGroupCombo(IDC_CB_GROUP, GroupChat.GetSelectedIdentity(IDC_CB_IDENTITY));
 }
 public IDD_DELETEGROUP()
 {
     InitializeComponent();
     GroupChat.RefreshIdentityCombo(IDC_CB_IDENTITY, true);
 }
 private void IDC_BTN_BROWSE_Click(object sender, EventArgs e)
 {
     GroupChat.BrowseHelper(this, IDC_EDT_LOCATION, "Group Invitation", GroupChat.c_wzFileExtInv, true);
 }
 private void RefreshIdentityCombo() => GroupChat.RefreshIdentityCombo(IDC_CB_IDENTITY, true);
 public IDD_DELETEIDENTITY()
 {
     InitializeComponent();
     GroupChat.RefreshIdentityCombo(IDC_CB_IDENTITY, false);
 }