Пример #1
0
 internal FunctionalId(DatastoreModel parent, string label, string prefix, IdFormat format, int startFrom)
 {
     Label     = label;
     Prefix    = prefix;
     Format    = format;
     StartFrom = startFrom < 0 ? 0 : startFrom;
     Guid      = parent?.GenerateGuid(label) ?? Guid.Empty;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternatePublicFolderItemId"/> class.
 /// </summary>
 /// <param name="format">The format in which the public folder item Id is expressed.</param>
 /// <param name="folderId">The Id of the parent public folder of the public folder item.</param>
 /// <param name="itemId">The Id of the public folder item.</param>
 public AlternatePublicFolderItemId(
     IdFormat format,
     string folderId,
     string itemId)
     : base(format, folderId)
 {
     this.itemId = itemId;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternatePublicFolderItemId"/> class.
 /// </summary>
 /// <param name="format">The format in which the public folder item Id is expressed.</param>
 /// <param name="folderId">The Id of the parent public folder of the public folder item.</param>
 /// <param name="itemId">The Id of the public folder item.</param>
 public AlternatePublicFolderItemId(
     IdFormat format,
     string folderId,
     string itemId)
     : base(format, folderId)
 {
     this.itemId = itemId;
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 public AlternateId(
     IdFormat format,
     string id,
     string mailbox)
     : base(format)
 {
     this.UniqueId = id;
     this.Mailbox = mailbox;
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 public AlternateId(
     IdFormat format,
     string id,
     string mailbox)
     : base(format)
 {
     this.UniqueId = id;
     this.Mailbox  = mailbox;
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 /// <param name="isArchive">Primary (false) or archive (true) mailbox.</param>
 public AlternateId(
     IdFormat format,
     string id,
     string mailbox,
     bool isArchive)
     : base(format)
 {
     this.UniqueId = id;
     this.Mailbox = mailbox;
     this.IsArchive = isArchive;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 /// <param name="isArchive">Primary (false) or archive (true) mailbox.</param>
 public AlternateId(
     IdFormat format,
     string id,
     string mailbox,
     bool isArchive)
     : base(format)
 {
     this.UniqueId  = id;
     this.Mailbox   = mailbox;
     this.IsArchive = isArchive;
 }
Пример #8
0
        public FunctionalId New(string label, string prefix, IdFormat format = IdFormat.Hash, int startFrom = 0)
        {
            if (collection.Any(item => item.Value.Prefix == prefix))
            {
                throw new InvalidOperationException(string.Format("You cannot have multiple FunctionalIds that have the same prefix '{0}'.", prefix));
            }

            FunctionalId value = new FunctionalId(Parent, label, prefix, format, startFrom);

            collection.Add(label, value);

            return(value);
        }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 AlternateId(
     IdFormat format,
     String id,
     String mailbox)
     : super(format)
 /// <summary>
 /// Initializes a new instance of AlternatePublicFolderId.
 /// </summary>
 /// <param name="format">The format in which the public folder Id is expressed.</param>
 /// <param name="folderId">The Id of the public folder.</param>
 public AlternatePublicFolderId(IdFormat format, string folderId)
     : base(format)
 {
     this.FolderId = folderId;
 }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateIdBase"/> class.
 /// </summary>
 /// <param name="format">The format.</param>
 internal AlternateIdBase(IdFormat format)
     : this()
 {
     this.Format = format;
 }
 /// <summary>
 /// Loads the attributes from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal virtual void LoadAttributesFromXml(EwsServiceXmlReader reader)
 {
     this.Format = reader.ReadAttributeValue <IdFormat>(XmlAttributeNames.Format);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateIdBase"/> class.
 /// </summary>
 /// <param name="format">The format.</param>
 internal AlternateIdBase(IdFormat format)
     : this()
 {
     this.Format = format;
 }
 /// <summary>
 /// Initializes a new instance of AlternatePublicFolderId.
 /// </summary>
 /// <param name="format">The format in which the public folder Id is expressed.</param>
 /// <param name="folderId">The Id of the public folder.</param>
 public AlternatePublicFolderId(IdFormat format, string folderId)
     : base(format)
 {
     this.FolderId = folderId;
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlternateId"/> class.
 /// </summary>
 /// <param name="format">The format the Id is expressed in.</param>
 /// <param name="id">The Id.</param>
 /// <param name="mailbox">The SMTP address of the mailbox that the Id belongs to.</param>
 /// <param name="isArchive">Primary (false) or archive (true) mailbox.</param>
 AlternateId(
     IdFormat format,
     String id,
     String mailbox,
     bool isArchive)
     : super(format)
 /// <summary>
 /// Initializes a new instance of AlternatePublicFolderId.
 /// </summary>
 /// <param name="format">The format in which the public folder Id is expressed.</param>
 /// <param name="folderId">The Id of the public folder.</param>
 AlternatePublicFolderId(IdFormat format, String folderId)
     : super(format)
Пример #17
0
 /// <summary>
 /// Loads the attributes from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal virtual void LoadAttributesFromXml(EwsServiceXmlReader reader)
 {
     this.Format = reader.ReadAttributeValue<IdFormat>(XmlAttributeNames.Format);
 }
Пример #18
0
 public FunctionalId New(Entity entity, string prefix, IdFormat format = IdFormat.Hash, int startFrom = 0)
 {
     return(New(entity.Label.Name, prefix, format, startFrom));
 }
Пример #19
0
 /// <summary>
 /// Loads the attributes from json.
 /// </summary>
 /// <param name="responseObject">The response object.</param>
 internal virtual void LoadAttributesFromJson(JsonObject responseObject)
 {
     this.Format = responseObject.ReadEnumValue <IdFormat>(XmlAttributeNames.Format);
 }