コード例 #1
0
		/// <summary>
		/// This constructor will initialise the form correctly.
		/// </summary>
		/// <param name="ldapServer">The server name to use</param>
		public LdapSearcherScreen(ILdapSearchEngine ldapServer)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			m_ldapServer = ldapServer;
			m_resources = new SmartResourceManager("Workshare.Common.Control.Resources", Assembly.GetAssembly(typeof(LdapSearcherScreen)));
			this.Text =m_resources.GetString("LSC_007",
				SmartResourceManager.CurrentCulture);
			this.groupBox1.Text = m_resources.GetString("LSC_009",
				SmartResourceManager.CurrentCulture);
			this.btnImport.Text = m_resources.GetString("LSC_008",
				SmartResourceManager.CurrentCulture);
			this.btnOK.Text = m_resources.GetString("LSC_010",
				SmartResourceManager.CurrentCulture);
			this.btnCancel.Text = m_resources.GetString("LSC_011",
				SmartResourceManager.CurrentCulture);

			string title = m_resources.GetString("LSS_TITLE",
				SmartResourceManager.CurrentCulture);

			StringBuilder sb = new StringBuilder();
			sb.AppendFormat("LDAP_{0}", m_ldapServer.EngineType);
			string ldap = m_resources.GetString(sb.ToString(),
				SmartResourceManager.CurrentCulture);
			sb.Remove(0,sb.Length);
			if ( ldap.Length == 0 )
				ldap = m_ldapServer.EngineType.ToString();
			sb.AppendFormat(title, ldap);
			this.Text = sb.ToString();

			m_found = new Hashtable();
			m_selected = new LdapSearchResultCollection();
			m_ldapControl.LdapServer = m_ldapServer;

			m_ldapControl.OnSelected +=new LdapSearchEventHandler(OnMemberSelected);
		}
コード例 #2
0
ファイル: NewGetMembers.cs プロジェクト: killbug2004/WSProf
		/// <summary>
		/// This constructor will initialise the internal members
		/// and set the valid roles
		/// </summary>
		/// <param name="roles">The roles that can be used.</param>
		public NewGetMembers(string[] roles, string ldapServer)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			if ( roles.Length > 0 )
			{
				m_roles = roles;
				foreach( string role in m_roles )
					m_cbRoles.Items.Add(role);
			}

			m_failed = new ArrayList();

			m_ldap = LdapSearcher.GetSearchEngine(ldapServer);
			if ( m_ldap == null)
				throw( new ArgumentNullException( ldapServer, Properties.Resources.NME_003 ) );
		}