/// <summary> /// Initializes a new instance of the <see cref="WordSelectionInfo"/> class. /// </summary> /// <param name="startIndex">The selection start index.</param> /// <param name="endIndex">The selection end index.</param> /// <param name="parent">The parent document.</param> public WordSelectionInfo(int startIndex, int endIndex, WordDocumentInfo parent) { if (parent == null) { throw new ArgumentNullException("parent"); } this.StartIndex = startIndex; this.EndIndex = endIndex; this.Parent = parent; }
// Needed to find out if two objects are same or not. public override bool Equals(object obj) { WordDocumentInfo other = obj as WordDocumentInfo; if (other != null) { return(string.Equals(this.DocName, other.DocName, StringComparison.Ordinal)); } return(false); }
/// <summary> /// Creates an appropriate Word UI element. /// </summary> /// <param name="windowHandle">The window handle.</param> /// <param name="rangeInfo">The info on the element.</param> /// <returns>The Word UI element.</returns> internal UITechnologyElement GetWordRange(IntPtr windowHandle, WordRangeInfo rangeInfo) { WordSelectionInfo wsi = rangeInfo as WordSelectionInfo; if (wsi != null) { return(new WordSelectionRange(windowHandle, wsi, this)); } WordDocumentInfo wdi = rangeInfo as WordDocumentInfo; return(wdi != null ? new WordDocumentRange(windowHandle, wdi, this) : new WordRange(windowHandle, this)); }
/// <summary> /// Initializes a new instance of the <see cref="WordDocumentRange"/> class. /// </summary> /// <param name="windowHandle">The window handle.</param> /// <param name="documentInfo">The document info.</param> /// <param name="manager">The technology manager.</param> internal WordDocumentRange(IntPtr windowHandle, WordDocumentInfo documentInfo, WordTechnologyManager manager) : base(windowHandle, manager) { this.DocumentInfo = documentInfo; }
/// <summary> /// Gets the Document from the document info. /// </summary> /// <param name="docInfo">The document info.</param> /// <returns>The Document.</returns> private Document GetDocument(WordDocumentInfo docInfo) { return(this.application.Documents[docInfo.DocName]); }