//#if DEBUG
        //        public override void XukIn(XmlReader source, IProgressHandler handler)
        //        {
        //            base.XukIn(source, handler);

        //            checkWavClips();
        //        }
        //#endif //DEBUG

        /// <summary>
        /// Reads a child of a WavAudioMediaData xuk element.
        /// </summary>
        /// <param name="source">The source <see cref="XmlReader"/></param>
        /// <param name="handler">The handler for progress</param>
        protected override void XukInChild(XmlReader source, IProgressHandler handler)
        {
            bool readItem = false;

            if (source.NamespaceURI == XukAble.XUK_NS)
            {
                readItem = true;
                if (source.LocalName == XukStrings.WavClips)
                {
                    XukInWavClips(source);
                }
                else if (!Presentation.Project.PrettyFormat &&
                         WavClip_NAME.Match(source.LocalName)
                         //XukAble.GetXukName(typeof(WavClip))
                         )
                {
                    XukInWavClip(source);
                }
                else if (source.LocalName == XukStrings.PCMFormat)
                {
                    XukInPCMFormat(source, handler);
                }
                else
                {
                    readItem = false;
                }
            }
            if (!readItem)
            {
                base.XukInChild(source, handler);
            }
        }
예제 #2
0
 /// <summary>
 /// Reads a child of a XukAble xuk element.
 /// </summary>
 /// <param name="source">The source <see cref="XmlReader"/></param>
 /// <param name="handler">The handler of progress</param>
 protected override void XukInChild(XmlReader source, progress.IProgressHandler handler)
 {
     if (RegisteredTypes_NAME.Match(source.LocalName) &&
         source.NamespaceURI == XukAble.XUK_NS)
     {
         XukInRegisteredTypes(source, handler);
         return;
     }
     base.XukInChild(source, handler);
 }
예제 #3
0
        protected void XukInRegisteredType(XmlReader source)
        {
            if (Type_NAME.Match(source.LocalName) &&
                source.NamespaceURI == XukAble.XUK_NS)
            {
                TypeAndQNames tq = new TypeAndQNames();

                readTypeAndQNamesFromXmlReader(tq, source, PrettyFormat);

                if (tq.Type == null)
                {
#if DEBUG
                    Debugger.Break();
#endif
                    RegisterType(tq);
                }
                else
                {
                    TypeAndQNames tq_ = RegisterType(tq.Type);

                    DebugFix.Assert(tq_.AssemblyName.Name == tq.AssemblyName.Name);
                    //DebugFix.Assert(tq_.AssemblyName.Version == tq.AssemblyName.Version);

                    DebugFix.Assert(tq_.ClassName == tq.ClassName);
                    DebugFix.Assert(tq_.Type == tq.Type);

                    DebugFix.Assert(tq_.QName.NamespaceUri == tq.QName.NamespaceUri);

                    DebugFix.Assert(tq_.QName.LocalName.Ugly == tq.QName.LocalName.Ugly);
                    DebugFix.Assert(tq_.QName.LocalName.Pretty == tq.QName.LocalName.Pretty);

                    if (tq_.BaseQName != null && tq.BaseQName != null)
                    {
                        DebugFix.Assert(tq_.BaseQName.NamespaceUri == tq.BaseQName.NamespaceUri);

                        if (!String.IsNullOrEmpty(tq.BaseQName.LocalName.Ugly))
                        {
                            DebugFix.Assert(tq_.BaseQName.LocalName.Ugly == tq.BaseQName.LocalName.Ugly);
                        }

                        if (!String.IsNullOrEmpty(tq.BaseQName.LocalName.Pretty))
                        {
                            DebugFix.Assert(tq_.BaseQName.LocalName.Pretty == tq.BaseQName.LocalName.Pretty);
                        }
                    }
                }
            }
            if (!source.IsEmptyElement)
            {
                source.ReadSubtree().Close();
            }
        }