Exemplo n.º 1
0
 public void Initialize(SellPanelManager Manager, SellableItemType Type, int ItemIndex, Sprite ItemSprite, int ItemQuantity)
 {
     this.Manager     = Manager;
     this.Type        = Type;
     this.ItemIndex   = ItemIndex;
     ItemImage.sprite = ItemSprite;
     SetQuantity(ItemQuantity);
 }
Exemplo n.º 2
0
        private void ButtonLoadDepartment_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = Environment.CurrentDirectory;
            openFileDialog1.Filter           = "Assembly files (*.exe;*.dll)|*.exe;*.dll|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 1;
            openFileDialog1.RestoreDirectory = true;
            //openFileDialog1.RestoreDirectory = true;
#if asdfasdf
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Assembly department     = osalot.LoadAssembly(openFileDialog1.FileName);
                    Type[]   assembly_types = null;
                    try
                    {
                        assembly_types = a.GetTypes();
                    }
                    catch
                    {
                        return;
                    }
                    foreach (Type current_type in assembly_types)
                    {
                        Type[] interfaces;
                        interfaces = current_type.FindInterfaces(MyInterfaceFilter, "SellableItemType");
                        if (interfaces.Length > 0)
                        {
                            object o = Activator.CreateInstance(t);
                            tracker.objects.Add(ao = new AssemblyObject(t, o));
                            SellableItemType department = o as SellableItemType;
                        }
                    }
                }
                catch (Exception e2)
                {
                    Console.WriteLine(e2.Message);
                }
            }
#endif
        }