public void EditReplicationInitJobSet(BackupRestoreConfig.BrSchedule schedule) { try { string[] details = schedule.details.Split('|'); this._choice_sr_ip = details[0]; this.DestUsernameTextbox.Text = details[1]; this.DestPasswordTextbox.Text = details[2]; if (!details[3].Equals("")) { this.VMNameCheckBox.Checked = true; this.VMNameTextBox.Text = details[3]; } this._choice_sr_uuid = details[4]; if (details[5].Equals("1")) { this.NewMacAddressCheckBox.Checked = true; } NetworkItem item = new NetworkItem(); item.text = ""; item.value = details[6]; this.NetworkComboBox.Items.Add(item); this.NetworkComboBox.SelectedIndex = 0; } catch (Exception e) { throw e; } }
private void FillNetworkItemAddresses(ListViewItem litem, NetworkItem item) { if (item.Connection.Local != null && !item.Connection.Local.IsEmpty()) { string addressString = item.Connection.Local.Address.ToString(); if (item.LocalString != null && item.LocalString != addressString) { litem.SubItems[1].Text = item.LocalString + " (" + addressString + ")"; } else { litem.SubItems[1].Text = addressString; } } if (item.Connection.Remote != null && !item.Connection.Remote.IsEmpty()) { string addressString = item.Connection.Remote.Address.ToString(); if (item.RemoteString != null && item.RemoteString != addressString) { litem.SubItems[3].Text = item.RemoteString + " (" + addressString + ")"; } else { litem.SubItems[3].Text = addressString; } } }
private void SpawnItem(Vector2Int position, Tile tile) { GameObject itemObject = Instantiate(m_itemPrefab, tile.Sprite.transform.position, Quaternion.identity); NetworkItem item = itemObject.GetComponent <NetworkItem>(); item.ItemIndex = m_items.GetRandomItemIndex(); NetworkServer.Spawn(itemObject); m_map.AddItemAtPosition(item, position); }
private void HandlePossibleItemAtTargetPosition(Vector2Int targetPosition) { NetworkItem item = m_map.GetItemAtPosition(targetPosition); if (item == null) { return; } m_health.RestoreHealth(item.HealthRestoreAmount); m_map.RemoveItemAtPosition(targetPosition); NetworkServer.Destroy(item.gameObject); }
protected void gvActiveNetwork_OnRowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { NetworkItem networkitem = (NetworkItem)e.Row.DataItem; Literal lbPerson = (Literal)e.Row.FindControl("lbPerson"); ImageButton ibRemove = (ImageButton)e.Row.FindControl("ibRemove"); ibRemove.CommandArgument = networkitem.NodeID.ToString(); ibRemove.ImageUrl = Root.Domain + "/Framework/Images/delete.png"; lbPerson.Text = "<a href='" + networkitem.URI + "'>" + networkitem.Name + "</a>"; } }
bool TryGetItemIdentifier(NetworkItem networkItem, out ItemIdentifier itemIdentifier) { try { itemIdentifier = ItemMap.GetItemIdentifier(networkItem.Item); return(true); } catch { itemIdentifier = null; return(false); } }
bool TryGetLocation(NetworkItem networkItem, out ItemLocation location) { try { location = this[LocationMap.GetItemkey(networkItem.Location)]; return(true); } catch { location = null; return(false); } }
public MainWindow() { InitializeComponent(); try { // 프로그램 시작 시 정보 로딩 configInfo = LoadFile("config.dat", 0); userInfo = LoadFile("user.dat", 5); logInfo = LoadFile("log.dat", 10); if (configInfo[0][1] == "True" || configInfo[0][1] == "true") { CHB_Remember_me.IsChecked = true; try { TB_ID.Text = logInfo[0][0]; PB_PW.Password = logInfo[0][1]; } catch { }; } } catch (Exception exc) { MessageBox.Show(exc.ToString()); }; // 임시 카테고리 CHBTRVVM CHBViewModel = new CHBTRVVM(); NetworkItem NImyStuff = new NetworkItem("myStuff"); NetworkItem NIcar = new NetworkItem("car"); NetworkItem NIsmall = new NetworkItem("small"); NetworkItem NImartiz = new NetworkItem("martiz"); NetworkItem NImorning = new NetworkItem("morning"); NetworkItem NImedium = new NetworkItem("medium"); NetworkItem NIbenz = new NetworkItem("benz"); NetworkItem NIgift = new NetworkItem("gift"); NetworkItem NIwallet = new NetworkItem("wallet"); NImyStuff.AddChild(NIcar); NIcar.AddChild(NIsmall); NIsmall.AddChild(NImartiz); NIsmall.AddChild(NImorning); NIcar.AddChild(NImedium); NImedium.AddChild(NIbenz); NImyStuff.AddChild(NIgift); NIgift.AddChild(NIbenz); NIgift.AddChild(NIwallet); CHBViewModel.NetworkItems.Add(NImyStuff); CHBTRV_CHBTreeView.DataContext = CHBViewModel; }
protected void gvActiveNetwork_ItemBound(object sender, RepeaterItemEventArgs e) { NetworkItem networkitem = (NetworkItem)e.Item.DataItem; Literal lbPerson = (Literal)e.Item.FindControl("lbPerson"); if (this.first) { lbPerson.Text = "<li style='height: 25px !important; border-top:1px solid #383737'><a style='border-left:1px solid #383737;border-right:1px solid #383737;padding-top:5px;' href='" + networkitem.URI + "'>" + networkitem.Name + "</a></li>"; } else { lbPerson.Text = "<li style='height: 25px !important;'><a style='height: 25px !important; border-left:1px solid #383737;border-right:1px solid #383737;padding-top:5px;' href='" + networkitem.URI + "'>" + networkitem.Name + "</a></li>"; } this.first = false; }
public NetworkItem GetCurrentNetworkFromFile() { NetworkItem network = new NetworkItem(); string currentNetwork = GetCurrentNetworkName(); NetworksContainer container = GetNetworksFromFile(); foreach (NetworkItem item in container.Networks) { if (item.NetworkName == currentNetwork) { return item; } } return null; }
void ReceiveItem(NetworkItem networkItem, Level level) { if (TryGetLocation(networkItem, out var location) && networkItem.Player == slot) { //ignore message if its from my slot and a location i already picked up if (location.IsPickedUp && personalLocationItemKeys.Contains(location.Key)) { return; } } else { location = new ExternalItemLocation(); Add(location); } if (!TryGetItemIdentifier(networkItem, out var itemIdentifier)) { return; } // itemInfoProvider's cache is out of date here when it comes to pyramid unlocks var item = new SingleItemInfo(UnlockingMap, itemIdentifier); location.SetItem(item); location.IsPickedUp = true; item.OnPickup(level); level.GameSave.AddItem(level, itemIdentifier); if (itemIdentifier.LootType == LootType.ConstRelic) { level.AsDynamic().UnlockRelic(itemIdentifier.Relic); } if (!firstPass || item.IsProgression) { level.ShowItemAwardPopup(itemIdentifier); } if (item.IsProgression) { ItemTrackerUplink.UpdateState(ItemTrackerState.FromItemLocationMap(this)); } }
public void AddCurrentNetworkToFile(NetworksContainer container, string networkName) { if (container != null) { if (!string.IsNullOrEmpty(networkName)) { if (container.Networks == null) container.Networks = new List<NetworkItem>(); var networkItem = new NetworkItem(); networkItem.NetworkName = networkName; container.Networks.Add(networkItem); SaveNetworksContainer(container); } } }
private void provider_DictionaryRemoved(NetworkItem item) { this.BeginInvoke(new MethodInvoker(() => { lock (listNetwork) { if (!listNetwork.Items.ContainsKey(item.Id)) { return; } ListViewItem litem = listNetwork.Items[item.Id]; bool imageStillUsed = false; if (litem.ImageKey == "generic_process") { imageStillUsed = true; } else { foreach (ListViewItem lvItem in listNetwork.Items) { if (lvItem != litem && lvItem.ImageKey == item.Connection.Pid.ToString()) { imageStillUsed = true; break; } } } if (!imageStillUsed) { imageList.Images.RemoveByKey(item.Connection.Pid.ToString()); // Set the item's icon to generic_process, otherwise we are going to // get a blank space for the icon. litem.ImageKey = "generic_process"; // Reset all the image keys (by now most items' icons have screwed up). this.ResetImageKeys(); } litem.Remove(); } })); }
private void listNetwork_MouseMove(object sender, MouseEventArgs e) { if (this.MouseMove != null) { this.MouseMove(sender, e); } ListViewItem litem = listNetwork.GetItemAt(e.X, e.Y); if (litem != null) { NetworkItem item = (NetworkItem)litem.Tag; var tree = Program.HackerWindow.ProcessTree; if (tree.Model.Nodes.ContainsKey(item.Connection.Pid)) { litem.ToolTipText = tree.Model.Nodes[item.Connection.Pid].GetTooltipText(tree.TooltipProvider); } } }
private void provider_DictionaryModified(NetworkItem oldItem, NetworkItem newItem) { this.BeginInvoke(new MethodInvoker(() => { lock (listNetwork) { ListViewItem litem = listNetwork.Items[newItem.Id]; if (litem == null) { return; } this.FillNetworkItemAddresses(litem, newItem); litem.SubItems[6].Text = newItem.Connection.State != 0 ? newItem.Connection.State.ToString() : ""; _needsSort = true; } })); }
private void InitNetworkListBox() { this.ComboBox_Network.Items.Clear(); this.ComboBox_Network.BeginUpdate(); foreach (XenAPI.Network network in this._xenModelObject.Connection.Cache.Networks) { if (this.ShowNetwork(network) && network.AutoPlug) { NetworkItem item = new NetworkItem(); item.text = network.Name; item.value = network.uuid; this.ComboBox_Network.Items.Add(item); } } this.ComboBox_Network.EndUpdate(); if (this.ComboBox_Network.Items.Count > 0) { this.ComboBox_Network.SelectedIndex = 0; } }
private void InitNetworkListBox() { this.NetworkComboBox.Items.Clear(); this.NetworkComboBox.BeginUpdate(); this.NetworkComboBox.Text = Messages.REPLICATION_NETWORK_TEXT; this.NetworkComboBox.SelectedItem = null; foreach (XenAPI.Network network in this.selected_xenConnection.Cache.Networks) { if (this.ShowNetwork(network) && network.AutoPlug) { NetworkItem item = new NetworkItem(); item.text = network.Name; item.value = network.uuid; this.NetworkComboBox.Items.Add(item); } } this.NetworkComboBox.EndUpdate(); if (this.NetworkComboBox.Items.Count > 0) { this.NetworkComboBox.SelectedIndex = 0; } }
public MainWindow() { InitializeComponent(); //List<User> list = GetTypeFromJson<List<User>>("1213213"); //userlist.Add(new User() { ID = "Alice", Password = "******" }); //userlist.Add(new User() { ID = "Paul", Password = "******" }); //userlist.Add(new User() { ID = "Tom", Password = "******" }); //string userJson = JsonConvert.SerializeObject(userlist); // encrypt, RijndaelManaged //SaveFile("userinfo.txt", userJson); //string json = File.ReadAllText("userinfo.txt"); // decrypt, RijndaelManaged //userlist = JsonConvert.DeserializeObject<List<User>>(json); try { // 프로그램 시작 시 정보 로딩 configInfo = LoadFile("config.dat", 0); userInfo = LoadFile("user.dat", 5); logInfo = LoadFile("log.dat", 10); if (configInfo[0][1] == "True" || configInfo[0][1] == "true") { CHB_Remember_me.IsChecked = true; try { TB_ID.Text = logInfo[0][0]; PB_PW.Password = logInfo[0][1]; } catch { }; } } catch (Exception exc) { MessageBox.Show(exc.ToString()); }; // 임시 카테고리 NetworkItem NIcar = new NetworkItem("car"); NetworkItem NIsmall = new NetworkItem("small"); NetworkItem NImartiz = new NetworkItem("martiz"); NetworkItem NImorning = new NetworkItem("morning"); NetworkItem NImedium = new NetworkItem("medium"); NetworkItem NIbenz = new NetworkItem("benz"); NetworkItem NIgift = new NetworkItem("gift"); NetworkItem NIwallet = new NetworkItem("wallet"); NImyStuff.AddChildren(NIcar); NIcar.AddChildren(NIsmall); NIsmall.AddChildren(NImartiz); NIsmall.AddChildren(NImorning); NIcar.AddChildren(NImedium); NImedium.AddChildren(NIbenz); NImyStuff.AddChildren(NIgift); NIgift.AddChildren(NIbenz); NIgift.AddChildren(NIwallet); CHBViewModel.NetworkItems.Add(NImyStuff); CHBTRV_CHBTreeView.DataContext = CHBViewModel; DataContext = new MainWindowViewModel(); }
public void AddItemAtPosition(NetworkItem item, Vector2Int position) { AddAtPosition(m_items, item, position); }
private void provider_DictionaryRemoved(NetworkItem item) { this.BeginInvoke(new MethodInvoker(() => { lock (listNetwork) { if (!listNetwork.Items.ContainsKey(item.Id)) return; ListViewItem litem = listNetwork.Items[item.Id]; bool imageStillUsed = false; if (litem.ImageKey == "generic_process") { imageStillUsed = true; } else { foreach (ListViewItem lvItem in listNetwork.Items) { if (lvItem != litem && lvItem.ImageKey == item.Connection.Pid.ToString()) { imageStillUsed = true; break; } } } if (!imageStillUsed) { imageList.Images.RemoveByKey(item.Connection.Pid.ToString()); litem.ImageKey = "generic_process"; this.ResetImageKeys(); } litem.Remove(); } })); }
private void provider_DictionaryModified(NetworkItem oldItem, NetworkItem newItem) { this.BeginInvoke(new MethodInvoker(() => { lock (listNetwork) { ListViewItem litem = listNetwork.Items[newItem.Id]; if (litem == null) return; this.FillNetworkItemAddresses(litem, newItem); litem.SubItems[6].Text = newItem.Connection.State != 0 ? newItem.Connection.State.ToString() : ""; _needsSort = true; } })); }
private void provider_DictionaryAdded(NetworkItem item) { HighlightedListViewItem litem = new HighlightedListViewItem(_highlightingContext, (int)item.Tag > 0 && _runCount > 0); litem.Name = item.Id; litem.Tag = item; Icon icon = null; if (Program.ProcessProvider.Dictionary.ContainsKey(item.Connection.Pid)) { lock (listNetwork) { if (imageList.Images.ContainsKey(item.Connection.Pid.ToString())) imageList.Images.RemoveByKey(item.Connection.Pid.ToString()); icon = Program.ProcessProvider.Dictionary[item.Connection.Pid].Icon; } } if (icon != null) { lock (listNetwork) imageList.Images.Add(item.Connection.Pid.ToString(), icon); litem.ImageKey = item.Connection.Pid.ToString(); } else { litem.ImageKey = "generic_process"; } if (item.Connection.Pid == 0) { litem.Text = "Waiting Connections"; } else if (Program.ProcessProvider.Dictionary.ContainsKey(item.Connection.Pid)) { litem.Text = Program.ProcessProvider.Dictionary[item.Connection.Pid].Name + " (" + item.Connection.Pid.ToString() + ")"; } else { litem.Text = "Unknown Process (" + item.Connection.Pid.ToString() + ")"; } if (item.Connection.Local != null && !item.Connection.Local.IsEmpty()) { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Local.ToString())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Local.Port.ToString())); } else { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); } if (item.Connection.Remote != null && !item.Connection.Remote.IsEmpty()) { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Remote.ToString())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Remote.Port.ToString())); } else { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); } this.FillNetworkItemAddresses(litem, item); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Protocol.ToString().ToUpper())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.State != 0 ? item.Connection.State.ToString() : "")); lock (_needsAdd) _needsAdd.Add(litem); _needsImageKeyReset = true; }
private void FillNetworkItemAddresses(ListViewItem litem, NetworkItem item) { if (item.Connection.Local != null && !item.Connection.Local.IsEmpty()) { string addressString = item.Connection.Local.Address.ToString(); if (item.LocalString != null && item.LocalString != addressString) { litem.SubItems[1].Text = item.LocalString + " (" + addressString + ")"; } else { litem.SubItems[1].Text = addressString; } } if (item.Connection.Remote != null && !item.Connection.Remote.IsEmpty()) { string addressString = item.Connection.Remote.Address.ToString(); if (item.RemoteString != null && item.RemoteString != addressString) litem.SubItems[3].Text = item.RemoteString + " (" + addressString + ")"; else litem.SubItems[3].Text = addressString; } }
private void provider_DictionaryRemoved(NetworkItem item) { this.BeginInvoke(new MethodInvoker(() => { lock (listNetwork) { if (!listNetwork.Items.ContainsKey(item.Id)) return; ListViewItem litem = listNetwork.Items[item.Id]; bool imageStillUsed = false; if (litem.ImageKey == "generic_process") { imageStillUsed = true; } else { foreach (ListViewItem lvItem in listNetwork.Items) { if (lvItem != litem && lvItem.ImageKey == item.Connection.Pid.ToString()) { imageStillUsed = true; break; } } } if (!imageStillUsed) { imageList.Images.RemoveByKey(item.Connection.Pid.ToString()); // Set the item's icon to generic_process, otherwise we are going to // get a blank space for the icon. litem.ImageKey = "generic_process"; // Reset all the image keys (by now most items' icons have screwed up). this.ResetImageKeys(); } litem.Remove(); } })); }
private void provider_DictionaryAdded(NetworkItem item) { HighlightedListViewItem litem = new HighlightedListViewItem(_highlightingContext, (int)item.Tag > 0 && _runCount > 0); litem.Name = item.Id; litem.Tag = item; Icon icon = null; if (Program.ProcessProvider.Dictionary.ContainsKey(item.Connection.Pid)) { lock (listNetwork) { if (imageList.Images.ContainsKey(item.Connection.Pid.ToString())) { imageList.Images.RemoveByKey(item.Connection.Pid.ToString()); } icon = Program.ProcessProvider.Dictionary[item.Connection.Pid].Icon; } } if (icon != null) { lock (listNetwork) imageList.Images.Add(item.Connection.Pid.ToString(), icon); litem.ImageKey = item.Connection.Pid.ToString(); } else { litem.ImageKey = "generic_process"; } if (item.Connection.Pid == 0) { litem.Text = "Waiting Connections"; } else if (Program.ProcessProvider.Dictionary.ContainsKey(item.Connection.Pid)) { litem.Text = Program.ProcessProvider.Dictionary[item.Connection.Pid].Name + " (" + item.Connection.Pid.ToString() + ")"; } else { litem.Text = "Unknown Process (" + item.Connection.Pid.ToString() + ")"; } if (item.Connection.Local != null && !item.Connection.Local.IsEmpty()) { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Local.ToString())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Local.Port.ToString())); } else { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); } if (item.Connection.Remote != null && !item.Connection.Remote.IsEmpty()) { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Remote.ToString())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Remote.Port.ToString())); } else { litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, "")); } this.FillNetworkItemAddresses(litem, item); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.Protocol.ToString().ToUpper())); litem.SubItems.Add(new ListViewItem.ListViewSubItem(litem, item.Connection.State != 0 ? item.Connection.State.ToString() : "")); lock (_needsAdd) _needsAdd.Add(litem); _needsImageKeyReset = true; }