Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((ParentKey.GetHashCode() * 397) ^ ChildKey.GetHashCode());
     }
 }
Example #2
0
        public override void ParseParentKey(ParentKey parent)
        {
            base.keyValues = parent.GetKeyValues();
            foreach (ParentKey child in parent.GetChildren())
            {
                switch (child.GetKey())
                {
                case "group_source_bindings":
                    GroupSourceBinding g = new GroupSourceBinding();
                    g.ParseParentKey(child);
                    groupSourceBindings.Add(g);
                    break;

                case "switch_bindings":
                    SwitchBinding sb = new SwitchBinding();
                    sb.ParseParentKey(child);
                    switchBindings.Add(sb);
                    break;

                case "settings":
                    Setting s = new Setting();
                    s.ParseParentKey(child);
                    settings.Add(s);
                    break;
                }
            }
        }
Example #3
0
 public override void ParseParentKey(ParentKey parent)
 {
     foreach (ParentKey child in parent.GetChildren())
     {
         Binding b = new Binding();
         b.ParseParentKey(child);
         bindings.Add(b);
     }
 }
Example #4
0
        /// <summary>
        /// Gets a value indicating whether the current <see cref='System.Data.ForeignKeyConstraint'/> is identical to the specified object.
        /// </summary>
        public override bool Equals(object key)
        {
            if (!(key is ForeignKeyConstraint))
            {
                return(false);
            }
            ForeignKeyConstraint key2 = (ForeignKeyConstraint)key;

            // The ParentKey and ChildKey completely identify the ForeignKeyConstraint
            return(ParentKey.ColumnsEqual(key2.ParentKey) && ChildKey.ColumnsEqual(key2.ChildKey));
        }
Example #5
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <ControllerComponentObject> controllerComponents = new List <ControllerComponentObject>();
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                desktopVDFFileLoc = ofd.FileName;
            }
            VDFParser parser = new VDFParser();
            ParentKey parent = parser.Parse(new StreamReader(File.Open(desktopVDFFileLoc, FileMode.Open)));


            controllerMapping = new ControllerMapping();
            controllerMapping.ParseParentKey(parent);
        }
        private void SetIdentity()
        {
            StringBuilder sb = new StringBuilder(128);

            sb.Append(ParentType?.Name);
            sb.Append(ChildType?.Name);
            sb.Append(ChildPropertyName);
            sb.Append(ParentPropertyName);
            if (ParentKey != null)
            {
                sb.Append(string.Join("", ParentKey.ToArray()));
            }
            if (ChildRoleName != null)
            {
                sb.Append(string.Join("", ChildRoleName.ToArray()));
            }
            _identity = sb.ToString();
        }
Example #7
0
        private string CreateCommitFileContent()
        {
            StringBuilder contentBuilder = new StringBuilder();

            contentBuilder.AppendLine(CommitFileType);
            if (ParentKey == null)
            {
                contentBuilder.AppendLine(NullParentKey);
            }
            else
            {
                contentBuilder.AppendLine(ParentKey.ToString());
            }
            contentBuilder.AppendLine(TreeKey.ToString());
            contentBuilder.AppendLine();
            contentBuilder.AppendLine(Message);
            return(contentBuilder.ToString());
        }
Example #8
0
        public void ParentChild()
        {
            var parent = new ParentKey {
                Domain = 100, Id = 101
            };
            var child = new ChildKey {
                Parent = parent, Id = 102
            };

            byte[] parentBytes = Serializer.Serialize(parent);
            byte[] childBytes  = Serializer.Serialize(child);

            Assert.Equal(
                "1, 100, 2, 101, 0",
                string.Join(", ", parentBytes));
            Assert.Equal(
                "1, 100, 2, 101, 0, 3, 102, 0",
                string.Join(", ", childBytes));
        }
Example #9
0
        public override void ParseParentKey(ParentKey parent)
        {
            base.keyValues = parent.GetKeyValues();
            foreach (ParentKey child in parent.GetChildren())
            {
                switch (child.GetKey())
                {
                case "group":
                    Group group = new Group();
                    group.ParseParentKey(child);
                    groups.Add(group);
                    break;

                case "preset":
                    Preset preset = new Preset();
                    preset.ParseParentKey(child);
                    presets.Add(preset);
                    break;
                }
            }
        }
Example #10
0
        public override void ParseParentKey(ParentKey parent)
        {
            base.keyValues = parent.GetKeyValues();
            foreach (ParentKey child in parent.GetChildren())
            {
                switch (child.GetKey())
                {
                case "bindings":
                    Binding b = new Binding();
                    b.ParseParentKey(child);
                    bindings.Add(b);
                    break;

                case "settings":
                    Setting s = new Setting();
                    s.ParseParentKey(child);
                    settings.Add(s);
                    break;
                }
            }
        }
Example #11
0
 public override int GetHashCode()
 {
     unchecked {
         int result = (comments != null ? comments.GetHashCode() : 0);
         result = (result * 397) ^ (versions != null ? versions.GetHashCode() : 0);
         result = (result * 397) ^ (fixVersions != null ? fixVersions.GetHashCode() : 0);
         result = (result * 397) ^ (SubtaskKeys.GetHashCode());
         result = (result * 397) ^ (IssueLinks.GetHashCode());
         result = (result * 397) ^ (components != null ? components.GetHashCode() : 0);
         result = (result * 397) ^ (attachments != null ? attachments.GetHashCode() : 0);
         result = (result * 397) ^ (Server != null ? Server.GUID.GetHashCode() : 0);
         result = (result * 397) ^ (IssueType != null ? IssueType.GetHashCode() : 0);
         result = (result * 397) ^ IssueTypeId;
         result = (result * 397) ^ (IssueTypeIconUrl != null ? IssueTypeIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         result = (result * 397) ^ Id;
         result = (result * 397) ^ (Key != null ? Key.GetHashCode() : 0);
         result = (result * 397) ^ (Summary != null ? Summary.GetHashCode() : 0);
         result = (result * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         result = (result * 397) ^ (StatusIconUrl != null ? StatusIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ (Priority != null ? Priority.GetHashCode() : 0);
         result = (result * 397) ^ (Resolution != null ? Resolution.GetHashCode() : 0);
         result = (result * 397) ^ (Reporter != null ? Reporter.GetHashCode() : 0);
         result = (result * 397) ^ (Assignee != null ? Assignee.GetHashCode() : 0);
         result = (result * 397) ^ CreationDate.GetHashCode();
         result = (result * 397) ^ UpdateDate.GetHashCode();
         result = (result * 397) ^ (ProjectKey != null ? ProjectKey.GetHashCode() : 0);
         result = (result * 397) ^ (Environment != null ? Environment.GetHashCode() : 0);
         result = (result * 397) ^ (OriginalEstimate != null ? OriginalEstimate.GetHashCode() : 0);
         result = (result * 397) ^ (RemainingEstimate != null ? RemainingEstimate.GetHashCode() : 0);
         result = (result * 397) ^ (TimeSpent != null ? TimeSpent.GetHashCode() : 0);
         result = (result * 397) ^ (ParentKey != null ? ParentKey.GetHashCode() : 0);
         result = (result * 397) ^ (PriorityIconUrl != null ? PriorityIconUrl.GetHashCode() : 0);
         result = (result * 397) ^ StatusId;
         result = (result * 397) ^ PriorityId;
         return(result);
     }
 }
Example #12
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            try
            {
                VDFParser parser = new VDFParser();
                ParentKey parent = parser.Parse(new StreamReader(File.Open(desktopVDFFileLoc, FileMode.Open)));
                controllerMapping = new ControllerMapping();
                controllerMapping.ParseParentKey(parent);

                a = new A_Button(controllerMapping);
                b = new B_Button(controllerMapping);
                x = new X_Button(controllerMapping);
                y = new Y_Button(controllerMapping);
                lbl_A_Button.Text = a.action;
                lbl_B_Button.Text = b.action;
                lbl_X_Button.Text = x.action;
                lbl_Y_Button.Text = y.action;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Could not read file");
                Console.WriteLine(ex.Message);
            }
        }
Example #13
0
 /// <include file='doc\ForeignKeyConstraint.uex' path='docs/doc[@for="ForeignKeyConstraint.GetHashCode"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public override Int32 GetHashCode()
 {
     return(ParentKey.GetHashCode() + ChildKey.GetHashCode());
 }
Example #14
0
 public bool Equals(CompositeKey?other)
 {
     return(ParentKey.Equals(other?.ParentKey) && ChildKey.Equals(other?.ChildKey));
 }
Example #15
0
 public override void ParseParentKey(ParentKey parent)
 {
     base.keyValues = parent.GetKeyValues();
 }
Example #16
0
 public override void ParseParentKey(ParentKey parent)
 {
     setting = parent.GetKeyValues();
 }
Example #17
0
 public abstract void ParseParentKey(ParentKey parent);