/// <summary> /// Initializes a new instance of the TwentyQuestions.ViewModels.Entities.EntitiesViewModel class. /// </summary> public EntitiesViewModel() { this.EntityCollection = new PagedListView <Entity>(); }
public void SetupGUI() { var root = this.GetRootVisualContainer(); root.AddStyleSheetPath("StyleSheets/CollabHistoryCommon.uss"); if (EditorGUIUtility.isProSkin) { root.AddStyleSheetPath("StyleSheets/CollabHistoryDark.uss"); } else { root.AddStyleSheetPath("StyleSheets/CollabHistoryLight.uss"); } m_Container = new VisualElement(); m_Container.StretchToParentSize(); root.Add(m_Container); m_Pager = new PagedListView() { name = "PagedElement", pageSize = m_ItemsPerPage }; var errorView = new StatusView() { message = "An Error Occurred", icon = EditorGUIUtility.LoadIconRequired("Collab.Warning") as Texture, }; var noInternetView = new StatusView() { message = "No Internet Connection", icon = EditorGUIUtility.LoadIconRequired("Collab.NoInternet") as Texture, }; var maintenanceView = new StatusView() { message = "Maintenance", }; var loginView = new StatusView() { message = "Sign in to access Collaborate", buttonText = "Sign in...", callback = SignInClick, }; var noSeatView = new StatusView() { message = "Ask your project owner for access to Unity Teams", buttonText = "Learn More", callback = NoSeatClick, }; var waitingView = new StatusView() { message = "Updating...", }; m_HistoryView = new ScrollView() { name = "HistoryContainer", showHorizontal = false }; m_HistoryView.contentContainer.StretchToParentWidth(); m_HistoryView.Add(m_Pager); m_Views = new Dictionary <HistoryState, VisualElement>() { { HistoryState.Error, errorView }, { HistoryState.Offline, noInternetView }, { HistoryState.Maintenance, maintenanceView }, { HistoryState.LoggedOut, loginView }, { HistoryState.NoSeat, noSeatView }, { HistoryState.Waiting, waitingView }, { HistoryState.Ready, m_HistoryView } }; }
public void SetupGUI() { VisualElement rootVisualContainer = this.GetRootVisualContainer(); rootVisualContainer.AddStyleSheetPath("StyleSheets/CollabHistoryCommon.uss"); if (EditorGUIUtility.isProSkin) { rootVisualContainer.AddStyleSheetPath("StyleSheets/CollabHistoryDark.uss"); } else { rootVisualContainer.AddStyleSheetPath("StyleSheets/CollabHistoryLight.uss"); } this.m_Container = new VisualElement(); this.m_Container.StretchToParentSize(); rootVisualContainer.Add(this.m_Container); this.m_Pager = new PagedListView { name = "PagedElement", PagerLoc = PagerLocation.Top, pageSize = this.m_ItemsPerPage }; StatusView value = new StatusView { message = "An Error Occurred", icon = EditorGUIUtility.LoadIconRequired("Collab.Warning") }; StatusView value2 = new StatusView { message = "No Internet Connection", icon = EditorGUIUtility.LoadIconRequired("Collab.NoInternet") }; StatusView value3 = new StatusView { message = "Maintenance" }; StatusView value4 = new StatusView { message = "Sign in to access Collaborate", buttonText = "Sign in...", callback = new Action(this.SignInClick) }; StatusView value5 = new StatusView { message = "Ask your project owner for access to Unity Teams", buttonText = "Learn More", callback = new Action(this.NoSeatClick) }; StatusView value6 = new StatusView { message = "Connecting..." }; ScrollView scrollView = new ScrollView { name = "HistoryContainer", showHorizontal = false }; scrollView.contentContainer.StretchToParentWidth(); scrollView.Add(this.m_Pager); this.m_Views = new Dictionary <HistoryState, VisualElement> { { HistoryState.Error, value }, { HistoryState.Offline, value2 }, { HistoryState.Maintenance, value3 }, { HistoryState.LoggedOut, value4 }, { HistoryState.NoSeat, value5 }, { HistoryState.Waiting, value6 }, { HistoryState.Ready, scrollView } }; }