//********************************************************************* /// /// <summary>Creates a new instance of the PortalDataSetV2 class</summary> /// <param name="data">Array of data to be returned</param> /// <param name="namePropertyName">Name of the name property used for data merging</param> /// <param name="pollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling normally</param> /// <param name="fastPollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling fast</param> /// <param name="mergeMethod">The merge method</param> /// <param name="isComplete">Indicates whether the data set is complete or partial</param> /// //********************************************************************* public PortalDataSet(object data, string namePropertyName = null, TimeSpan?pollingInterval = null, TimeSpan?fastPollingInterval = null, TimeSpan?slowPollingInterval = null, PortalDataSetMergeMethod mergeMethod = PortalDataSetMergeMethod.Cascade, bool isComplete = true) { this.data = data ?? new object[] { }; this.namePropertyName = namePropertyName ?? "id"; this.pollingInterval = (int)(pollingInterval.HasValue ? pollingInterval.Value : TimeSpan.FromSeconds(DataSetNormalPollingIntervalInSeconds)).TotalMilliseconds; this.fastPollingInterval = (int)(fastPollingInterval.HasValue ? fastPollingInterval.Value : TimeSpan.FromSeconds(DataSetFastPollingIntervalInSeconds)).TotalMilliseconds; this.slowPollingInterval = (int)(slowPollingInterval.HasValue ? slowPollingInterval.Value : TimeSpan.FromSeconds(DataSetSlowPollingIntervalInSeconds)).TotalMilliseconds; this.mergeMethod = mergeMethod.ToString(); this.isComplete = isComplete; }
/// <summary>Creates a new instance of the PortalDataSetV2 class</summary> /// <param name="data">Array of data to be returned</param> /// <param name="namePropertyName">Name of the name property used for data merging</param> /// <param name="pollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling normally</param> /// <param name="fastPollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling fast</param> /// <param name="mergeMethod">The merge method</param> /// <param name="isComplete">Indicates whether the data set is complete or partial</param> public PortalDataSet( object data, TimeSpan?pollingInterval = null, TimeSpan?fastPollingInterval = null, TimeSpan?slowPollingInterval = null, PortalDataSetMergeMethod mergeMethod = PortalDataSetMergeMethod.Cascade, bool isComplete = true, IEnumerable <PartialDataError> partialErrors = null) { this.data = data ?? new object[] { }; this.pollingInterval = (int)(pollingInterval.HasValue ? pollingInterval.Value : TimeSpan.FromSeconds(DataSetNormalPollingIntervalInSeconds)).TotalMilliseconds; this.fastPollingInterval = (int)(fastPollingInterval.HasValue ? fastPollingInterval.Value : TimeSpan.FromSeconds(DataSetFastPollingIntervalInSeconds)).TotalMilliseconds; this.slowPollingInterval = (int)(slowPollingInterval.HasValue ? slowPollingInterval.Value : TimeSpan.FromSeconds(DataSetSlowPollingIntervalInSeconds)).TotalMilliseconds; this.mergeMethod = mergeMethod.ToString(); this.isComplete = isComplete; this.partialErrors = partialErrors; }
/// <summary>Creates a new instance of the PortalDataSetV2 class</summary> /// <param name="data">Array of data to be returned</param> /// <param name="namePropertyName">Name of the name property used for data merging</param> /// <param name="pollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling normally</param> /// <param name="fastPollingInterval">The duration for which the item can persist on the client before it is considered to have expired when polling fast</param> /// <param name="mergeMethod">The merge method</param> /// <param name="isComplete">Indicates whether the data set is complete or partial</param> public PortalDataSet( object data, TimeSpan? pollingInterval = null, TimeSpan? fastPollingInterval = null, TimeSpan? slowPollingInterval = null, PortalDataSetMergeMethod mergeMethod = PortalDataSetMergeMethod.Cascade, bool isComplete = true, IEnumerable<PartialDataError> partialErrors = null ) { this.data = data ?? new object[] { }; this.pollingInterval = (int)(pollingInterval.HasValue ? pollingInterval.Value : TimeSpan.FromSeconds(DataSetNormalPollingIntervalInSeconds)).TotalMilliseconds; this.fastPollingInterval = (int)(fastPollingInterval.HasValue ? fastPollingInterval.Value : TimeSpan.FromSeconds(DataSetFastPollingIntervalInSeconds)).TotalMilliseconds; this.slowPollingInterval = (int)(slowPollingInterval.HasValue ? slowPollingInterval.Value : TimeSpan.FromSeconds(DataSetSlowPollingIntervalInSeconds)).TotalMilliseconds; this.mergeMethod = mergeMethod.ToString(); this.isComplete = isComplete; this.partialErrors = partialErrors; }