예제 #1
0
        internal WatchItem ProcessThing(Element element, string tag, bool showRawData = true)
        {
            var id = element.Id;

            var node = new WatchItem(element.Name);
            node.Clicked += () => dynRevitSettings.Doc.ShowElements(element);
            node.Link = id.IntegerValue.ToString(CultureInfo.InvariantCulture);

            return node;
        }
예제 #2
0
 internal WatchItem ProcessThing(object value, string tag, bool showRawData = true)
 {
     var node = new WatchItem(value.ToString(), tag);
     return node;
 }
예제 #3
0
파일: dynWatch.cs 프로젝트: jimmplan/Dynamo
        /// <summary>
        /// Called during Evaluation, this method handles the 
        /// conversion of an FScheme.Value object into a watchnode. 
        /// This process uses the IWatchHandler registered on
        /// the controller to dynamically dispatch watch node 
        /// processing based on the unboxed Value's object.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="tag"></param>
        /// <param name="showRawData"></param>
        /// <returns></returns>
        public WatchItem Process(Value value, string tag, bool showRawData = true)
        {
            WatchItem node;

            if (value == null || value.IsDummy)
            {
                node = new WatchItem("null");
            }
            else if (value.IsFunction)
            {
                node = new WatchItem("<function>");
            }
            else if (value.IsList)
            {
                var list = ((Value.List) value).Item;
                node = new WatchItem(list.IsEmpty ? "Empty List" : string.Format("[{0}] List", tag));

                foreach (var e in list.Select((x, i) => new {Element = x, Index = i}))
                {
                    node.Children.Add(Process(e.Element, e.Index.ToString(CultureInfo.InvariantCulture), showRawData));
                }
            }
            else
            {
                node = dynSettings.Controller.WatchHandler.Process(value.ToDynamic(), tag, showRawData);
            }

            return node ?? (new WatchItem("null"));
        }