コード例 #1
0
ファイル: ComponentPlacement.cs プロジェクト: Tyler-Zhou/SHFB
        /// <summary>
        /// Constructor.  Indicate the placement action, component ID, and instance to act on.
        /// </summary>
        /// <param name="placement">The placement action to use</param>
        /// <param name="id">A build component ID for use with the <c>Before</c>, <c>After</c>, or
        /// <c>Replace</c> <see cref="Placement"/> action.</param>
        /// <param name="instance">The instance to use with the placement option</param>
        /// <exception cref="ArgumentException">This is thrown if <c>Before</c>, <c>After</c>, or <c>Replace</c>
        /// is specified without an ID or if instance is less than one.</exception>
        public ComponentPlacement(PlacementAction placement, string id, int instance) : this(placement, id)
        {
            if (instance < 1)
            {
                throw new ArgumentException("Instance must be greater than or equal to one", nameof(instance));
            }

            this.Instance = instance;
        }
コード例 #2
0
        /// <summary>
        /// Constructor.  Indicate the placement action and an optional component ID related to it if needed.
        /// </summary>
        /// <param name="placement">The placement action to use</param>
        /// <param name="id">A build component ID for use with the <c>Before</c>, <c>After</c>, or
        /// <c>Replace</c> <see cref="Placement"/> action.</param>
        /// <exception cref="ArgumentException">This is thrown if <c>Before</c>, <c>After</c>, or <c>Replace</c>
        /// is specified without an ID or if one is specified with <c>None</c>, <c>Start</c>, or <c>End</c>.</exception>
        public ComponentPlacement(PlacementAction placement, string id)
        {
            if((placement == PlacementAction.Before || placement == PlacementAction.After ||
              placement == PlacementAction.Replace) && String.IsNullOrWhiteSpace(id))
                throw new ArgumentException("An ID must be specified if Before, After, or Replace is used " +
                    "for the placement action", "id");

            if((placement == PlacementAction.None || placement == PlacementAction.Start ||
              placement == PlacementAction.End) && !String.IsNullOrWhiteSpace(id))
                throw new ArgumentException("An ID cannot be specified if None, Start, or End is used " +
                    "for the placement action", "id");

            this.Placement = placement;
            this.Id = id;
            this.Instance = 1;
        }
コード例 #3
0
ファイル: ComponentPlacement.cs プロジェクト: Tyler-Zhou/SHFB
        /// <summary>
        /// Constructor.  Indicate the placement action and an optional component ID related to it if needed.
        /// </summary>
        /// <param name="placement">The placement action to use</param>
        /// <param name="id">A build component ID for use with the <c>Before</c>, <c>After</c>, or
        /// <c>Replace</c> <see cref="Placement"/> action.</param>
        /// <exception cref="ArgumentException">This is thrown if <c>Before</c>, <c>After</c>, or <c>Replace</c>
        /// is specified without an ID or if one is specified with <c>None</c>, <c>Start</c>, or <c>End</c>.</exception>
        public ComponentPlacement(PlacementAction placement, string id)
        {
            if ((placement == PlacementAction.Before || placement == PlacementAction.After ||
                 placement == PlacementAction.Replace) && String.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException("An ID must be specified if Before, After, or Replace is used " +
                                            "for the placement action", nameof(id));
            }

            if ((placement == PlacementAction.None || placement == PlacementAction.Start ||
                 placement == PlacementAction.End) && !String.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException("An ID cannot be specified if None, Start, or End is used " +
                                            "for the placement action", nameof(id));
            }

            this.Placement = placement;
            this.Id        = id;
            this.Instance  = 1;
        }
コード例 #4
0
 public virtual UpdateResult performPlacementAction(PlacementAction placementAction, Statement filterStatement) {
   object[] results = this.Invoke("performPlacementAction", new object[] { placementAction, filterStatement });
   return ((UpdateResult) (results[0]));
 }
コード例 #5
0
        /// <summary>
        /// Constructor.  Indicate the placement action, component ID, and instance to act on.
        /// </summary>
        /// <param name="placement">The placement action to use</param>
        /// <param name="id">A build component ID for use with the <c>Before</c>, <c>After</c>, or
        /// <c>Replace</c> <see cref="Placement"/> action.</param>
        /// <param name="instance">The instance to use with the placement option</param>
        /// <exception cref="ArgumentException">This is thrown if <c>Before</c>, <c>After</c>, or <c>Replace</c>
        /// is specified without an ID or if instance is less than one.</exception>
        public ComponentPlacement(PlacementAction placement, string id, int instance) : this(placement, id)
        {
            if(instance < 1)
                throw new ArgumentException("Instance must be greater than or equal to one", "instance");

            this.Instance = instance;
        }