public frmFeed(DialogRole role, NavBarControl navBar) { InitializeComponent(); this.role = role; this.navBar = navBar; cbeGroup.Properties.Items.AddRange(NavBarHelper.GetGroupNames(navBar)); sbOK.Text = role == DialogRole.New ? Properties.Resources.Add : Properties.Resources.OK; Text = (role == DialogRole.New ? Properties.Resources.NewFeedDescription : Properties.Resources.EditFeedDescription).Replace(".", string.Empty); uniqueNames = NavBarHelper.GetItemNames(navBar); uniqueNames.Add(string.Empty); if (role == DialogRole.New) { teCaption.Text = NavBarHelper.GetUniqueItemName(Properties.Resources.TempFeedName, navBar); cbeGroup.Text = Properties.Resources.TempGroupName; sbOK.Enabled = false; } else { uniqueNames.Remove(CurrentItem.Caption); teCaption.Text = CurrentItem.Caption; cbeGroup.Text = CurrentGroup.Caption; heLink.Text = string.Format("{0}", CurrentItem.Tag); } InitValidation(); }
public frmFeed(DialogRole role, NavBarControl navBar) { InitializeComponent(); this.role = role; this.navBar = navBar; cbeGroup.Properties.Items.AddRange(NavBarHelper.GetGroupNames(navBar)); sbOK.Text = role == DialogRole.New ? Properties.Resources.Add : Properties.Resources.OK; Text = (role == DialogRole.New ? Properties.Resources.NewFeedDescription : Properties.Resources.EditFeedDescription).Replace(".", string.Empty); uniqueNames = NavBarHelper.GetItemNames(navBar); uniqueNames.Add(string.Empty); if(role == DialogRole.New) { teCaption.Text = NavBarHelper.GetUniqueItemName(Properties.Resources.TempFeedName, navBar); cbeGroup.Text = Properties.Resources.TempGroupName; sbOK.Enabled = false; } else { uniqueNames.Remove(CurrentItem.Caption); teCaption.Text = CurrentItem.Caption; cbeGroup.Text = CurrentGroup.Caption; heLink.Text = string.Format("{0}", CurrentItem.Tag); } InitValidation(); }