コード例 #1
0
    /// <summary>
    ///     This is the point where the ball starts rolling.  We'll walk down the object's class hierarchy,
    ///     continually trying to cast it to objects we know about.  NOTE: this is intentionally not Reflection.
    ///     We can do that elsewhere, but here we want to explicitly control how data is formatted and navigated,
    ///     so we will manually walk the entire hierarchy.
    /// </summary>
    /// <param name="obj">Object to collect data for</param>
    public Task Collect(object obj)
    {
        Data.Clear();

        return(obj is null
            ? Task.CompletedTask
            : ExternalExecutor.ExecuteInRevitContextAsync(_ => Collect(Document, this, obj)));
    }
コード例 #2
0
ファイル: CollectorObj.cs プロジェクト: ricaun/RevitLookup
        /// <summary>
        ///     This is the point where the ball starts rolling.  We'll walk down the object's class hierarchy,
        ///     continually trying to cast it to objects we know about.  NOTE: this is intentionally not Reflection.
        ///     We can do that elsewhere, but here we want to explicitly control how data is formatted and navigated,
        ///     so we will manually walk the entire hierarchy.
        /// </summary>
        /// <param name="obj">Object to collect data for</param>
        public Task Collect(object obj)
        {
            MDataObjs.Clear();

            if (obj == null)
            {
                return(Task.CompletedTask);
            }

            return(ExternalExecutor.ExecuteInRevitContextAsync(app => Collect(app, SourceDocument, this, obj)));
        }