Show / Hide Table of Contents

    Class Protocol

    A Protocol defines a plan for collecting (via Probes), anonymizing (via Anonymizers), and storing (via LocalDataStores and RemoteDataStores) data from a device. Study organizers use Sensus to configure the study's Protocol. Study participants use Sensus to load a Protocol and enroll in the study. All of this happens within the Sensus app.

    Inheritance
    System.Object
    Protocol
    Implements
    System.ComponentModel.INotifyPropertyChanged
    IProtocol
    Namespace: Sensus
    Assembly: SensusAndroid.dll
    Syntax
    public class Protocol : Object, INotifyPropertyChanged, IProtocol

    Fields

    GPS_DEFAULT_ACCURACY_METERS

    Declaration
    public const int GPS_DEFAULT_ACCURACY_METERS = 25
    Field Value
    Type Description
    System.Int32

    GPS_DEFAULT_DEFERRAL_DISTANCE_METERS

    Declaration
    public const int GPS_DEFAULT_DEFERRAL_DISTANCE_METERS = 500
    Field Value
    Type Description
    System.Int32

    GPS_DEFAULT_DEFERRAL_TIME_MINUTES

    Declaration
    public const int GPS_DEFAULT_DEFERRAL_TIME_MINUTES = 5
    Field Value
    Type Description
    System.Int32

    GPS_DEFAULT_MIN_DISTANCE_DELAY_METERS

    Declaration
    public const int GPS_DEFAULT_MIN_DISTANCE_DELAY_METERS = 50
    Field Value
    Type Description
    System.Int32

    GPS_DEFAULT_MIN_TIME_DELAY_MS

    Declaration
    public const int GPS_DEFAULT_MIN_TIME_DELAY_MS = 5000
    Field Value
    Type Description
    System.Int32

    MANAGED_URL_STRING

    Declaration
    public const string MANAGED_URL_STRING = "managed"
    Field Value
    Type Description
    System.String

    Properties

    Agent

    Gets or sets the SensingAgent that controls this Protocol. See here for more information. This property is not serialized because, on Android, the assembly containing its type is not necessarily in the app's executing assembly; rather, on Android, the type might be contained in an assembly (i.e., DLL) that has been provided by a third-party for run-time code injection (plug-in). Instead of storing the SensingAgent directly, we therefore store the assembly bytes and the identifier of the agent within the assembly, so that we can load the agent at run time.

    Declaration
    public SensingAgent Agent { get; set; }
    Property Value
    Type Description
    SensingAgent

    The agent.

    AgentAssemblyBytes

    Bytes of the assembly in which the Agent is contained.

    Declaration
    public byte[] AgentAssemblyBytes { get; set; }
    Property Value
    Type Description
    System.Byte[]

    The agent assembly bytes.

    AgentId

    Id of the Agent to use.

    Declaration
    public string AgentId { get; set; }
    Property Value
    Type Description
    System.String

    The agent identifier.

    AgentPolicy

    Gets or sets the agent policy.

    Declaration
    public JObject AgentPolicy { get; set; }
    Property Value
    Type Description
    Newtonsoft.Json.Linq.JObject

    The agent policy JSON.

    AlertExclusionWindowString

    A comma-separated list of time windows during which alerts from Sensus (e.g., notifications about new surveys) should not have a sound or vibration associated with them. The format is the same as described for TriggerWindowsString, except that exact times (e.g., 11:32am) do not make any sense -- only windows (e.g., 11:32am-1:00pm) do. The start time must precede the end time (e.g., 19:00-2:00 is not permitted). To specify, such a time, provide both intervals (e.g.: 0:00-2:00,19:00-23:59).

    Declaration
    [EntryStringUiProperty("Alert Exclusion Windows:", true, 36, false)]
    public string AlertExclusionWindowString { get; set; }
    Property Value
    Type Description
    System.String

    The alert exclusion window string.

    AllowCopy

    Whether or not to allow the user to copy the Protocol.

    Declaration
    [OnOffUiProperty("Allow Copy:", true, 42)]
    public bool AllowCopy { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AllowLocalDataShare

    Whether or not to allow the user to share local data collected on the device.

    Declaration
    [OnOffUiProperty("Allow Local Data Share:", true, 44)]
    public bool AllowLocalDataShare { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AllowParticipantIdReset

    Whether or not to allow the user to reset their participant ID. See ParticipantId and StartConfirmationMode for more information.

    Declaration
    [OnOffUiProperty("Allow ID Reset:", true, 45)]
    public bool AllowParticipantIdReset { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if allow participant identifier reset; otherwise, false.

    AllowParticipationScanning

    Whether or not to allow the user to display/scan participation QR codes for the Protocol.

    Declaration
    [OnOffUiProperty("Allow Participation Scanning:", true, 41)]
    public bool AllowParticipationScanning { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AllowPause

    Whether or not to allow the user to put the protocol into the Paused state.

    Declaration
    [OnOffUiProperty("Allow Pause:  ", true, 48)]
    public bool AllowPause { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow pause; otherwise, false.

    AllowSubmitData

    Whether or not to allow the user to manually submit data being collected by the Protocol.

    Declaration
    [OnOffUiProperty("Allow Submit Data:", true, 40)]
    public bool AllowSubmitData { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AllowTagging

    Whether or not to allow the user to enter tagging mode. See this article for more information.

    Declaration
    [OnOffUiProperty("Allow Tagging:", true, 46)]
    public bool AllowTagging { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if allow tagging; otherwise, false.

    AllowTestPushNotification

    Whether or not to allow the user to request a test push notification.

    Declaration
    [OnOffUiProperty("Allow Test Push:  ", true, 49)]
    public bool AllowTestPushNotification { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if allow test push notification; otherwise, false.

    AllowViewData

    Whether or not to allow the user to view data being collected by the Protocol.

    Declaration
    [OnOffUiProperty("Allow View Data:", true, 38)]
    public bool AllowViewData { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AllowViewStatus

    Whether or not to allow the user to view the status of the Protocol.

    Declaration
    [OnOffUiProperty("Allow View Status:", true, 39)]
    public bool AllowViewStatus { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    AsymmetricEncryptionPublicKey

    Sensus is able to use asymmetric key encryption to secure data before transmission from the device to a remote endpoint (e.g., AWS S3). This provides a layer of security on top of SSL encryption and certificate pinning. For example, even if an attacker is able to intercept and decrypt a service request (e.g., write data) to AWS S3 via a man-in-the-middle attack, the attacker would not be able to decrypt the Sensus data payload, which is encrypted with an additional public/private key pair that you control. This protects against two threats. First, it protects against the case where a man-in-the-middle has gained access to your pinned private encryption key and intercepts data. Second, it protects against unauthorized access to Sensus data payloads after storage within the intended system (e.g., within AWS S3). In the latter case, the data payloads are transferred to the correct server, but they live unencrypted on that system. Asymmetric encryption prevents unauthorized access to the data by ensuring that Sensus data payloads can only be decrypted by those who have the asymmetric private encryption key. To use asymmetric data encryption within Sensus, you must generate a public/private key pair and enter the public key within AsymmetricEncryptionPublicKey. You can generate a public/private key pair in the appropriate format using the following steps (on Mac):

    • Generate a 2048-bit RSA PRIVATE KEY:
    openssl genrsa -des3 -out private.pem 2048
    
    • Extract the PUBLIC KEY for entering into your Sensus Protocol:
    openssl rsa -in private.pem -outform PEM -pubout -out public.pem
    
    • Use the PUBLIC KEY contained within public.pem as AsymmetricEncryptionPublicKey.

    Keep all PRIVATE KEY information safe and secure. Never share it.

    Declaration
    [EntryStringUiProperty("Asymmetric Encryption Public Key:", true, 37, false)]
    public string AsymmetricEncryptionPublicKey { get; set; }
    Property Value
    Type Description
    System.String

    The asymmetric encryption public key.

    AuthenticationService

    The authentication service. This is serialized to JSON; however, the only thing that is retained in the serialized JSON is the service base URL. No account or credential information is serialized; rather, this information is refreshed when needed.

    Declaration
    public AuthenticationService AuthenticationService { get; set; }
    Property Value
    Type Description
    AuthenticationService

    The management service.

    AvailableTags

    The tags to make available when in tagging mode. See this article for more information.

    Declaration
    [EditableListUiProperty("Available Tags:", true, 47, false)]
    public List<string> AvailableTags { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The tags.

    Caption

    Declaration
    public string Caption { get; }
    Property Value
    Type Description
    System.String

    CompatibilityMode

    Specifies whether the current Protocol should be compatible with Android only, iOS only, or both.

    Declaration
    [ListUiProperty]
    public ProtocolCompatibilityMode CompatibilityMode { get; set; }
    Property Value
    Type Description
    ProtocolCompatibilityMode

    The protocol compatibility mode.

    ContactEmail

    An email address for the individual who is responsible for handling questions associated with this study.

    Declaration
    [EntryStringUiProperty("Contact Email:", true, 24, false)]
    public string ContactEmail { get; set; }
    Property Value
    Type Description
    System.String

    The contact email.

    ContinueIndefinitely

    Whether or not to execute the Protocol forever after it has started.

    Declaration
    [OnOffUiProperty("Continue Indefinitely:", true, 19)]
    public bool ContinueIndefinitely { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to execute forever; otherwise, false.

    Description

    A detailed description of the Protocol (e.g., what it does, who it is intended for, etc.).

    Declaration
    [EditorUiProperty(null, true, 15, false)]
    public string Description { get; set; }
    Property Value
    Type Description
    System.String

    The description.

    DisplayParticipationPercentageInForegroundServiceNotification

    Available on Android only. Whether or not to display the participation percentage (see ParticipationHorizonDays) in the foreground service notification. If multiple Protocols enable this option, then the average percentage across these will be displayed.

    Declaration
    [OnOffUiProperty("(Android) Display Participation:", true, 55)]
    public bool DisplayParticipationPercentageInForegroundServiceNotification { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if display participation percentage in foreground service notification; otherwise, false.

    EndDate

    The date on which the Protocol will stop running. Only has an effect if ContinueIndefinitely is false.

    Declaration
    [DateUiProperty("End Date:", true, 20, false)]
    public DateTime EndDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    The end date.

    EndTime

    The time at which the Protocol will stop running. Only has an effect if ContinueIndefinitely is false.

    Declaration
    [TimeUiProperty("End Time:", true, 21, false)]
    public TimeSpan EndTime { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    The end time.

    EnvelopeEncryptor

    Declaration
    public IEnvelopeEncryptor EnvelopeEncryptor { get; }
    Property Value
    Type Description
    IEnvelopeEncryptor

    GpsDeferLocationUpdates

    Available on iOS only. Whether or not to defer location updates until the app is active, thereby conserving battery.

    Declaration
    [OnOffUiProperty("(iOS) GPS - Defer Location Updates:", true, 34)]
    public bool GpsDeferLocationUpdates { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if gps defer location updates; otherwise, false.

    GpsDeferralDistanceMeters

    Available on iOS only. How far to travel before deferred location updates are delivered.

    Declaration
    [EntryFloatUiProperty("(iOS) GPS - Deferral Distance (Meters):", true, 35, false)]
    public float GpsDeferralDistanceMeters { get; set; }
    Property Value
    Type Description
    System.Single

    The gps deferral distance meters.

    GpsDeferralTimeMinutes

    Available on iOS only. How long to wait before deferred location updates are delivered.

    Declaration
    [EntryFloatUiProperty("(iOS) GPS - Deferral Time (Mins.):", true, 36, false)]
    public float GpsDeferralTimeMinutes { get; set; }
    Property Value
    Type Description
    System.Single

    The gps deferral time minutes.

    GpsDesiredAccuracyMeters

    The desired accuracy in meters of the collected GPS readings. There are no guarantees that this accuracy will be achieved.

    Declaration
    [EntryFloatUiProperty("GPS - Desired Accuracy (Meters):", true, 27, true)]
    public float GpsDesiredAccuracyMeters { get; set; }
    Property Value
    Type Description
    System.Single

    The GPS desired accuracy, in meters.

    GpsListenForSignificantChanges

    Available on iOS only. Whether or not to use significant changes in location (e.g., moving between cellular towers) in place of GPS.

    Declaration
    [OnOffUiProperty("(iOS) GPS - Significant Changes:", true, 33)]
    public bool GpsListenForSignificantChanges { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if gps listen for significant changes; otherwise, false.

    GpsLongitudeAnonymizationParticipantOffset

    We regenerate the offset every time a protocol starts, so there's no need to serialize it. Furthermore, we never want the offset to be shared.

    Declaration
    public double GpsLongitudeAnonymizationParticipantOffset { get; set; }
    Property Value
    Type Description
    System.Double

    The gps longitude anonymization participant offset.

    GpsLongitudeAnonymizationStudyOffset

    Declaration
    public double GpsLongitudeAnonymizationStudyOffset { get; set; }
    Property Value
    Type Description
    System.Double

    GpsMinDistanceDelayMeters

    The minimum distance in meters to wait between deliveries of GPS readings.

    Declaration
    [EntryFloatUiProperty("GPS - Minimum Distance Delay (Meters):", true, 29, true)]
    public float GpsMinDistanceDelayMeters { get; set; }
    Property Value
    Type Description
    System.Single

    The GPS minimum distance delay, in meters.

    GpsMinTimeDelayMS

    The minimum amount of time in milliseconds to wait between deliveries of GPS readings.

    Declaration
    [EntryIntegerUiProperty("GPS - Minimum Time Delay (MS):", true, 28, true)]
    public int GpsMinTimeDelayMS { get; set; }
    Property Value
    Type Description
    System.Int32

    The GPS minimum time delay, in milliseconds.

    GpsPauseActivityType

    Available on iOS only. The types of activities that should be considered for pausing activities, if GpsPauseLocationUpdatesAutomatically is enabled.

    Declaration
    [ListUiProperty]
    public ActivityType GpsPauseActivityType { get; set; }
    Property Value
    Type Description
    Plugin.Geolocator.Abstractions.ActivityType

    The type of the gps pause activity.

    GpsPauseLocationUpdatesAutomatically

    Available on iOS only. Whether or not to pause location updates when movement is unlikely.

    Declaration
    [OnOffUiProperty("(iOS) GPS - Pause Location Updates:", true, 31)]
    public bool GpsPauseLocationUpdatesAutomatically { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if gps pause location updates automatically; otherwise, false.

    Groupable

    Whether the user should be allowed to group the Protocol with other Protocols to form a bundle that participant's are randomized into.

    Declaration
    [OnOffUiProperty(null, true, 25)]
    public bool Groupable { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if groupable; otherwise, false.

    GroupedProtocols

    Declaration
    public List<Protocol> GroupedProtocols { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Protocol>

    Id

    The study's identifier. All studies on the same device must have unique identifiers. Certain Probes like the BluetoothDeviceProximityProbe rely on the study identifiers to be the same across Android and iOS platforms in order to make detections.

    Declaration
    [EntryStringUiProperty(null, false, 0, true)]
    public string Id { get; set; }
    Property Value
    Type Description
    System.String

    The identifier.

    JsonAnonymizer

    Declaration
    public AnonymizedJsonContractResolver JsonAnonymizer { get; set; }
    Property Value
    Type Description
    AnonymizedJsonContractResolver

    LocalDataStore

    Declaration
    public LocalDataStore LocalDataStore { get; set; }
    Property Value
    Type Description
    LocalDataStore

    LockPasswordHash

    Declaration
    public string LockPasswordHash { get; set; }
    Property Value
    Type Description
    System.String

    LongitudeOffsetParticipantSeededRandom

    Gets a System.Random that is seeded specifically to the participant.

    Declaration
    public Random LongitudeOffsetParticipantSeededRandom { get; }
    Property Value
    Type Description
    System.Random

    The seeded System.Random.

    Name

    A descriptive name for the Protocol.

    Declaration
    [EntryStringUiProperty("Name:", true, 1, true)]
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    The name.

    ParticipantId

    Gets or sets the participant identifier.

    Declaration
    public string ParticipantId { get; set; }
    Property Value
    Type Description
    System.String

    The participant identifier.

    Participation

    Declaration
    public double Participation { get; }
    Property Value
    Type Description
    System.Double

    ParticipationHorizon

    Declaration
    public DateTime ParticipationHorizon { get; }
    Property Value
    Type Description
    System.DateTime

    ParticipationHorizonDays

    The number of days used to calculate the participation percentage. For example, if the participation horizon is 7 days, and the user has been running a ListeningProbe for 1 day, then the participation percentage would be 1/7 (~14%). On the other hand, if the participation horizon is 1 day, then the same user would have a participation percentage of 1/1 (100%). Must be at least 1.

    Declaration
    [EntryIntegerUiProperty("Participation Horizon (Days):", true, 23, true)]
    public int ParticipationHorizonDays { get; set; }
    Property Value
    Type Description
    System.Int32

    The participation horizon, in days.

    PointsOfInterest

    Declaration
    public ConcurrentObservableCollection<PointOfInterest> PointsOfInterest { get; }
    Property Value
    Type Description
    ConcurrentObservableCollection<PointOfInterest>

    Probes

    Declaration
    public List<Probe> Probes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Probe>

    PushNotificationsHub

    The push notification hub to listen to. This can be created within the Azure Portal. The value to use here is the name of the hub (e.g., xxxx-notifications). You must also include the PushNotificationsSharedAccessSignature for this hub.

    Declaration
    [EntryStringUiProperty("Push Notification Hub:", true, 51, false)]
    public string PushNotificationsHub { get; set; }
    Property Value
    Type Description
    System.String

    The push notifications hub.

    PushNotificationsSharedAccessSignature

    The shared access signature for listening for push notifications at the PushNotificationsHub. This value can be obtained by inspecting the Access Policies tab of the Notification Hub within the Azure Portal. Locate the DefaultListenSharedAccessSignature policy and copy the entire value of the connection string into this field.

    Declaration
    [EntryStringUiProperty("Push Notifications Shared Access Signature:", true, 52, false)]
    public string PushNotificationsSharedAccessSignature { get; set; }
    Property Value
    Type Description
    System.String

    The push notifications shared access signature.

    RandomTimeAnchor

    Declaration
    public DateTimeOffset RandomTimeAnchor { get; set; }
    Property Value
    Type Description
    System.DateTimeOffset

    RemoteDataStore

    Declaration
    public RemoteDataStore RemoteDataStore { get; set; }
    Property Value
    Type Description
    RemoteDataStore

    RewardThreshold

    The participation percentage required for a user to be considered eligible for rewards.

    Declaration
    [EntryFloatUiProperty("Reward Threshold:", true, 26, false)]
    public Nullable<float> RewardThreshold { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Single>

    The reward threshold.

    Shareable

    Whether or not to allow the user to share the Protocol.

    Declaration
    [OnOffUiProperty("Allow Protocol Share:", true, 43)]
    public bool Shareable { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to allow; otherwise, false.

    StartConfirmationMode

    The user can be asked to confirm starting the Protocol in serveral ways. See ProtocolStartConfirmationMode for more information.

    Declaration
    [ListUiProperty]
    public ProtocolStartConfirmationMode StartConfirmationMode { get; set; }
    Property Value
    Type Description
    ProtocolStartConfirmationMode

    The protocol start confirmation mode.

    StartDate

    The date on which the Protocol will start running. Only has an effect if StartImmediately is false.

    Declaration
    [DateUiProperty("Start Date:", true, 17, false)]
    public DateTime StartDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    The start date.

    StartImmediately

    Whether or not to start the Protocol immediately after the user has opted into it.

    Declaration
    [OnOffUiProperty("Start Immediately:", true, 16)]
    public bool StartImmediately { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to start immediately; otherwise, false.

    StartIsScheduled

    Declaration
    public bool StartIsScheduled { get; }
    Property Value
    Type Description
    System.Boolean

    StartTime

    The time at which the Protocol will start running. Only has an effect if StartImmediately is false.

    Declaration
    [TimeUiProperty("Start Time:", true, 18, false)]
    public TimeSpan StartTime { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    The start time.

    State

    Declaration
    public ProtocolState State { get; }
    Property Value
    Type Description
    ProtocolState

    StorageDirectory

    Declaration
    public string StorageDirectory { get; set; }
    Property Value
    Type Description
    System.String

    SubCaption

    Declaration
    public string SubCaption { get; }
    Property Value
    Type Description
    System.String

    TaggedEventId

    The current event identifier for tagging. See this article for more information.

    Declaration
    public string TaggedEventId { get; set; }
    Property Value
    Type Description
    System.String

    The tag identifier.

    TaggedEventTags

    The current tags applied during event tagging. See this article for more information.

    Declaration
    public List<string> TaggedEventTags { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The set tags.

    TaggingEndTimestamp

    The time at which the current tagging ended.

    Declaration
    public Nullable<DateTimeOffset> TaggingEndTimestamp { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTimeOffset>

    The tagging end timestamp.

    TaggingStartTimestamp

    The time at which the current tagging started.

    Declaration
    public Nullable<DateTimeOffset> TaggingStartTimestamp { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTimeOffset>

    The tagging start timestamp.

    TaggingsToExport

    A list of taggings to export.

    Declaration
    public List<string> TaggingsToExport { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The taggings to export.

    VariableValue

    Declaration
    public Dictionary<string, string> VariableValue { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.String>

    VariableValueUiProperty

    A Protocol may delare variables whose values can be easily reused throughout the system. For example, if many of the survey inputs share a particular substring (e.g., the study name), consider defining a variable named study-name that holds the study name. You can then reference this variable when defining the survey input label via {study-name}. The format of this field is variable-name:variable-value.

    Declaration
    [EditableListUiProperty("Variables:", true, 30, false)]
    public List<string> VariableValueUiProperty { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The variable value user interface property.

    Methods

    ApplySettingsAsync(List<ProtocolSetting>, CancellationToken)

    Applies a list of ProtocolSetting to the current Protocol and its Probes.

    Declaration
    public Task<bool> ApplySettingsAsync(List<ProtocolSetting> settings, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Collections.Generic.List<ProtocolSetting> settings

    Settings.

    System.Threading.CancellationToken cancellationToken

    Cancellation token.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if either the current Protocol or any of its Probes were restarted as a result of applying the passed ProtocolSettings.

    CancelScheduledStartAsync()

    Declaration
    public Task CancelScheduledStartAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    CancelScheduledStopAsync()

    Declaration
    public Task CancelScheduledStopAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    CopyAsync(Boolean, Boolean)

    Declaration
    public Task<Protocol> CopyAsync(bool resetId, bool register)
    Parameters
    Type Name Description
    System.Boolean resetId
    System.Boolean register
    Returns
    Type Description
    System.Threading.Tasks.Task<Protocol>

    CreateAsync(String)

    Declaration
    public static Task<Protocol> CreateAsync(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Threading.Tasks.Task<Protocol>

    DeleteAsync()

    Declaration
    public Task DeleteAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    DeserializeAsync(Byte[], Boolean)

    Declaration
    public static Task<Protocol> DeserializeAsync(byte[] bytes, bool offerToReplaceExistingProtocol)
    Parameters
    Type Name Description
    System.Byte[] bytes
    System.Boolean offerToReplaceExistingProtocol
    Returns
    Type Description
    System.Threading.Tasks.Task<Protocol>

    DeserializeAsync(Uri, Boolean, AmazonS3Credentials)

    Declaration
    public static Task<Protocol> DeserializeAsync(Uri uri, bool offerToReplaceExistingProtocol, AmazonS3Credentials credentials = null)
    Parameters
    Type Name Description
    System.Uri uri
    System.Boolean offerToReplaceExistingProtocol
    AmazonS3Credentials credentials
    Returns
    Type Description
    System.Threading.Tasks.Task<Protocol>

    DisplayAndStartAsync(Protocol)

    Declaration
    public static Task DisplayAndStartAsync(Protocol protocol)
    Parameters
    Type Name Description
    Protocol protocol
    Returns
    Type Description
    System.Threading.Tasks.Task

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean

    GetAgent(String, Byte[])

    Gets a SensingAgent from those available.

    Declaration
    public SensingAgent GetAgent(string agentId, byte[] assemblyBytes)
    Parameters
    Type Name Description
    System.String agentId

    Agent identifier.

    System.Byte[] assemblyBytes

    Assembly bytes. This is only permitted on Android, as iOS does not permit dynamic code loading. Attempting to do this crashes the app.

    Returns
    Type Description
    SensingAgent

    The agent.

    GetAgents(Byte[])

    Gets available SensingAgents from the current executing assembly.

    Declaration
    public List<SensingAgent> GetAgents(byte[] assemblyBytes)
    Parameters
    Type Name Description
    System.Byte[] assemblyBytes

    Additional assembly to scan for SensingAgents. Pass null for no assembly, in which case only agents present in the executing assembly (the app codebase) will be loaded. Only permitted on Android

    Returns
    Type Description
    System.Collections.Generic.List<SensingAgent>

    The agents.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    PauseAsync()

    Declaration
    public Task PauseAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ResumeAsync()

    Declaration
    public Task ResumeAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    RunUiTestingProtocolAsync(Stream)

    Declaration
    public static Task RunUiTestingProtocolAsync(Stream uiTestingProtocolFile)
    Parameters
    Type Name Description
    System.IO.Stream uiTestingProtocolFile
    Returns
    Type Description
    System.Threading.Tasks.Task

    Save(String)

    Declaration
    public void Save(string path)
    Parameters
    Type Name Description
    System.String path

    ScheduleAgentControlCompletionCheckAsync(SensingAgent.ControlCompletionCheck)

    Declaration
    public Task ScheduleAgentControlCompletionCheckAsync(SensingAgent.ControlCompletionCheck controlCompletionCheck)
    Parameters
    Type Name Description
    SensingAgent.ControlCompletionCheck controlCompletionCheck
    Returns
    Type Description
    System.Threading.Tasks.Task

    ScheduleStartAsync()

    Declaration
    public Task ScheduleStartAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ScheduleStopAsync()

    Declaration
    public Task ScheduleStopAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ShareAsync()

    Declaration
    public Task ShareAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    StartAsync(CancellationToken)

    Declaration
    public Task StartAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task

    StartWithUserAgreementAsync()

    Starts the current Protocol after displaying a message to the user indicating what is about to happen. This is also the place where the user's agreement to the Protocol is obtained through the various ProtocolStartConfirmationMode options. After obtaining agreement, a ProgressPage is displayed to show progress and prevent the user from interacting with the app until the Protocol is fully started.

    Declaration
    public Task StartWithUserAgreementAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    StopAsync()

    Declaration
    public Task StopAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    TestHealthAsync(Boolean, CancellationToken)

    Declaration
    public Task<List<AnalyticsTrackedEvent>> TestHealthAsync(bool userInitiated, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Boolean userInitiated
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.List<AnalyticsTrackedEvent>>

    TimeIsWithinAlertExclusionWindow(TimeSpan)

    Declaration
    public bool TimeIsWithinAlertExclusionWindow(TimeSpan time)
    Parameters
    Type Name Description
    System.TimeSpan time
    Returns
    Type Description
    System.Boolean

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    TryGetProbe(Type, out Probe)

    Declaration
    public bool TryGetProbe(Type type, out Probe probe)
    Parameters
    Type Name Description
    System.Type type
    Probe probe
    Returns
    Type Description
    System.Boolean

    TryGetProbe<DatumInterface, ProbeType>(out ProbeType)

    Declaration
    public bool TryGetProbe<DatumInterface, ProbeType>(out ProbeType probe)
        where DatumInterface : IDatum where ProbeType : class, IProbe
    Parameters
    Type Name Description
    ProbeType probe
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    DatumInterface
    ProbeType

    UpdateScriptAgentPolicyAsync(JObject)

    Declaration
    public Task UpdateScriptAgentPolicyAsync(JObject policy)
    Parameters
    Type Name Description
    Newtonsoft.Json.Linq.JObject policy
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateScriptAgentPolicyAsync(CancellationToken)

    Declaration
    public Task UpdateScriptAgentPolicyAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateSensingAgentPolicyAsync(JObject)

    Declaration
    public Task UpdateSensingAgentPolicyAsync(JObject policy)
    Parameters
    Type Name Description
    Newtonsoft.Json.Linq.JObject policy
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateSensingAgentPolicyAsync(CancellationToken)

    Declaration
    public Task UpdateSensingAgentPolicyAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task

    WriteSensingAgentStateDatum(SensingAgentState, SensingAgentState, String, CancellationToken)

    Declaration
    public void WriteSensingAgentStateDatum(SensingAgentState previousState, SensingAgentState currentState, string description, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SensingAgentState previousState
    SensingAgentState currentState
    System.String description
    System.Threading.CancellationToken cancellationToken

    Events

    PropertyChanged

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    StateChanged

    Declaration
    public event EventHandler<ProtocolState> StateChanged
    Event Type
    Type Description
    System.EventHandler<ProtocolState>

    Implements

    System.ComponentModel.INotifyPropertyChanged
    IProtocol
    Back to top Copyright © 2014-2018 University of Virginia
    Generated by DocFX