示例#1
0
 void Start()
 {
     myAnimator    = transform.gameObject.GetComponent <Animator>();
     FishBossUI    = transform.gameObject;
     ValueEditor   = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();
     defaultString = FishText.text;
 }
示例#2
0
        public static IEntityValue CreateEditorValue(IEntityValue parent, ValueEditor editor, IUIPropertyEditorPropertiesAvailableStatus requestedProperties)
        {
            Requires.NotNull(parent, nameof(parent));
            Requires.NotNull(editor, nameof(editor));

            var identity = new EntityIdentity(
                ((IEntityWithId)parent).Id,
                new KeyValuePair <string, string>[]
            {
                new(ProjectModelIdentityKeys.EditorName, editor.EditorType)
            });
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VariableValueEditor"/> class.
 /// </summary>
 /// <param name="xmlElement">A default value as the XML element.</param>
 public VariableValueEditor(XmlElement xmlElement)
 {
     if (xmlElement != null)
     {
         this.Editor = ValueEditor.CreateValueEditor(xmlElement);
     }
     else
     {
         this.Editor = new ValueEditor.NotSetEditor();
     }
 }
        public void WhenCreatingAnEntityFromAParentAndEditor_TheIdIsTheEditorType()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: false);

            var parentEntity = IEntityWithIdFactory.Create(key: "parentId", value: "aaa");
            var editor       = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(parentEntity, editor, properties);

            Assert.Equal(expected: "My.Editor.Type", actual: result.Id[ProjectModelIdentityKeys.EditorName]);
        }
        public void WhenAnEditorValueIsCreated_TheEditorIsTheProviderState()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: true);

            var context = IQueryExecutionContextFactory.Create();
            var id      = new EntityIdentity(key: "EditorKey", value: "bbb");
            var editor  = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(context, id, editor, properties);

            Assert.Equal(expected: editor, actual: ((IEntityValueFromProvider)result).ProviderState);
        }
        public void WhenPropertiesAreRequested_PropertyValuesAreReturned()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: true);

            var context = IQueryExecutionContextFactory.Create();
            var id      = new EntityIdentity(key: "EditorKey", value: "bbb");
            var editor  = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(context, id, editor, properties);

            Assert.Equal(expected: "My.Editor.Type", actual: result.Name);
        }
示例#7
0
    void Start()
    {
        FinalCameraController = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        LevelManager          = GameObject.Find("---LevelManager").GetComponent <LevelManager>();
        ValueEditor           = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();
        washers = FinalCameraController.AllMachines;

        stationBagOwners.Add(new List <string>());
        stationBagOwners.Add(new List <string>());
        stationBagOwners.Add(new List <string>());


        timeUpBagNum     = 0;
        unfinishedBagNum = 0;
    }
        public void InitializeComponent()
        {
            this.panel   = new Panel();
            this.textbox = new TextBox();
            this.button  = new Button();

            this.BeginInit();
            for (int i = 0; i < this.Controls.Count; i++)
            {
                if (this.Controls[i] is ValueEditor)
                {
                    ValueEditor vale = (ValueEditor)this.Controls[i];
                    this.Controls.RemoveAt(i);
                    break;
                }
            }

            base.SuspendLayout();

            this.panel.Anchor      = AnchorStyles.Right | AnchorStyles.Left;
            this.panel.BorderStyle = BorderStyle.None;
            this.panel.Location    = new Point(3, 0x12);
            this.panel.MinimumSize = new Size(100, 0x12);
            this.panel.Name        = "valueEditor";
            this.panel.Size        = new Size(200, panelHeight);

            textbox.Size     = new Size(177, 12);
            textbox.Location = new Point(0, 0);
            textbox.Anchor   = AnchorStyles.Right | AnchorStyles.Left;
            textbox.Name     = "textbox";
            textbox.Leave   += new EventHandler(textbox_Leave);
            panel.Controls.Add(this.textbox);

            button.Text     = "...";
            button.Click   += new EventHandler(button_Click);
            button.Size     = new Size(20, 20);
            button.Location = new Point(180, 0);
            button.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            panel.Controls.Add(this.button);

            base.invalidValuePictureBox.Location = new Point(0xca, 1);
            base.Controls.Add(panel);
            base.Size = new Size(0xda, PanelHeight + 25);
            this.EndInit();
            base.ResumeLayout(false);
        }
示例#9
0
        private void OnValueEditAction()
        {
            if (lstValues.SelectedItems.Count == 1)
            {
                RegValue value = (RegValue)lstValues.SelectedItems[0].SubItems[2].Tag;
                if (value.ParentKey != null)
                {
                    ValueEditor editor = null;

                    switch (value.Kind)
                    {
                    case RegistryValueKind.Binary:
                        editor = new BinaryEditor(value);
                        break;

                    case RegistryValueKind.MultiString:
                        editor = new MultiStringEditor(value);
                        break;

                    case RegistryValueKind.DWord:
                    case RegistryValueKind.QWord:
                        editor = new DWordEditor(value);
                        break;

                    case RegistryValueKind.String:
                    case RegistryValueKind.ExpandString:
                        editor = new StringEditor(value);
                        break;

                    case RegistryValueKind.Unknown:
                    default:
                        break;
                    }

                    if (editor != null)
                    {
                        if (editor.ShowDialog(this) == DialogResult.OK)
                        {
                            RefreshValues();
                        }
                    }
                }
            }
        }
        public void InitializeComponent()
        {
            this.panel    = new Panel();
            this.dropDown = new ComboBox();


            this.BeginInit();
            for (int i = 0; i < this.Controls.Count; i++)
            {
                if (this.Controls[i] is ValueEditor)
                {
                    ValueEditor vale = (ValueEditor)this.Controls[i];
                    vale.Visible = false;
                    //this.Controls.RemoveAt(i);
                    break;
                }
            }

            base.SuspendLayout();

            this.panel.Anchor      = AnchorStyles.Right | AnchorStyles.Left;
            this.panel.BorderStyle = BorderStyle.None;
            this.panel.Location    = new Point(3, 0x12);
            this.panel.MinimumSize = new Size(100, 0x12);
            this.panel.Name        = "valueEditor";
            this.panel.Size        = new Size(200, panelHeight);

            dropDown.DisplayMember         = "DisplayName";
            dropDown.DropDownStyle         = ComboBoxStyle.DropDown;
            dropDown.Size                  = new Size(200, 20);
            dropDown.SelectedIndexChanged += new EventHandler(dropDown_SelectedIndexChanged);
            dropDown.Location              = new Point(0, 0);
            dropDown.Dock                  = DockStyle.Top;
            dropDown.Name                  = "textbox";
            dropDown.DropDown             += new EventHandler(dropDown_DropDown);
            dropDown.Leave                += new EventHandler(dropDown_Leave);
            panel.Controls.Add(this.dropDown);

            base.invalidValuePictureBox.Location = new Point(0xca, 1);
            base.Controls.Add(panel);
            base.Size = new Size(0xda, PanelHeight + 25);
            this.EndInit();
            base.ResumeLayout(false);
        }
示例#11
0
    void Start()
    {
        //find the horizontal scroll snap script
        //myHSS = GameObject.Find("Horizontal Scroll Snap").GetComponent<HorizontalScrollSnap>();

        myAudio = GetComponent <AudioSource>();

        myImage = GetComponent <Image>();
//        secondImage = GetComponentInChildren<Image>();
        hitTime = 0;


        AudioManager = GameObject.Find("---AudioManager").GetComponent <AudioManager>();

        ClothInMachineController = GameObject.Find("---ClothInMachineController");
        FinalCameraController    = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        SubwayMovement           = GameObject.Find("---StationController").GetComponent <SubwayMovement>();
        cameraMovement           = GameObject.Find("Main Camera").GetComponent <CameraMovement>();
        RatingSys      = GameObject.Find("FloatingUI").GetComponent <RatingSystem>();
        SpriteLoader   = GameObject.Find("---SpriteLoader").GetComponent <SpriteLoader>();
        BagsController = GameObject.Find("---BagsController").GetComponent <BagsController>();
        ValueEditor    = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();
        AllMachines    = ClothInMachineController.GetComponent <AllMachines>();

        myAnimator = this.transform.gameObject.GetComponent <Animator>();
        //todo: generate clothes
        //Debug.Log(this.transform.gameObject.tag);

        owner = SpriteLoader.NPCDic[this.transform.gameObject.tag];

        GenerateCloth();

        if (!FinalCameraController.AllStationClothList.ContainsKey(owner.name))
        {
            FinalCameraController.AllStationClothList.Add(owner.name, new List <Sprite>());
        }


        myImage.enabled = true;
        stage           = FinalCameraController.LevelManager.stage;
    }
示例#12
0
        public void Init(FlexDesignerHostServices provider, ReportParameterValues parameterValues)
        {
            Debug.Assert(parameterValues != null);

            _provider = provider;
            C1FlexReport anotherReport;

            GetReportParameterValuesEnviroment(parameterValues, out _scriptNamePrefix, out anotherReport);
            _report = parameterValues.Report;

            _updating = true;

            _valueEditor = new ValueEditor(c1FlexGrid1);
            _valueEditor.Init(provider, _report.DataSourceName, "");
            C1ThemeController.ApplyThemeToControlTree(_valueEditor, MainForm.TheMainForm.CachedTheme);
            _nameEditor = new NameEditor(c1FlexGrid1);
            _nameEditor.Init(provider, anotherReport);
            C1ThemeController.ApplyThemeToControlTree(_nameEditor, MainForm.TheMainForm.CachedTheme);

            var labelIndex = c1FlexGrid1.Cols.Fixed;
            var valueIndex = labelIndex + 1;

            foreach (var item in parameterValues)
            {
                var row = c1FlexGrid1.Rows.Add();
                row[labelIndex] = ScriptValueHelper.ToString(item.Name);
                row[valueIndex] = ScriptValueHelper.ToString(item.Value);
            }

            c1FlexGrid1.Col = labelIndex;
            if (parameterValues.Count > 0)
            {
                c1FlexGrid1.Row = c1FlexGrid1.Rows.Fixed;
            }

            UpdateButtonsSatus();

            _updating = false;
        }
示例#13
0
    // Start is called before the first frame update


    void Start()
    {
        clothNum       = buttons.Length;
        myMachineState = AllMachines.MachineState.empty;

        myAnimator = GetComponentInChildren <Animator>();

        FinalCameraController = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        SpriteLoader          = GameObject.Find("---SpriteLoader").GetComponent <SpriteLoader>();
        AudioManager          = GameObject.Find("---AudioManager").GetComponent <AudioManager>();
        SubwayMovement        = GameObject.Find("---StationController").GetComponent <SubwayMovement>();
        ValueEditor           = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();

        washingSound = AllMachines.gameObject.GetComponent <AudioSource>();

        TouchController = GameObject.Find("---TouchController").GetComponent <TouchController>();


        emptyImage = empty.GetComponent <SpriteRenderer>();
        fullImage  = full.GetComponent <SpriteRenderer>();
        DoorImage  = front.GetComponent <SpriteRenderer>();

        Light.sprite = statusEmpty;
    }
示例#14
0
            /// <summary>
            /// Converts the given object to the type of this converter, using the specified context and culture information.
            /// </summary>
            /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
            /// <param name="culture">The <see cref="T:System.Globalization.CultureInfo"/> to use as the current culture.</param>
            /// <param name="value">The <see cref="T:System.Object"/> to convert.</param>
            /// <returns>
            /// An <see cref="T:System.Object"/> that represents the converted value.
            /// </returns>
            /// <exception cref="T:System.NotSupportedException">
            /// The conversion cannot be performed.
            /// </exception>
            public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
            {
                if (!(value is string))
                {
                    return(base.ConvertFrom(context, culture, value));
                }
                string name = ((string)value).Trim();

                if (m_TypeList.ContainsKey(name))
                {
                    return(m_TypeList[name].Clone());
                }
                ValueEditor editor = ((VariableValueEditor)context.Instance).Editor;

                if (editor is ValueEditor.NotSetEditor)
                {
                    return(editor);
                }
                ValueEditor newEditor = editor.Clone();

                newEditor.TypeName = name;
                m_TypeList.Add(name, newEditor);
                return(newEditor);
            }
示例#15
0
        /// <summary>
        /// Validates the properties of this object. This method should be called
        /// after initialization is complete.
        /// </summary>
        internal void Validate(this ValueEditor type)
        {
            string propertyId = GetPropertyId("EditorType", type);

            VerifyThrowPropertyNotSetOrEmptyString(type.EditorType, propertyId);
        }
 public static IEnumerable <IEntityValue> CreateMetadataValues(IEntityValue parent, ValueEditor editor, IUIEditorMetadataPropertiesAvailableStatus requestedProperties)
 {
     foreach (NameValuePair metadataPair in editor.Metadata)
     {
         IEntityValue metadataValue = CreateMetadataValue(parent.EntityRuntime, metadataPair, requestedProperties);
         yield return(metadataValue);
     }
 }
        public void InitializeComponent()
        {
            this.panel    = new Panel();
            this.listview = new ListView();


            this.BeginInit();
            for (int i = 0; i < this.Controls.Count; i++)
            {
                if (this.Controls[i] is ValueEditor)
                {
                    ValueEditor vale = (ValueEditor)this.Controls[i];
                    vale.Visible = false;
                    //this.Controls.RemoveAt(i);
                    break;
                }
            }

            base.SuspendLayout();

            this.panel.Anchor      = AnchorStyles.Right | AnchorStyles.Left;
            this.panel.BorderStyle = BorderStyle.None;
            this.panel.Location    = new Point(3, 0x12);
            this.panel.MinimumSize = new Size(100, 0x12);
            this.panel.Name        = "valueEditor";
            this.panel.Size        = new Size(200, panelHeight);

            if (withCheckboxes)
            {
                listview.CheckBoxes  = true;
                listview.MultiSelect = true;
            }
            else
            {
                listview.CheckBoxes    = false;
                listview.MultiSelect   = false;
                listview.HideSelection = false;
            }
            listview.FullRowSelect         = true;
            listview.View                  = View.Details;
            listview.Size                  = new Size(200, panelHeight - 60);
            listview.Dock                  = DockStyle.Fill;
            listview.ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(listview_ItemSelectionChanged);
            listview.ItemChecked          += new ItemCheckedEventHandler(listview_ItemChecked);
            listview.Location              = new Point(0, 0);
            listview.SmallImageList        = ImageListProvider.GetIcons();
            listview.LargeImageList        = ImageListProvider.GetIcons();

            ColumnHeader header1 = listview.Columns.Add("Name");

            header1.Width = 250;
            ColumnHeader header2 = listview.Columns.Add("Description");

            header2.Width = 150;

            //listview.Anchor = AnchorStyles.Right | AnchorStyles.Left;
            listview.Name = "textbox";
            panel.Controls.Add(this.listview);

            listview.SizeChanged += new EventHandler(listview_SizeChanged);

            base.invalidValuePictureBox.Location = new Point(0xca, 1);
            base.Controls.Add(panel);
            base.Size = new Size(0xda, PanelHeight + 25);
            this.EndInit();
            base.ResumeLayout(false);
        }
        public void InitializeComponent()
        {
            this.panel        = new Panel();
            this.listbox      = new ListBox();
            this.button       = new Button();
            this.removebutton = new Button();

            this.BeginInit();
            for (int i = 0; i < this.Controls.Count; i++)
            {
                if (this.Controls[i] is ValueEditor)
                {
                    ValueEditor vale = (ValueEditor)this.Controls[i];
                    this.Controls.RemoveAt(i);
                    break;
                }
            }

            base.SuspendLayout();

            this.panel.Anchor      = AnchorStyles.Right | AnchorStyles.Left;
            this.panel.BorderStyle = BorderStyle.None;
            this.panel.Location    = new Point(3, 0x12);
            this.panel.MinimumSize = new Size(100, 0x12);
            this.panel.Name        = "valueEditor";
            this.panel.Size        = new Size(200, panelHeight);

            listbox.Size                  = new Size(172, 75);
            listbox.Location              = new Point(0, 0);
            listbox.Anchor                = AnchorStyles.Right | AnchorStyles.Left;
            listbox.Name                  = "textbox";
            listbox.SelectionMode         = SelectionMode.MultiSimple;
            listbox.DisplayMember         = "DisplayName";
            listbox.SelectedIndexChanged += new EventHandler(listbox_SelectedIndexChanged);
            panel.Controls.Add(this.listbox);

            button.Text       = "";
            button.Image      = ResourceIcons.plus;
            button.Click     += new EventHandler(button_Click);
            button.Size       = new Size(26, 21);
            button.ImageAlign = ContentAlignment.MiddleCenter;
            button.Location   = new Point(175, 0);
            button.Anchor     = AnchorStyles.Top | AnchorStyles.Right;
            panel.Controls.Add(this.button);

            removebutton.Text       = "";
            removebutton.Enabled    = false;
            removebutton.Image      = ResourceIcons.cross;
            removebutton.ImageAlign = ContentAlignment.MiddleCenter;
            removebutton.Click     += new EventHandler(button_removeClick);
            removebutton.Size       = new Size(26, 21);
            removebutton.Location   = new Point(175, 23);
            removebutton.Anchor     = AnchorStyles.Top | AnchorStyles.Right;
            panel.Controls.Add(this.removebutton);

            base.invalidValuePictureBox.Location = new Point(0xca, 1);
            base.Controls.Add(panel);
            base.Size = new Size(0xda, PanelHeight + 25);
            this.EndInit();
            base.ResumeLayout(false);
        }
示例#19
0
    // Start is called before the first frame update
    void Start()
    {
        FinalCameraController = GameObject.Find("Main Camera").GetComponent <FinalCameraController>();
        InstagramController   = GameObject.Find("---InstagramController").GetComponent <InstagramController>();
        BagsController        = GameObject.Find("---BagsController").GetComponent <BagsController>();
        AdsController         = GameObject.Find("---AdsController").GetComponent <AdsController>();
        AudioManager          = GameObject.Find("---AudioManager").GetComponent <AudioManager>();
        ValueEditor           = GameObject.Find("---ValueEditor").GetComponent <ValueEditor>();


        if (!FinalCameraController.isTutorial)
        {
            LevelManager = FinalCameraController.LevelManager;

            bagPosAvailable.Add(false);
            bagPosAvailable.Add(false);
            bagPosAvailable.Add(false);

            noSameBag = true;

            aSR = arrow.GetComponent <SpriteRenderer>();
            hSR = highlight.GetComponent <SpriteRenderer>();

            //tabImg0 = GameObject.Find("bag0Logo").GetComponent<Image>();
            //tabImg1 = GameObject.Find("bag1Logo").GetComponent<Image>();
            LostAndFound = GameObject.Find("Lost&Found_basket").GetComponent <LostAndFound>();

            //tab0 = GameObject.Find("bagTab0");
            //tab1 = GameObject.Find("bagTab1");
            collection.SetActive(false);
        }

        // 不知道 real timer干什么用的
        realTimer = (moveTime + stayTime + pauseTime) * 3 - timer;

        NameToStationBags.Add(bagStation0);
        NameToStationBags.Add(bagStation1);
        NameToStationBags.Add(bagStation2);


        AllDetailList.Add(detailList0);
        AllDetailList.Add(detailList1);

        DetailCG.Add(dSR1);
        DetailCG.Add(dSR2);

        currentStation = 0;

        stationTimer = stayTime;
//        CountDownTimer.text = "";

        if (!FinalCameraController.isTutorial)
        {
            //get all the doors position when game starts
            left1Pos  = left1.position.x;
            right1Pos = right1.position.x;
        }



        //get all station names into the dictionary
        for (var i = 0; i < stationNames.Count; ++i)
        {
            allStation.Add(stationNames[i], i);
        }


        //trainStop();
    }
示例#20
0
        /*
         *  Events
         */
        private void onSelectionChanged()
        {
            Controls.Clear();

            if (selection.Count == 0)
            {
                ClientSize = new Size(WIDTH, 108);

                //No selection label
                Label lbl = new Label();
                lbl.TextAlign = ContentAlignment.MiddleCenter;
                lbl.Bounds    = new Rectangle(0, 0, WIDTH, 108);
                lbl.Text      = "No\nSelection";
                Controls.Add(lbl);
            }
            else if (selection.Count == 1)
            {
                //Name label
                Label name = new Label();
                name.Font      = new Font(name.Font, FontStyle.Bold);
                name.TextAlign = ContentAlignment.MiddleCenter;
                name.Bounds    = new Rectangle(0, 0, WIDTH, 24);
                name.Text      = selection[0].Definition.Name;
                Controls.Add(name);

                //Add the image
                EntitySelectionImage sel = new EntitySelectionImage(selection[0], WIDTH / 2 - 16, 24);
                Controls.Add(sel);

                //Entity ID
                {
                    Label id = new Label();
                    id.TextAlign = ContentAlignment.MiddleLeft;
                    id.Text      = selection[0].ID.ToString();
                    id.Bounds    = new Rectangle(CONTENT_X, 60, CONTENT_WIDTH, 16);
                    Controls.Add(id);

                    Label label = new Label();
                    label.TextAlign = ContentAlignment.MiddleRight;
                    label.Text      = "ID:";
                    label.Bounds    = new Rectangle(0, 60, TITLE_WIDTH, 16);
                    Controls.Add(label);
                }

                //Entity count
                {
                    Label count = new Label();
                    count.TextAlign = ContentAlignment.MiddleLeft;
                    count.Bounds    = new Rectangle(CONTENT_X, 78, CONTENT_WIDTH, 16);
                    count.Text      = ((EntityLayer)Ogmo.LayersWindow.CurrentLayer).Entities.Count(e => e.Definition == selection[0].Definition).ToString();
                    if (selection[0].Definition.Limit > 0)
                    {
                        count.Text += " / " + selection[0].Definition.Limit.ToString();
                    }
                    Controls.Add(count);

                    Label label = new Label();
                    label.TextAlign = ContentAlignment.MiddleRight;
                    label.Text      = "Count:";
                    label.Bounds    = new Rectangle(0, 78, TITLE_WIDTH, 16);
                    Controls.Add(label);
                }

                //Entity position
                {
                    RefreshPosition();
                    Controls.Add(positionLabel);

                    Label label = new Label();
                    label.TextAlign = ContentAlignment.MiddleRight;
                    label.Text      = "Position:";
                    label.Bounds    = new Rectangle(0, 96, TITLE_WIDTH, 16);
                    Controls.Add(label);
                }

                //Entity size
                int yy = 114;
                if (selection[0].Definition.ResizableX || selection[0].Definition.ResizableY)
                {
                    sizeLabel.Bounds = new Rectangle(CONTENT_X, yy, CONTENT_WIDTH, 16);
                    RefreshSize();
                    Controls.Add(sizeLabel);

                    Label label = new Label();
                    label.TextAlign = ContentAlignment.MiddleRight;
                    label.Text      = "Size:";
                    label.Bounds    = new Rectangle(0, yy, TITLE_WIDTH, 16);
                    Controls.Add(label);

                    yy += 18;
                }

                //Entity angle
                if (selection[0].Definition.Rotatable)
                {
                    yy += 3;

                    TextBox angleTextBox = new TextBox();
                    angleTextBox.Bounds     = new Rectangle(CONTENT_X, yy - 2, CONTENT_WIDTH - 20, 16);
                    angleTextBox.Text       = selection[0].Angle.ToString();
                    angleTextBox.LostFocus += delegate(object sender, EventArgs e) { if (selection.Count > 0)
                                                                                     {
                                                                                         HandleAngleChange(angleTextBox);
                                                                                     }
                    };
                    angleTextBox.KeyDown += delegate(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter)
                                                                                      {
                                                                                          HandleAngleChange(angleTextBox); Ogmo.MainWindow.LevelEditors[Ogmo.CurrentLevelIndex].Focus();
                                                                                      }
                    };
                    Controls.Add(angleTextBox);

                    Label label = new Label();
                    label.TextAlign = ContentAlignment.MiddleRight;
                    label.Text      = "Angle:";
                    label.Bounds    = new Rectangle(0, yy, TITLE_WIDTH, 16);
                    Controls.Add(label);

                    yy += 18;
                }

                //Value editors
                if (selection[0].Values != null)
                {
                    yy += 8;
                    foreach (var v in selection[0].Values)
                    {
                        ValueEditor ed = v.Definition.GetInstanceEditor(v, 0, yy);
                        Controls.Add(ed);
                        yy += ed.Height;
                    }
                }

                ClientSize = new Size(ClientSize.Width, yy + 4);
            }
            else
            {
                ClientSize = new Size(ClientSize.Width, ((selection.Count - 1) / 4) * 32 + 32);

                for (int i = 0; i < selection.Count; i++)
                {
                    EntitySelectionImage e = new EntitySelectionImage(selection[i], (i % 4) * 32, (i / 4) * 32);
                    Controls.Add(e);
                }
            }

            Ogmo.MainWindow.FocusEditor();
        }
        public override void DataBind()
        {
            base.DataBind();

            ValueEditor.SelectFirstByValue(Value, StringComparer.OrdinalIgnoreCase);
        }