当前位置: 首页>>代码示例>>C#>>正文


C# Enums.BringToFront方法代码示例

本文整理汇总了C#中Enums.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# Enums.BringToFront方法的具体用法?C# Enums.BringToFront怎么用?C# Enums.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Enums的用法示例。


在下文中一共展示了Enums.BringToFront方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadControls

        private void loadControls(TreeNode Location)
        {
            toolTip1.AutoPopDelay = 10000;
            reflexiveData rd = (reflexiveData)Location.Tag;

            if (rd.chunkCount > 100000) // Some very large number
                throw new Exception("\"" + rd.node.Text + "\" appears to contain " + rd.chunkCount + "chunks!\n"
                    + "Try reloading tag. If problem persists, you likely have a corrupt map!");

            int chNum = rd.chunkSelected;
            bool enabled = rd.chunkCount != 0;
            int metaOffset = rd.baseOffset;

            // Make our panel non-visibile while we create our controls
            Panel panel = this.panelMetaEditor;
            panel.Visible = false;

            // Dispose of each control and also add a safety  in case we somehow go into an endless loop (max 1000)
            int safetyCount = 1000;
            while (panel.Controls.Count > 0 && safetyCount > 0)
            {
                panel.Controls[0].Dispose();
                safetyCount--;
            }
            // Should be empty, but clear anyways.
            panel.Controls.Clear();

            Object[] o;
            if (rd.reflexive == null)
                o = ifp.items;
            else
                o = rd.reflexive.items;

            bool labelFound = false;
            int tabIndex = 0;
            // These are used to detect color fields and replace with a ColorWheel control
            // Stores the control for an Alpha Color value
            DataValues alphaControl = null;
            // Stores the control for a blue Color value
            DataValues blueControl = null;
            // Stores the control for a green Color value
            DataValues greenControl = null;
            // Stores the control for a red Color value
            DataValues redControl = null;
            // Keeps track of how many controls are between fields; Colors need to be adjacent
            int colorSpaceCount = 4;

            foreach (IFPIO.BaseObject ctl in o)
            {
                tabIndex++;
                try
                {
                    switch (ctl.ObjectType)
                    {
                        case IFPIO.ObjectEnum.Struct:
                            {
            #if DEBUG
                                if (((IFPIO.Reflexive)ctl).chunkSize == 1)
                                {
                                    System.IO.BinaryReader BR = new System.IO.BinaryReader(meta.MS);
                                    BR.BaseStream.Position = ctl.offset + metaOffset;
                                    int chunkCount = BR.ReadInt32();
                                    if (chunkCount == 0)
                                        continue;
                                    int chunkOffset = BR.ReadInt32() - meta.magic;
                                    int tagIndex = map.Functions.ForMeta.FindMetaByOffset(chunkOffset);

                                    StringBox sb = new StringBox(meta, ctl.name + " (reflexive)", map, ctl.offset, ctl.lineNumber, 0);

                                    if (enabled) sb.Populate(metaOffset, tagIndex == meta.TagIndex);
                                    if (sb.size > 0)
                                    {
                                        panelMetaEditor.Controls.Add(sb);
                                        sb.BringToFront();
                                    }
                                    //panelMetaEditor.Controls[0].Controls[2].GotFocus += new EventHandler(MetaEditorControlPage_GotFocus);
                                }
            #endif
                                /*
                            if (Meta_Editor.MetaEditor.ShowReflexives == false)
                                break;
                            // tempLabel is a blank space located above reflexives
                            Label tempLabel = new Label();
                            tempLabel.AutoSize = true;
                            tempLabel.Location = new System.Drawing.Point(0, 0);
                            tempLabel.Name = "label1";
                            tempLabel.Dock = DockStyle.Top;
                            tempLabel.Size = new System.Drawing.Size(35, 13);
                            tempLabel.TabIndex = tabIndex;

                            // tempReflexive is the reflexive and all data (incl other reflexives) within it
                            ReflexiveControl tempReflexive = new ReflexiveControl(mapnumber, meta.offset, ((IFPIO.Reflexive)ctl).HasCount, ctl.lineNumber, this);
                            //tempReflexive.Location = new System.Drawing.Point(10, 0);
                            tempReflexive.Name = "reflexive";
                            tempReflexive.TabIndex = tabIndex;
                            tempReflexive.LoadENTControls((IFPIO.Reflexive)ctl, ((IFPIO.Reflexive)ctl).items,
                                                           true, 0, ref tabIndex, ctl.offset.ToString());

                            // Label, Combobox & Button are always added ( = 3)
                            if (!(tempReflexive.Controls.Count <= 2 && skipEmptyReflex))
//.........这里部分代码省略.........
开发者ID:troymac1ure,项目名称:Entity,代码行数:101,代码来源:MetaEditorControlPage.cs

示例2: loadControls

        private void loadControls(TreeNode Location)
        {
            toolTip1.AutoPopDelay = 10000;
            reflexiveData rd = (reflexiveData)Location.Tag;

            if (rd.chunkCount > 100000) // Some very large number
                throw new Exception("\"" + rd.node.Text + "\" appears to contain " + rd.chunkCount + "chunks!\n"
                    + "Try reloading tag. If problem persists, you likely have a corrupt map!");

            int chNum = rd.chunkSelected;
            bool enabled = rd.chunkCount != 0;
            int metaOffset = rd.baseOffset;

            // Make our panel non-visibile while we create our controls
            Panel panel = this.panelMetaEditor;
            panel.Visible = false;

            // Dispose of each control and also add a safety  in case we somehow go into an endless loop (max 1000)
            int safetyCount = 1000;
            while (panel.Controls.Count > 0 && safetyCount > 0)
            {
                panel.Controls[0].Dispose();
                safetyCount--;
            }
            // Should be empty, but clear anyways.
            panel.Controls.Clear();

            Object[] o;
            if (rd.reflexive == null)
                o = ifp.items;
            else
                o = rd.reflexive.items;

            bool labelFound = false;
            int tabIndex = 0;
            foreach (IFPIO.BaseObject ctl in o)
            {
                tabIndex++;
                try
                {
                    switch (ctl.ObjectType)
                    {
                        case IFPIO.ObjectEnum.Struct:
                            {
            #if DEBUG
                                if (((IFPIO.Reflexive)ctl).chunkSize == 1)
                                {
                                    System.IO.BinaryReader BR = new System.IO.BinaryReader(meta.MS);
                                    BR.BaseStream.Position = ctl.offset + metaOffset;
                                    int chunkCount = BR.ReadInt32();
                                    if (chunkCount == 0)
                                        continue;
                                    int chunkOffset = BR.ReadInt32() - meta.magic;
                                    int tagIndex = map.Functions.ForMeta.FindMetaByOffset(chunkOffset);

                                    StringBox sb = new StringBox(meta, ctl.name + " (reflexive)", map, ctl.offset, ctl.lineNumber, 0);

                                    if (enabled) sb.Populate(metaOffset, tagIndex == meta.TagIndex);
                                    if (sb.size > 0)
                                    {
                                        panelMetaEditor.Controls.Add(sb);
                                        sb.BringToFront();
                                    }
                                    //panelMetaEditor.Controls[0].Controls[2].GotFocus += new EventHandler(MetaEditorControlPage_GotFocus);
                                }
            #endif
                                /*
                            if (Meta_Editor.MetaEditor.ShowReflexives == false)
                                break;
                            // tempLabel is a blank space located above reflexives
                            Label tempLabel = new Label();
                            tempLabel.AutoSize = true;
                            tempLabel.Location = new System.Drawing.Point(0, 0);
                            tempLabel.Name = "label1";
                            tempLabel.Dock = DockStyle.Top;
                            tempLabel.Size = new System.Drawing.Size(35, 13);
                            tempLabel.TabIndex = tabIndex;

                            // tempReflexive is the reflexive and all data (incl other reflexives) within it
                            ReflexiveControl tempReflexive = new ReflexiveControl(mapnumber, meta.offset, ((IFPIO.Reflexive)ctl).HasCount, ctl.lineNumber, this);
                            //tempReflexive.Location = new System.Drawing.Point(10, 0);
                            tempReflexive.Name = "reflexive";
                            tempReflexive.TabIndex = tabIndex;
                            tempReflexive.LoadENTControls((IFPIO.Reflexive)ctl, ((IFPIO.Reflexive)ctl).items,
                                                           true, 0, ref tabIndex, ctl.offset.ToString());

                            // Label, Combobox & Button are always added ( = 3)
                            if (!(tempReflexive.Controls.Count <= 2 && skipEmptyReflex))
                            {
                                panelMetaEditor.Controls.Add(tempLabel);
                                panelMetaEditor.Controls[panelMetaEditor.Controls.Count - 1].BringToFront();
                                panelMetaEditor.Controls.Add(tempReflexive);
                                panelMetaEditor.Controls[panelMetaEditor.Controls.Count - 1].BringToFront();
                            }
                            break;
                            */
                                continue;
                            }
                        case IFPIO.ObjectEnum.Block:
                            {
//.........这里部分代码省略.........
开发者ID:nolenfelten,项目名称:Entity,代码行数:101,代码来源:MetaEditorControlPage.cs


注:本文中的Enums.BringToFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。