private void subLootDel_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete?", Application.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { ListViewItem lvi = lvLootList.SelectedItems[0]; int nSelected = lvi.Index; if (lvi != null && lvi.Tag != null && ((lvi.Tag.GetType() == typeof(SHLootSoul) || lvi.Tag.GetType() == typeof(SHLootSilver) || lvi.Tag.GetType() == typeof(SHLootItem)))) { SHLoot loot = lvLootList.Tag as SHLoot; if (loot != null) { loot.dataList.Remove(lvi.Tag); m_ListViewController.SetListText(pgLoot.Tag as ListViewItem, loot); ProcessLoot(loot, lvLootList); lvLootList.SelectedIndices.Clear(); SHListViewUtil.SelectIndex(lvLootList, nSelected); Global._VelixianForms.FindForm("LOOTING").Touch(); } } } }
public void PasteDataObject() { if (m_nCopyObjectID <= 0) { return; } if (m_ListView.SelectedItems.Count <= 0) { return; } ListViewItem lvi = m_ListView.SelectedItems[0]; if (lvi == null || lvi.Tag == null) { return; } SHDataObject tarDataObject = (SHDataObject)lvi.Tag; if (_PasteDataObject(tarDataObject) == false) { m_nCopyObjectID = 0; return; } SetListText(lvi, tarDataObject); SHListViewUtil.SelectIndex(m_ListView, lvi.Index); if (m_ListView.SelectedItems.Count > 0) { m_ListView.SelectedItems[0].EnsureVisible(); } }
private void lvLooting_SelectedIndexChanged(object sender, EventArgs e) { if (lvLooting.SelectedItems.Count > 0) { ListViewItem lvi = lvLooting.SelectedItems[0]; if (lvi != null && lvi.Tag != null && lvi.Tag.GetType() == typeof(SHLoot)) { SHLoot loot = (SHLoot)lvi.Tag; if (loot != null) { pgLoot.SelectedObject = loot; pgLoot.Tag = lvi; ProcessLoot(loot, lvLootList); SHListViewUtil.SelectIndex(lvLootList, 0); if (lvLootList.Items.Count == 0) { pgLootableDetail.SelectedObject = null; pgLootableDetail.Tag = null; } Global._mainForm.SetStatusLabelText(loot.CompiledMessage); } } } m_ListViewController.OnSelectedIndexChanged(); }
private void subLootAddItem_Click(object sender, EventArgs e) { SHLootItem item = new SHLootItem(); item.min = 0; item.max = 1; item.rate = 20; item.id = 0; if (lvLootList.Tag != null && lvLootList.Tag.GetType() == typeof(SHLoot)) { item.Compile(); item.Build(xmlCore); ((SHLoot)lvLootList.Tag).Add(item); ListViewItem lvi = new ListViewItem(); ProcessLootItem(lvi, item); lvLootList.Items.Add(lvi); SHListViewUtil.SelectIndex(lvLootList, lvi.Index); m_ListViewController.SetListText(pgLoot.Tag as ListViewItem, lvLootList.Tag as SHLoot); } Global._VelixianForms.FindForm("LOOTING").Touch(); }
private void subLootAddSoul_Click(object sender, EventArgs e) { SHLootSoul soul = new SHLootSoul(); soul.min = 0; soul.max = 1; soul.rate = 10; soul.type = SHLootSoulType.C; if (lvLootList.Tag != null && lvLootList.Tag.GetType() == typeof(SHLoot)) { soul.Compile(); soul.Build(xmlCore); ((SHLoot)lvLootList.Tag).Add(soul); ListViewItem lvi = new ListViewItem(); ProcessLootSoul(lvi, soul); lvLootList.Items.Add(lvi); SHListViewUtil.SelectIndex(lvLootList, lvi.Index); m_ListViewController.SetListText(pgLoot.Tag as ListViewItem, lvLootList.Tag as SHLoot); } Global._VelixianForms.FindForm("LOOTING").Touch(); }
private void subLootAddSilver_Click(object sender, EventArgs e) { SHLootSilver silver = new SHLootSilver(); silver.min = 1; silver.max = 2; silver.rate = 50; if (lvLootList.Tag != null && lvLootList.Tag.GetType() == typeof(SHLoot)) { silver.Compile(); silver.Build(xmlCore); ((SHLoot)lvLootList.Tag).Add(silver); ListViewItem lvi = new ListViewItem(); ProcessLootSilver(lvi, silver); lvLootList.Items.Add(lvi); SHListViewUtil.SelectIndex(lvLootList, lvi.Index); m_ListViewController.SetListText(pgLoot.Tag as ListViewItem, lvLootList.Tag as SHLoot); } Global._VelixianForms.FindForm("LOOTING").Touch(); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.ITEM, lvItems, "ITEM", xmlCore.Items.LoadingFailed, null, null, null); } m_ListViewController = new ItemListViewController(xmlCore, xmlCore.Items, xmlCore.Items.dataList, lvItems, cbItemFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvItems, 0); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.LOOTING, lvLooting, "LOOTING", xmlCore.Lootings.LoadingFailed, null, null, xmlCore.SaveLootings); } m_ListViewController = new LootListViewController(xmlCore, xmlCore.Lootings, xmlCore.Lootings.dataList, lvLooting, cbLootFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvLooting, 0); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.ITEMCONDITION, lvIConditions, "ITEMCONDITION", xmlCore.ItemConditions.LoadingFailed, null, null, xmlCore.SaveItemConditions); } m_ListViewController = new ItemConditionsListViewController(xmlCore, xmlCore.ItemConditions, xmlCore.ItemConditions.dataList, lvIConditions, cbIConditionFilter); m_ListViewController.InitListView(null); lvIConditions.Tag = xmlCore.ItemConditions; SHListViewUtil.SelectIndex(lvIConditions, 0); }
public void AddItem(SHDataObject newDataObject) { ListViewItem lviNew = new ListViewItem(); SetListText(lviNew, newDataObject); m_ListView.Items.Add(lviNew); SHListViewUtil.SelectIndex(m_ListView, lviNew.Index); SortListView(newDataObject); if (m_ListView.SelectedItems.Count > 0) { m_ListView.SelectedItems[0].EnsureVisible(); } }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.STRING, lvStrings, "STRING", xmlCore.Strings.LoadingFailed, null, null, null); } lvStrings.Items.Clear(); foreach (SHString str in xmlCore.Strings.dataList) { ListViewItem lvi = new ListViewItem(); String_SetListText(lvi, str); lvStrings.Items.Add(lvi); } SHListViewUtil.SelectIndex(lvStrings, 0); }
public override void InitEditForm(MainForm mainForm) { if (wbDialogDetail.ObjectForScripting == null) { wbDialogDetail.ObjectForScripting = mainForm; } if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.DIALOG, lvDialogs, "DIALOG", xmlCore.Dialogs.LoadingFailed, null, null, xmlCore.SaveDialogs); } m_ListViewController = new DialogListViewController(xmlCore, xmlCore.Dialogs, xmlCore.Dialogs.dataList, lvDialogs, cbDialogFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvDialogs, 0); }
public override void InitEditForm(MainForm mainForm) { if (wbQuestDetail.ObjectForScripting == null) { wbQuestDetail.ObjectForScripting = mainForm; } if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.QUEST, lvQuests, "QUEST", xmlCore.Quests.LoadingFailed, null, null, xmlCore.SaveQuests); } m_ListViewController = new QuestListViewController(xmlCore, xmlCore.Quests, xmlCore.Quests.dataList, lvQuests, cbQuestFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvQuests, 0); }
/// <summary> /// 자바스크립트 호출용 인터페이스 /// </summary> /// <param name="type">탭페이지 Keyword</param> /// <param name="key">검색할 ID를 문자열로 담은 것</param> public void Navigate(String type, String id) { String szType = type.ToUpper(); Boolean bFound = false; VelixianForm MatchedTab = null; foreach (Int32 TabIndex in _Forms._TabPages.Keys) { MatchedTab = _Forms._TabPages[TabIndex]; if (MatchedTab.Keyword == szType) { MatchedTab.form.Show(dockPanel); bFound = true; break; } } if (bFound) { ListView searchView = MatchedTab.MainList; Int32 nSearchIndex = 0; ListViewItem lvi = null; while ((lvi = searchView.FindItemWithText(id, false, 0, true)) != null) { if (lvi.Text == id) { break; } nSearchIndex = lvi.Index; lvi = null; } if (lvi != null) { SHListViewUtil.SelectIndex(searchView, lvi.Index); } else { MessageBox.Show("잘못된 링크를 참조하고 있습니다.", Application.ProductName); } } }
public object DeleteSelectedItem() { ListViewItem lvi = m_ListView.SelectedItems[0]; if (lvi != null) { object tagObject = lvi.Tag; if (tagObject != null) { int nSelected = lvi.Index; m_ListView.Items.Remove(lvi); SHListViewUtil.SelectIndex(m_ListView, nSelected); return(tagObject); } } return(null); }
public void FindItem() { ListViewItem lvi = null; VelixianFindType ft = (VelixianFindType)cbFindType.Items[cbFindType.SelectedIndex]; ListView searchView = ft.Tag.MainList; if (searchView == null) { return; } int nSearchIndex = (searchView.SelectedIndices.Count > 0 && searchView.SelectedIndices[0] != searchView.Items.Count) ? searchView.SelectedIndices[0] + 1 : 0; if (cbFindIDOnly.SelectedIndex == 2) { lvi = SHListViewUtil.FullTextSearch(searchView, cbFindString.Text, nSearchIndex); if (lvi == null) { lvi = SHListViewUtil.FullTextSearch(searchView, cbFindString.Text, 0); } } else { lvi = searchView.FindItemWithText(cbFindString.Text, (cbFindIDOnly.SelectedIndex != 0), nSearchIndex, (cbStrict.SelectedIndex == 0)); if (lvi == null) { lvi = searchView.FindItemWithText(cbFindString.Text, (cbFindIDOnly.SelectedIndex != 0), 0, (cbStrict.SelectedIndex == 0)); } } if (lvi != null) { Global._VelixianForms.ShowForm(cbFindType.SelectedIndex); SHListViewUtil.SelectIndex(searchView, lvi.Index); } else { staMain.Text = "일치하는 값이 없습니다."; MessageBox.Show(staMain.Text, Application.ProductName); } }