Esempio n. 1
0
 public override int GetHashCode()
 {
     return(Text.GetHashCode() +
            IsSelected.GetHashCode() +
            IsRequired.GetHashCode() +
            (Value != null ? Value.GetHashCode() : 0));
 }
Esempio n. 2
0
    private void ClickToSelect()
    {
        RaycastHit rayHit;

        if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out rayHit, Mathf.Infinity, clickableLayer))
        {
            IsSelected clickOnScript = rayHit.collider.GetComponent <IsSelected>();

            if (Input.GetKey(KeyCode.LeftControl))
            {
                if (clickOnScript.currentlySelected == false)
                {
                    clickOnScript.currentlySelected = true;
                    clickOnScript.ClickMe();
                }
                else
                {
                    selectedObjects.Remove(rayHit.collider.gameObject);
                    clickOnScript.currentlySelected = false;
                    clickOnScript.ClickMe();
                }
            }
            else
            {
                DeselectObjects();

                clickOnScript.currentlySelected = true;
                clickOnScript.ClickMe();
            }
        }
    }
        public MapItemViewModel(MapItem mapItem)
        {
            Model = mapItem;

            IsSelected.Subscribe(_ =>
            {
            });
        }
Esempio n. 4
0
 public override string ToString()
 {
     if (Value == null)
     {
         return(BoolValue.ToString() + "; Selected = " + IsSelected.ToString());
     }
     return(Value + "; Selected = " + IsSelected.ToString());
 }
 protected virtual void Start()
 {
     if (AutoSelect)
     {
         _view
         .CombineLatest(IsSelected.WhereTrue(), (x, y) => x)
         .Subscribe(SelectView);
     }
 }
 protected virtual void Start()
 {
     Views
     .Select(x => x.FirstOrDefault())
     .Do(x => MutableFirstView.Value = x)
     .Where(x => AutoSelect)
     .CombineLatest(IsSelected.WhereTrue(), (x, y) => x)
     .Subscribe(SelectView)
     .AddTo(this);
 }
Esempio n. 7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (Text != null ? Text.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsCorrect.GetHashCode();
         hashCode = (hashCode * 397) ^ IsSelected.GetHashCode();
         return(hashCode);
     }
 }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AgencyCode?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AgencyDescription?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AgencyAddress?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IsSelected.GetHashCode());
            hashCode = hashCode * -1521134295 + (Rating?.GetHashCode() ?? 0);
            return(hashCode);
        }
Esempio n. 9
0
 public override int GetHashCode()
 {
     var hashCode = -629432352;
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(CourseShortName);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(CourseFullName);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(CourseSubject);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Courselevel);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(CreditHrs);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(CourseType);
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(EnrolledSemester);
     hashCode = hashCode * -1521134295 + IsSelected.GetHashCode();
     hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(GradesRecieved);
     return hashCode;
 }
Esempio n. 10
0
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            var color = Color.White;

            if (_isHovering)
            {
                color = HoverColor;
            }

            if (Locked.Equals(true))
            {
                color = Color.DarkGray;
            }

            if (IsSelected.Equals(true))
            {
                color = Color.DarkGray;
            }

            if (IsFlipped.Equals(true))
            {
                spriteBatch.Draw(_texture, destinationRectangle: Rectangle, color: color, effects: (IsFlippedVert ? SpriteEffects.FlipVertically : SpriteEffects.FlipHorizontally));
            }
            else
            {
                spriteBatch.Draw(_texture, Rectangle, color);
            }

            if (!string.IsNullOrEmpty(Text))
            {
                // get vals for origin
                var x = (_font.MeasureString(Text).X / 2);
                var y = (_font.MeasureString(Text).Y / 2);

                Vector2 origin = new Vector2(x, y);

                spriteBatch.DrawString(_font,
                                       Text,
                                       new Vector2(Rectangle.X + (Rectangle.Width - Rectangle.Width / 2),
                                                   Rectangle.Y + (Rectangle.Height - Rectangle.Height / 2)),
                                       PenColor,
                                       0,
                                       origin,
                                       Scale,
                                       SpriteEffects.None,
                                       1);
            }
        }
Esempio n. 11
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ HasError.GetHashCode();
         hashCode = (hashCode * 397) ^ (ErrorMessage != null ? ErrorMessage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsEditable.GetHashCode();
         hashCode = (hashCode * 397) ^ IsVisible.GetHashCode();
         hashCode = (hashCode * 397) ^ IsSelected.GetHashCode();
         hashCode = (hashCode * 397) ^ IsUsed.GetHashCode();
         hashCode = (hashCode * 397) ^ AllowNotes.GetHashCode();
         hashCode = (hashCode * 397) ^ IsComplexObject.GetHashCode();
         hashCode = (hashCode * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)ColumnIODirection;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         return(hashCode);
     }
 }
        //Gets users not already assigned to the role
        public async Task <IActionResult> OnGetAsync(string roleId)
        {
            RoleId = roleId;
            IdentityRole role = await RoleManager.FindByIdAsync(RoleId);

            if (role == null)
            {
                ViewData["ErrorMessage"] = $"Role with Id =  {roleId} cannot be found";
                return(Page());
            }
            else
            {
                foreach (ApplicationUser user in UserManager.Users)
                {
                    if (!await UserManager.IsInRoleAsync(user, role.Name))
                    {
                        GetUsers.Add(user);
                        IsSelected.Add(false);
                    }
                }
            }

            return(Page());
        }
 private void onNextSelectedItem(SampleTreeViewAdapter item)
 => item.IsSelected.Where(b => b).Subscribe(b => IsSelected.OnNext(item)).AddTo(DisposeCollection);
Esempio n. 14
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return(string.Format("Id: {0}, Name:{1}, IsSelected: {2}", Id, Name, IsSelected.ToString(CultureInfo.InvariantCulture)));
 }
Esempio n. 15
0
        public void ShouldBeAbleTo_CheckSelected()
        {
            new GoToUrl($"http://www.material-ui.com/#/components/checkbox")
            {
                Selenium = _selenium
            }.Execute();

            var check = new IsSelected("Simple")
            {
                Expect = false, Selenium = _selenium, WaitAfter = 700
            }.Execute();

            Assert.IsInstanceOf <SuccessAnswer>(check);

            try
            {
                check = new IsSelected("Simple")
                {
                    Expect = true, Selenium = _selenium, WaitAfter = 700
                }.Execute();
                Assert.Fail("No exception thrown");
            }
            catch (AssertionException)
            {
                Assert.Fail("No exception thrown");
            }
            catch (Exception)
            {
                // expected
            }

            check = new IsSelected("Simple")
            {
                Selenium = _selenium, WaitAfter = 700
            }.Execute();
            Assert.IsFalse((bool?)check);

            var result = new Click("Simple")
            {
                Selenium = _selenium, WaitAfter = 700
            }.Execute();

            check = new IsSelected("Simple")
            {
                Selenium = _selenium, WaitAfter = 700
            }.Execute();
            Assert.IsTrue((bool?)check);

            //new Wait(700).Execute();
            //new Click("1st Components from left") { Selenium = _selenium }.Execute();
            //new Wait(700).Execute();
            //new Click("1st Drawer from left") { Selenium = _selenium }.Execute();

            //try
            //{
            //    new Click("button Menu Item 2") { Selenium = _selenium }.Execute();
            //    Assert.Fail("Should throw exception when clicking on item in offset burger menu");
            //}
            //catch (Exception)
            //{
            //}
            //new IsVisible("Menu Item 2 left from Examples") { Selenium = _selenium, Expect = false }.Execute();
            //new Click("1st Toggle drawer from top") { Selenium = _selenium }.Execute();
            //new Wait(1200).Execute();
            //new Click("Menu Item 2 from left") { Selenium = _selenium }.Execute();
            //new Wait(900).Execute();
        }
Esempio n. 16
0
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            //write strong type if necessary (if it's not a basic object )
            var type = this.GetType();

            if (type.Name != "LayoutAnchorablePaneGroup" &&
                type.Name != "LayoutAnchorablePane" &&
                type.Name != "LayoutAnchorable" &&
                type.Name != "LayoutDocumentPaneGroup" &&
                type.Name != "LayoutDocumentPane" &&
                type.Name != "LayoutDocument" &&
                type.Name != "LayoutAnchorGroup" &&
                type.Name != "LayoutPanel"
                )
            {
                writer.WriteAttributeString("StrongType", type.AssemblyQualifiedName);
            }

            if (!string.IsNullOrWhiteSpace(Title))
            {
                writer.WriteAttributeString("Title", Title);
            }

            //if (IconSource != null)
            //    writer.WriteAttributeString("IconSource", IconSource.ToString());

            if (IsSelected)
            {
                writer.WriteAttributeString("IsSelected", IsSelected.ToString());
            }

            if (IsLastFocusedDocument)
            {
                writer.WriteAttributeString("IsLastFocusedDocument", IsLastFocusedDocument.ToString());
            }

            if (!string.IsNullOrWhiteSpace(ContentId))
            {
                writer.WriteAttributeString("ContentId", ContentId);
            }


            if (ToolTip != null && ToolTip is string)
            {
                if (!string.IsNullOrWhiteSpace((string)ToolTip))
                {
                    writer.WriteAttributeString("ToolTip", (string)ToolTip);
                }
            }

            if (FloatingLeft != 0.0)
            {
                writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingTop != 0.0)
            {
                writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingWidth != 0.0)
            {
                writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingHeight != 0.0)
            {
                writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture));
            }

            if (IsMaximized)
            {
                writer.WriteAttributeString("IsMaximized", IsMaximized.ToString());
            }
            if (!CanClose)
            {
                writer.WriteAttributeString("CanClose", CanClose.ToString());
            }
            if (!CanFloat)
            {
                writer.WriteAttributeString("CanFloat", CanFloat.ToString());
            }

            if (LastActivationTimeStamp != null)
            {
                writer.WriteAttributeString("LastActivationTimeStamp", LastActivationTimeStamp.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (_previousContainer != null)
            {
                var paneSerializable = _previousContainer as ILayoutPaneSerializable;
                if (paneSerializable != null)
                {
                    writer.WriteAttributeString("PreviousContainerId", paneSerializable.Id);
                    writer.WriteAttributeString("PreviousContainerIndex", _previousContainerIndex.ToString());
                }
            }
        }
Esempio n. 17
0
 public void DoIsSelected(bool selected) => IsSelected?.Invoke(selected);
Esempio n. 18
0
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(Title))
            {
                writer.WriteAttributeString("Title", Title);
            }

            //if (IconSource != null)
            //    writer.WriteAttributeString("IconSource", IconSource.ToString());

            if (IsSelected)
            {
                writer.WriteAttributeString("IsSelected", IsSelected.ToString());
            }

            if (IsLastFocusedDocument)
            {
                writer.WriteAttributeString("IsLastFocusedDocument", IsLastFocusedDocument.ToString());
            }

            if (!string.IsNullOrWhiteSpace(ContentId))
            {
                writer.WriteAttributeString("ContentId", ContentId);
            }


            if (ToolTip != null && ToolTip is string)
            {
                if (!string.IsNullOrWhiteSpace((string)ToolTip))
                {
                    writer.WriteAttributeString("ToolTip", (string)ToolTip);
                }
            }

            if (FloatingLeft != 0.0)
            {
                writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingTop != 0.0)
            {
                writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingWidth != 0.0)
            {
                writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingHeight != 0.0)
            {
                writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture));
            }

            if (IsMaximized)
            {
                writer.WriteAttributeString("IsMaximized", IsMaximized.ToString());
            }
            if (!CanClose)
            {
                writer.WriteAttributeString("CanClose", CanClose.ToString());
            }
            if (!CanFloat)
            {
                writer.WriteAttributeString("CanFloat", CanFloat.ToString());
            }

            if (LastActivationTimeStamp != null)
            {
                writer.WriteAttributeString("LastActivationTimeStamp", LastActivationTimeStamp.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (_previousContainer != null)
            {
                var paneSerializable = _previousContainer as ILayoutPaneSerializable;
                if (paneSerializable != null)
                {
                    writer.WriteAttributeString("PreviousContainerId", paneSerializable.Id);
                    writer.WriteAttributeString("PreviousContainerIndex", _previousContainerIndex.ToString());
                }
            }
        }
Esempio n. 19
0
 public override string ToString()
 {
     return(String.Format("GameTileModel {{ IsMine : %s, IsFlagged : %s, IsSelected: %s }}", IsMine.ToString(), IsFlagged.ToString(), IsSelected.ToString()));
 }