public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; panelSet.CurrentItemToOperateOn = panelSet.FocusedListView.SelectedItem; panelSet.CurrentAction = Actions.Cut; }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; FileSystemInfo senderInfo = panelSet.FocusedListView.SelectedItem.Item; var source = senderInfo.FullName; PopupInput popupInput = new PopupInput(panelSet, "Enter new name:"); popupInput.Render(); string newName = popupInput.UserInputResult; var destination = Path.GetDirectoryName(source) + "\\" + newName; if (senderInfo is FileInfo) { File.Move(source, destination); } else if (senderInfo is DirectoryInfo) { Directory.Move(source, destination); } panelSet.RefreshScreen(); }
// パネル生成 public GameObject Create(PanelSet set) { Vector3 vector3 = transform.position; vector3.x += GameMap.mapChipSize; GameObject obj = Instantiate(panelPrefab, vector3, Quaternion.identity); MassPanel m = obj.GetComponent <MassPanel>(); m.InitialSetting(set, target, transform); // 爆弾の ObejectBase 情報を代入 for (int i = 0; i < GameManagement.mCNum; i++) { if (GameManagement.manager.c_MassPanel[i] == null) { GameManagement.manager.c_MassPanel[i] = m.SetObejectBase(); break; } } FC.SettingOrderInLayer(obj, GameMap.Order.orderIMass); return(obj); }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; PopupList popupList = new PopupList("Search result:"); PopupInput popupInput = new PopupInput(panelSet, "Enter the name of a file or directory:", "Search"); popupInput.Render(); var userInput = popupInput.UserInputResult; popupList.ListView = new ListView <FileSystemInfo>(popupList.OffsetX, popupList.OffsetY, popupList.Height, 0, popupList.BackgroundColor, popupList.ForegroundColor); popupList.ListView.Focused = true; popupList.ListView.ColumnWidths = new List <int>() { 30, 10, 10 }; popupList.ListView.Current = panelSet.FocusedPanel.Current; panelSet.Modal = popupList; popupList.ListView.Items = GetAllFilesAndFolders((DirectoryInfo)popupList.ListView.Current).Where(i => i.Item.Name.Contains(userInput)).ToList(); if (popupList.ListView.Items.Count > 0) { popupList.ListView.Current = panelSet.Modal.ListView.Items[0].Item; } else { return; } popupList.Render(); }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; var root = Path.GetPathRoot(panelSet.FocusedListView.SelectedItem.Item.FullName); panelSet.FocusedListView.Current = new DirectoryInfo(root); panelSet.RefreshFocusedPanel(); }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; var parent = Directory.GetParent(panelSet.FocusedListView.Current.FullName) ?? new DirectoryInfo(Path.GetPathRoot(panelSet.FocusedListView.Current.FullName)); panelSet.FocusedListView.Current = parent; panelSet.RefreshFocusedPanel(); }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; PopupInput popupInput = new PopupInput(panelSet, "Enter new folder name:"); popupInput.Render(); string newName = popupInput.UserInputResult; var currentPath = panelSet.FocusedListView.Current.FullName + "\\" + newName; Directory.CreateDirectory(currentPath); panelSet.RefreshFocusedPanel(); }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; FileSystemInfo senderInfo = panelSet.FocusedListView.Current; FileSystemInfo sourceInfo = panelSet.CurrentItemToOperateOn.Item; var action = panelSet.CurrentAction; var source = sourceInfo.FullName; var destination = senderInfo.FullName + "\\" + sourceInfo.Name; if (sourceInfo is FileInfo) { if (action == Actions.Copy) { File.Copy(source, destination); } else if (action == Actions.Cut) { File.Move(source, destination); } } else if (sourceInfo is DirectoryInfo) { if (action == Actions.Copy) { Utility.DirectoryCopy(source, destination); } else if (action == Actions.Cut) { Directory.Move(source, destination); } } if (action == Actions.Copy) { panelSet.RefreshFocusedPanel(); } else if (action == Actions.Cut) { panelSet.RefreshScreen(); } }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; ListView <FileSystemInfo> listView = panelSet.FocusedListView; FileSystemInfo info = listView.SelectedItem.Item; if (info is FileInfo file) { Process.Start(file.FullName); } else if (info is DirectoryInfo directoryInfo) { listView.Clean(); panelSet.FocusedListView.Current = directoryInfo; listView.Items = panelSet.GetItems(panelSet.FocusedPanel.Current); } }
static public void SetPanelSet(PanelSet set) { panelSet = set; switch (panelSet) { case PanelSet.Controller: ButtonPanel.Visible = true; PropertyPanel.Visible = true; TreeView.Visible = true; break; case PanelSet.Settings: ButtonPanel.Visible = false; PropertyPanel.Visible = false; TreeView.Visible = false; break; } }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; PopupList popupList = new PopupList("Select drive:"); popupList.ListView = new ListView <FileSystemInfo>(popupList.OffsetX, popupList.OffsetY, popupList.Height, 0, popupList.BackgroundColor, popupList.ForegroundColor); popupList.ListView.Focused = true; popupList.ListView.ColumnWidths = new List <int>() { 7, popupList.Width - 17, 10 }; popupList.ListView.Items = DriveInfo.GetDrives() .Where(d => d.IsReady) .Select(d => new ListViewItem <FileSystemInfo>(d.RootDirectory, d.RootDirectory.FullName, d.VolumeLabel, Utility.BytesToStringAsNormalizedSize(d.TotalSize))) .ToList(); panelSet.Modal = popupList; popupList.Render(); }
private void Start() { ob = GetComponent <ObjectBase>(); for (int i = 0; i < panelNum; i++) { panels[i] = new PanelSet(sprites[i], (i + 1)); } target = transform.position; target.x -= 192.0f; nextPanel = null; feverStart = 0; // 自分の番号から生成するパネルを決める switch (myNum) { case 0: min = 0; max = 2; break; case 1: min = 3; max = 5; break; case 2: min = 6; max = 9; break; case 3: min = 10; max = 12; break; case 4: min = 13; max = 15; break; } }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; var panels = panelSet.Panels; for (int i = 0; i < panels.Count; i++) { if (panels[i].Focused) { panels[i].Focused = false; if (i == panels.Count - 1) { panels[0].Focused = true; } else { panels[i + 1].Focused = true; } return; } } }
public override void Do(ActionPerformerArgs actionPerformerArgs) { PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender; var sourceInfo = panelSet.FocusedListView.SelectedItem.Item; StringBuilder stringBuilder = new StringBuilder(); string info = String.Empty; int readOnly = ((int)(sourceInfo.Attributes) & (int)FileAttributes.ReadOnly); stringBuilder.AppendLine("Name: " + sourceInfo.Name); stringBuilder.AppendLine("Parent direcotry: " + Path.GetDirectoryName(sourceInfo.FullName)); stringBuilder.AppendLine("Root direcotry: " + Path.GetPathRoot(sourceInfo.FullName)); stringBuilder.AppendLine("Read-only: " + ((readOnly == 1) ? "true" : "false")); stringBuilder.AppendLine("Last read time: " + sourceInfo.LastAccessTime); stringBuilder.AppendLine("Last write time: " + sourceInfo.LastWriteTime); if (sourceInfo is FileInfo fileInfo) { stringBuilder.AppendLine("Size: " + Utility.BytesToStringAsNormalizedSize(fileInfo.Length)); } else if (sourceInfo is DirectoryInfo directoryInfo) { stringBuilder.AppendLine("Size: " + Utility.BytesToStringAsNormalizedSize(directoryInfo.DirectorySize())); stringBuilder.AppendLine("Files: " + Directory.GetFiles(sourceInfo.FullName).Length); stringBuilder.AppendLine("Folders: " + Directory.GetDirectories(sourceInfo.FullName).Length); } info = stringBuilder.ToString(); PopupMessage popupMessage = new PopupMessage(panelSet, info, "Properties"); popupMessage.Render(); panelSet.RefreshScreen(); }