示例#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
		public void Test_12_ResourceManagerObject()
		{
            SmartResourceManager srm = new SmartResourceManager("Workshare.Common.Exceptions.Resources", Assembly.GetAssembly(typeof(SmartAssembly)));
			string testRes = srm.GetString("SI_004",
				SmartResourceManager.CurrentCulture);

			Assert.IsTrue(testRes.Length > 0, "The resource manager did not return anything");
			Assert.IsTrue(testRes.Equals("Thread has not started"), "The resource was not returned correctly.");
		}