Пример #1
0
        private void Ready(Vector3 position, Vector3 rotation)
        {
            Status = FeatureStatus.Ready;

            origin = home;

            destination = position;

            this.angle = rotation.y > 180 ? rotation.y - 360 : rotation.y;

            Vector3 angle = Quaternion.LookRotation(home, position).eulerAngles;

            offset = Vector3.zero;

            offset.x += distance * Mathf.Sin(angle.y * Mathf.Deg2Rad);

            offset.y += height;

            offset.z += distance * Mathf.Cos(angle.y * Mathf.Deg2Rad);

            camera.localPosition = offset;

            platform.transform.eulerAngles = Vector3.zero;

            SetActive(true);

            Status = FeatureStatus.Follow;
        }
Пример #2
0
 protected void RefreshFeatureNode(FeatureInfo feature, TreeNode node, FeatureStatus status)
 {
     node.ToolTipText      = TooltipHelper.CreateFeatureTooltip(feature);
     node.ForeColor        = ConverterUtil.GetStatusColor(status);
     node.ImageKey         = GetImageKey(status);
     node.SelectedImageKey = node.ImageKey;
 }
 public FeatureFlagsFeatureViewModel(
     string name,
     FeatureStatus status)
 {
     Name   = name;
     Status = status;
 }
Пример #4
0
 internal void Merge(FeatureLevel other)
 {
     IsExperimental |= other.IsExperimental;
     SupportsFrameLevelMultithreading = (FeatureStatus)Math.Max((int)SupportsFrameLevelMultithreading, (int)other.SupportsFrameLevelMultithreading);
     SupportsSliceLevelMultithreading = (FeatureStatus)Math.Max((int)SupportsSliceLevelMultithreading, (int)other.SupportsSliceLevelMultithreading);
     SupportsDrawHorizBand            = (FeatureStatus)Math.Max((int)SupportsDrawHorizBand, (int)other.SupportsDrawHorizBand);
     SupportsDirectRendering          = (FeatureStatus)Math.Max((int)SupportsDirectRendering, (int)other.SupportsDirectRendering);
 }
Пример #5
0
 public static AuditedFeatureFlagFeature CreateFrom(string name, FeatureStatus status)
 {
     return(new AuditedFeatureFlagFeature
     {
         Name = name,
         Status = status
     });
 }
Пример #6
0
 public override int GetHashCode()
 {
     unchecked {
         int result = (FeatureDescription != null ? FeatureDescription.GetHashCode() : 0);
         result = (result * 397) ^ (FeatureStatus != null ? FeatureStatus.GetHashCode() : 0);
         result = (result * 397) ^ (FeatureId != null ? FeatureId.GetHashCode() : 0);
         return(result);
     }
 }
Пример #7
0
 public override int GetHashCode()
 {
     unchecked {
         int result = FeatureDescription?.GetHashCode() ?? 0;
         result = (result * 397) ^ (FeatureStatus?.GetHashCode() ?? 0);
         result = (result * 397) ^ (FeatureId?.GetHashCode() ?? 0);
         return(result);
     }
 }
        private void Binding_Format(object sender, ConvertEventArgs e)
        {
            FeatureStatus featureStatus = FeatureStatus.Unknown;

            if (e.Value != null && typeof(bool).IsAssignableFrom(e.Value.GetType()))
            {
                featureStatus = (((bool)e.Value) ? FeatureStatus.Enabled : FeatureStatus.Disabled);
            }
            e.Value = featureStatus;
        }
 private void AddAudit(Guid featureId, FeatureStatus status, bool? value = null)
 {
     _connection.Execute(
         "insert into FeatureToggleAudit (Id, Status, Enable, ModificationDate) values (@Id, @Status, @Enable, @ModificationDate)", new
         {
             Id = featureId,
             Status = status,
             Enable = value,
             ModificationDate = DateTime.Now
         });
 }
        private void SetCurrentFeatureStatus(FeatureStatus status)
        {
            this.CurrentFeature.Status = status;
            bool flag = FeatureStatus.Enabled == status;

            this.enableButton.Enabled  = !flag;
            this.disableButton.Enabled = flag;
            this.SetPropertyButtonEnabled();
            this.featureListView.Sort();
            base.NotifyExposedPropertyIsModified(this.CurrentFeature.StatusBindingName);
        }
            public Task ReturnsViewWithFailureForExisting(bool hasLastUpdated, FeatureStatus status)
            {
                var model = new ModifyFeatureFlagsFlightViewModel
                {
                    Name      = Flight1Name,
                    ContentId = "c"
                };

                return(AssertFailure(
                           hasLastUpdated,
                           model,
                           GetTryAddExistingErrorMessage(model)));
            }
            public Task ReturnsViewWithFailureForMissing(bool hasLastUpdated, FeatureStatus status)
            {
                var model = new ModifyFeatureFlagsFeatureViewModel
                {
                    Name      = "MissingFeature",
                    Status    = status,
                    ContentId = "c"
                };

                return(AssertFailure(
                           hasLastUpdated,
                           model,
                           GetTryDeleteMissingErrorMessage(model)));
            }
Пример #13
0
        private void Feature()
        {
            step += Time.deltaTime * speed;

            progress = step;

            rotation = Mathf.Lerp(0, angle, progress) * Vector3.up;

            platform.transform.eulerAngles = rotation;

            if (step >= 1)
            {
                Status = FeatureStatus.End;
            }
        }
Пример #14
0
        private void HighlightFeature(FeatureInfo featureInfo, FeatureStatus status)
        {
            this.InvokeIfRequired((() =>
            {
                if (!mChildNodes.ContainsKey(featureInfo))
                {
                    return;
                }

                foreach (var node in mChildNodes[featureInfo])
                {
                    RefreshFeatureNode(featureInfo, node, status);
                }
            }));
        }
            public Task ReturnsViewWithFailureForMissing(bool hasLastUpdated, FeatureStatus status)
            {
                var model = new ModifyFeatureFlagsFlightViewModel
                {
                    Name       = "MissingFlight",
                    All        = true,
                    SiteAdmins = true,
                    Accounts   = new[] { ExistingAccount },
                    Domains    = new[] { "a.com", "b.com" },
                    ContentId  = "c"
                };

                return(AssertFailure(
                           hasLastUpdated,
                           model,
                           GetTryDeleteMissingErrorMessage(model)));
            }
        public static Color GetColor(this FeatureStatus status)
        {
            switch (status)
            {
            case FeatureStatus.Supported:
                return(Color.Green);

            case FeatureStatus.NotSupported:
                return(Color.Red);

            case FeatureStatus.Undefined:
                return(Color.Gray);

            default:
                throw new ArgumentOutOfRangeException("status");
            }
        }
Пример #17
0
        protected String GetImageKey(FeatureStatus status)
        {
            switch (status)
            {
            case FeatureStatus.Supported:
                return(IMG_SUPPORTED);

            case FeatureStatus.NotSupported:
                return(IMG_NOTSUPPORTED);

            case FeatureStatus.Undefined:
                return(IMG_UNDEFINED);

            default:
                throw new ArgumentOutOfRangeException("status");
            }
        }
Пример #18
0
        /// <summary>
        /// Sets the bluetooth feature on/off.
        /// </summary>
        /// <param name="status">Status of the bluetooth to be set.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void ManageBluetooth(FeatureStatus status)
        {
            int ret = -1;

            if (status == FeatureStatus.Off)
            {
                ret = Interop.CallManager.BluetoothOff(_handle);
            }

            else if (status == FeatureStatus.On)
            {
                ret = Interop.CallManager.BluetoothOn(_handle);
            }

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to manage bluetooth, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Пример #19
0
        private void Follow()
        {
            step += Time.deltaTime * speed;

            progress = curve.Evaluate(step);

            position = Vector3.Lerp(origin, destination, progress);

            rotation = Quaternion.LookRotation(position + offset, destination).eulerAngles;

            rotation.z = ZERO;

            camera.eulerAngles = rotation;

            platform.transform.position = position;

            if (step >= 1)
            {
                Status = FeatureStatus.Feature;
            }
        }
Пример #20
0
        private void Start()
        {
            Status = FeatureStatus.Idle;

            SetActive(false);
        }
Пример #21
0
 // Extension methods
 public static bool IsEnabled(this FeatureStatus status, UserAccount account = null) => default;
Пример #22
0
 public static bool IsEnabled(this FeatureStatus status, bool isAdmin) => default;
Пример #23
0
 public static void AssertIsEnabled(this FeatureStatus status, bool isAdmin, string featureName)
 {
 }
 /// <summary>
 /// Returns the features that match the sent-in <paramref name="status"/>
 /// </summary>
 /// <param name="status">the status that sent-in features should match</param>
 /// <returns>features matching the status</returns>
 public IList<Feature> ByStatus(FeatureStatus status)
 {
     return (from f in _featureDb
             where f.Status == status
             select f).ToList();
 }
Пример #25
0
 public void WriteOptionStatus(FeatureStatus value) => Write((ushort)value);
Пример #26
0
 public static void AssertIsEnabled(this FeatureStatus status, UserAccount account, string featureName)
 {
 }
Пример #27
0
 public IQueryable <Feature> GetAllByStatus(FeatureStatus featureStatus)
 {
     return(_context.Features.Where(x => x.Status == featureStatus));
 }
Пример #28
0
 public static Color GetStatusColor(FeatureStatus status)
 {
     return(status.GetColor());
 }
Пример #29
0
        public FeatureFlagStateBuilder WithFeature(string name, FeatureStatus status)
        {
            _features[name] = status;

            return(this);
        }
Пример #30
0
 public IQueryable <Feature> GetByStatus(FeatureStatus featureStatus, int listSize)
 {
     return(_context.Features.Where(x => x.Status == featureStatus).OrderByDescending(f => f.FeatureId).Take(listSize));
 }