示例#1
0
        public void AddLan()
        {
            if (this.lanTempPath == null || this.lanTempPath.Trim().Equals(string.Empty))
            {
                this.Hint = "临时路径不能为空!";
                return;
            }

            if (this.LanOptions == null)
            {
                this.LanOptions = new ObservableCollection <LanGroupOption>();
            }

            LanAddress addr = new LanAddress();

            addr.LanPath = this.lanTempPath.Trim();
            addr.LanName = this.lanUserName;
            addr.LanPwd  = this.lanPwd;
            LanGroupOption op = new LanGroupOption(addr);

            op.IsSelected = true;
            this.LanOptions.Add(op);
            this.LanTempPath = "";
            this.LanUserName = "";
            this.LanPwd      = "";
        }
示例#2
0
 public void Add()
 {
     if (this.aliasName == null || this.aliasName.Trim().Equals(string.Empty) ||
         this.path == null || this.path.Trim().Equals(string.Empty))
     {
         this.Hint = "地址名、LAN地址不能为空!";
     }
     else
     {
         LanAddress item = new LanAddress();
         item.LanAlias = this.aliasName.Trim();
         item.LanPath  = this.path.Trim();
         if (this.userName != null)
         {
             item.LanName = this.userName.Trim();
         }
         else
         {
             item.LanName = "";
         }
         if (this.pwd != null)
         {
             item.LanPwd = this.pwd.Trim();
         }
         else
         {
             item.LanPwd = "";
         }
         this.ContactList.Add(item);
         config.ListLanAddr = this.contactList.ToList();
         config.WriteConfigToFile();
         this.Hint      = "LAN地址保存成功!";
         this.AliasName = "";
         this.Path      = "";
         this.UserName  = "";
         this.Pwd       = "";
     }
 }
示例#3
0
 public LanGroupOption(LanAddress addr)
 {
     this.Address    = addr;
     this.IsSelected = false;
 }