/// <summary> /// Returns the dataset with the given ID. /// </summary> /// <param name="id">The ID of the dataset.</param> /// <returns>The dataset with the given ID if it exists; otherwise, <see langword="null" />.</returns> public IProxyDataset Dataset(DatasetId id) { IProxyDataset result = null; if (m_Datasets.Datasets.ContainsKey(id)) { result = m_Datasets.Datasets[id]; } return(result); }
/// <summary> /// Initializes a new instance of the <see cref="DatasetFacade"/> class. /// </summary> /// <param name="dataset"> /// The dataset for which the current object forms the facade. /// </param> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="dataset"/> is <see langword="null" />. /// </exception> internal DatasetFacade(IProxyDataset dataset) { { Enforce.Argument(() => dataset); } m_Dataset = dataset; m_Dataset.OnDeleted += (s, e) => RaiseOnInvalidate(); m_Dataset.OnProgressOfCurrentAction += (s, e) => RaiseOnProgressOfCurrentAction(e.Progress, e.Description, e.HasErrors); m_Dataset.OnActivated += (s, e) => RaiseOnActivated(); m_Dataset.OnDeactivated += (s, e) => RaiseOnDeactivated(); m_Dataset.OnNameChanged += (s, e) => RaiseOnNameChanged(); m_Dataset.OnSummaryChanged += (s, e) => RaiseOnSummaryChanged(); m_Dataset.OnSwitchToEditMode += (s, e) => RaiseOnSwitchToEditMode(); m_Dataset.OnSwitchToExecutingMode += (s, e) => RaiseOnSwitchToExecutingMode(); }
public bool Equals(IProxyDataset other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } var dataset = other as DatasetProxy; return(Equals(dataset)); }