Beispiel #1
0
 private void Update(EvaluationContext context)
 {
     Output.Value = new RawViewportF
     {
         X        = X.GetValue(context),
         Y        = Y.GetValue(context),
         Width    = Width.GetValue(context),
         Height   = Height.GetValue(context),
         MinDepth = MinDepth.GetValue(context),
         MaxDepth = MaxDepth.GetValue(context)
     };
 }
Beispiel #2
0
        public void getMaxDepthTest()
        {
            TreeNode root   = new TreeNode(3);
            TreeNode left1  = new TreeNode(9);
            TreeNode right1 = new TreeNode(20);
            TreeNode left2  = new TreeNode(15);
            TreeNode right2 = new TreeNode(7);

            root.left    = left1;
            root.right   = right1;
            right1.left  = left2;
            right1.right = right2;
            MaxDepth md = new MaxDepth();

            Assert.AreEqual(3, md.getMaxDepth(root));
            Assert.Fail();
        }
Beispiel #3
0
        /// <summary>
        /// Serves as a hash function for the objects of <see cref="DumpAttribute"/> and its derived types.
        /// </summary>
        /// <returns>A hash code for the current <see cref="DumpAttribute"/> instance.</returns>
        public override int GetHashCode()
        {
            var hashCode = Constants.HashInitializer;

            unchecked
            {
                hashCode = Constants.HashMultiplier * hashCode + Order.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + DumpNullValues.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + Skip.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + RecurseDump.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + (DefaultProperty?.GetHashCode() ?? 0);
                hashCode = Constants.HashMultiplier * hashCode + Mask.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaskValue.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaxLength.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaxDepth.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + LabelFormat.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + ValueFormat.GetHashCode();
            }

            return(hashCode);
        }
        public void Excution1Test()
        {
            var func = new MaxDepth();

            Assert.AreEqual(3, func.Excution1(new IsSameTree.TreeNode(3)
            {
                left  = new IsSameTree.TreeNode(9),
                right = new IsSameTree.TreeNode(20)
                {
                    left  = new IsSameTree.TreeNode(15),
                    right = new IsSameTree.TreeNode(78)
                }
            }));

            Assert.AreEqual(0, func.Excution1(null));

            Assert.AreEqual(1, func.Excution1(new IsSameTree.TreeNode(3)));
            Assert.AreEqual(2, func.Excution1(new IsSameTree.TreeNode(3)
            {
                right = new IsSameTree.TreeNode(2)
            }));
        }
        /// <summary>
        /// Crawl an individual profile, then its connections.
        /// </summary>
        /// <param name="userName">User name of profile to parse</param>
        /// <param name="delayBetweenPages">Delay between pages</param>
        /// <param name="depth">Depth to parse from seed</param>
        public void CrawlNode(String userName, int delayBetweenPages, int depth)
        {
            if (depth + 1 > MaxDepth)
            {
                return;
            }

            if (File.Exists(UserNameCrawlLock(userName)))
            {
                Log(String.Format(@"Skip Locked Profile: UserName={0}", userName));
                return;
            }

            #region Check if all connections have been parsed
            if (File.Exists(UserNameCompletePath(userName)))
            {
                try
                {
                    CompleteFile checkFile = JsonConvert.DeserializeObject <CompleteFile>(File.ReadAllText(UserNameCompletePath(userName)));
                    if (checkFile != null && checkFile.AllConnectionsParsed)
                    {
                        Log(String.Format(@"Skip Completed Profile: UserName={0}", userName));
                        return;
                    }
                }
                catch (Exception chk)
                {
                    Log(String.Format(@"Error Checking Lock File: UserName={0}, {1}", userName, chk?.Message));
                }
            }
            #endregion

            #region Create Directory if not exists
            try
            {
                String path = Path.Combine(StoreDirectory, userName);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }
            catch (Exception e)
            {
                Log(String.Format("Error Creating Directory: UserName={0}", userName));
            }
            #endregion

            #region Create Lock file
            try
            {
                File.Create(UserNameCrawlLock(userName)).Dispose();
            }
            catch (Exception e)
            {
                Log(String.Format(@"Error Creating Lock File: UserName={0}, {1}", userName, e?.Message));
            }
            #endregion

            Profile profile = null;

            if (!UserNameHasBeenParsed(userName))
            {
                bool captureConnections = CanCaptureConnections(userName);

                Log(String.Format(@"Parse Profile: UserName={0}, Depth={1}/{2}, CaptureConnections={3}",
                                  userName, depth.ToString(), MaxDepth.ToString(), captureConnections.ToString()));

                profile = new ProfileParser().Parse(
                    this,
                    HashKey,
                    userName,
                    DelayBetweenPages,
                    DelayBetweenAPIRequests,
                    captureConnections);

                if (profile != null)
                {
                    ProfileFinished(profile);

                    #region Download additional files if passes check
                    if (CapturePhotos)
                    {
                        #region Profile Photos
                        Log(String.Format(@"Download Profile Photos: UserName={0}", profile.UserName));
                        if (!String.IsNullOrEmpty(profile.ProfileImageURL) &&
                            !File.Exists(Path.Combine(StoreDirectory, profile.UserName, "profile.jpg")) &&
                            !File.Exists(Path.Combine(StoreDirectory, profile.UserName, "profile.jpg.error")))
                        {
                            bool success = CrawlUtil.GetFile(profile.ProfileImageURL, Path.Combine(StoreDirectory, profile.UserName, "profile.jpg"), 30000);
                            if (!success)
                            {
                                File.Create(Path.Combine(StoreDirectory, profile.UserName, "profile.jpg.error")).Dispose();
                                Log(String.Format(@"Error Profile Photo Thumbnail: UserName={0}", profile.UserName));
                            }
                        }

                        if (!String.IsNullOrEmpty(profile.ProfileThumbnailImageURL) &&
                            !File.Exists(Path.Combine(StoreDirectory, profile.UserName, "profile_sm.jpg")) &&
                            !File.Exists(Path.Combine(StoreDirectory, profile.UserName, "profile_sm.jpg.error")))
                        {
                            bool success = CrawlUtil.GetFile(profile.ProfileThumbnailImageURL, Path.Combine(StoreDirectory, profile.UserName, "profile_sm.jpg"), 30000);
                            if (!success)
                            {
                                File.Create(Path.Combine(StoreDirectory, profile.UserName, "profile_sm.jpg.error")).Dispose();
                                Log(String.Format(@"Error Profile Photo Thumbnail: UserName={0}", profile.UserName));
                            }
                        }
                        #endregion

                        #region Photos Albums
                        if (profile.Photos != null && profile.Photos.Count > 0)
                        {
                            Log(String.Format(@"Download Photos: UserName={0}", profile.UserName));

                            #region Ensure Photos directory exists
                            String photoAlbumsPath = Path.Combine(UserNameDirectoryPath(profile.UserName), "Photos");
                            if (!Directory.Exists(photoAlbumsPath))
                            {
                                Directory.CreateDirectory(photoAlbumsPath);
                            }
                            #endregion

                            foreach (PhotoEntry entry in profile.Photos)
                            {
                                try
                                {
                                    if (!String.IsNullOrEmpty(entry.PhotoID))
                                    {
                                        String picturePath = photoAlbumsPath;
                                        if (!String.IsNullOrEmpty(entry.AlbumName))
                                        {
                                            #region Ensure Photo album directory exists
                                            picturePath = Path.Combine(picturePath, entry.AlbumName);
                                            if (!Directory.Exists(picturePath))
                                            {
                                                Directory.CreateDirectory(picturePath);
                                            }
                                            #endregion

                                            #region Download Thumbnail
                                            if (!String.IsNullOrEmpty(entry.ThumbnailImageURL) &&
                                                !File.Exists(Path.Combine(picturePath, String.Format("{0}_sm.jpg", entry.PhotoID))) &&
                                                !File.Exists(Path.Combine(picturePath, String.Format("{0}_sm.error", entry.PhotoID))))
                                            {
                                                Log(String.Format(@"Download Photo Thumbnail: UserName={0}, PhotoID={1}, Album={2}", profile.UserName, entry.PhotoID, entry.AlbumName));
                                                bool success = CrawlUtil.GetFile(entry.ThumbnailImageURL,
                                                                                 Path.Combine(picturePath, String.Format("{0}_sm.jpg", entry.PhotoID)),
                                                                                 30000);

                                                if (!success)
                                                {
                                                    File.Create(Path.Combine(picturePath, String.Format("{0}_sm.error", entry.PhotoID))).Dispose();
                                                    Log(String.Format(@"Error Downloading Photo Thumbnail: UserName={0}, PhotoID={1}, Album={2}", profile.UserName, entry.PhotoID, entry.AlbumName));
                                                }
                                            }
                                            #endregion

                                            #region Download Full Photo
                                            if (!String.IsNullOrEmpty(entry.FullImageURL) &&
                                                !File.Exists(Path.Combine(picturePath, String.Format("{0}.jpg", entry.PhotoID))) &&
                                                !File.Exists(Path.Combine(picturePath, String.Format("{0}.error", entry.PhotoID))))
                                            {
                                                Log(String.Format(@"Download Photo: UserName={0}, PhotoID={1}, Album={2}", profile.UserName, entry.PhotoID, entry.AlbumName));
                                                bool success = CrawlUtil.GetFile(entry.FullImageURL,
                                                                                 Path.Combine(picturePath, String.Format("{0}.jpg", entry.PhotoID)),
                                                                                 30000);

                                                if (!success)
                                                {
                                                    File.Create(Path.Combine(picturePath, String.Format("{0}.error", entry.PhotoID))).Dispose();
                                                    Log(String.Format(@"Error Downloading Photo: UserName={0}, PhotoID={1}, Album={2}", profile.UserName, entry.PhotoID, entry.AlbumName));
                                                }
                                            }
                                            #endregion
                                        }

                                        //Wait between each photo.
                                        Thread.Sleep(CrawlUtil.GetVariableDelay(200));
                                    }
                                }
                                catch (Exception e)
                                {
                                    Log(String.Format(@"Error Downloading Photo: UserName={0}, PhotoID={1}", profile.UserName, entry?.PhotoID));
                                }
                            }
                        }
                        #endregion

                        #region Song Artwork
                        if (profile.Songs != null && profile.Songs.Count > 0)
                        {
                            Log(String.Format(@"Download Song Artwork: UserName={0}", profile.UserName));

                            #region Ensure Photos directory exists
                            String songArtworkPath = Path.Combine(UserNameDirectoryPath(profile.UserName), "Song_Artwork");
                            if (!Directory.Exists(songArtworkPath))
                            {
                                Directory.CreateDirectory(songArtworkPath);
                            }
                            #endregion

                            foreach (SongEntry entry in profile.Songs)
                            {
                                #region Download Thumbnail
                                String thumbnailFileName = entry.ImageThumbnailURL?.Replace(@"/", "___")?.Replace(":", "---");

                                if (!String.IsNullOrEmpty(thumbnailFileName) &&
                                    !File.Exists(Path.Combine(songArtworkPath, thumbnailFileName)) &&
                                    !File.Exists(Path.Combine(songArtworkPath, String.Format("{0}.error", thumbnailFileName))))
                                {
                                    Log(String.Format(@"Download Song Artwork Thumbnail: UserName={0}, Name={1}", profile.UserName, thumbnailFileName));
                                    bool success = CrawlUtil.GetFile(entry.ImageThumbnailURL,
                                                                     Path.Combine(songArtworkPath, thumbnailFileName),
                                                                     30000);

                                    if (!success)
                                    {
                                        File.Create(Path.Combine(songArtworkPath, String.Format("{0}.error", thumbnailFileName))).Dispose();
                                        Log(String.Format(@"Error Downloading Song Artwork Thumbnail: UserName={0}, Name={1}", profile.UserName, thumbnailFileName));
                                    }
                                }
                                #endregion

                                #region Download Full Image
                                String imageFileName = entry.ImageURL?.Replace(@"/", "___")?.Replace(":", "---");

                                if (!String.IsNullOrEmpty(imageFileName) &&
                                    !File.Exists(Path.Combine(songArtworkPath, imageFileName)) &&
                                    !File.Exists(Path.Combine(songArtworkPath, String.Format("{0}.error", imageFileName))))
                                {
                                    Log(String.Format(@"Download Song Artwork: UserName={0}, Name={1}", profile.UserName, imageFileName));
                                    bool success = CrawlUtil.GetFile(entry.ImageURL,
                                                                     Path.Combine(songArtworkPath, imageFileName),
                                                                     60000);

                                    if (!success)
                                    {
                                        File.Create(Path.Combine(songArtworkPath, String.Format("{0}.error", imageFileName))).Dispose();
                                        Log(String.Format(@"Error Downloading Song Artwork: UserName={0}, Name={1}", profile.UserName, imageFileName));
                                    }
                                }
                                #endregion

                                //Wait between each photo.
                                Thread.Sleep(CrawlUtil.GetVariableDelay(200));
                            }
                        }
                        #endregion
                    }
                    #endregion
                }
            }
            else
            {
                Log(String.Format(@"Load Profile: UserName={0}", userName));

                try
                {
                    profile = JsonConvert.DeserializeObject <Profile>(File.ReadAllText(UserNameProfilePath(userName)));
                }
                catch (Exception e)
                {
                    Log(String.Format(@"Error Loading Profile: UserName={0}, {1}", userName, e?.Message));
                }
            }

            if (profile != null)
            {
                CompleteFile completeFile = null;

                #region Ensure complete file has been created and populated
                if (!File.Exists(UserNameCompletePath(userName)))
                {
                    try
                    {
                        completeFile = new CompleteFile(userName);
                        if (profile.Connections != null)
                        {
                            foreach (ConnectionEntry c in profile.Connections)
                            {
                                completeFile.AllConnectionsParsed = false;
                                completeFile.ConnectionsParsed.Add(
                                    new ConnectionParsedEntry()
                                {
                                    UserName   = c.UserName,
                                    Parsed     = false,
                                    DateParsed = null
                                }
                                    );
                            }
                        }

                        File.WriteAllText(
                            UserNameCompletePath(userName),
                            JsonConvert.SerializeObject(completeFile, Formatting.Indented));
                    }
                    catch (Exception e)
                    {
                        Log(String.Format(@"Error Creating Complete File: UserName={0}", e?.Message));
                    }
                }
                else
                {
                    completeFile = JsonConvert.DeserializeObject <CompleteFile>(File.ReadAllText(UserNameCompletePath(userName)));
                }
                #endregion

                foreach (ConnectionEntry c in profile.Connections)
                {
                    ConnectionParsedEntry parsedEntry = completeFile.ConnectionsParsed.Where(x => String.Equals(x.UserName, c.UserName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
                    if (parsedEntry != null)
                    {
                        if (!parsedEntry.Parsed)
                        {
                            CrawlNode(c.UserName, DelayBetweenPages, depth + 1);

                            #region Update complete file
                            try
                            {
                                parsedEntry.Parsed     = true;
                                parsedEntry.DateParsed = DateTime.Now;

                                File.WriteAllText(
                                    UserNameCompletePath(userName),
                                    JsonConvert.SerializeObject(completeFile, Formatting.Indented));
                            }
                            catch (Exception p)
                            {
                                Log(String.Format(@"Error Updating Complete Entry: UserName={0}, ConnectionUserName={1}, {2]", userName, c.UserName, p?.Message));
                            }
                            #endregion
                        }
                    }
                    else
                    {
                        Log(String.Format(@"Error Missing Connection Complete Entry: UserName={0}, ConnectionUserName={1}", userName, c.UserName));
                    }
                }

                #region Update complete flag
                try
                {
                    Log(String.Format(@"All Connections Parsed: UserName={0}", userName));
                    completeFile.AllConnectionsParsed = true;

                    File.WriteAllText(
                        UserNameCompletePath(userName),
                        JsonConvert.SerializeObject(completeFile, Formatting.Indented));
                }
                catch (Exception p)
                {
                    Log(String.Format(@"Error Updating Complete File: UserName={0}, {1}", userName, p?.Message));
                }
                #endregion
            }
        }
Beispiel #6
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Labels != null)
         {
             hashCode = hashCode * 59 + Labels.GetHashCode();
         }
         if (Parents != null)
         {
             hashCode = hashCode * 59 + Parents.GetHashCode();
         }
         if (Values != null)
         {
             hashCode = hashCode * 59 + Values.GetHashCode();
         }
         if (BranchValues != null)
         {
             hashCode = hashCode * 59 + BranchValues.GetHashCode();
         }
         if (Count != null)
         {
             hashCode = hashCode * 59 + Count.GetHashCode();
         }
         if (Level != null)
         {
             hashCode = hashCode * 59 + Level.GetHashCode();
         }
         if (MaxDepth != null)
         {
             hashCode = hashCode * 59 + MaxDepth.GetHashCode();
         }
         if (Marker != null)
         {
             hashCode = hashCode * 59 + Marker.GetHashCode();
         }
         if (Leaf != null)
         {
             hashCode = hashCode * 59 + Leaf.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (TextInfo != null)
         {
             hashCode = hashCode * 59 + TextInfo.GetHashCode();
         }
         if (TextTemplate != null)
         {
             hashCode = hashCode * 59 + TextTemplate.GetHashCode();
         }
         if (TextTemplateArray != null)
         {
             hashCode = hashCode * 59 + TextTemplateArray.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (HoverTextArray != null)
         {
             hashCode = hashCode * 59 + HoverTextArray.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverInfoArray != null)
         {
             hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         }
         if (HoverTemplate != null)
         {
             hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
         }
         if (HoverTemplateArray != null)
         {
             hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
         }
         if (TextFont != null)
         {
             hashCode = hashCode * 59 + TextFont.GetHashCode();
         }
         if (InsideTextOrientation != null)
         {
             hashCode = hashCode * 59 + InsideTextOrientation.GetHashCode();
         }
         if (InsideTextFont != null)
         {
             hashCode = hashCode * 59 + InsideTextFont.GetHashCode();
         }
         if (OutsideTextFont != null)
         {
             hashCode = hashCode * 59 + OutsideTextFont.GetHashCode();
         }
         if (Domain != null)
         {
             hashCode = hashCode * 59 + Domain.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (LabelsSrc != null)
         {
             hashCode = hashCode * 59 + LabelsSrc.GetHashCode();
         }
         if (ParentsSrc != null)
         {
             hashCode = hashCode * 59 + ParentsSrc.GetHashCode();
         }
         if (ValuesSrc != null)
         {
             hashCode = hashCode * 59 + ValuesSrc.GetHashCode();
         }
         if (TextSrc != null)
         {
             hashCode = hashCode * 59 + TextSrc.GetHashCode();
         }
         if (TextTemplateSrc != null)
         {
             hashCode = hashCode * 59 + TextTemplateSrc.GetHashCode();
         }
         if (HoverTextSrc != null)
         {
             hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
         }
         if (HoverInfoSrc != null)
         {
             hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         }
         if (HoverTemplateSrc != null)
         {
             hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #7
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Sunburst other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Equals(Labels, other.Labels) ||
                     Labels != null && other.Labels != null &&
                     Labels.SequenceEqual(other.Labels)
                 ) &&
                 (
                     Equals(Parents, other.Parents) ||
                     Parents != null && other.Parents != null &&
                     Parents.SequenceEqual(other.Parents)
                 ) &&
                 (
                     Equals(Values, other.Values) ||
                     Values != null && other.Values != null &&
                     Values.SequenceEqual(other.Values)
                 ) &&
                 (
                     BranchValues == other.BranchValues ||
                     BranchValues != null &&
                     BranchValues.Equals(other.BranchValues)
                 ) &&
                 (
                     Count == other.Count ||
                     Count != null &&
                     Count.Equals(other.Count)
                 ) &&
                 (
                     Level == other.Level ||
                     Level != null &&
                     Level.Equals(other.Level)
                 ) &&
                 (
                     MaxDepth == other.MaxDepth ||
                     MaxDepth != null &&
                     MaxDepth.Equals(other.MaxDepth)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     Leaf == other.Leaf ||
                     Leaf != null &&
                     Leaf.Equals(other.Leaf)
                 ) &&
                 (
                     Equals(Text, other.Text) ||
                     Text != null && other.Text != null &&
                     Text.SequenceEqual(other.Text)
                 ) &&
                 (
                     TextInfo == other.TextInfo ||
                     TextInfo != null &&
                     TextInfo.Equals(other.TextInfo)
                 ) &&
                 (
                     TextTemplate == other.TextTemplate ||
                     TextTemplate != null &&
                     TextTemplate.Equals(other.TextTemplate)
                 ) &&
                 (
                     Equals(TextTemplateArray, other.TextTemplateArray) ||
                     TextTemplateArray != null && other.TextTemplateArray != null &&
                     TextTemplateArray.SequenceEqual(other.TextTemplateArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     InsideTextOrientation == other.InsideTextOrientation ||
                     InsideTextOrientation != null &&
                     InsideTextOrientation.Equals(other.InsideTextOrientation)
                 ) &&
                 (
                     InsideTextFont == other.InsideTextFont ||
                     InsideTextFont != null &&
                     InsideTextFont.Equals(other.InsideTextFont)
                 ) &&
                 (
                     OutsideTextFont == other.OutsideTextFont ||
                     OutsideTextFont != null &&
                     OutsideTextFont.Equals(other.OutsideTextFont)
                 ) &&
                 (
                     Domain == other.Domain ||
                     Domain != null &&
                     Domain.Equals(other.Domain)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     LabelsSrc == other.LabelsSrc ||
                     LabelsSrc != null &&
                     LabelsSrc.Equals(other.LabelsSrc)
                 ) &&
                 (
                     ParentsSrc == other.ParentsSrc ||
                     ParentsSrc != null &&
                     ParentsSrc.Equals(other.ParentsSrc)
                 ) &&
                 (
                     ValuesSrc == other.ValuesSrc ||
                     ValuesSrc != null &&
                     ValuesSrc.Equals(other.ValuesSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     TextTemplateSrc == other.TextTemplateSrc ||
                     TextTemplateSrc != null &&
                     TextTemplateSrc.Equals(other.TextTemplateSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
Beispiel #8
0
 private void SpiderProperty_Load(object sender, EventArgs e)
 {
     tbxConn.Text  = MaxConnextion.ToString();
     tbxDepth.Text = MaxDepth.ToString();
 }
Beispiel #9
0
        public bool Equals([AllowNull] TreeMap other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Labels, other.Labels) || Labels != null && other.Labels != null && Labels.SequenceEqual(other.Labels)) &&
                   (Equals(Parents, other.Parents) || Parents != null && other.Parents != null && Parents.SequenceEqual(other.Parents)) &&
                   (Equals(Values, other.Values) || Values != null && other.Values != null && Values.SequenceEqual(other.Values)) &&
                   (BranchValues == other.BranchValues && BranchValues != null && other.BranchValues != null && BranchValues.Equals(other.BranchValues)) &&
                   (Count == other.Count && Count != null && other.Count != null && Count.Equals(other.Count)) &&
                   (Level == other.Level && Level != null && other.Level != null && Level.Equals(other.Level)) &&
                   (MaxDepth == other.MaxDepth && MaxDepth != null && other.MaxDepth != null && MaxDepth.Equals(other.MaxDepth)) &&
                   (Tiling == other.Tiling && Tiling != null && other.Tiling != null && Tiling.Equals(other.Tiling)) &&
                   (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) &&
                   (PathBar == other.PathBar && PathBar != null && other.PathBar != null && PathBar.Equals(other.PathBar)) &&
                   (Equals(Text, other.Text) || Text != null && other.Text != null && Text.SequenceEqual(other.Text)) &&
                   (TextInfo == other.TextInfo && TextInfo != null && other.TextInfo != null && TextInfo.Equals(other.TextInfo)) &&
                   (TextTemplate == other.TextTemplate && TextTemplate != null && other.TextTemplate != null && TextTemplate.Equals(other.TextTemplate)) &&
                   (Equals(TextTemplateArray, other.TextTemplateArray) || TextTemplateArray != null && other.TextTemplateArray != null && TextTemplateArray.SequenceEqual(other.TextTemplateArray)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) &&
                   (Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                    HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) &&
                   (TextFont == other.TextFont && TextFont != null && other.TextFont != null && TextFont.Equals(other.TextFont)) &&
                   (InsideTextFont == other.InsideTextFont && InsideTextFont != null && other.InsideTextFont != null && InsideTextFont.Equals(other.InsideTextFont)) &&
                   (OutsideTextFont == other.OutsideTextFont && OutsideTextFont != null && other.OutsideTextFont != null && OutsideTextFont.Equals(other.OutsideTextFont)) &&
                   (TextPosition == other.TextPosition && TextPosition != null && other.TextPosition != null && TextPosition.Equals(other.TextPosition)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (LabelsSrc == other.LabelsSrc && LabelsSrc != null && other.LabelsSrc != null && LabelsSrc.Equals(other.LabelsSrc)) &&
                   (ParentsSrc == other.ParentsSrc && ParentsSrc != null && other.ParentsSrc != null && ParentsSrc.Equals(other.ParentsSrc)) &&
                   (ValuesSrc == other.ValuesSrc && ValuesSrc != null && other.ValuesSrc != null && ValuesSrc.Equals(other.ValuesSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (TextTemplateSrc == other.TextTemplateSrc && TextTemplateSrc != null && other.TextTemplateSrc != null && TextTemplateSrc.Equals(other.TextTemplateSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc)));
        }
Beispiel #10
0
 private void ustawienia_Load(object sender, EventArgs e)
 {
     comboBoxMaxDepth.Text  = MaxDepth.ToString();
     textBoxExtensions.Text = Extensions;
 }