protected override void PerformLoad(IDesignerSerializationManager serializationManager)
        {
            // Create designer root object.
            this.serializationManager = serializationManager;
            RubyComponentWalker visitor = new RubyComponentWalker(this);

            visitor.CreateComponent(generator.ViewContent.DesignerCodeFileContent);
        }
		public void LocalVariableAssignmentWithUnknownTypeRhs()
		{
			string RubyCode =
				"require \"System.Windows.Forms\"\r\n" +
				"\r\n" +
				"class MainForm < System::Windows::Forms::Form\r\n" +
				"    def initialize()\r\n" +
				"        self.InitializeComponent()\r\n" +
				"    end\r\n" +
				"\r\n" +
				"    def InitializeComponent()\r\n" +
				"        abc = Unknown::Type(10)\r\n" +
				"   end\r\n" +
				"end";

			try {
				RubyComponentWalker walker = new RubyComponentWalker(new MockComponentCreator());
				walker.CreateComponent(RubyCode);
				Assert.Fail("Exception should have been thrown before this.");
			} catch (RubyComponentWalkerException ex) {
				string expectedMessage = String.Format(StringParser.Parse("${res:ICSharpCode.PythonBinding.UnknownTypeName}"), "Unknown.Type");
				Assert.AreEqual(expectedMessage, ex.Message);
			}
		}
Example #3
0
        /// <summary>
        /// Adds the named base type to the class.
        /// </summary>
        void AddBaseType(IClass c, ClassDefinition classDef)
        {
            string name = RubyComponentWalker.GetBaseClassName(classDef);

            c.BaseTypes.Add(new SearchClassReturnType(c.ProjectContent, c, 0, 0, name, 0));
        }
		public void RubyFormWalkerExceptionThrown()
		{
			RubyComponentWalker walker = new RubyComponentWalker(this);
			walker.CreateComponent(RubyCode);
			Assert.Fail("Exception should have been thrown before this.");
		}
		public void SetUpFixture()
		{
			RubyComponentWalker walker = new RubyComponentWalker(componentCreator);
			form = walker.CreateComponent(RubyCode) as Form;
			userControl = form.Controls[0] as DoublePropertyUserControl;
		}