Esempio n. 1
0
 private void addNewAccountButton_Click(object sender, EventArgs e)
 {
     SipAccountConfig cfg = new SipAccountConfig();
     SipAccountEditorForm f = new SipAccountEditorForm(cfg);
     if (f.ShowDialog() == DialogResult.OK)
     {
         if (SipAccountManager.Default.DefaultAcrcount == null)
         {
             cfg.IsDefault = true;
         }
         bindingSourceSipAccounts.Add(cfg);
     }
 }
 public SipAccountEditorForm(SipAccountConfig cfg)
 {
     InitializeComponent();
     this.iAccountBindingSource.DataSource = cfg;
 }
 public SipAccountConfig(SipAccountConfig cfg)
 {
     copy(cfg);
 }
 private void copy(SipAccountConfig cfg)
 {
     this.AccountName = cfg.AccountName;
     this.DisplayName = cfg.DisplayName;
     this.DomainName = cfg.DomainName;
     this.HostName = cfg.HostName;
     this.Id = cfg.Id;
     this.Index = cfg.Index;
     this.Password = cfg.Password;
     this.ProxyAddress = cfg.ProxyAddress;
     this.RegState = cfg.RegState;
     this.TransportMode = cfg.TransportMode;
     this.UserName = cfg.UserName;
 }
        public virtual void CancelEdit()
        {
            if (!editing) return;

            editing = false;
            copy(savedObject);
            savedObject = null;
        }
 public virtual void BeginEdit()
 {
     if (editing) return;
     savedObject = this.Copy();
     editing = true;
 }