internal static MemberSlot Create(ViewProxy proxy, MemberMeta member) { if (member.IsCollection) return new CollectionSlot(proxy, member); else return new AtomSlot(proxy, member); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="EditorialChecksViewWrapper"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="cache">The cache.</param> /// <param name="bookFilter">The book filter.</param> /// <param name="draftViewProxy">View proxy used to create the view.</param> /// <param name="settingsRegKey">The settings reg key.</param> /// <param name="sProjectName">The name of the current project</param> /// <param name="helpTopicProvider">The help topic provider.</param> /// <param name="app">The application (needed to get the product name)</param> /// ------------------------------------------------------------------------------------ public EditorialChecksViewWrapper(Control parent, FdoCache cache, FilteredScrBooks bookFilter, ViewProxy draftViewProxy, RegistryKey settingsRegKey, string sProjectName, IHelpTopicProvider helpTopicProvider, IApp app) : base(parent, cache, draftViewProxy, settingsRegKey) { Name = "EditorialChecks"; m_helpTopicProvider = helpTopicProvider; m_app = app; m_sProjectName = sProjectName; m_bookFilter = bookFilter; }
protected MemberSlot(ViewProxy proxy, MemberMeta member) { Proxy = proxy; Member = member; if (member.CanRead) { // When the property is out of date, update it from the wrapped object. _computed = new Computed(() => BindingInterceptor.Current.UpdateValue(this)); // When the property becomes out of date, trigger an update. // The update should have lower priority than user input & drawing, // to ensure that the app doesn't lock up in case a large model is // being updated outside the UI (e.g. via timers or the network). _computed.Invalidated += () => UpdateScheduler.ScheduleUpdate(UpdateNow); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructs a ChecksViewWrapper /// </summary> /// <param name="parent">The parent of the split wrapper (can be null). Will be replaced /// with real parent later.</param> /// <param name="cache">The Cache to give to the views</param> /// <param name="draftViewProxy">View proxy for creating the draft view to display in /// the lower right corner</param> /// <param name="settingsRegKey">The parent control's ISettings registry key</param> /// ------------------------------------------------------------------------------------ public ChecksViewWrapper(Control parent, FdoCache cache, ViewProxy draftViewProxy, RegistryKey settingsRegKey) { SuspendLayout(); m_cache = cache; m_scr = m_cache.LangProject.TranslatedScriptureOA; m_mainWnd = parent as FwMainWnd; Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; Dock = DockStyle.Fill; Name = "ChecksViewWrapper"; Visible = false; // If we have a main window, then ignore the one sent to us and use the main // window's extended settings key. Otherwise use the one sent to us. SettingsKey = settingsRegKey; if (parent != null) { Site = parent.Site; } // Set up the right view m_rightView = new FwSplitContainer(SettingsKey); m_rightView.Name = "ChecksRightView"; m_rightView.Orientation = Orientation.Horizontal; m_rightView.DesiredFirstPanePercentage = 0.7f; m_rightView.PanelToActivate = m_rightView.Panel1; m_rightView.Panel1Collapsed = false; m_rightView.Panel2Collapsed = false; m_rightView.Tag = draftViewProxy; m_rightView.Dock = DockStyle.Fill; Controls.Add(m_rightView); // Note: setting parent needs to come last Parent = parent; ResumeLayout(); // This should only be null when running tests. if (m_mainWnd != null) { m_mainWnd.Mediator.AddColleague(this); } }
internal AtomSlot(ViewProxy proxy, MemberMeta member) : base(proxy, member) { }