/// <summary>
 /// Create a connection with a new APObject instance.
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="obj">The instance of the new APObject.</param>
 public FluentAPConnection FromNewObject(string endpointLabel, APObject obj)
 {
     this.EndpointALabel   = endpointLabel;
     this.EndpointAContent = obj;
     this.EndpointAId      = null;
     return(this);
 }
 /// <summary>
 /// Create a connection with a new APObject instance.
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="obj">The instance of the new APObject.</param>
 public APConnection ToNewObject(string endpointLabel, APObject obj)
 {
     this.EndpointBLabel   = endpointLabel;
     this.EndpointBContent = obj;
     this.EndpointBId      = null;
     return(Build());
 }
 /// <summary>
 /// Create a connection with an existing APObject.
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="objectId">The id of the existing APObject.</param>
 public APConnection ToExistingObject(string endpointLabel, string objectId)
 {
     this.EndpointBLabel   = endpointLabel;
     this.EndpointBContent = null;
     this.EndpointBId      = objectId;
     return(Build());
 }
        /// <summary>
        /// Creates a new instance of an APConnection object between two new APObject instances.
        /// </summary>
        /// <param name="type">The name of the relation for which to create a new connection.</param>
        /// <param name="labelA">Label for the first endpoint in the connection.</param>
        /// <param name="objectA">The instance of the new object corresponding to the first endpoint in the connection.</param>
        /// <param name="labelB">Label for the second endpoint in the connection.</param>
        /// <param name="objectB">The instance of the new object corresponding to the second endpoint in the connection.</param>
        public APConnection(string type, string labelA, APObject objectA, string labelB, APObject objectB)
            : base(type)
        {
            Endpoint ep1, ep2;
            string   nullId = null;

            if (objectA.IsNewInstance == true)
            {
                ep1         = new Endpoint(labelA, nullId);
                ep1.Content = objectA;
            }
            else
            {
                ep1 = new Endpoint(labelA, objectA.Id);
            }

            if (objectB.IsNewInstance == true)
            {
                ep2         = new Endpoint(labelB, nullId);
                ep2.Content = objectB;
            }
            else
            {
                ep2 = new Endpoint(labelB, objectB.Id);
            }

            this.Endpoints = new EndpointPair(ep1, ep2);
        }
 /// <summary>
 /// Creates a new endpoint corresponding to a new APObject.
 /// </summary>
 /// <param name="label">The label for the endpoint.</param>
 /// <param name="content">The new APObject associated with the endpoint.</param>
 public Endpoint(string label, APObject content)
 {
     this.Label   = label;
     this.Content = content;
     if (content != null)
     {
         this.ObjectId = content.Id;
     }
 }
 /// <summary>
 /// Creates a new instance of an APConnection object between a new and an existing APObject instance.
 /// </summary>
 /// <param name="type">The name of the relation for which to create a new connection.</param>
 /// <param name="labelA">Label for the first endpoint in the connection.</param>
 /// <param name="objectA">The instance of the new object corresponding to the first endpoint in the connection.</param>
 /// <param name="labelB">Label for the second endpoint in the connection.</param>
 /// <param name="objectIdB">Id of the existing object corresponding to the second endpoint in the connection.</param>
 public APConnection(string type, string labelA, APObject objectA, string labelB, string objectIdB)
     : base(type)
 {
     Endpoint ep1, ep2;
     if (objectA.IsNewInstance == false)
     {
         ep1 = new Endpoint(labelA, objectA.Id);
         ep2 = new Endpoint(labelB, objectIdB);
     }
     else
     {
         string nullId = null;
         ep1 = new Endpoint(labelA, nullId);
         ep2 = new Endpoint(labelB, objectIdB);
         ep1.Content = objectA;
     }
     this.Endpoints = new EndpointPair(ep1, ep2);
 }
 /// <summary>
 /// Create a connection with a new APObject instance. 
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="obj">The instance of the new APObject.</param>
 public FluentAPConnection FromNewObject(string endpointLabel, APObject obj)
 {
     this.EndpointALabel = endpointLabel;
     this.EndpointAContent = obj;
     this.EndpointAId = null;
     return this;
 }
 /// <summary>
 /// Creates a new endpoint corresponding to a new APObject.
 /// </summary>
 /// <param name="label">The label for the endpoint.</param>
 /// <param name="content">The new APObject associated with the endpoint.</param>
 public Endpoint(string label, APObject content)
 {
     this.Label = label;
     this.Content = content; 
     if( content != null )
         this.ObjectId = content.Id;
 }
Beispiel #9
0
 protected APUser(APObject obj)
     : base(obj)
 {
 }
 /// <summary>
 /// Copy and create a new instance from an existing instance.
 /// </summary>
 /// <param name="existing">Existing object instance.</param>
 protected APObject(APObject existing) : base(existing)
 {
     this.Acl = new Acl();
     this.Acl.SetInternal(existing.Acl.Claims);
 }
 /// <summary>
 /// Creates a new instance of APDevice and copies the internal state from the provided object.
 /// </summary>
 /// <param name="device">Device object with the state to be copied.</param>
 protected APDevice(APObject device)
     : base(device)
 {
     this.Channels = new MultiValueCollection <string>(this, "channels");
 }
 public APConnection ToBatchObjectReference(string endpointLabel, APObjectReference reference)
 {
     this.EndpointBLabel = endpointLabel;
     this.EndpointBContent = null;
     this.EndpointBId = null;
     this.EndpointBObjectReference = reference;
     return Build();
 }
 /// <summary>
 /// Creates a new instance of an APConnection objects for use inside a batch api.
 /// This api will create a connection between a new object and a new object via its batch api reference.
 /// </summary>
 /// <param name="type">The name of the relation for which to create a new connection.</param>
 /// <param name="labelA">Label for the first endpoint in the connection.</param>
 /// <param name="objectA">The instance of the new object corresponding to the first endpoint in the connection.</param>
 /// <param name="labelB">Label for the second endpoint in the connection.</param>
 /// <param name="objectReferenceB">Batch object reference to the APObject associated with endpoint B.</param>
 public APConnection(string type, string labelA, APObject objectA, string labelB, APObjectReference objectReferenceB)
     : base(type)
 {
     this.Endpoints = new EndpointPair(new Endpoint(labelA, objectA),new Endpoint(labelB, objectReferenceB));
 }
Beispiel #14
0
 protected APUser(APObject obj)
     : base(obj)
 {
 }
Beispiel #15
0
 //special constructor called by SDK
 public ImageDetails(Appacitive.Sdk.APObject existing)
     : base(existing)
 {
 }
 /// <summary>
 /// Create a connection with a new APObject instance.
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="obj">The instance of the new APObject.</param>
 public APConnection ToNewObject(string endpointLabel, APObject obj)
 {
     this.EndpointBLabel = endpointLabel;
     this.EndpointBContent = obj;
     this.EndpointBId = null;
     return Build();
 }
 /// <summary>
 /// Copy and create a new instance from an existing instance.
 /// </summary>
 /// <param name="existing">Existing object instance.</param>
 protected APObject(APObject existing) : base(existing)
 {
     this.Acl = new Acl();
     this.Acl.SetInternal(existing.Acl.Claims);
 }
 /// <summary>
 /// Create a connection with an existing APObject.
 /// </summary>
 /// <param name="endpointLabel">The label for the endpoint.</param>
 /// <param name="objectId">The id of the existing APObject.</param>
 public APConnection ToExistingObject(string endpointLabel, string objectId)
 {
     this.EndpointBLabel = endpointLabel;
     this.EndpointBContent = null;
     this.EndpointBId = objectId;
     return Build();
 }
 /// <summary>
 /// Creates a new instance of APDevice and copies the internal state from the provided object.
 /// </summary>
 /// <param name="device">Device object with the state to be copied.</param>
 protected APDevice(APObject device)
     : base(device)
 {
     this.Channels = new MultiValueCollection<string>(this, "channels");
 }
        /// <summary>
        /// Creates a new instance of an APConnection object between two new APObject instances.
        /// </summary>
        /// <param name="type">The name of the relation for which to create a new connection.</param>
        /// <param name="labelA">Label for the first endpoint in the connection.</param>
        /// <param name="objectA">The instance of the new object corresponding to the first endpoint in the connection.</param>
        /// <param name="labelB">Label for the second endpoint in the connection.</param>
        /// <param name="objectB">The instance of the new object corresponding to the second endpoint in the connection.</param>
        public APConnection(string type, string labelA, APObject objectA, string labelB, APObject objectB)
            : base(type)
        {
            Endpoint ep1, ep2;
            string nullId = null;
            if (objectA.IsNewInstance == true)
            {
                ep1 = new Endpoint(labelA, nullId);
                ep1.Content = objectA;
            }
            else
                ep1 = new Endpoint(labelA, objectA.Id);

            if (objectB.IsNewInstance == true)
            {   
                ep2 = new Endpoint(labelB, nullId);
                ep2.Content = objectB;
            }
            else
                ep2 = new Endpoint(labelB, objectB.Id);

            this.Endpoints = new EndpointPair(ep1, ep2);
        }
 /// <summary>
 /// Copy and create a new instance from an existing instance.
 /// </summary>
 /// <param name="existing">Existing object instance.</param>
 protected APObject(APObject existing) : base(existing)
 {
     this.Acl = new Acl();
     this.Acl.SetInternal(existing.Acl.Claims);
     this.Aggregates = new Dictionary<string, decimal>(StringComparer.OrdinalIgnoreCase);
 }