/// <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; } }
/// <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(',')); }
/// <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]); }
/// <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. }
/// <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. }
/// <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; }
/// <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; }
/// <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(','); }
/// <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]; }