Exemplo n.º 1
0
        /// <summary>
        /// Creates a new AddAttributeDialog.
        /// </summary>
        /// <param name="attributeNames">The attribute names to be listed in the
        /// dialog.</param>
        protected virtual IAddXmlNodeDialog CreateAddAttributeDialog(string[] attributeNames)
        {
            AddXmlNodeDialog dialog = new AddXmlNodeDialog(attributeNames);

            dialog.Text = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddAttributeDialog.Title}");
            dialog.CustomNameLabelText = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddAttributeDialog.CustomAttributeLabel}");
            return(dialog);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new AddElementDialog.
        /// </summary>
        /// <param name="elementNames">The element names to be listed in the
        /// dialog.</param>
        protected virtual IAddXmlNodeDialog CreateAddElementDialog(string[] elementNames)
        {
            AddXmlNodeDialog dialog = new AddXmlNodeDialog(elementNames);

            dialog.Text = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.Title}");
            dialog.CustomNameLabelText = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.CustomElementLabel}");
            return(dialog);
        }
		public void NoListBoxShownWhenNoNames()
		{
			using (AddXmlNodeDialog dialog = new AddXmlNodeDialog(new string[0])) {
				Size expectedClientSize = this.bottomPanel.Size;
				Size expectedMinSize = dialog.Size;
				
				Panel bottomPanel = (Panel)dialog.Controls["bottomPanel"];
			
				Assert.IsFalse(dialog.Controls.ContainsKey("namesListBox"));
				Assert.AreEqual(DockStyle.Fill, bottomPanel.Dock);
				Assert.AreEqual(expectedClientSize, dialog.ClientSize);
				Assert.AreEqual(expectedMinSize, dialog.MinimumSize);
			}
		}
		public void RightToLeftConversion()
		{
			try {
				RightToLeftConverter.IsRightToLeft = true;
				using (AddXmlNodeDialog dialog = new AddXmlNodeDialog()) {
					Assert.AreEqual(RightToLeft.Yes, dialog.RightToLeft);
				}
			} finally {
				RightToLeftConverter.IsRightToLeft = false;
			}
		}
		/// <summary>
		/// Creates a new AddAttributeDialog.
		/// </summary>
		/// <param name="attributeNames">The attribute names to be listed in the
		/// dialog.</param>
		protected virtual IAddXmlNodeDialog CreateAddAttributeDialog(string[] attributeNames)
		{
			AddXmlNodeDialog dialog = new AddXmlNodeDialog(attributeNames);
			dialog.Text = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddAttributeDialog.Title}");
			dialog.CustomNameLabelText = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddAttributeDialog.CustomAttributeLabel}");
			return dialog;
		}
		/// <summary>
		/// Creates a new AddElementDialog.
		/// </summary>
		/// <param name="elementNames">The element names to be listed in the
		/// dialog.</param>
		protected virtual IAddXmlNodeDialog CreateAddElementDialog(string[] elementNames)
		{
			AddXmlNodeDialog dialog = new AddXmlNodeDialog(elementNames);
			dialog.Text = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.Title}");
			dialog.CustomNameLabelText = StringParser.Parse("${res:ICSharpCode.XmlEditor.AddElementDialog.CustomElementLabel}");
			return dialog;
		}
		public void RightToLeftConversion()
		{
			try {
				PropertyService.Set("CoreProperties.UILanguage", RightToLeftConverter.RightToLeftLanguages[0]);
				using (AddXmlNodeDialog dialog = new AddXmlNodeDialog()) {
					Assert.AreEqual(RightToLeft.Yes, dialog.RightToLeft);
				}
			} finally {
				PropertyService.Set("CoreProperties.UILanguage", Thread.CurrentThread.CurrentUICulture.Name);
			}
		}