示例#1
0
        public void TestMethod1()
        {
            CurrentMappings currentMappings;
            Application     app;

            // Here the CORE_USER entity is NOT being ignored
            currentMappings = new CurrentMappings((modelBuilder) =>
            {
                modelBuilder.Configurations.Add(new CORE_SESSIONConfiguration());
                modelBuilder.Configurations.Add(new CORE_USERConfiguration());
                modelBuilder.Filter("test", (CORE_USER b, bool isDeleted) => true, () => false);
            });

            GlobalDBConfiguration config = new GlobalDBConfiguration();

            DbConfiguration.SetConfiguration(config);

            app = new Application(currentMappings);
            app.ResetDatabase();
            app.DoMerge();

            // Here we ignore both the entity and the field that has the FK
            currentMappings = new CurrentMappings((modelBuilder) =>
            {
                modelBuilder.Configurations.Add(new CORE_SESSIONConfiguration());
                modelBuilder.Entity <CORE_SESSION>().Ignore(t => t.fk_core_user);
                modelBuilder.Ignore <CORE_USER>();
            });

            ZzzUtils.ClearZzzAndEfCaches(ConnectionBuilder.GetConnectionString());

            var dcs = new DBModelSession();

            app = new Application(currentMappings);
            app.DoMerge();
        }
示例#2
0
        private void LipSyncMultiPicSelect_Load(object sender, EventArgs e)
        {
            int boxNum = 0;

            infoLabel.Text = "Multiple images detected, "
                             + Environment.NewLine
                             + "Please select the desired mapping";

            this.ForeColor = ThemeColorTable.ForeColor;
            this.BackColor = ThemeColorTable.BackgroundColor;


            foreach (KeyValuePair <string, ComboBox> kvp in comboBoxes)
            {
                kvp.Value.Items.Add("<Unmapped>");
                kvp.Value.Items.Add("<Mapped>");
            }

            foreach (string fileName in DropFileNames)
            {
                foreach (KeyValuePair <string, ComboBox> kvp in comboBoxes)
                {
                    kvp.Value.Items.Add(Path.GetFileName(fileName));
                }
            }

            //Check the mapping list supplied before the call.
            //If no mapping exists and the CurrentPhonemeIndex is more than the index of ComboBox, mark "Unmapped"
            //If mapping exists and the CurrentPhonemeIndex is more than the index of ComboBox, mark "Mapped"
            //In either case, if the ComboBoxIndex is equal to CurrentPhonemeIndex (+2?) then use the FileDrop

            int dropIndex = 0;

            SortedSet <string> phonemeTypes = new SortedSet <string>();

            foreach (PhonemeType tmpPhoneme in Enum.GetValues(typeof(PhonemeType)))
            {
                string phonemeString = tmpPhoneme.ToString();
                if (string.Compare(phonemeString, "Unknown") != 0)
                {
                    phonemeTypes.Add(tmpPhoneme.ToString());
                }
            }

            foreach (string searchPhoneme in phonemeTypes)
            {
                Bitmap searchValue;
                if (string.Compare(CurrentPhonemeString, searchPhoneme) == 0)
                {
                    comboBoxes[searchPhoneme].SelectedIndex = dropIndex + 2;
                    dropIndex++;
                }
                else if ((dropIndex > 0) && (dropIndex < DropFileNames.Length))
                {
                    comboBoxes[searchPhoneme].SelectedIndex = dropIndex + 2;
                    dropIndex++;
                }
                else
                {
                    if (CurrentMappings.TryGetValue(searchPhoneme, out searchValue) == true)
                    {
                        comboBoxes[searchPhoneme].SelectedIndex = 1;
                    }
                    else
                    {
                        comboBoxes[searchPhoneme].SelectedIndex = 0;
                    }
                }
            }
        }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 public Application(CurrentMappings mappings)
 {
     this.sb = new ScopeBuilder(mappings);
 }