Пример #1
0
        /// <summary>
        /// Adss a DesignMode Block and returns it
        /// </summary>
        /// <param name="gmnd"></param>
        /// <param name="dle"></param>
        protected void AddDesignModeBlock(SimPe.Plugin.Rcol gmnd, DataListExtension dle)
        {
            dle.Extension.VarName = "tsDesignModeEnabled";

            /*IRcolBlock[] newblock = new IRcolBlock[gmnd.Blocks.Length+1];
             * for (int i=0; i<gmnd.Blocks.Length; i++)
             * {
             *      if (i==0) newblock[i] = gmnd.Blocks[i];
             *      else newblock[i+1] = gmnd.Blocks[i];
             * }
             * newblock[1] = dle;
             * gmnd.Blocks = newblock;*/


            SimPe.Plugin.GeometryNode gn = (SimPe.Plugin.GeometryNode)gmnd.Blocks[0];

            ObjectGraphNodeItem item = new ObjectGraphNodeItem();

            item.Enabled   = 0x01;
            item.Dependant = 0x00;
            item.Index     = (uint)gmnd.Blocks.Length;

            gn.ObjectGraphNode.Items = (ObjectGraphNodeItem[])Helper.Add(gn.ObjectGraphNode.Items, item);
            gmnd.Blocks = (IRcolBlock[])Helper.Add(gmnd.Blocks, dle, typeof(IRcolBlock));
        }
Пример #2
0
        private void SelectNode(object sender, System.EventArgs e)
        {
            if (lbnode.Tag != null)
            {
                return;
            }
            if (lbnode.SelectedIndex < 0)
            {
                return;
            }

            try
            {
                lbnode.Tag = true;
                ObjectGraphNodeItem item = (ObjectGraphNodeItem)lbnode.Items[lbnode.SelectedIndex];
                tbnode1.Text = "0x" + Helper.HexString(item.Enabled);
                tbnode2.Text = "0x" + Helper.HexString(item.Dependant);
                tbnode2.Text = "0x" + Helper.HexString(item.Index);
            }
            catch (Exception) {}
            finally
            {
                lbnode.Tag = null;
            }
        }
Пример #3
0
        //internal Shpe wrapper;



        private void UpdateLists()
        {
            try
            {
                SimPe.Plugin.Shape shape = (SimPe.Plugin.Shape) this.Tag;

                ObjectGraphNodeItem[] ogni = new ObjectGraphNodeItem[lbnode.Items.Count];
                for (int i = 0; i < ogni.Length; i++)
                {
                    ogni[i] = (ObjectGraphNodeItem)lbnode.Items[i];
                }
                shape.GraphNode.Items = ogni;
            }
            catch (Exception) {}
        }
Пример #4
0
        private void linkLabel10_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                //Shpe wrp = (Shpe)wrapper;
                Shape shape = (Shape)this.Tag;

                ObjectGraphNodeItem val = new ObjectGraphNodeItem();
                val.Enabled   = Convert.ToByte(tbnode1.Text, 16);
                val.Dependant = Convert.ToByte(tbnode2.Text, 16);
                val.Index     = Convert.ToUInt32(tbnode3.Text, 16);

                lbnode.Items.Add(val);
                UpdateLists();
            }
            catch (Exception) {}
        }
Пример #5
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            items = new ObjectGraphNodeItem[reader.ReadUInt32()];
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new ObjectGraphNodeItem();
                items[i].Unserialize(reader);
            }

            if (version == 0x04)
            {
                filename = reader.ReadString();
            }
            else
            {
                filename = "cObjectGraphNode";
            }
        }