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

C# IGumpComponent类代码示例

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

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



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

示例1: onEditPageButtonClick

        public void onEditPageButtonClick(IGumpComponent gumpComponent, object param)
        {
            if (m_caller.AccessLevel < AccessLevel.Administrator)
            {
                return;
            }

            try
            {
                CompendiumEditorState state = new CompendiumEditorState();
                state.PageName = Renderer.Name;
                state.Caller = (PlayerMobile)m_caller;
                state.RendererToEdit = (CompendiumPageRenderer)Renderer.Clone();

                state.RendererToEdit.SelectedElement = null;
                state.EditorInstance = new CompendiumPageEditor(state);
                state.RendererToEdit.State = state;
                state.ElementListGump = new ElementListGump(state);

                state.PreviewGump = new CompendiumPreviewPageGump(state.Caller, state.RendererToEdit);

                state.EditorInstance.Send();
                state.ElementListGump.Send();
                state.PreviewGump.Send();
            }
            catch (Exception e)
            {
                Console.WriteLine("An exception was caught while trying to edit Compendium page.");
                Console.WriteLine(e);
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:31,代码来源:CompendiumPageGump.cs


示例2: onHyperlinkClick

        public virtual void onHyperlinkClick(IGumpComponent gumpComponent, object param)
        {
            GumpButton button = gumpComponent as GumpButton;

            if (button != null)
            {
                try
                {
                  string linkName = m_hyperlinkRegistry.Where(element => element.Value == button.Param).First().Key;
                  
                  if (Compendium.g_CompendiumRenderers.ContainsKey(linkName))
                  {
                      CompendiumPageGump gump = new CompendiumPageGump(m_caller, Compendium.g_CompendiumRenderers[linkName]);
                      gump.Send();
                  }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Bad CompendiumPageGump link");
                    Console.WriteLine(e);
                    this.Refresh();
                }
            }
            //lookup the hyperlink from the param and open the gump
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:25,代码来源:CompendiumPageGump.cs


示例3: Add

        public void Add(IGumpComponent g)
        {
            if (g.Parent == null)
                g.Parent = this;

            if (!this._Entries.Contains((IGumpComponent)g))
            {
                g.X += _X;
                g.Y += _Y;

                this._Entries.Add((IGumpComponent)g);
                this.Invalidate();
            }
        }
开发者ID:havik,项目名称:ForkUO,代码行数:14,代码来源:Gumpling.cs


示例4: Add

		public void Add(IGumpComponent g)
		{
			if (g.Container == null)
			{
				g.Container = this;
			}

			if (!_Entries.Contains(g))
			{
				g.X += _X;
				g.Y += _Y;

				_Entries.Add(g);
				Invalidate();
			}
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:16,代码来源:Gumpling.cs


示例5: onGumpNameEntryUpdate

        public void onGumpNameEntryUpdate(IGumpComponent gumpComponent, object param)
        {
            GumpTextEntry entry = gumpComponent as GumpTextEntry;

            if (entry != null)
            {
                string gumpname = entry.InitialText;
                if (gumpname.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) >= 0)
                {
                    m_displayErrorMessage = true;
                }
                else
                {
                    m_gumpName = gumpname;
                    m_displayErrorMessage = false;
                }
            }
        }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:18,代码来源:SaveAs.cs


示例6: AddGumpEntryFirst

        public static void AddGumpEntryFirst(this Gump gump, IGumpComponent g)
        {
            if (g is GumpEntry)
            {
                if (!gump.Entries.Contains((GumpEntry)g))
                {
                    if (AssignIdMethodInfo != null)
                    {
                        AssignIdMethodInfo.Invoke((GumpEntry)g, new object[] { });
                    }
                    gump.Entries.Insert(0, (GumpEntry)g);
                    gump.Invalidate();
                }
            }

            if (g.Container == null)
            {
                g.Container = gump;
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:20,代码来源:HyperLink.cs


示例7: onSaveButtonClick

        public void onSaveButtonClick(IGumpComponent gumpComponent, object param)
        {
            if (!m_displayErrorMessage && !string.IsNullOrEmpty(m_gumpName) && !string.IsNullOrWhiteSpace(m_gumpName))
            {
                m_state.RendererToEdit.Name = m_gumpName;

                m_state.RendererToEdit.Serialize();

                if (Compendium.g_CompendiumRenderers.ContainsKey(m_state.RendererToEdit.Name))
                {
                    Compendium.g_CompendiumRenderers[m_state.RendererToEdit.Name] = m_state.RendererToEdit;
                }
                else
                {
                    Compendium.g_CompendiumRenderers.Add(m_state.RendererToEdit.Name, m_state.RendererToEdit);
                }

                m_state.Refresh();
            }
            else
            {
                this.Refresh();
            }
        }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:24,代码来源:SaveAs.cs


示例8: onElementZOrderChangeDownButtonClick

 public void onElementZOrderChangeDownButtonClick(IGumpComponent gumpComponent, object param)
 {
     ChangeZOrder(gumpComponent, Z_ORDER_CHANGE_DOWN);
 }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:4,代码来源:ElementListGump.cs


示例9: onSelectElementButtonClick

        public void onSelectElementButtonClick(IGumpComponent gumpComponent, object param)
        {
            GumpButton button = gumpComponent as GumpButton;

            if (button != null)
            {
                int idx = button.Param;
                if (m_editorState.RendererToEdit.Elements.Count > idx)
                {
                    var elements = m_editorState.RendererToEdit.Elements.OrderBy(element => element.Z);

                    if (m_editorState.SelectedElement == elements.ElementAt(idx))
                    {
                        m_editorState.SelectedElement = null;
                        m_editorState.RendererToEdit.SelectedElement = null;
                    }
                    else
                    {
                        m_editorState.SelectedElement = elements.ElementAt(idx);
                        m_editorState.RendererToEdit.SelectedElement = elements.ElementAt(idx);
                    }
                }
            }

            m_editorState.Refresh();
        }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:26,代码来源:ElementListGump.cs


示例10: onBottomButtonClick

        public void onBottomButtonClick(IGumpComponent gumpComponent, object param)
        {
            GumpButton button = gumpComponent as GumpButton;

            if (button != null)
            {
                int idx = button.Param;
                var elements = m_editorState.RendererToEdit.Elements.OrderBy(element => element.Z);

                if (idx < elements.Count() - 1)
                {
                    BaseCompendiumPageElement lower = elements.ElementAt(elements.Count() - 1);
                    m_editorState.SelectedElement.Z = lower.Z + 1;

                    var changedElements = m_editorState.RendererToEdit.Elements.OrderBy(element => element.Z);
                    int newIdx = changedElements.FindIndex(element => element == m_editorState.SelectedElement);
                    m_editorState.ElementListGumpCurrentPageNumber = newIdx / NUMBER_OF_ELEMENTS_PER_PAGE;
                }
            }

            m_editorState.Refresh();
        }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:22,代码来源:ElementListGump.cs


示例11: onDeleteButtonClick

        public void onDeleteButtonClick(IGumpComponent gumpComponent, object param)
        {
            GumpButton button = gumpComponent as GumpButton;

            if (button != null)
            {
                try
                {
                    int idx = button.Param;
                    var elements = m_editorState.RendererToEdit.Elements.OrderBy(element => element.Z);
                    BaseCompendiumPageElement elementToRemove = m_editorState.SelectedElement;
                    BaseCompendiumPageElement elementToSelect = null;

                    int count = elements.Count();

                    if (count > 1)
                    {
                        if (idx < count - 1)
                        {
                            elementToSelect = elements.ElementAt(idx + 1);
                        }
                        else if (idx == count - 1)
                        {
                            elementToSelect = elements.ElementAt(idx - 1);
                        }
                    }

                    m_editorState.SelectedElement = elementToSelect;
                    m_editorState.RendererToEdit.SelectedElement = elementToSelect;
                    m_editorState.RendererToEdit.Elements.Remove(elementToRemove);


                }
                catch (Exception e)
                {
                    if (Compendium.LOG_ERRORS)
                    {
                        Console.WriteLine("An exception was caught while trying to delete a compendium element");
                        Console.WriteLine(e);
                    }
                }
            }

            m_editorState.Refresh();
        }
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:45,代码来源:ElementListGump.cs


示例12: Remove

		public void Remove(IGumpComponent g)
		{
			if (g is GumpEntry)
			{
				_Entries.Remove((GumpEntry)g);
				g.Container = null;
				Invalidate();
			}
			else if (g is Gumpling)
			{
				((Gumpling)g).RemoveFromGump(this);
				Invalidate();
			}
		}
开发者ID:mtPrimo,项目名称:ServUO,代码行数:14,代码来源:Gump.cs


示例13: onPropertyPrevPageButtonClick

 public void onPropertyPrevPageButtonClick(IGumpComponent gumpComponent, object param)
 {
     EditorState.PropertiesCurrentPageNumber--;
     EditorState.Refresh();
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:5,代码来源:CompendiumPageEditor.cs


示例14: onElementPrevPageButtonClick

 public void onElementPrevPageButtonClick(IGumpComponent gumpComponent, object param)
 {
     EditorState.ElementToolbarPageNumber--;
     EditorState.Refresh();
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:5,代码来源:CompendiumPageEditor.cs


示例15: onApplyPropertiesButtonClick

 public void onApplyPropertiesButtonClick(IGumpComponent gumpComponent, object param)
 {
     EditorState.Refresh();
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:4,代码来源:CompendiumPageEditor.cs


示例16: onSaveAsButtonClick

 public void onSaveAsButtonClick(IGumpComponent gumpComponent, object param)
 {
     EditorState.Refresh();
     Timer.DelayCall(ShowSaveAs, EditorState);
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:5,代码来源:CompendiumPageEditor.cs


示例17: Add

		public void Add(IGumpComponent g)
		{
			if (g.Container == null)
			{
				g.Container = this;
			}

			if (g is GumpEntry)
			{
				if (!_Entries.Contains((GumpEntry)g))
				{
					((GumpEntry)g).AssignID();
					_Entries.Add((GumpEntry)g);
					Invalidate();
				}
			}
			else if (g is Gumpling)
			{
				((Gumpling)g).AddToGump(this);
			}
		}
开发者ID:mtPrimo,项目名称:ServUO,代码行数:21,代码来源:Gump.cs


示例18: onSavePageButtonClick

        public void onSavePageButtonClick(IGumpComponent gumpComponent, object param)
        {
            EditorState.RendererToEdit.Serialize();

            if (Compendium.g_CompendiumRenderers.ContainsKey(EditorState.RendererToEdit.Name))
            {
                Compendium.g_CompendiumRenderers[EditorState.RendererToEdit.Name] = EditorState.RendererToEdit;
            }
            else
            {
                Compendium.g_CompendiumRenderers.Add(EditorState.RendererToEdit.Name, EditorState.RendererToEdit);
            }

            EditorState.Refresh();
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:15,代码来源:CompendiumPageEditor.cs


示例19: Remove

		public void Remove(IGumpComponent g)
		{
			_Entries.Remove(g);
			g.Container = null;
			Invalidate();
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:6,代码来源:Gumpling.cs


示例20: onNavigateButtonClick

        public void onNavigateButtonClick(IGumpComponent gumpComponent, object param)
        {
            GumpButton button = gumpComponent as GumpButton;
            if (button != null && EditorState != null && EditorState.SelectedElement != null)
            {
                switch (button.Param)
                {
                    case (int)NavButtonDirection.Up:
                    {
                        EditorState.SelectedElement.Y--;
                    }
                    break;

                    case (int)NavButtonDirection.UpUp:
                    {
                        EditorState.SelectedElement.Y -= 5;
                    }
                    break;

                    case (int)NavButtonDirection.Right:
                    {
                        EditorState.SelectedElement.X++;
                    }
                    break;

                    case (int)NavButtonDirection.RightRight:
                    {
                        EditorState.SelectedElement.X += 5;
                    }
                    break;

                    case (int)NavButtonDirection.Down:
                    {
                        EditorState.SelectedElement.Y++;
                    }
                    break;

                    case (int)NavButtonDirection.DownDown:
                    {
                        EditorState.SelectedElement.Y += 5;
                    }
                    break;

                    case (int)NavButtonDirection.Left:
                    {
                        EditorState.SelectedElement.X--;
                    }
                    break;

                    case (int)NavButtonDirection.LeftLeft:
                    {
                        EditorState.SelectedElement.X -= 5;
                    }
                    break;
                }
            }

            EditorState.Refresh();
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:59,代码来源:CompendiumPageEditor.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IGumpWriter类代码示例发布时间:2022-05-24
下一篇:
C# IGuildMember类代码示例发布时间: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