/// <summary> /// This method is called whenever a data changed event is raised. By default, the /// data view is refreshed but this method can be overriden to perform custom actions /// as needed by derived classes /// </summary> /// <param name="source"></param> /// <param name="e"></param> /// <remarks> /// Revision History /// MM/DD/YY Who Version Issue# Description /// -------- --- ------- ------ ------------------------------------------- /// 07/19/07 MAH Created /// /// </remarks> virtual protected void OnViewDataCreated(object source, FileSystemEventArgs e) { try { if (!String.IsNullOrEmpty(e.FullPath)) { // Before we can refresh the data view, we need to know where this request is coming // from. We can only interact with the control if the request originated on the thread that // owns the flex grid. If the request originated from any other thread, then the refresh must // redirected to the proper thread. if (m_ctlDataGrid.InvokeRequired == false) { CreateDataViewItem(e.FullPath); } else { // Refresh the view asynchronously CreateViewDelegate CreateViewAsync = new CreateViewDelegate(CreateDataViewItem); object[] parameterArray = new object[1]; parameterArray[0] = e.FullPath; this.Invoke(CreateViewAsync, parameterArray); } } } catch { // It is possible that a refresh message is sent to a data view that has been switched out. In this case the data view // and all child controls no longer exist. Rather than display an error, just don't attempt to refresh something that // isn't visible anyway } }
/// <summary> /// Setup constructor with explicit show command (show command can be null) /// </summary> public ControlViewInfo( string name, CreateViewDelegate createView, Command showCommand ) { Arguments.CheckNotNull( createView, "createView" ); m_Name = name; m_CreateView = createView; m_ShowCommand = showCommand; }
/// <summary> /// Setup constructor /// </summary> public ControlViewInfo( string name, CreateViewDelegate createView, CommandGroup showCommandGroup ) { Arguments.CheckNotNull( createView, "createView" ); m_Name = name; m_CreateView = createView; if ( showCommandGroup != null ) { m_ShowCommand = showCommandGroup.NewCommand( name, name, name ); } }
// Create a view with the requested factory public View <T> CreateView <T>(string identifier, T model) where T : Model <T>, new() { object obj; if (viewFactories.TryGetValue(identifier, out obj)) { CreateViewDelegate <T> createView = obj as CreateViewDelegate <T>; if (createView == null) { return(null); } return(createView(model)); } return(null); }
/// <summary> /// Setup constructor with explicit dock state and show command /// </summary> public DockingViewInfo( string name, CreateViewDelegate createView, Command showCommand, DockState defaultDockState ) : base(name, createView, showCommand) { m_DefaultDockState = defaultDockState; }
/// <summary> /// Setup constructor with explicit show command /// </summary> public DockingViewInfo( string name, CreateViewDelegate createView, Command showCommand ) : this(name, createView, showCommand, DockState.Float) { }
/// <summary> /// Setup constructor with explicit show command /// </summary> public DockingViewInfo( string name, CreateViewDelegate createView, DockState defaultDockState ) : this(name, createView, ( Command )null, defaultDockState) { }
/// <summary> /// Setup constructor with explicit show command /// </summary> public DockingViewInfo( string name, CreateViewDelegate createView ) : this(name, createView, ( Command )null) { }
// Register View factory public void RegisterViewFactory <T>(string identifier, CreateViewDelegate <T> factory) where T : Model <T>, new() { viewFactories[identifier] = factory; }
/// <summary> /// Setup constructor /// </summary> public ControlViewInfo( string name, CreateViewDelegate createView ) { Arguments.CheckNotNull( createView, "createView" ); m_Name = name; m_CreateView = createView; }
/// <summary> /// Setup constructor with show command /// </summary> public HostedViewInfo( string name, CreateViewDelegate createView, Command showCommand ) : base(name, createView, showCommand) { }
/// <summary> /// Setup constructor /// </summary> public HostedViewInfo( string name, CreateViewDelegate createView ) : base(name, createView) { }