예제 #1
0
        /// <summary>
        /// Tags with the default value (the presentation's current value or
        /// false if the presentation has no current value or there is no
        /// current presentation) iff there is currently NO value tagged.
        /// </summary>
        private void NormalizeShapeTags(PowerPoint.Tags tags)
        {
            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            if (!tagDict.Contains(PANE_TAG))
            {
                tagDict[PANE_TAG] = DEFAULT_MODE;
            }
        }
예제 #2
0
        /// <summary>
        /// Get the modes of the given presentation tag.
        /// </summary>
        /// <remarks>if it is so far
        /// entirely untagged, defaults to DEFAULT_MODE</remarks>
        private string[] GetShapeModes(PowerPoint.Tags tags)
        {
            // Tag if necessary.
            this.NormalizeShapeTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            // Discover what mode this is currently tagged as being in.
            return(((string)tagDict[PANE_TAG]).Split(','));
        }
예제 #3
0
        /// <summary>
        /// Get the mode of the given presentation tag.
        /// </summary>
        /// <remarks>if it is so far
        /// entirely untagged, Defaults to DEFAULT_MODE</remarks>
        private string GetPresentationMode(PowerPoint.Tags tags)
        {
            // Tag if necessary.
            this.NormalizePresentationTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            // Discover what mode this is currently tagged as being in.
            return((string)tagDict[PANE_TAG]);
        }
예제 #4
0
        /// <summary>
        /// Tags with the given value, adding the mode if it is anything but default and resetting to that
        /// mode if it is default.
        /// </summary>
        private void SetShapeMode(PowerPoint.Tags tags, string mode)
        {
            this.NormalizeShapeTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            string oldModes = (string)tagDict[PANE_TAG];

            // HACK: theoretically, this should disallow the default mode ever ending up in a list with other modes. That's assumed, but it could be more explicitly monitored.
            if (mode == DEFAULT_MODE || oldModes == DEFAULT_MODE || oldModes == "")
            {
                tagDict[PANE_TAG] = mode;
            }
            else if (System.Array.IndexOf(oldModes.Split(','), mode) == -1)
            {
                tagDict[PANE_TAG] = oldModes + "," + mode;
            }
            // Otherwise, do nothing b/c the mode is already there.
        }
예제 #5
0
        /// <summary>
        /// Tags with the given value, adding the mode if it is anything but default and resetting to that
        /// mode if it is default.
        /// </summary>
        private void SetShapeMode(PowerPoint.Tags tags, string mode)
        {
            this.NormalizeShapeTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            string oldModes = (string)tagDict[PANE_TAG];
            // HACK: theoretically, this should disallow the default mode ever ending up in a list with other modes. That's assumed, but it could be more explicitly monitored.
            if (mode == DEFAULT_MODE || oldModes == DEFAULT_MODE || oldModes == "")
                tagDict[PANE_TAG] = mode;
            else if (System.Array.IndexOf(oldModes.Split(','), mode) == -1)
                tagDict[PANE_TAG] = oldModes + "," + mode;
            // Otherwise, do nothing b/c the mode is already there.
        }
예제 #6
0
 /// <summary>
 /// Tags with the provided default value iff there is currently NO value tagged.
 /// </summary>
 private void NormalizeShapeTags(PowerPoint.Tags tags, string mode)
 {
     IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);
     if (!tagDict.Contains(PANE_TAG))
         tagDict[PANE_TAG] = mode;
 }
예제 #7
0
 /// <summary>
 /// Tags with the default value (the presentation's current value or
 /// false if the presentation has no current value or there is no
 /// current presentation) iff there is currently NO value tagged.
 /// </summary>
 private void NormalizePresentationTags(PowerPoint.Tags tags)
 {
     IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);
     if (!tagDict.Contains(PANE_TAG))
         tagDict[PANE_TAG] = DEFAULT_MODE;
 }
예제 #8
0
        /// <summary>
        /// Get the modes of the given presentation tag.
        /// </summary>
        /// <remarks>if it is so far
        /// entirely untagged, defaults to DEFAULT_MODE</remarks>
        private string[] GetShapeModes(PowerPoint.Tags tags)
        {
            // Tag if necessary.
            this.NormalizeShapeTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            // Discover what mode this is currently tagged as being in.
            return ((string)tagDict[PANE_TAG]).Split(',');
        }
예제 #9
0
        /// <summary>
        /// Get the mode of the given presentation tag.
        /// </summary>
        /// <remarks>if it is so far
        /// entirely untagged, Defaults to DEFAULT_MODE</remarks>
        private string GetPresentationMode(PowerPoint.Tags tags)
        {
            // Tag if necessary.
            this.NormalizePresentationTags(tags);

            IDictionary tagDict = new PPTLibrary.TagDictionary(tags, true, this.UniqueName);

            // Discover what mode this is currently tagged as being in.
            return (string)tagDict[PANE_TAG];
        }