示例#1
0
 public RandomStatic(XmlElement xmlInfo)
 {
     try
     {
         try
         {
             this.m_TileID = (ushort)XmlConvert.ToInt16(xmlInfo.GetAttribute("TileID"));
         }
         catch (Exception expr_22)
         {
             ProjectData.SetProjectError(expr_22);
             this.m_TileID = (ushort)ShortType.FromString("&H" + xmlInfo.GetAttribute("TileID"));
             ProjectData.ClearProjectError();
         }
         this.m_XMod   = (ushort)XmlConvert.ToInt16(xmlInfo.GetAttribute("X"));
         this.m_YMod   = (ushort)XmlConvert.ToInt16(xmlInfo.GetAttribute("Y"));
         this.m_ZMod   = (ushort)XmlConvert.ToInt16(xmlInfo.GetAttribute("Z"));
         this.m_HueMod = (ushort)XmlConvert.ToInt16(xmlInfo.GetAttribute("Hue"));
     }
     catch (Exception expr_AC)
     {
         ProjectData.SetProjectError(expr_AC);
         Interaction.MsgBox(string.Format("Error\r\n{0}", xmlInfo.OuterXml), MsgBoxStyle.OkOnly, null);
         ProjectData.ClearProjectError();
     }
 }
示例#2
0
        private void ToolBar1_ButtonClick(object sender, EventArgs e)
        {
            ToolStripButton button = sender as ToolStripButton;

            if (button == null)
            {
                return;
            }

            RandomStaticCollection selectedItem = (RandomStaticCollection)this.ListBox1.SelectedItem;

            if (selectedItem != null)
            {
                object tag = button.Tag;
                if (ObjectType.ObjTst(tag, "Add", false) == 0)
                {
                    selectedItem.Add(new RandomStatic(ShortType.FromString(this.TileID.Text), Convert.ToInt16(this.Xaxis.Value), Convert.ToInt16(this.Yaxis.Value), Convert.ToInt16(this.Zaxis.Value), ShortType.FromString(this.HueID.Text)));
                    selectedItem.Display(this.ListBox2);
                    this.Panel3.Refresh();
                }
                else if (ObjectType.ObjTst(tag, "Delete", false) == 0)
                {
                    selectedItem.Remove((RandomStatic)this.ListBox2.SelectedItem);
                    selectedItem.Display(this.ListBox2);
                    this.Panel3.Refresh();
                }
            }
        }
 public RandomStatic(XmlElement xmlInfo)
 {
     try
     {
         try
         {
             this.m_TileID = XmlConvert.ToInt16(xmlInfo.GetAttribute("TileID"));
         }
         catch (Exception ex)
         {
             ProjectData.SetProjectError(ex);
             this.m_TileID = ShortType.FromString("&H" + xmlInfo.GetAttribute("TileID"));
             ProjectData.ClearProjectError();
         }
         this.m_XMod   = XmlConvert.ToInt16(xmlInfo.GetAttribute("X"));
         this.m_YMod   = XmlConvert.ToInt16(xmlInfo.GetAttribute("Y"));
         this.m_ZMod   = XmlConvert.ToInt16(xmlInfo.GetAttribute("Z"));
         this.m_HueMod = XmlConvert.ToInt16(xmlInfo.GetAttribute("Hue"));
     }
     catch (Exception ex)
     {
         ProjectData.SetProjectError(ex);
         int num = (int)Interaction.MsgBox((object)string.Format("Error\r\n{0}", (object)xmlInfo.OuterXml), MsgBoxStyle.OKOnly, (object)null);
         ProjectData.ClearProjectError();
     }
 }
示例#4
0
 public MapTile(XmlElement xmlInfo)
 {
     try
     {
         this.m_TileID = XmlConvert.ToInt16(xmlInfo.GetAttribute("TileID"));
     }
     catch (Exception expr_21)
     {
         ProjectData.SetProjectError(expr_21);
         this.m_TileID = ShortType.FromString("&H" + xmlInfo.GetAttribute("TileID"));
         ProjectData.ClearProjectError();
     }
     this.m_AltID = XmlConvert.ToInt16(xmlInfo.GetAttribute("AltIDMod"));
 }
        /*
         * private void StaticToolBar_ButtonClick(object sender, EventArgs e)
         * {
         *  ToolStripButton button = sender as ToolStripButton;
         *  if (button == null)
         *  {
         *      return;
         *  }
         *
         *  object tag = button.Tag;
         *  if (ObjectType.ObjTst(tag, (object)"Add", false) == 0)
         *  {
         *      if (StringType.StrCmp(this.Static_TileID.Text, string.Empty, false) == 0)
         *          return;
         *      this.iTransition.AddStaticTile(ShortType.FromString(this.Static_TileID.Text), Convert.ToInt16(this.Static_AltIDMod.Value));
         *      this.iTransition.GetStaticTiles.Display(this.StaticTileList);
         *  }
         *  else if (ObjectType.ObjTst(tag, (object)"Delete", false) == 0)
         *  {
         *      Transition.StaticTile iStaticTile = (Transition.StaticTile)this.StaticTileList.SelectedItem;
         *      if (iStaticTile == null)
         *          return;
         *      this.StaticImage.Image = (Image)null;
         *      this.iTransition.RemoveStaticTile(iStaticTile);
         *      this.iTransition.GetStaticTiles.Display(this.StaticTileList);
         *  }
         *  else if (ObjectType.ObjTst(tag, (object)"Select", false) == 0)
         *  {
         *      StaticZoom staticZoom = new StaticZoom();
         *      staticZoom.Tag = (object)this.StaticItems;
         *      staticZoom.Show();
         *  }
         * }
         */
        #endregion

        private void ToolBarButton14_Click(object sender, EventArgs e)
        {
            ToolStripButton button = sender as ToolStripButton;

            if (button == null)
            {
                return;
            }

            object tag = button.Tag;

            if (ObjectType.ObjTst(tag, (object)"Add", false) == 0)
            {
                if (StringType.StrCmp(this.Static_TileID.Text, string.Empty, false) == 0)
                {
                    return;
                }
                this.iTransition.AddStaticTile(ShortType.FromString(this.Static_TileID.Text), Convert.ToInt16(this.Static_AltIDMod.Value));
                this.iTransition.GetStaticTiles.Display(this.StaticTileList);
            }
        }
示例#6
0
 public void FromString_ThrowsOverflowException(string value)
 {
     Assert.Throws <OverflowException>(() => ShortType.FromString(value));
 }
示例#7
0
 public void FromString_ThrowsInvalidCastException(string value)
 {
     Assert.Throws <InvalidCastException>(() => ShortType.FromString(value));
 }
示例#8
0
 public void FromString(string value, short expected)
 {
     Assert.Equal(expected, ShortType.FromString(value));
 }
示例#9
0
 public void FromString_NotSupported(string value, short expected)
 {
     Assert.Throws <InvalidCastException>(() => ShortType.FromString(value));
 }