예제 #1
0
 /// <summary>
 /// Walks the children of a Taskpanes element.
 /// </summary>
 /// <param name="tps"></param>
 /// <param name="svCallback"></param>
 /// <param name="dblCallback"></param>
 /// <param name="uint32Callback"></param>
 private void Walker_WebExtentionPane(Wetp.Taskpanes tps,
                                      TypedValueFoo <StringValue> svCallback, TypedValueFoo <DoubleValue> dblCallback,
                                      TypedValueFoo <UInt32Value> uint32Callback, TypedValueFoo <BooleanValue> boolCallback)
 {
     foreach (Wetp.WebExtensionTaskpane tp in tps.ChildElements)
     {
         tp.DockState = svCallback(tp.DockState);
         tp.Locked    = boolCallback(tp.Locked);
         /// TODO: these are messy, let's do them later:
         /// OfficeArtExtensionList
         /// OsfWebExtensionPartRef
         tp.Row        = uint32Callback(tp.Row);
         tp.Visibility = boolCallback(tp.Visibility);
         tp.Width      = dblCallback(tp.Width);
     }
 }
예제 #2
0
        /// <summary>
        /// Walks the WebExtension element, invoking the delegates provided on all the Strings and Int32 values
        /// </summary>
        /// <param name="wep">WebExtensionPart the element to be walked</param>
        /// <param name="svCallback">StringValueFoo delegate to be called for StringValues</param>
        /// <param name="int32Callback">Int32ValueFoo delegate to be called for Int32Values</param>
        private void WalkWep(WebExtensionPart wep, TypedValueFoo <StringValue> svCallback, TypedValueFoo <Int32Value> int32Callback)
        {
            We.WebExtension we = wep.WebExtension;

            foreach (OpenXmlElement blipKid in we.Snapshot)
            {
                // Actually they say (obj.GetType() == typeof(ClassA)) is faster, but we are not in hurry here anyways
                if (blipKid is A.AlphaBiLevel)
                {
                    A.AlphaBiLevel abl = blipKid as A.AlphaBiLevel;
                    abl.Threshold = int32Callback(abl.Threshold);
                }
                else

                if (blipKid is A.AlphaCeiling)
                {
                }
                else

                if (blipKid is A.AlphaFloor)
                {
                }
                else

                if (blipKid is A.BlipExtensionList)
                {
                    A.BlipExtensionList bel = blipKid as A.BlipExtensionList;

                    foreach (A.BlipExtension be in bel)
                    {
                        be.Uri = svCallback(be.Uri);
                    }
                    // it's possible to try and access the childs of be, but these are OpenXmlUnknownElement
                    // and it's not possible to modify them in an intelligent way.
                }
            }

            we.Id = svCallback(we.Id);

            foreach (We.WebExtensionBinding binding in we.WebExtensionBindingList)
            {
                binding.AppReference = svCallback(binding.AppReference);
                binding.Id           = svCallback(binding.Id);

                // UF: how about the Type?
            }

            foreach (We.WebExtensionProperty prop in we.WebExtensionPropertyBag)
            {
                prop.Name  = svCallback(prop.Name);
                prop.Value = svCallback(prop.Value);
            }

            {
                We.WebExtensionStoreReference refr = we.WebExtensionStoreReference;

                refr.Id        = svCallback(refr.Id);
                refr.Store     = svCallback(refr.Store);
                refr.StoreType = svCallback(refr.StoreType);
                refr.Version   = svCallback(refr.Version);
            }

            foreach (We.WebExtensionStoreReference refr in we.WebExtensionReferenceList)
            {
                refr.Id        = svCallback(refr.Id);
                refr.Store     = svCallback(refr.Store);
                refr.StoreType = svCallback(refr.StoreType);
                refr.Version   = svCallback(refr.Version);
            }
        }