private ListViewItem GenerateItem(MacroNode macroNode)
        {
            ListViewItem listViewItem = new ListViewItem
            {
                ImageIndex = (int)macroNode.state,
                Text       = NodeSetter.NodeName(macroNode.state, false)
            };

            listViewItem.SubItems.Add(NodeSetter.NodeName(macroNode.state, true));
            listViewItem.SubItems.Add(macroNode.x.ToString() + ", " + macroNode.y.ToString());
            return(listViewItem);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// MacroNode로 리스트뷰 형식에 맞는 ListViewItem을 반환해줍니다.
        /// </summary>
        /// <param name="macroNode"></param>
        /// <returns></returns>
        private ListViewItem GenerateItem(MacroNode macroNode, bool isPrefab)
        {
            if (isPrefab)
            {
                ListViewItem listViewItem = new ListViewItem
                {
                    ImageIndex = (int)macroNode.state,
                    Text       = NodeSetter.NodeName(macroNode.state, false)
                };
                listViewItem.SubItems.Add(NodeSetter.NodeName(macroNode.state, true));
                listViewItem.SubItems.Add(macroNode.tag);
                return(listViewItem);
            }
            else
            {
                ListViewItem listViewItem = new ListViewItem
                {
                    ImageIndex = (int)macroNode.state,
                    Text       = ""
                };
                listViewItem.SubItems.Add(NodeSetter.NodeName(macroNode.state, false));
                listViewItem.SubItems.Add(NodeSetter.NodeName(macroNode.state, true));

                if ((MainListColumnFlag & ColumnFlag.Tag) != 0)
                {
                    listViewItem.SubItems.Add(macroNode.tag);
                }

                if ((MainListColumnFlag & ColumnFlag.Point) != 0)
                {
                    listViewItem.SubItems.Add(string.Format("{0}, {1}", macroNode.x, macroNode.y));
                }

                if ((MainListColumnFlag & ColumnFlag.Interval) != 0)
                {
                    listViewItem.SubItems.Add(macroNode.interval.ToString());
                }

                if ((MainListColumnFlag & ColumnFlag.InputString) != 0)
                {
                    listViewItem.SubItems.Add(macroNode.inputString);
                }
                return(listViewItem);
            }
        }
        private void GenerateImages()
        {
            foreach (NodeStates nodeState in Enum.GetValues(typeof(NodeStates)))
            {
                Bitmap    image;
                Rectangle bounds;

                bounds = new Rectangle(Point.Empty, imageList.ImageSize);
                image  = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);

                using (Graphics g = Graphics.FromImage(image))
                {
                    g.SmoothingMode = SmoothingMode.AntiAlias;

                    using (Brush brush = new SolidBrush(NodeSetter.NodeColor(nodeState)))
                    {
                        g.FillEllipse(brush, bounds);
                    }
                }
                imageList.Images.Add(image);
            }
        }