Exemplo n.º 1
0
        /// <summary>
        /// Déclenche l'événement SelectedItemsChanged
        /// </summary>
        protected virtual void OnSelectedItemsChanged(NotifyCollectionChangedEventArgs e)
        {
            SelectedItemsChanged?.Invoke(this, e);

            // Refresh Command
            DetailCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_projectsService != null ? _projectsService.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (_navigationService != null ? _navigationService.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DetailCommand != null ? DetailCommand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EditCommand != null ? EditCommand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Identify != null ? StringComparer.CurrentCulture.GetHashCode(Identify) : 0);
         hashCode = (hashCode * 397) ^ Id;
         hashCode = (hashCode * 397) ^ (Name != null ? StringComparer.CurrentCulture.GetHashCode(Name) : 0);
         hashCode = (hashCode * 397) ^ (Identifier != null ? StringComparer.CurrentCulture.GetHashCode(Identifier) : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? StringComparer.CurrentCulture.GetHashCode(Description) : 0);
         hashCode = (hashCode * 397) ^ (Parent != null ? Parent.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (HomePage != null ? StringComparer.CurrentCulture.GetHashCode(HomePage) : 0);
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ UpdatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Status;
         hashCode = (hashCode * 397) ^ IsPublic.GetHashCode();
         hashCode = (hashCode * 397) ^ InheritMembers.GetHashCode();
         hashCode = (hashCode * 397) ^ (Trackers != null ? Trackers.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomFields != null ? CustomFields.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IssueCategories != null ? IssueCategories.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EnabledModules != null ? EnabledModules.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TimeEntryActivities != null ? TimeEntryActivities.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        private void SerializeResourceProvider(IResourceProvider provider)
        {
            var resourceType     = provider.ResourceType;
            var resourceQuantity = provider.Quantity;

            var resourceTypeTextNode = new TextNode(
                this,
                new Vector2(20, 50),
                Vector2.One,
                resourceType.ToString(),
                SpriteFontManager.Instance.GetFont("Arial_18"),
                Color.White);

            var resourceQuantityTextNode = new TextNode(
                this,
                new Vector2(20, 80),
                Vector2.One,
                resourceQuantity.ToString(),
                SpriteFontManager.Instance.GetFont("Arial_18"),
                Color.White);

            this.TextNodes.Add(resourceTypeTextNode);
            this.TextNodes.Add(resourceQuantityTextNode);

            var pickProvider = new Button(
                this.Position + new Vector2(20, 110),
                PointTextures.TransparentGrayPoint,
                new Vector2(80, 30),
                Color.Black,
                2,
                () =>
            {
                this.Command = DetailCommand.PickEntity;
            });

            var pickProviderTextNode = new TextNode(pickProvider, new Vector2(20, 0), Vector2.One, "Pick", SpriteFontManager.Instance.GetFont("Arial_18"), Color.White);

            pickProvider.TextNode = pickProviderTextNode;

            var gatherProvider = new Button(
                this.Position + new Vector2(110, 110),
                PointTextures.TransparentGrayPoint,
                new Vector2(110, 30),
                Color.Black,
                2,
                () =>
            {
                this.Command = DetailCommand.GatherResource;
            });

            var gatherProviderTextNode = new TextNode(gatherProvider, new Vector2(20, 0), Vector2.One, "Gather", SpriteFontManager.Instance.GetFont("Arial_18"), Color.White);

            gatherProvider.TextNode = gatherProviderTextNode;

            this.Buttons.Add(pickProvider);
            this.Buttons.Add(gatherProvider);
        }
Exemplo n.º 4
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (Input.LeftMouseClick())
            {
                float mouseX = Input.MousePos.X;
                float mouseY = Input.MousePos.Y;

                if (!(mouseX >= this.Position.X && mouseX <= this.Position.X + this.Background.Width * this.Dimensions.X &&
                      mouseY >= this.Position.Y && mouseY <= this.Position.Y + this.Background.Height * this.Dimensions.Y))
                {
                    this.Command = DetailCommand.Close;
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Déclenche l'événement <see cref="Searched"/>
        /// </summary>
        protected virtual void OnSearched(OperationEventArgs operationEventArgs)
        {
            if (operationEventArgs != null && !operationEventArgs.Succeed)
            {
                IsSearching = false;
                IsBusy      = false;
                // TODO : ManageException
                //ManageException(operationEventArgs.Error, Resources.Error_Searching);
            }

            IsSearching = false;
            IsBusy      = false;
            SetFocus();

            if (NavigateAutoIfOnlyOneItem && operationEventArgs.Succeed && Items.Count == 1)
            {
                CurrentItem = Items.First();
                DetailCommand.Execute();
            }

            Searched?.Invoke(this, operationEventArgs);
        }