IEnumerable <TemplateRef> GetTemplateRefs(PanelEntry panel) { var input = SitemapUtils.SplitMultilineInput(panel.Raw["exclude_templates"]); var templateRefs = GetTemplateRefs(input); return(templateRefs); }
public FieldAccessor(PanelEntry panel, bool editable = true) { _type = 2; _panel = panel; _editable = editable; _raw = new RawAccessor(_panel); }
/// <summary> /// Apply current panel orientation /// </summary> private void applyPanelSettings(PanelEntry entry) { Screen.orientation = entry.orientation; if (entry.backButtonLock) { isLocked = true; } }
/// <summary> /// Retrieves ignored paths from 'ignored_paths' field /// </summary> /// <param name="siteroot_panel"></param> /// <returns></returns> public IEnumerable <Regex> GetIgnoredPaths(PanelEntry siteroot_panel) { var regex_list = SitemapUtils.SplitMultilineInput(siteroot_panel.Raw["ignored_paths"]) .Select(_ => CPContrib.SiteMap.SitemapUtils.PathspecToRegex(_)).ToArray(); return(regex_list); }
public FieldAccessor(PanelEntry panel, Asset parent, bool editable = true) { //Need a way to reference the parent Asset of a Panel without needing to always pass both to a function. //Its annoying because there is no better API functionality when dealing with Assets and their children Panels. _type = 2; _panel = panel; _asset = parent; _editable = editable; _raw = new RawAccessor(_panel); }
private IPreferenceFolder[] GetWorkPreferencesFor(PanelEntry entry) { string[] ids = entry.Extension.PreferenceFolderIDsToEdit; IPreferenceFolder[] t = new IPreferenceFolder[ids.Length]; for (int i = 0; i < t.Length; i++) { t[i] = _idToWorkPreference[ids[i]].Work; } return(t); }
private void MovePanelLeft(int panelIndex) { if (panelIndex <= 0) { throw new InternalError("Invalid panel index"); } PanelEntry panel = Panels[panelIndex]; Panels.RemoveAt(panelIndex); Panels.Insert(panelIndex - 1, panel); _ActiveTab = panelIndex - 1; }
private void MovePanelRight(int panelIndex) { if (panelIndex >= Panels.Count - 1) { throw new InternalError("Invalid panel index"); } PanelEntry panel = Panels[panelIndex]; Panels.RemoveAt(panelIndex); Panels.Insert(panelIndex + 1, panel); _ActiveTab = panelIndex + 1; }
public OptionDialog() { _instance = this; // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); IOptionPanelExtension[] extps = (IOptionPanelExtension[])OptionDialogPlugin.Instance.PoderosaWorld.PluginManager.FindExtensionPoint(OptionDialogPlugin.OPTION_PANEL_ID).GetExtensions(); _entries = new PanelEntry[extps.Length]; for (int i = 0; i < extps.Length; i++) _entries[i] = new PanelEntry(i, extps[i]); InitItems(); FillText(); Debug.Assert(_entries.Length == _categoryItems.Controls.Count); //拡張と同数のパネルがあること }
public OptionDialog() { _instance = this; // // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B // InitializeComponent(); IOptionPanelExtension[] extps = (IOptionPanelExtension[])OptionDialogPlugin.Instance.PoderosaWorld.PluginManager.FindExtensionPoint(OptionDialogPlugin.OPTION_PANEL_ID).GetExtensions(); _entries = new PanelEntry[extps.Length]; for (int i = 0; i < extps.Length; i++) _entries[i] = new PanelEntry(i, extps[i]); InitItems(); FillText(); Debug.Assert(_entries.Length == _categoryItems.Controls.Count); //�g���Ɠ����̃p�l�������邱�� }
public OptionDialog() { _instance = this; // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); IOptionPanelExtension[] extps = (IOptionPanelExtension[])OptionDialogPlugin.Instance.PoderosaWorld.PluginManager.FindExtensionPoint(OptionDialogPlugin.OPTION_PANEL_ID).GetExtensions(); _entries = new PanelEntry[extps.Length]; for (int i = 0; i < extps.Length; i++) { _entries[i] = new PanelEntry(i, extps[i]); } InitItems(); FillText(); Debug.Assert(_entries.Length == _categoryItems.Controls.Count); //拡張と同数のパネルがあること }
/// <summary> /// Go to panel by index, does NOT check locked /// And will also reset locked status /// </summary> /// <param name="index"></param> public bool goToPanel(int index, bool disableOthers = true) { setLock(false); //Debug.Log(string.Format("Active panel at index {0}", index)); //The previous panel, callbacks previousIndex = currentIndex; PanelEntry currentEntry = getPanel(previousIndex); if (onHidePanelGlobalCallback != null) { onHidePanelGlobalCallback.Invoke(); } //if (currentEntry.onHideCallback != null) currentEntry.onHideCallback.Invoke(); //Activating the panel here so coroutines can be started from onShowCallback etc. //Disable others and show next panel if (disableOthers) { disableAllPanels(); } panelEntries[index].panel.SetActive(true); if (panelEntries[index].extraCanvas != null) { panelEntries[index].extraCanvas.enabled = true; } //The next panel, callbacks currentIndex = index; PanelEntry nextEntry = getPanel(currentIndex); //if (nextEntry.onShowCallback != null) nextEntry.onShowCallback.Invoke(); if (onShowPanelGlobalCallback != null) { onShowPanelGlobalCallback.Invoke(); } //Apply panel orientation/lock applyPanelSettings(nextEntry); if (currentEntry.includeInHistory && index != previousIndex && history.Count < maxHistorySize) { history.Push(previousIndex); } return(true); }
/// <summary> /// Mostly ment for quick testing, it will detect objects that contain /// panel within their name and will add them to the panel entries. /// So you can use their object names to navigate them quickly. /// </summary> private void autoDetect() { List <PanelEntry> entries = new List <PanelEntry>(); foreach (Transform child in transform) { if (child.name.ToLower().Contains("panel")) { PanelEntry entry = new PanelEntry { name = child.name, panel = child.gameObject, orientation = defaultOrientation, includeInHistory = true, }; entries.Add(entry); } } panelEntries = entries.ToArray(); }
private void ShowPage(int index) { _currentEntry = _entries[index]; _currentEntry.Extension.InitiUI(GetWorkPreferencesFor(_currentEntry)); Control panel = _currentEntry.Extension.ContentPanel; if (panel is Panel) { ((Panel)panel).BorderStyle = BorderStyle.FixedSingle; } else if (panel is UserControl) { ((UserControl)panel).BorderStyle = BorderStyle.FixedSingle; } panel.Location = new Point(_categoryItems.Right + 4, _categoryItems.Top); panel.Size = new Size(this.Width - _categoryItems.Width - 16, _categoryItems.Height); this.Controls.Add(panel); PanelItemAt(index).Selected = true; _categoryItems.Invalidate(true); }
/// <summary> /// Apply current panel orientation /// </summary> private void applyPanelSettings() { PanelEntry entry = currentPanel(); Screen.orientation = entry.orientation; }
public EditablePanelEntry(PanelEntry panelEntry, bool editable) { this.PanelEntry = panelEntry; this._editable = editable; this._raw = new RawAccessor(this.PanelEntry); }
public RawAccessor(PanelEntry panel) { this._panel = panel; this._type = 2; }
public IEnumerable <UrlMetaEntry> GetDefaults(PanelEntry panel) { var input = SitemapUtils.SplitMultilineInput(panel.Raw["sm_defaults"]); return(_ParseOverrides(input)); }
private IPreferenceFolder[] GetWorkPreferencesFor(PanelEntry entry) { string[] ids = entry.Extension.PreferenceFolderIDsToEdit; IPreferenceFolder[] t = new IPreferenceFolder[ids.Length]; for (int i = 0; i < t.Length; i++) t[i] = _idToWorkPreference[ids[i]].Work; return t; }
private void ShowPage(int index) { _currentEntry = _entries[index]; _currentEntry.Extension.InitiUI(GetWorkPreferencesFor(_currentEntry)); Control panel = _currentEntry.Extension.ContentPanel; if (panel is Panel) ((Panel)panel).BorderStyle = BorderStyle.FixedSingle; else if (panel is UserControl) ((UserControl)panel).BorderStyle = BorderStyle.FixedSingle; panel.Location = new Point(_categoryItems.Right + 4, _categoryItems.Top); panel.Size = new Size(this.Width - _categoryItems.Width - 16, _categoryItems.Height); this.Controls.Add(panel); PanelItemAt(index).Selected = true; _categoryItems.Invalidate(true); }