/// <summary> /// This adds a workspace entry to our available data source list. /// </summary> /// <param name="entry"></param> private void AddFileToWorkspace(WorkspaceEntry entry) { // Find the specific data loader responsible for this entry. var owner = Extensions.Current.DataProviders.Where(ldr => ldr.Key == entry.LoaderKey).FirstOrDefault(); if (owner != null) { IBioDataLoader loader = owner.Create(entry.LoaderData); if (loader != null) { var dvm = new OpenBioDataViewModel(entry.LoaderData, entry.FormatType, loader, owner); dvm.CloseRequest += OnDataSourceClosing; AvailableDataSources.Add(dvm); } } else { var uiMessage = Resolve <IErrorVisualizer>(); if (uiMessage != null) { uiMessage.Show("Error loading workspace", "Could not resolve loader provider for " + entry.FormatType + ". File will be ignored."); } } }
public void AddEntryIndented() { var data = @" ### Generated by the tool ### End of generated by the tool "; var writer = new WorkspaceWriter(); var entry = new WorkspaceEntry() { PackageIdentity = new PackageIdentity("remotion.linq", new NuGetVersion(2, 2, 0)) }; var result = writer.AddEntry(data, entry, true); result = result.Replace("\r", ""); var tocompare = @" ### Generated by the tool nuget_package( name = ""remotion.linq"", package = ""remotion.linq"", version = ""2.2.0"", ) ### End of generated by the tool ".Replace("\r", ""); Assert.Equal(tocompare, result); }
public void Remove(WorkspaceEntry entry) { _entries.Remove(entry); Destroy(entry.Base.gameObject); OnCountChanged?.Invoke(); OnEntryRemoved?.Invoke(entry); }
private void updateDisplayOnRemoved(WorkspaceEntry entry) { if (entry.LinkedEntry != _entry) { return; } _target.SetActive(!_show); }
private void onClick() { WorkspaceEntry newEntry = Instantiate(_entryPrefab); newEntry.Set(_volumeFactory.Create(_entry.Volume)); newEntry.LinkedEntry = _entry; newEntry.Volume.Data = _entry.Volume.Data; _workspace.AddToCenter(newEntry); }
public void Add(WorkspaceEntry entry, Vector2 screenPos) { _entries.Add(entry); entry.Base.SetParent(_hook, true); Vector2 rectPoint; RectTransformUtility.ScreenPointToLocalPointInRectangle(Content, screenPos, GetComponentInParent <Canvas>().worldCamera, out rectPoint); Vector2 normalized = Rect.PointToNormalized(Content.rect, rectPoint); entry.Base.anchorMin = normalized; entry.Base.anchorMax = normalized; entry.Base.anchoredPosition = Vector2.zero; entry.Base.localScale = Vector3.one; entry.CursorFollower.Container = Content; OnCountChanged?.Invoke(); OnEntryAdded?.Invoke(entry); }
public void AddToCenter(WorkspaceEntry entry) { Add(entry, RectTrans.position); }
public override Task AddEntry(WorkspaceEntry entry) { Entries.Add(entry); return(base.AddEntry(entry)); }