예제 #1
0
        /// <summary>
        /// Builds a <see cref="NullCell"/>.
        /// </summary>
        /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
        /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
        /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
        /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
        /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
        /// <returns>
        /// The cell.
        /// </returns>
        public static NullCell CreateNull(
            string id            = null,
            int?columnsSpanned   = null,
            string details       = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null,
            ILink link           = null)
        {
            var result = new NullCell(id, columnsSpanned, details, null, null, Availability.Enabled, null, null, format, hoverOver, link);

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Builds a disabled <see cref="IConstOutputCell{TValue}"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
        /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
        /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
        /// <param name="validation">OPTIONAL validation to perform.  DEFAULT is no validation.</param>
        /// <param name="availabilityCheck">OPTIONAL availability check to perform.  DEFAULT is a cell with no availability check.</param>
        /// <param name="valueFormat">OPTIONAL format to apply to the cell value.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
        /// <returns>
        /// The cell.
        /// </returns>
        public static InputCell <TValue> CreateDisabledInput <TValue>(
            string id             = null,
            int?columnsSpanned    = null,
            string details        = null,
            Validation validation = null,
            AvailabilityCheck availabilityCheck   = null,
            ICellValueFormat <TValue> valueFormat = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null)
        {
            var result = new InputCell <TValue>(id, columnsSpanned, details, validation, null, Availability.Disabled, availabilityCheck, null, null, valueFormat, format, hoverOver);

            return(result);
        }
예제 #3
0
        /// <summary>
        /// Builds an <see cref="IConstOutputCell{TValue}"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="value">The cell's value.</param>
        /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
        /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
        /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
        /// <param name="valueFormat">OPTIONAL format to apply to the cell value.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
        /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
        /// <returns>
        /// The cell.
        /// </returns>
        public static ConstCell <TValue> CreateConst <TValue>(
            TValue value,
            string id          = null,
            int?columnsSpanned = null,
            string details     = null,
            ICellValueFormat <TValue> valueFormat = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null,
            ILink link           = null)
        {
            var result = new ConstCell <TValue>(value, id, columnsSpanned, details, null, null, Availability.Enabled, null, null, valueFormat, format, hoverOver, link);

            return(result);
        }
예제 #4
0
        /// <summary>
        /// Builds an <see cref="IOperationOutputCell{TValue}"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="operation">The operation.</param>
        /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
        /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
        /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
        /// <param name="validation">OPTIONAL validation to perform.  DEFAULT is no validation.</param>
        /// <param name="valueFormat">OPTIONAL format to apply to the cell value.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
        /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
        /// <returns>
        /// The cell.
        /// </returns>
        public static OperationCell <TValue> CreateOp <TValue>(
            IReturningOperation <TValue> operation,
            string id             = null,
            int?columnsSpanned    = null,
            string details        = null,
            Validation validation = null,
            ICellValueFormat <TValue> valueFormat = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null,
            ILink link           = null)
        {
            var result = new OperationCell <TValue>(operation, id, columnsSpanned, details, validation, null, Availability.Enabled, null, null, null, valueFormat, format, hoverOver, link);

            return(result);
        }
예제 #5
0
        public NullCell DeepCloneWithHoverOver(IHoverOver hoverOver)
        {
            var result = new NullCell(
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.Format?.DeepClone(),
                hoverOver,
                this.Link?.DeepClone());

            return(result);
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NullCell"/> class.
 /// </summary>
 /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
 /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
 /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
 /// <param name="validation">OPTIONAL validation to perform.  DEFAULT is no validation.</param>
 /// <param name="validationEvents">OPTIONAL events that record the validation of this cell.  DEFAULT is a cell that has not yet been validated.</param>
 /// <param name="defaultAvailability">OPTIONAL default availability of the cell (before <paramref name="availabilityCheck"/> is run).  DEFAULT is an enabled cell.</param>
 /// <param name="availabilityCheck">OPTIONAL availability check to perform.  DEFAULT is a cell with no availability check.</param>
 /// <param name="availabilityCheckEvents">OPTIONAL events that record the availability checks on this cell.  DEFAULT is a cell that has not yet had an availability check.</param>
 /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
 /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
 /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
 public NullCell(
     string id             = null,
     int?columnsSpanned    = null,
     string details        = null,
     Validation validation = null,
     IReadOnlyList <CellValidationEventBase> validationEvents = null,
     Availability defaultAvailability    = Availability.Enabled,
     AvailabilityCheck availabilityCheck = null,
     IReadOnlyList <CellAvailabilityCheckEventBase> availabilityCheckEvents = null,
     CellFormat format    = null,
     IHoverOver hoverOver = null,
     ILink link           = null)
     : base(id, columnsSpanned, details, validation, validationEvents, defaultAvailability, availabilityCheck, availabilityCheckEvents)
 {
     this.Format    = format;
     this.HoverOver = hoverOver;
     this.Link      = link;
 }
        public InputCell <TValue> DeepCloneWithHoverOver(IHoverOver hoverOver)
        {
            var result = new InputCell <TValue>(
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.InputEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                hoverOver);

            return(result);
        }
        public ConstCell <TValue> DeepCloneWithHoverOver(IHoverOver hoverOver)
        {
            var result = new ConstCell <TValue>(
                this.Value == null ? default : this.Value.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                hoverOver,
                this.Link?.DeepClone());

            return(result);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="OperationCell{TValue}"/> class.
 /// </summary>
 /// <param name="operation">The operation.</param>
 /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
 /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
 /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
 /// <param name="validation">OPTIONAL validation to perform.  DEFAULT is no validation.</param>
 /// <param name="validationEvents">OPTIONAL events that record the validation of this cell.  DEFAULT is a cell that has not yet been validated.</param>
 /// <param name="defaultAvailability">OPTIONAL default availability of the cell (before <paramref name="availabilityCheck"/> is run).  DEFAULT is an enabled cell.</param>
 /// <param name="availabilityCheck">OPTIONAL availability check to perform.  DEFAULT is a cell with no availability check.</param>
 /// <param name="availabilityCheckEvents">OPTIONAL events that record the availability checks on this cell.  DEFAULT is a cell that has not yet had an availability check.</param>
 /// <param name="operationExecutionEvents">OPTIONAL events that record the execution of <paramref name="operation"/>.  DEFAULT is a cell who's operation has not yet been executed.</param>
 /// <param name="valueFormat">OPTIONAL format to apply to the cell value.  DEFAULT is to leave the format unchanged.</param>
 /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
 /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
 /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
 public OperationCell(
     IReturningOperation <TValue> operation,
     string id             = null,
     int?columnsSpanned    = null,
     string details        = null,
     Validation validation = null,
     IReadOnlyList <CellValidationEventBase> validationEvents = null,
     Availability defaultAvailability    = Availability.Enabled,
     AvailabilityCheck availabilityCheck = null,
     IReadOnlyList <CellAvailabilityCheckEventBase> availabilityCheckEvents = null,
     IReadOnlyList <CellOpExecutionEventBase> operationExecutionEvents      = null,
     ICellValueFormat <TValue> valueFormat = null,
     CellFormat format    = null,
     IHoverOver hoverOver = null,
     ILink link           = null)
     : base(id, columnsSpanned, details, validation, validationEvents, defaultAvailability, availabilityCheck, availabilityCheckEvents, operation, operationExecutionEvents)
 {
     this.ValueFormat = valueFormat;
     this.Format      = format;
     this.HoverOver   = hoverOver;
     this.Link        = link;
 }
예제 #10
0
 protected virtual void Update()
 {
     transform.Rotate(Vector3.up, rotationValue * Time.deltaTime * rotationSpeed);
     if (raycastOn)
     {
         Ray ray = new Ray(raycastPoint.position, raycastPoint.forward);
         raycastLine.SetPosition(0, raycastPoint.position);
         if (Physics.Raycast(ray, out RaycastHit hit, 1000, Database.Layers.UILayer))
         {
             GameObject hitGameObject = hit.transform.gameObject;
             raycastEnd.gameObject.SetActive(true);
             raycastLine.SetPosition(1, hit.point);
             raycastEnd.position = hit.point;
             if (hitGameObject.TryGetComponent(out IHoverOver hoverOver))
             {
                 if (hoverOver != lastHoverOver)
                 {
                     if (lastHoverOver != null)
                     {
                         lastHoverOver.OnHoverEnd();
                     }
                     lastHoverOver = hoverOver;
                     hoverOver.OnHoverStart();
                 }
             }
             else if (lastHoverOver != null)
             {
                 lastHoverOver.OnHoverEnd();
                 lastHoverOver = null;
             }
             if (hitGameObject.TryGetComponent(out IClickable clickable))
             {
                 lastClickable   = clickable;
                 lastClickableGO = hitGameObject;
             }
             else
             {
                 lastClickable   = null;
                 lastClickableGO = null;
             }
         }
         else
         {
             if (Physics.Raycast(ray, out hit))
             {
                 raycastEnd.gameObject.SetActive(true);
                 raycastLine.SetPosition(1, hit.point);
                 raycastEnd.position = hit.point;
             }
             else
             {
                 raycastLine.SetPosition(1, raycastPoint.position + raycastPoint.forward * 1000);
                 raycastEnd.gameObject.SetActive(false);
             }
             if (lastHoverOver != null)
             {
                 lastHoverOver.OnHoverEnd();
             }
             lastHoverOver   = null;
             lastClickable   = null;
             lastClickableGO = null;
         }
     }