Example #1
0
 public TreeViewDialog()
 {
     InitializeComponent();
     wrappedTree = new TreeViewWrapper(this.treeView);
     ClearTree();
     EnableControls();
 }
        void CacheComponent(GameObject go, int layer, bool isPrefabRoot)
        {
            var so = new SerializedObject(go);

            var t = new TreeViewWrapper(Id);

            t.values = so;
            serializedObjects.Add(t);
            Id++;
            CacheProperty(so);

            var components = go.GetComponents(typeof(Component));

            foreach (var item in components)
            {
                if (item == null)
                {
                    ViewSystemLog.LogError("It seems there is some Component's script is missing, Please check your prefab");
                    continue;
                }

                // if (isPrefabRoot == true &&
                //     (item is UnityEngine.Transform || item is UnityEngine.RectTransform)
                // )
                // {
                //     continue;
                // }
                var t1  = new TreeViewWrapper(Id);
                var so1 = new SerializedObject(item);
                t1.values = so1;
                serializedObjects.Add(t1);
                Id++;
                CacheProperty(so1);
            }
        }
Example #3
0
        public MainForm()
        {
            InitializeComponent();
            docWindows     = new DocumentWindowCollection(this);
            ProjectBrowser = new TreeViewWrapper(treeBrowser);

            this.Load += MainForm_Load;
            this.ProcessCommandKey += this.MainForm_ProcessCommandKey;
        }
        void CacheProperty(SerializedObject obj)
        {
            allTreeViewWrappers.Clear();
            var    prop = obj.GetIterator().Copy();
            string key  = "";

            if (obj.targetObject as Component == null)
            {
                key = "UnityEngine.GameObject";
            }
            else
            {
                key = obj.targetObject.GetType().Name;
            }
            List <TreeViewWrapper> slist;

            if (!serializedPropertys.TryGetValue(key, out slist))
            {
                slist = new List <TreeViewWrapper>();
                serializedPropertys.Add(key, slist);
            }

            TreeViewWrapper temp;

            //GameObject Hack m_IsActive is not a Visable Property but we still want to modify it.
            if (key == "UnityEngine.GameObject")
            {
                var active = obj.FindProperty("m_IsActive");
                if (active != null)
                {
                    temp        = new TreeViewWrapper(Id);
                    temp.values = active.Copy();
                    slist.Add(temp);
                    allTreeViewWrappers.Add(temp);
                    Id++;
                }
            }

            prop.NextVisible(true);
            do
            {
                //排除不希望被修改的欄位
                if (VS_EditorUtility.IsPropertyNeedIgnore(prop))
                {
                    continue;
                }
                temp = new TreeViewWrapper(Id);
                allTreeViewWrappers.Add(temp);
                temp.values = prop.Copy();
                slist.Add(temp);
                Id++;
            }while (prop.NextVisible(false));
        }
        public void PBS_RejectTextDrop()
        {
            var mockTree = new FakeTreeView();
            var pbs      = new WindowsProjectBrowserService(sc, tabPage.Object, mockTree);
            var e        = Given_DraggedText();

            var project = new Project();

            pbs.Load(project);
            mockTree.PerformDragEnter(e);
            var winEvent = TreeViewWrapper.Convert(e);

            Assert.AreEqual(DragDropEffects.None, (DragDropEffects)(int)winEvent.Effect);
        }
Example #6
0
 public MainForm()
 {
     InitializeComponent();
     docWindows     = new DocumentWindowCollection(this);
     ProjectBrowser = new TreeViewWrapper(treeBrowser);
 }
Example #7
0
 private void InitializeComponent()
 {
     this.components              = new System.ComponentModel.Container();
     this.tvPorts                 = new TI.Toolbox.TreeViewWrapper();
     this.cmsTreeHandle           = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.tsmiSetConnectionHandle = new System.Windows.Forms.ToolStripMenuItem();
     this.tsmiCopyHandle          = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator2     = new System.Windows.Forms.ToolStripSeparator();
     this.tsmiDiscoverUuids       = new System.Windows.Forms.ToolStripMenuItem();
     this.tsmiReadValues          = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator4     = new System.Windows.Forms.ToolStripSeparator();
     this.tsmiClearTransmitQueue2 = new System.Windows.Forms.ToolStripMenuItem();
     this.cmsTreeBda              = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.tsmiCopyAddress         = new System.Windows.Forms.ToolStripMenuItem();
     this.cmsTreeComPort          = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.tsmiDiscoverAllUuids    = new System.Windows.Forms.ToolStripMenuItem();
     this.tsmiReadAllValues       = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator3     = new System.Windows.Forms.ToolStripSeparator();
     this.tsmiClearTransmitQueue  = new System.Windows.Forms.ToolStripMenuItem();
     this.cmsTreeHandle.SuspendLayout();
     this.cmsTreeBda.SuspendLayout();
     this.cmsTreeComPort.SuspendLayout();
     this.SuspendLayout();
     //
     // tvPorts
     //
     this.tvPorts.Dock         = System.Windows.Forms.DockStyle.Fill;
     this.tvPorts.Indent       = 12;
     this.tvPorts.Location     = new System.Drawing.Point(0, 0);
     this.tvPorts.Name         = "tvPorts";
     this.tvPorts.Size         = new System.Drawing.Size(210, 579);
     this.tvPorts.TabIndex     = 4;
     this.tvPorts.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvPorts_AfterSelect);
     //
     // cmsTreeHandle
     //
     this.cmsTreeHandle.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsmiSetConnectionHandle,
         this.tsmiCopyHandle,
         this.toolStripSeparator2,
         this.tsmiDiscoverUuids,
         this.tsmiReadValues,
         this.toolStripSeparator4,
         this.tsmiClearTransmitQueue2
     });
     this.cmsTreeHandle.Name = "contextMenuStrip1";
     this.cmsTreeHandle.Size = new System.Drawing.Size(209, 126);
     //
     // tsmiSetConnectionHandle
     //
     this.tsmiSetConnectionHandle.Name        = "tsmiSetConnectionHandle";
     this.tsmiSetConnectionHandle.Size        = new System.Drawing.Size(208, 22);
     this.tsmiSetConnectionHandle.Text        = "&Set Connection Handle";
     this.tsmiSetConnectionHandle.ToolTipText = "Set The Connection Handle Used By BTool";
     this.tsmiSetConnectionHandle.Click      += new System.EventHandler(this.tsmiSetConnectionHandle_Click);
     //
     // tsmiCopyHandle
     //
     this.tsmiCopyHandle.Name        = "tsmiCopyHandle";
     this.tsmiCopyHandle.Size        = new System.Drawing.Size(208, 22);
     this.tsmiCopyHandle.Text        = "&Copy Handle";
     this.tsmiCopyHandle.ToolTipText = "Copy The Handle To The Clipboard";
     this.tsmiCopyHandle.Click      += new System.EventHandler(this.tsmiCopyHandle_Click);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
     //
     // tsmiDiscoverUuids
     //
     this.tsmiDiscoverUuids.Name        = "tsmiDiscoverUuids";
     this.tsmiDiscoverUuids.Size        = new System.Drawing.Size(208, 22);
     this.tsmiDiscoverUuids.Text        = "&Discover UUIDs";
     this.tsmiDiscoverUuids.ToolTipText = "Start A Message Sequence To Discover UUID\'s";
     this.tsmiDiscoverUuids.Click      += new System.EventHandler(this.tsmiDiscoverUuids_Click);
     //
     // tsmiReadValues
     //
     this.tsmiReadValues.Name        = "tsmiReadValues";
     this.tsmiReadValues.Size        = new System.Drawing.Size(208, 22);
     this.tsmiReadValues.Text        = "&Read Values";
     this.tsmiReadValues.ToolTipText = "Start A Message Sequence To Discover UUID\'s And Read Values";
     this.tsmiReadValues.Click      += new System.EventHandler(this.tsmiReadValues_Click);
     //
     // toolStripSeparator4
     //
     this.toolStripSeparator4.Name = "toolStripSeparator4";
     this.toolStripSeparator4.Size = new System.Drawing.Size(205, 6);
     //
     // tsmiClearTransmitQueue2
     //
     this.tsmiClearTransmitQueue2.Name        = "tsmiClearTransmitQueue2";
     this.tsmiClearTransmitQueue2.Size        = new System.Drawing.Size(208, 22);
     this.tsmiClearTransmitQueue2.Text        = "Clear Transmit &Queue";
     this.tsmiClearTransmitQueue2.ToolTipText = "Clears All Pending Transmit Commands";
     this.tsmiClearTransmitQueue2.Click      += new System.EventHandler(this.tsmiClearTransmitQ_Click);
     //
     // cmsTreeBda
     //
     this.cmsTreeBda.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsmiCopyAddress
     });
     this.cmsTreeBda.Name = "cmsTreeBda";
     this.cmsTreeBda.Size = new System.Drawing.Size(159, 26);
     //
     // tsmiCopyAddress
     //
     this.tsmiCopyAddress.Name        = "tsmiCopyAddress";
     this.tsmiCopyAddress.Size        = new System.Drawing.Size(158, 22);
     this.tsmiCopyAddress.Text        = "&Copy Address";
     this.tsmiCopyAddress.ToolTipText = "Copy The Address To The Clipboard";
     this.tsmiCopyAddress.Click      += new System.EventHandler(this.tsmiCopyAddress_Click);
     //
     // cmsTreeComPort
     //
     this.cmsTreeComPort.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsmiDiscoverAllUuids,
         this.tsmiReadAllValues,
         this.toolStripSeparator3,
         this.tsmiClearTransmitQueue
     });
     this.cmsTreeComPort.Name = "cmsTreeComPort";
     this.cmsTreeComPort.Size = new System.Drawing.Size(381, 76);
     //
     // tsmiDiscoverAllUuids
     //
     this.tsmiDiscoverAllUuids.Name        = "tsmiDiscoverAllUuids";
     this.tsmiDiscoverAllUuids.Size        = new System.Drawing.Size(380, 22);
     this.tsmiDiscoverAllUuids.Text        = "Discover &UUIDs (All Devices Connected To This Port)";
     this.tsmiDiscoverAllUuids.ToolTipText = "Start A Message Sequence To Discover UUID\'s \r\nOn All Connected Devices To This Port";
     this.tsmiDiscoverAllUuids.Click      += new System.EventHandler(this.tsmiDiscoverAllUuids_Click);
     //
     // tsmiReadAllValues
     //
     this.tsmiReadAllValues.Name        = "tsmiReadAllValues";
     this.tsmiReadAllValues.Size        = new System.Drawing.Size(380, 22);
     this.tsmiReadAllValues.Text        = "Read &Values (All Devices Connected To This Port)";
     this.tsmiReadAllValues.ToolTipText = "Start A Message Sequence To Discover UUID\'s And Read Values \r\nOn All Connected Devices To This Port\r\n";
     this.tsmiReadAllValues.Click      += new System.EventHandler(this.tsmiReadAllValues_Click);
     //
     // toolStripSeparator3
     //
     this.toolStripSeparator3.Name = "toolStripSeparator3";
     this.toolStripSeparator3.Size = new System.Drawing.Size(377, 6);
     //
     // tsmiClearTransmitQueue
     //
     this.tsmiClearTransmitQueue.Name        = "tsmiClearTransmitQueue";
     this.tsmiClearTransmitQueue.Size        = new System.Drawing.Size(380, 22);
     this.tsmiClearTransmitQueue.Text        = "&Clear Transmit Queue";
     this.tsmiClearTransmitQueue.ToolTipText = "Clears All Pending Transmit Commands";
     this.tsmiClearTransmitQueue.Click      += new System.EventHandler(this.tsmiClearTransmitQ_Click);
     //
     // ComPortTreeForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(210, 579);
     this.Controls.Add(this.tvPorts);
     this.Name = "ComPortTreeForm";
     this.Text = "Com Port Tree";
     this.cmsTreeHandle.ResumeLayout(false);
     this.cmsTreeBda.ResumeLayout(false);
     this.cmsTreeComPort.ResumeLayout(false);
     this.ResumeLayout(false);
 }