예제 #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));
 }