internal void Add(SchemaInfo sinfo, ValidationEventHandler eventhandler)
        {
            if (schemaType == SchemaType.None)
            {
                schemaType = sinfo.SchemaType;
            }
            else if (schemaType != sinfo.SchemaType)
            {
                if (eventhandler != null)
                {
                    eventhandler(this, new ValidationEventArgs(new XmlSchemaException(Res.Sch_MixSchemaTypes, string.Empty)));
                }
                return;
            }

            foreach (string tns in sinfo.TargetNamespaces.Keys)
            {
                if (!targetNamespaces.ContainsKey(tns))
                {
                    targetNamespaces.Add(tns, true);
                }
            }

            foreach (KeyValuePair <XmlQualifiedName, SchemaElementDecl> entry in sinfo.elementDecls)
            {
                if (!elementDecls.ContainsKey(entry.Key))
                {
                    elementDecls.Add(entry.Key, entry.Value);
                }
            }
            foreach (KeyValuePair <XmlQualifiedName, SchemaElementDecl> entry in sinfo.elementDeclsByType)
            {
                if (!elementDeclsByType.ContainsKey(entry.Key))
                {
                    elementDeclsByType.Add(entry.Key, entry.Value);
                }
            }
            foreach (SchemaAttDef attdef in sinfo.AttributeDecls.Values)
            {
                if (!attributeDecls.ContainsKey(attdef.Name))
                {
                    attributeDecls.Add(attdef.Name, attdef);
                }
            }
            foreach (SchemaNotation notation in sinfo.Notations.Values)
            {
                if (!Notations.ContainsKey(notation.Name.Name))
                {
                    Notations.Add(notation.Name.Name, notation);
                }
            }
        }
Exemplo n.º 2
0
        public AddNotationViewModel(INavigation navigation)
        {
            Title               = "Add notation";
            Notation            = new Notations();
            SaveNotationCommand = new Command(async() => await SaveNotation());

            foreach (NotationType type in Enum.GetValues(typeof(NotationType)))
            {
                NotationTypes.Add(type);
            }

            _navigation = navigation;
        }
Exemplo n.º 3
0
 public PlayerBio(float height, float weight, byte yearsPro, DateTime birthDate, Notations notation)
 {
     this.yearsPro = yearsPro;
     this.birthDate = birthDate;
     switch (notation)
     {
         case Notations.USA:
             this.heightM = FeetToM(height);
             this.weightKG = PoundsToKG(weight);
             break;
         default:
             this.heightM = height;
             this.weightKG = weight;
             break;
     }
 }
Exemplo n.º 4
0
        public void ShouldHaveCollectionProperties()
        {
            foreach (var property in typeof(OpenCartDomain).GetOwnProperties())
            {
                Assert.IsTrue(
                    property.PropertyType.IsGeneric(typeof(DbSet <>)),
                    $"Domain property {property.Name} should have ICollection<> type.");

                Assert.IsTrue(
                    Notations.InPascal(property.Name),
                    $"Domain property {property.Name} should be in pascal notation.");

                Assert.IsTrue(
                    property.HasPublicGetter() && property.HasVirtualGetter(),
                    $"Domain property {property.Name} should have public virtual getter.");

                Assert.IsTrue(
                    property.HasPublicSetter() && property.HasVirtualSetter(),
                    $"Domain property {property.Name} should have public virtual setter.");
            }
        }
Exemplo n.º 5
0
        public async static Task Add(Notations notation)
        {
            string stored_notations = await SecureStorage.GetAsync("Notations");

            if (string.IsNullOrWhiteSpace(stored_notations))
            {
                stored_notations = notation.Id.ToString();
            }
            else
            {
                stored_notations += "," + notation.Id.ToString();
            }

            await SecureStorage.SetAsync("Notations", stored_notations);

            string serialized_str = JsonConvert.SerializeObject(notation);

            string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Notation_" + notation.Id + ".dat");

            File.WriteAllText(fileName, serialized_str);
        }
Exemplo n.º 6
0
        public static T FindAndInclude <T>(this DbSet <T> _db, int Id, bool AsNoTracking = false) where T : class
        {
            var db = AsNoTracking ? _db.AsNoTracking() : _db;

            switch (db)
            {
            case IQueryable <Template> Templates:
                return((dynamic)Templates.Where(i => i.Id == Id).Include(r => r.Rules).Include(r => r.RuleReplaces).Include(r => r.RuleOverrides).Include(r => r.RuleArgs).FirstOrDefault());

            case IQueryable <Domain> Domains:
                return((dynamic)Domains.Where(i => i.Id == Id).Include(a => a.av).Include(a => a.AntiBot).Include(l => l.limitRequest).Include(i => i.IgnoreToLogs).Include(c => c.confToLog).Include(a => a.Aliases).Include(r => r.Rules).Include(r => r.RuleReplaces).Include(r => r.RuleOverrides).Include(r => r.RuleArgs).Include(t => t.Templates).FirstOrDefault());

            case IQueryable <Notation> Notations:
                return((dynamic)Notations.Where(i => i.Id == Id).Include(n => n.More).FirstOrDefault());

            case IQueryable <Task> Tasks:
                return((dynamic)Tasks.Where(i => i.Id == Id).Include(f => f.FTP).Include(w => w.WebDav).Include(o => o.OneDrive).Include(i => i.IgnoreFileOrFolders).FirstOrDefault());
            }

            return(null);
        }
Exemplo n.º 7
0
        public static Note CreateNote(NoteProperties ni)
        {
            ObjectFactory factory = new ObjectFactory();
            Note          note    = factory.createNote();

            if (ni.chord == true)
            {
                note.setChord(new Empty());
            }


            if (ni.rest == true)
            {
                note.setRest(factory.createRest());
            }
            else
            {
                note.setPitch(CreatePitch(ni.PitchStep, ni.Pitchoctave, ni.PitchAlter));
            }

            //set the duration
            note.setDuration(new BigDecimal(ni.duration));

            //set the tie element
            if (ni.TieType != "")
            {
                note.getTie().add(CreateTie(ni.TieType));
            }


            //Set the Voice
            note.setVoice("1");

            //assign the notetype
            note.setType(CreateNotetype(ni.NoteType));

            //Set a dot
            if (ni.dot == true)
            {
                note.getDot().add(new EmptyPlacement());
            }

            //assign the accidental
            if (ni.AccidentalType != "")
            {
                note.setAccidental(CreateAccidental(ni.AccidentalType));
            }

            //assign the timemodification
            if (ni.TimeModactualnotes != "")
            {
                note.setTimeModification(CreateTimemodification(ni.TimeModactualnotes, ni.TimeModnormalnotes, ni.TimeModnormaltype));
            }

            //Set the note staff
            note.setStaff(new BigInteger(ni.staff.ToString()));

            ////add a beam
            for (int i = 0; i < ni.beamnumber.Count; i++)
            {
                note.getBeam().add(CreateBeam(ni.beamnumber.ElementAt <int>(i), ni.beamvalue.ElementAt <string>(i)));
            }

            if (ni.SlurType != "" | ni.TupletType != "" | ni.TiedType != "" | ni.dynamic != "")
            {
                Notations notations = factory.createNotations();

                //add a tied element
                if (ni.TiedType != "")
                {
                    notations.getTiedOrSlurOrTuplet().add(CreateTied(ni.TiedType));
                }


                //add a slur
                if (ni.SlurType != "")
                {
                    notations.getTiedOrSlurOrTuplet().add(CreateSlur(ni.SlurType));
                }


                //add a tuplet
                if (ni.TupletNumber != 0)
                {
                    notations.getTiedOrSlurOrTuplet().add(CreateTuplet(ni.TupletNumber, ni.TupletType));
                }

                //Adding dynamics here
                if (ni.dynamic != "")
                {
                    Dynamics dynamics = new Dynamics();

                    switch (ni.dynamic)
                    {
                    case "pp":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsPp(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }

                    case "p":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsP(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }

                    case "mp":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsMp(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }

                    case "mf":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsMf(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }

                    case "f":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsF(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }

                    case "ff":
                    {
                        dynamics.getPOrPpOrPpp().add(factory.createDynamicsFf(new Empty()));
                        //add the dynamic to the direction
                        notations.getTiedOrSlurOrTuplet().add(dynamics);
                        break;
                    }
                    }
                }
                //add the notations to the note
                note.getNotations().add(notations);
            }
            //assign the lyric
            if (ni.LyricText != "")
            {
                note.getLyric().add(CreateLyric(ni.LyricSyllabic, ni.LyricText, ni.LyricEndline));
            }

            return(note);
        }
Exemplo n.º 8
0
        //Read the note
        public static NoteProperties ReadNote(int notenumber, ScorePartwise.Part.Measure measure)
        {
            if (getnoteindex(notenumber, measure) != -1)
            {
                Note           note     = (Note)measure.getNoteOrBackupOrForward().get(getnoteindex(notenumber, measure));
                NoteProperties noteprop = new NoteProperties();

                noteprop.chord = note.getChord() == new Empty() ? true : false;

                if (note.getRest() != null)
                {
                    //MessageBox.Show("Rest Read!");

                    noteprop.rest = true;
                    try
                    {
                        noteprop.NoteType = note.getType().getValue();
                    }
                    catch (System.Exception)
                    {
                        noteprop.NoteType = "";
                    }
                }
                else if (note.getPitch() is Pitch)
                {
                    noteprop.NoteType    = note.getType().getValue();   // get the notetype only if it is not a rest
                    noteprop.PitchStep   = note.getPitch().getStep().value();
                    noteprop.Pitchoctave = note.getPitch().getOctave();
                    if (note.getPitch().getAlter() != null)
                    {
                        noteprop.PitchAlter = note.getPitch().getAlter().floatValue();
                    }
                }

                noteprop.duration = note.getDuration().intValue();

                if (note.getTie().size() != 0)
                {
                    Tie tie = (Tie)note.getTie().get(0);
                    noteprop.TieType = tie.getType().toString();
                }



                noteprop.dot = note.getDot().size() == 0? false:true;

                noteprop.AccidentalType = note.getAccidental() == null? "":note.getAccidental().getValue().value();



                if (note.getTimeModification() != null)
                {
                    noteprop.TimeModactualnotes = note.getTimeModification().getActualNotes().intValue().ToString();
                    noteprop.TimeModnormalnotes = note.getTimeModification().getNormalNotes().intValue().ToString();
                    noteprop.TimeModnormaltype  = note.getTimeModification().getNormalType() == null ? "" : note.getTimeModification().getNormalType();
                }

                ///////////////////////////////////COMPLETE ME
                Beam beam;
                for (int i = 0; i < note.getBeam().size(); i++)
                {
                    beam = (Beam)note.getBeam().get(i);
                    noteprop.beamvalue.Add(beam.getValue().value());
                    noteprop.beamnumber.Add(beam.getNumber());
                }

                if (note.getNotations().size() != 0)
                {
                    Notations notations = (Notations)note.getNotations().get(0);
                    for (int i = 0; i < notations.getTiedOrSlurOrTuplet().size(); i++)
                    {
                        if (notations.getTiedOrSlurOrTuplet().get(i) is Tied)
                        {
                            Tied tied = (Tied)notations.getTiedOrSlurOrTuplet().get(i);
                            //if(tied.getNumber().intValue()==1)
                            noteprop.TiedType = tied.getType().value();
                        }

                        if (notations.getTiedOrSlurOrTuplet().get(i) is Slur)
                        {
                            Slur slur = (Slur)notations.getTiedOrSlurOrTuplet().get(i);
                            if (slur.getNumber() == 1)
                            {
                                noteprop.SlurType = slur.getType().value();
                            }
                        }

                        if (notations.getTiedOrSlurOrTuplet().get(i) is Tuplet)
                        {
                            Tuplet tuplet = (Tuplet)notations.getTiedOrSlurOrTuplet().get(i);
                            noteprop.TupletType = tuplet.getType().value();
                            //noteprop.TupletNumber = tuplet.getNumber().intValue();
                        }
                        if (notations.getTiedOrSlurOrTuplet().get(i) is Dynamics)
                        {
                            Dynamics dynamics            = (Dynamics)notations.getTiedOrSlurOrTuplet().get(i);
                            javax.xml.bind.JAXBElement x = (javax.xml.bind.JAXBElement)dynamics.getPOrPpOrPpp().get(0);
                            noteprop.dynamic = x.getName().ToString();
                        }
                    }
                }

                if (note.getLyric().size() != 0)
                {
                    Lyric lyric = (Lyric)note.getLyric().get(0);
                    for (int i = 0; i < lyric.getElisionAndSyllabicAndText().size(); i++)
                    {
                        if (lyric.getElisionAndSyllabicAndText().get(i) is Syllabic)
                        {
                            Syllabic syllabic = (Syllabic)lyric.getElisionAndSyllabicAndText().get(i);
                            noteprop.LyricSyllabic = syllabic.value();
                        }

                        if (lyric.getElisionAndSyllabicAndText().get(i) is TextElementData)
                        {
                            TextElementData text = (TextElementData)lyric.getElisionAndSyllabicAndText().get(i);
                            noteprop.LyricText = text.getValue();
                        }
                    }
                    noteprop.LyricEndline = lyric.getEndLine() == null?false:true;
                }
                return(noteprop);
            }
            return(null);
        }
Exemplo n.º 9
0
        public PlayerBio(float height, float weight, byte yearsPro, DateTime birthDate, Notations notation)
        {
            this.yearsPro  = yearsPro;
            this.birthDate = birthDate;
            switch (notation)
            {
            case Notations.USA:
                this.heightM  = FeetToM(height);
                this.weightKG = PoundsToKG(weight);
                break;

            default:
                this.heightM  = height;
                this.weightKG = weight;
                break;
            }
        }