Пример #1
0
        public void CreateInterface(Node node)
        {
            foreach (var child in Controls.First().Controls.ToList()) Controls.First().Remove(child);

            _node = node;

            int yPos = 16;

            // Create the node editing section
            var nodeEditing = new GroupPanel(Manager) { Text = "Node Details" };
            nodeEditing.Init();
            // nodeEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top;
            nodeEditing.Left = 16;
            nodeEditing.Top = yPos;
            nodeEditing.Width = Width - 48;
            nodeEditing.Parent = this;
            nodeEditing.Visible = true;

            _nodeEditor = new ObjectEditor<Node>(Manager, nodeEditing);
            _nodeEditor.SetInstance(node);
            _nodeEditor.CreateInterface();
            yPos += nodeEditing.Height + 16;

            // Create the binded logic section
            var bindedLogicEditing = new GroupPanel(Manager) { Text = "Node Details" };
            bindedLogicEditing.Init();
            //bindedLogicEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top;
            bindedLogicEditing.Left = 16;
            bindedLogicEditing.Top = yPos;
            bindedLogicEditing.Width = Width - 48;
            bindedLogicEditing.Parent = this;
            bindedLogicEditing.Visible = true;

            _bindedLogicEditor = new ObjectEditor<BindedLogic>(Manager, bindedLogicEditing);
            _bindedLogicEditor.SetInstance(node.BindedLogic);
            _bindedLogicEditor.CreateInterface();

            yPos += bindedLogicEditing.Height + 16;

            // Create the pure logic section
            pureLogicEditing = new GroupPanel(Manager) {
                Text = "Node Details",
                AutoScroll = true,
                Left = 16,
                Top = yPos,
                Width = Width - 48,
                Parent = this,
                Visible = true,
                Height = 80
            };

            pureLogicEditing.Init();

            CreatePureLogicEditor(pureLogicEditing);

            Invalidate();
            Refresh();

            pureLogicEditing.Invalidate();
            pureLogicEditing.Refresh();
        }
Пример #2
0
        /// <summary>
        /// Help method to delete old group panel and create new one to be drawn.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void createGroupPanlControl()
        {
            var directories = GetFiles(directory);
            subDirectories.Clear();
            musicFiles.Clear();
            lastDirecPosition = 0;
            foreach (string dir in directories)
            {
                subDirectories.Add((string)dir);
            }
            lastDirecPosition = subDirectories.Count();

            List<FileInfo> musicFilestemp = GetMusicFiles(directory, "*.mp3", "*.wav");
            foreach (FileInfo dir in musicFilestemp)
            {
                musicFiles.Add(dir);
                System.Console.WriteLine(dir);
            }

            isChanged = true;

            gpList.Add(new TomShane.Neoforce.Controls.GroupPanel(manager));

            gpList.RemoveAt(0);

            gp2 = gp;
            gp2.Dispose();
            gp = gpList[0];
            gp.Text = "File Browser";
            gp.AutoScroll = true;

            gp.Width = window.Width;
            gp.Height = window.Height;
            gp.Left = 0;
            gp.Top = 0;
            gp.Parent = window;
            gp.Add(backButton);
            gp.Add(selectAudio);

            //if (selectedMusicFile != null)
            //{
            //    selectedMusicFile.Left = 500;
            //    gp.Add(selectedMusicFile);
            //}

            if (subDirectories.Count() > 0 || musicFiles.Count() > 0)
            {

                createBrowserControls();
                createMusicControls();
            }
            else
            {
                Label noDirectories = new Label(manager);
                noDirectories.Text = "Music files";
                noDirectories.Top = 30;
                noDirectories.Parent = gp;
            }
            gp.Invalidate();
        }