本文整理汇总了C#中IGumpComponent类的典型用法代码示例。如果您正苦于以下问题:C# IGumpComponent类的具体用法?C# IGumpComponent怎么用?C# IGumpComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGumpComponent类属于命名空间,在下文中一共展示了IGumpComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
}
示例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;
}
}
示例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();
}
}
示例8: onElementZOrderChangeDownButtonClick
public void onElementZOrderChangeDownButtonClick(IGumpComponent gumpComponent, object param)
{
ChangeZOrder(gumpComponent, Z_ORDER_CHANGE_DOWN);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例13: onPropertyPrevPageButtonClick
public void onPropertyPrevPageButtonClick(IGumpComponent gumpComponent, object param)
{
EditorState.PropertiesCurrentPageNumber--;
EditorState.Refresh();
}
示例14: onElementPrevPageButtonClick
public void onElementPrevPageButtonClick(IGumpComponent gumpComponent, object param)
{
EditorState.ElementToolbarPageNumber--;
EditorState.Refresh();
}
示例15: onApplyPropertiesButtonClick
public void onApplyPropertiesButtonClick(IGumpComponent gumpComponent, object param)
{
EditorState.Refresh();
}