示例#1
0
        public void SetupPunchTypes()
        {
            IsolatedStorageSettings          appSet = IsolatedStorageSettings.ApplicationSettings;
            ObservableCollection <PunchType> ptc    = new ObservableCollection <PunchType>();

            AddStartPunchTypes(ptc);

            String BreakList;

            if (appSet.TryGetValue <String>("Breaks", out BreakList))
            {
                foreach (String BreakName in BreakList.Split(','))
                {
                    if (BreakName.Trim().Length != 0)
                    {
                        ptc.Add(new PunchType("Start " + BreakName, StartEnd.Start, Category.Break));
                    }
                }
            }
            String ProjList;

            if (appSet.TryGetValue <String>("Projects", out ProjList))
            {
                foreach (String ProjName in ProjList.Split(','))
                {
                    if (ProjName.Trim().Length != 0)
                    {
                        ptc.Add(new PunchType("Start " + ProjName, StartEnd.Start, Category.Project));
                    }
                }
            }
            AddEndPunchTypes(ptc);
            App.Inst.PunchList = ptc;
        }
示例#2
0
        public override int GetHashCode()
        {
            int hashCode = 1946622093;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (LocationId != null)
            {
                hashCode += LocationId.GetHashCode();
            }

            if (BreakName != null)
            {
                hashCode += BreakName.GetHashCode();
            }

            if (ExpectedDuration != null)
            {
                hashCode += ExpectedDuration.GetHashCode();
            }
            hashCode += IsPaid.GetHashCode();

            if (Version != null)
            {
                hashCode += Version.GetHashCode();
            }

            if (CreatedAt != null)
            {
                hashCode += CreatedAt.GetHashCode();
            }

            if (UpdatedAt != null)
            {
                hashCode += UpdatedAt.GetHashCode();
            }

            return(hashCode);
        }
示例#3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is BreakType other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((BreakName == null && other.BreakName == null) || (BreakName?.Equals(other.BreakName) == true)) &&
                   ((ExpectedDuration == null && other.ExpectedDuration == null) || (ExpectedDuration?.Equals(other.ExpectedDuration) == true)) &&
                   IsPaid.Equals(other.IsPaid) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }