Пример #1
0
        public void メンバーがint型1つの型に対してツリーを生成できる()
        {
            var impl     = new ToolElementTreeFactory();
            var elements = impl.CreateToolElements(new TestSubject1()).ToArray();

            Assert.AreEqual(1, elements.Length);
            Assert.AreEqual("TestInteger", elements[0].Name);
            Assert.AreEqual("Integer", elements[0].PropertyName);
            Assert.IsInstanceOf <IntToolElement>(elements[0]);
        }
Пример #2
0
        public void メンバーがboolとVector2Fの型に対してツリーを生成できる()
        {
            var impl     = new ToolElementTreeFactory();
            var elements = impl.CreateToolElements(new TestSubject2()).ToArray();

            Assert.AreEqual(2, elements.Length);
            Assert.AreEqual("Boolean", elements[0].Name);
            Assert.IsInstanceOf <BoolToolElement>(elements[0]);

            Assert.AreEqual("Vector", elements[1].Name);
            Assert.IsInstanceOf <Vector2FToolElement>(elements[1]);
        }
Пример #3
0
        public void ToolAuto属性のついた型に対してツリーを生成できる()
        {
            var impl     = new ToolElementTreeFactory();
            var elements = impl.CreateToolElements(new TestSubject3()).ToArray();

            Assert.AreEqual(2, elements.Length);
            Assert.AreEqual("Single", elements[0].Name);
            Assert.IsInstanceOf <FloatToolElement>(elements[0]);

            Assert.AreEqual("Color", elements[1].Name);
            Assert.IsInstanceOf <ColorToolElement>(elements[1]);
        }
Пример #4
0
        public NodeEditor(NodeEditorViewModel viewModel)
        {
            _first = true;

            var t = new ToolElementTreeFactory();

            t.GuiInfoRepository.SetAltseed2DefaultObjectMapping();

            IEditorPropertyAccessor propertyAccessor = this;

            _nodeTreeWindow       = new NodeTreeWindow(propertyAccessor, new NodeTreeViewModel(propertyAccessor));
            _selectedNodeWindow   = new SelectedNodeWindow(propertyAccessor, t);
            _previewWindow        = new PreviewWindow(propertyAccessor, viewModel.PreviewViewModel);
            _textureBrowserWindow = new TextureBrowserWindow(viewModel.TextureBrowserViewModel);
            _fontBrowserWindow    = new FontBrowserWindow(viewModel.FontBrowserViewModel);
        }
Пример #5
0
        public void メソッドをGUIに表示するようなツリーを生成できる()
        {
            var impl     = new ToolElementTreeFactory();
            var elements = impl.CreateToolElements(new TestSubject4()).ToArray();

            Assert.AreEqual(2, elements.Length);
            Assert.AreEqual("SubmitCommand", elements[0].Name);
            Assert.IsInstanceOf <ButtonToolElement>(elements[0]);

            Assert.AreEqual("UserCommand", elements[1].Name);
            Assert.IsInstanceOf <UserToolElement>(elements[1]);

            if (elements[0] is ButtonToolElement button)
            {
                Assert.AreEqual("Submit", button.MethodName);
            }

            if (elements[1] is UserToolElement user)
            {
                Assert.AreEqual("User", user.MethodName);
            }
        }