• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TomShane类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TomShane的典型用法代码示例。如果您正苦于以下问题:C# TomShane类的具体用法?C# TomShane怎么用?C# TomShane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TomShane类属于命名空间,在下文中一共展示了TomShane类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EraseToolBehavior

        public void EraseToolBehavior(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            CurrentToolSystem toolSys = (CurrentToolSystem)(world.SystemManager.GetSystem<CurrentToolSystem>()[0]);
            toolSys.SetCurrentTool(CustomControls.Tool.ERASE_TOOL);

            HighligthButton(eraserTool);
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:7,代码来源:ToolbarSystem.cs


示例2: SaveBtn_Click

 /// <summary>
 /// When the saved button is clicked
 /// </summary>
 void SaveBtn_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (Edit)
     {
         //TODO: Add validation and error handling
         string[] address = AddressTxt.Text.Split(':');
         string IP;
         int port = 0;
         IP = address[0];
         if (address.Length > 1)
             port = int.Parse(address[1]);
         ServerList.EditServer(Index, new ServerSaveData(NameTxt.Text, IP, port));
     }
     else
     {
         //TODO: Add validation and error handling
         string[] address = AddressTxt.Text.Split(':');
         string IP;
         int port = 0;
         IP = address[0];
         if (address.Length > 1)
             port = int.Parse(address[1]);
         ServerList.AddServer(new ServerSaveData(NameTxt.Text, IP, port));
     }
     Close();
 }
开发者ID:Express50,项目名称:Bricklayer,代码行数:29,代码来源:AddServerDialog.cs


示例3: DrawControl

        protected override void DrawControl(TomShane.Neoforce.Controls.Renderer renderer, Microsoft.Xna.Framework.Rectangle rect, Microsoft.Xna.Framework.GameTime gameTime)
        {
            Color color = Color.White;
            color.A = imageOpacity;

            base.DrawControl(renderer, rect, gameTime);
            renderer.Draw(image, rect, color);
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:8,代码来源:ImageBasedButton.cs


示例4: canvasWindow_MouseClick

 private void canvasWindow_MouseClick(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     TomShane.Neoforce.Controls.MouseEventArgs ev = (TomShane.Neoforce.Controls.MouseEventArgs)(e);
     if (ev.Button == MouseButton.Right)
     {
         RadialMenuSystem radial = (RadialMenuSystem)world.SystemManager.GetSystem<RadialMenuSystem>()[0];
         radial.toggleRadialMenu();
     }
 }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:9,代码来源:CanvasControlSystem.cs


示例5: ExportMapBehavior

 public void ExportMapBehavior(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     Button btn = (Button)sender;
     btn.Focused = false;
     System.Windows.Forms.SaveFileDialog exportMapDialog = new System.Windows.Forms.SaveFileDialog();
     exportMapDialog.InitialDirectory = Convert.ToString(Environment.SpecialFolder.CommonProgramFilesX86);
     exportMapDialog.Filter = "Map files (*.datmap)|*.datmap";
     exportMapDialog.FilterIndex = 1;
     exportMapDialog.Title = "Export your map";
     exportMapDialog.FileOk += new System.ComponentModel.CancelEventHandler(SuccessfullyExportedMap);
     exportMapDialog.ShowDialog();
 }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:12,代码来源:ToolbarSystem.cs


示例6: ShowSimpleInputDialog

        /// <summary>
        /// Shows the simple input dialog.
        /// </summary>
        public void ShowSimpleInputDialog(Manager manager, string caption, string text, string initialValue,
            TomShane.Neoforce.Controls.EventHandler okBtnEventHandler)
        {
            window = new Window(manager);
            window.Init();
            window.Width = 450;
            window.Height = 150;
            window.Text = caption;
            window.Closing += OnSimpleInputDialogClosing;
            window.Visible = true;

            Label label = new Label(manager);
            label.Init();
            label.Text = text;
            label.Width = 400;
            label.Height = 20;
            label.Left = 5;
            label.Top = 5;
            label.Parent = window;

            TextBox textBox = new TextBox(manager);
            textBox.Init();
            textBox.Width = 400;
            textBox.Height = 20;
            textBox.Left = 5;
            textBox.Top = 40;
            textBox.Text = initialValue;
            textBox.Parent = window;

            Button btnSimpleInputDialogOk = new Button(manager);
            btnSimpleInputDialogOk.Init();
            btnSimpleInputDialogOk.Text = "Ok";
            btnSimpleInputDialogOk.Width = 100;
            btnSimpleInputDialogOk.Height = 30;
            btnSimpleInputDialogOk.Left = 5;
            btnSimpleInputDialogOk.Top = 75;
            btnSimpleInputDialogOk.Click += okBtnEventHandler;
            btnSimpleInputDialogOk.Click += OnClickBtnSimpleInputDialogOk;
            btnSimpleInputDialogOk.Tag = textBox; // Textbox as Tag, to access the value
            btnSimpleInputDialogOk.Parent = window;

            Button btnSimpleInputDialogCancel = new Button(manager);
            btnSimpleInputDialogCancel.Init();
            btnSimpleInputDialogCancel.Text = "Cancel";
            btnSimpleInputDialogCancel.Width = 100;
            btnSimpleInputDialogCancel.Height = 30;
            btnSimpleInputDialogCancel.Left = 110;
            btnSimpleInputDialogCancel.Top = 75;
            btnSimpleInputDialogCancel.Click += OnClickBtnSimpleInputDialogCancel;
            btnSimpleInputDialogCancel.Parent = window;

            manager.Add(window);
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:56,代码来源:SimpleInputDialog.cs


示例7: DrawControl

        protected override void DrawControl(TomShane.Neoforce.Controls.Renderer renderer, 
            Microsoft.Xna.Framework.Rectangle rect,
            Microsoft.Xna.Framework.GameTime gameTime)
        {
            //renderer.Draw(tilemapImage, rect, Color.White);
            //renderer.Draw(tileSelectorImage, selectorRect, Color.White);
            /*Vector2 offset = new Vector2(-m_windowParent.ScrollBarValue.Horizontal,
                -m_windowParent.ScrollBarValue.Vertical);*/

            m_undoTree.draw(renderer.SpriteBatch,
                new Vector2(Parent.AbsoluteLeft, Parent.AbsoluteTop));

            // resizing
            /*
            Width = Math.Max(OriginWidth,(int)tck);
            Height = Math.Max(OriginHeight, (int)(tck*0.1f));
            //m_windowParent.Width = (int)tck;
            m_windowParent.MovableArea = new Rectangle(0,0,(int)tck,(int)(tck*0.1f));
             * */
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:20,代码来源:UndoTreeContainer.cs


示例8: okButton_Click

 void okButton_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     Close();
 }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:4,代码来源:UnitInfoDialog.cs


示例9: lstMain_ItemIndexChanged

        void lstMain_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            ListBox listbox = (ListBox)sender;
            //remove panelControl elements (from groupPanel at the bottom)
            if (inspectorArea.propertyEditPanel.panelControls.Keys.Count > 0)
            {
                inspectorArea.propertyEditPanel.DisableControls();
            }

            if (listbox.ItemIndex >= 0 && listbox.Items.ElementAt(listbox.ItemIndex) is Node)
            {
                SetTargetNode((Node)listbox.Items.ElementAt(listbox.ItemIndex));
            }
            else if (listbox.ItemIndex >= 0)
            {
                //ResetInspectorBox(inspectorArea.InsBox, listbox.Items.ElementAt(listbox.ItemIndex));
                inspectorArea.ResetInspectorBox(listbox.Items.ElementAt(listbox.ItemIndex));
            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:19,代码来源:Sidebar.cs


示例10: consolePressed

 void consolePressed(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (sender is Button || (sender is TextBox && (((KeyEventArgs)e).Key == Keys.Enter)))
         ProcessConsoleCommand(consoletextbox.Text);
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:5,代码来源:Sidebar.cs


示例11: cbPresets_ItemIndexChanged

 void cbPresets_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     ComboBox combobox = (ComboBox)sender;
     if (combobox.ItemIndex != lstPresets.ItemIndex)
     {
         lstPresets.ItemIndex = combobox.ItemIndex;
     }
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:8,代码来源:Sidebar.cs


示例12: btnDefaultNode_Click

 void btnDefaultNode_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     SetDefaultNodeAsEdit();
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:4,代码来源:Sidebar.cs


示例13: btnAddComponent_Click

 void btnAddComponent_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (inspectorArea.editNode == null)
         PopUp.Toast("You haven't selected a Node.");
     else
     {
         new AddComponentWindow(this, tbcMain, inspectorArea.editNode, null, false);
         //ObservableCollection<dynamic> nodecomplist = new ObservableCollection<dynamic>((Enum.GetValues(typeof(comp)).Cast<dynamic>().Where(c => !inspectorArea.editNode.HasComp(c))));
         //List<dynamic> missingcomps = new List<dynamic>(Enum.GetValues(typeof(comp)).Cast<dynamic>().Where(c => inspectorArea.editNode.HasComp(c)));
         //
         //PopUp.opt[] options = new PopUp.opt[]{
         //    new PopUp.opt(PopUp.OptType.info, "Add component to: " + inspectorArea.editNode.name),
         //    new PopUp.opt(PopUp.OptType.dropDown, nodecomplist),
         //    new PopUp.opt(PopUp.OptType.checkBox, "Add to all",
         //        delegate(object s, TomShane.Neoforce.Controls.EventArgs a){
         //            if ((s as CheckBox).Checked) nodecomplist.AddRange(missingcomps);
         //            else nodecomplist.RemoveRange(missingcomps);})};
         //
         //PopUp.makePopup(ui, options, "Add Component", delegate(bool a, object[] o)
         //{
         //    if (a) return addComponent(o);
         //    else return false;
         //});
     }
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:25,代码来源:Sidebar.cs


示例14: InsBox_ItemIndexChanged

        void InsBox_ItemIndexChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            ListBox InsBox = (ListBox)sender;

            if (InsBox.ItemIndex < 0 || InsBox.Items.Count == 0) return;
            InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);

            //UpdateGroupPanel(item, groupPanel);
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:9,代码来源:InspectorArea.cs


示例15: InsBox_DoubleClick

        void InsBox_DoubleClick(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            //InspectorBox InsBox = (InspectorBox)sender;
            MouseEventArgs mouseArgs = (MouseEventArgs)e;
            if (mouseArgs.Button == MouseButton.Left)
            {
                if (InsBox.ItemIndex < 0 || InsBox.Items.Count == 0 || InsBox.ItemIndex >= InsBox.Items.Count) return;
                InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);
                item.DoubleClickItem(this);
                InspectorInfo temp = ActiveInspectorParent;
                string lbltext = "/" + temp.Name();
                while (temp.parentItem != null)
                {
                    temp = temp.parentItem;
                    lbltext = lbltext.Insert(0, "/" + temp.Name());
                }
                if (!OverrideString.Item1)
                {
                    lblInspectorAddress.Text = lbltext;
                }
                //Type t = item.obj.GetType();

                //if (activeInspectorItem != item)
                //    propertyEditPanel.UpdatePanel(item);

            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:27,代码来源:InspectorArea.cs


示例16: btnRemoveAllNodes_Click

        public void btnRemoveAllNodes_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            if (sender != null)
                (sender as Button).Focused = false;

            Group g = GetActiveGroup();
            if (g == null) return;
            if (room.targetNode != null)
                if (g.fullSet.Contains(room.targetNode)) room.targetNode = null;
            if (g.fullSet.Contains(inspectorArea.editNode) && inspectorArea.editNode != g.defaultNode)
            {
                inspectorArea.InsBox.Items.Clear();
                inspectorArea.rootitem = null;
                inspectorArea.editNode = null;
            }
            //int size = g.fullSet.Count, count = 0;
            g.EmptyGroup();

            lstMain.ItemIndex = -1;
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:20,代码来源:Sidebar.cs


示例17: applyToAllNodesMenuItem_Click

        //TODO: fix the relection copying reference types
        void applyToAllNodesMenuItem_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            List<InspectorInfo> itemspath = new List<InspectorInfo>();
            InspectorInfo item = (InspectorInfo)inspectorArea.InsBox.Items.ElementAt(inspectorArea.InsBox.ItemIndex);
            object value = item.GetValue();

            BuildItemsPath(item, itemspath);

            Group activeGroup = GetActiveGroup();
            if (activeGroup == null) return;
            activeGroup.ForEachAllSets(delegate(Node o)
            {
                Node n = (Node)o;
                if (n == itemspath.ElementAt(0).obj) return;
                InspectorInfo temp = new InspectorInfo(null, n, this);
                int count = 0;
                foreach (InspectorInfo pathitem in itemspath)
                {
                    if (temp.obj.GetType() != pathitem.obj.GetType())
                    {
                        Console.WriteLine("The paths did not match while applying to all. {0} != {1}", temp.obj.GetType(), pathitem.obj.GetType());
                        break;
                    }
                    if (count == itemspath.Count - 1) //last item
                    {
                        if (pathitem.membertype == member_type.dictentry)
                        {
                            dynamic dict = temp.parentItem.obj;
                            dynamic key = pathitem.key;
                            if (!dict.ContainsKey(key)) break;
                            if (dict[key] is Component)
                            {
                                dict[key].active = ((Component)value).active;
                            }
                            else if (temp.IsPanelType())
                            {
                                dict[key] = value;
                            }
                        }
                        else
                        {
                            if (value is Component)
                            {
                                ((Component)temp.obj).active = ((Component)value).active;
                            }
                            else if (temp.IsPanelType())
                            {
                                temp.fpinfo.SetValue(value, temp.parentItem.obj);
                            }
                        }
                    }
                    else
                    {
                        InspectorInfo next = itemspath.ElementAt(count + 1);
                        if (next.membertype == member_type.dictentry)
                        {
                            dynamic dict = temp.obj;
                            dynamic key = next.key;
                            if (!dict.ContainsKey(key)) break;
                            temp = new InspectorInfo(null, temp, dict[key], key);
                        }
                        //else if (next.membertype == member_type.collectionentry)
                        //{
                        //    dynamic coll = temp.obj;
                        //
                        //}
                        else
                        {
                            if (next.fpinfo.propertyInfo == null)
                            {
                                temp = new InspectorInfo(null, temp, next.fpinfo.GetValue(temp.obj), next.fpinfo.fieldInfo);
                            }
                            else
                            {
                                temp = new InspectorInfo(null, temp, next.fpinfo.GetValue(temp.obj), next.fpinfo.propertyInfo);
                            }
                        }
                    }
                    count++;
                }
            });
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:83,代码来源:Sidebar.cs


示例18: removeComponentMenuItem_Click

        void removeComponentMenuItem_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);
            if (!(item.obj is Component))
            {
                Console.WriteLine("Error: The list item was not a component.");
                return;
            }
            Component component = (Component)item.obj;
            if (component is Movement || component is Collision)
            {
                return;
            }

            if (item.parentItem.parentItem.obj is Node)
            {
                component.active = false;
                editNode.RemoveComponent(component.GetType());
                item.RemoveChildren();
                InsBox.Items.Remove(item);
            }
            else if (item.parentItem.parentItem.obj is Link)
            {
                component.active = false;
                Link link = (Link)item.parentItem.parentItem.obj;
                //link.components.Remove(component as ILinkable);
                link.components.Remove(component.GetType());
                item.RemoveChildren();
                InsBox.Items.Remove(item);
            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:31,代码来源:InspectorArea.cs


示例19: btnClear_Click

 void btnClear_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
 {
     if (e is KeyEventArgs)
     {
         KeyEventArgs ke = (KeyEventArgs)e;
         if (ke.Key == Keys.Enter)
         {
             TextBox textbox = (TextBox)sender;
             textbox.Text = "";
         }
     }
     else
     {
         consoletextbox.Text = "";
     }
 }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:16,代码来源:Sidebar.cs


示例20: removeLinkMenuItem_Click

        void removeLinkMenuItem_Click(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            InspectorInfo item = (InspectorInfo)InsBox.Items.ElementAt(InsBox.ItemIndex);
            if (!(item.obj is Link))
            {
                Console.WriteLine("Error: The list item was not a link.");
                return;
            }

            Link link = (Link)item.obj;
            if (item.parentItem.obj is ObservableHashSet<Link>)
            {
                //Console.WriteLine("ObservableHashSet<Link> has been observed.");
                ObservableHashSet<Link> set = (ObservableHashSet<Link>)item.parentItem.obj;
                set.Remove(link);
                link.DeleteLink();

                item.parentItem.DoubleClickItem(this);

            }
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:21,代码来源:InspectorArea.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tool类代码示例发布时间:2022-05-24
下一篇:
C# Tokens类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap