Example #1
0
        void ReleaseDesignerOutlets()
        {
            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DotView != null)
            {
                DotView.Dispose();
                DotView = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (StartView != null)
            {
                StartView.Dispose();
                StartView = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ContinueButton != null)
            {
                ContinueButton.Dispose();
                ContinueButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CircleView != null)
            {
                CircleView.Dispose();
                CircleView = null;
            }

            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TotalTimeLabel != null)
            {
                TotalTimeLabel.Dispose();
                TotalTimeLabel = null;
            }
        }
Example #4
0
        void ReleaseDesignerOutlets()
        {
            if (ClientLabel != null)
            {
                ClientLabel.Dispose();
                ClientLabel = null;
            }

            if (DescriptionFadeView != null)
            {
                DescriptionFadeView.Dispose();
                DescriptionFadeView = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (ProjectDot != null)
            {
                ProjectDot.Dispose();
                ProjectDot = null;
            }

            if (ProjectFadeView != null)
            {
                ProjectFadeView.Dispose();
                ProjectFadeView = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (ProjectView != null)
            {
                ProjectView.Dispose();
                ProjectView = null;
            }

            if (NoDescriptionLabel != null)
            {
                NoDescriptionLabel.Dispose();
                NoDescriptionLabel = null;
            }
        }
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            FadeView.FadeRight = true;

            this.DelayBind(() =>
            {
                var colorConverter      = new MvxRGBValueConverter();
                var durationCombiner    = new DurationValueCombiner();
                var visibilityConverter = new MvxVisibilityValueConverter();
                var bindingSet          = this.CreateBindingSet <ReportsLegendViewCell, ChartSegment>();

                ProjectLabel.SetKerning(-0.2);
                ClientLabel.SetKerning(-0.2);
                TotalTimeLabel.SetKerning(-0.2);
                PercentageLabel.SetKerning(-0.2);

                //Text
                bindingSet.Bind(ProjectLabel).To(vm => vm.ProjectName);
                bindingSet.Bind(ClientLabel).To(vm => vm.ClientName);
                bindingSet.Bind(PercentageLabel)
                .For(v => v.Text)
                .ByCombining("Format", "'{0:0.00}%'", nameof(ChartSegment.Percentage));

                bindingSet.Bind(TotalTimeLabel)
                .ByCombining(durationCombiner,
                             vm => vm.TrackedTime,
                             vm => vm.DurationFormat);

                bindingSet.Bind(ClientLabel)
                .For(v => v.BindVisibility())
                .To(vm => vm.HasClient)
                .WithConversion(visibilityConverter);

                // Color
                bindingSet.Bind(ProjectLabel)
                .For(v => v.TextColor)
                .To(vm => vm.Color)
                .WithConversion(colorConverter);

                bindingSet.Bind(CircleView)
                .For(v => v.BackgroundColor)
                .To(vm => vm.Color)
                .WithConversion(colorConverter);

                bindingSet.Apply();
            });
        }
Example #6
0
 public LinkObjectViewModel()
 {
     DeveloperOptions  = new ObservableCollection <User>(User.AllApplicationUsers);
     SelectedDeveloper =
         DeveloperOptions.SingleOrDefault(
             x => x.DomainUserName.Equals(Environment.UserName, StringComparison.InvariantCultureIgnoreCase));
     ReleaseDate = DateHelper.GetNextWeekday(DateTime.Now, DayOfWeek.Thursday);
     LinkObjectsChanged?.Invoke(this, EventArgs.Empty);
     Labels = new ObservableCollection <ProjectLabel>();
     Labels.AddRange(_rogueProjectRepository.GetProjectLabels().Select(x => new ProjectLabel(x)));
     Labels.Insert(0, new ProjectLabel {
         Id = 0, Name = "Select a Label"
     });
     SelectedLabel = Labels.FirstOrDefault();
 }
Example #7
0
 public void DeleteLabel(ProjectLabelDomain label)
 {
     if (label != null)
     {
         using (var ctx = new smbimAuditEntities())
         {
             ProjectLabel deleteLabel = ctx.ProjectLabels.FirstOrDefault(l => l.Id == label.Id);
             if (deleteLabel != null)
             {
                 ctx.ProjectLabels.Remove(deleteLabel);
                 ctx.SaveChanges();
             }
         }
     }
 }
Example #8
0
 public void AddLabel(ProjectLabelDomain label)
 {
     if (label == null)
     {
         return;
     }
     using (var ctx = new smbimAuditEntities())
     {
         var insertLabel = new ProjectLabel
         {
             Name        = label.Name,
             ReleaseDate = label.ReleaseDate,
             IsJunk      = label.IsJunk
         };
         ctx.ProjectLabels.Add(insertLabel);
         ctx.SaveChanges();
     }
 }
Example #9
0
        void ReleaseDesignerOutlets()
        {
            if (ContinueButton != null)
            {
                ContinueButton.Dispose();
                ContinueButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DescriptionTopDistanceConstraint != null)
            {
                DescriptionTopDistanceConstraint.Dispose();
                DescriptionTopDistanceConstraint = null;
            }

            if (ProjectDotView != null)
            {
                ProjectDotView.Dispose();
                ProjectDotView = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
Example #10
0
        protected override void UpdateView()
        {
            ProjectLabel.SetKerning(-0.2);
            ClientLabel.SetKerning(-0.2);
            TotalTimeLabel.SetKerning(-0.2);
            PercentageLabel.SetKerning(-0.2);

            //Text
            ProjectLabel.Text    = Item.ProjectName;
            ClientLabel.Text     = Item.ClientName;
            PercentageLabel.Text = $"{Item.Percentage:F2}%";
            TotalTimeLabel.Text  = Item.TrackedTime.ToFormattedString(Item.DurationFormat);

            ClientLabel.Hidden = !Item.HasClient;

            // Color
            var color = new Color(Item.Color).ToNativeColor();

            ProjectLabel.TextColor     = color;
            CircleView.BackgroundColor = color;
        }
Example #11
0
        void ReleaseDesignerOutlets()
        {
            if (BottomRowView != null)
            {
                BottomRowView.Dispose();
                BottomRowView = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (ProjectDot != null)
            {
                ProjectDot.Dispose();
                ProjectDot = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }
        }
Example #12
0
        private void AddLabels(IEnumerable <Label> labels, Project project)
        {
            foreach (var label in labels)
            {
                var labelEntity = this.data.LabelRepository.Get(l => l.Name == label.Name).FirstOrDefault();
                if (labelEntity == null)
                {
                    labelEntity = new Label()
                    {
                        Name = label.Name
                    };
                    this.data.LabelRepository.Insert(labelEntity);
                }

                var projectLabel = new ProjectLabel()
                {
                    Label   = labelEntity,
                    Project = project
                };

                project.ProjectLabels.Add(projectLabel);
            }
        }
Example #13
0
        void ReleaseDesignerOutlets()
        {
            if (AddDescriptionView != null)
            {
                AddDescriptionView.Dispose();
                AddDescriptionView = null;
            }

            if (AddProjectAndTaskView != null)
            {
                AddProjectAndTaskView.Dispose();
                AddProjectAndTaskView = null;
            }

            if (AddTagsView != null)
            {
                AddTagsView.Dispose();
                AddTagsView = null;
            }

            if (BillableSwitch != null)
            {
                BillableSwitch.Dispose();
                BillableSwitch = null;
            }

            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

            if (ConfirmButton != null)
            {
                ConfirmButton.Dispose();
                ConfirmButton = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DurationLabel != null)
            {
                DurationLabel.Dispose();
                DurationLabel = null;
            }

            if (ProjectDot != null)
            {
                ProjectDot.Dispose();
                ProjectDot = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (StartDateLabel != null)
            {
                StartDateLabel.Dispose();
                StartDateLabel = null;
            }

            if (StartTimeLabel != null)
            {
                StartTimeLabel.Dispose();
                StartTimeLabel = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }
        }