Пример #1
0
        private void Prepare()
        {
            cameraWorldVector.x = Vector2.Distance(
                mainCamera.ScreenToWorldPoint(Vector3.zero),
                mainCamera.ScreenToWorldPoint(new Vector3(Screen.width, 0f))) * 0.5f;
            cameraWorldVector.y = Vector2.Distance(
                mainCamera.ScreenToWorldPoint(Vector3.zero),
                mainCamera.ScreenToWorldPoint(new Vector3(0f, Screen.height))) * 0.5f;

            Data = new WallData(cameraWorldVector, thickness, ceilingFactor);

            try {
                if (OnCreateEvent != null)
                {
                    OnCreateEvent.Invoke();
                }
                else
                {
                    EventExtension.ThrowMessage(nameof(OnCreateEvent));
                }
            }
            catch (Exception e) {
                EventExtension.PrintError(e);
            }
        }
Пример #2
0
        private void OnGUI()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("自动生成View/Presenter文件");

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("请输入关键字");

            EditorGUILayout.Space();

            _keyword = EditorGUILayout.TextField(_keyword);

            EditorGUILayout.Space();

            if (GUILayout.Button("Create"))
            {
                OnCreateEvent?.Invoke();
            }

            EditorGUILayout.EndVertical();
        }
Пример #3
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Create new event?", "Security", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                var userId   = currentUser.Keys.FirstOrDefault();
                var userName = currentUser.Values.FirstOrDefault();

                if (!string.IsNullOrEmpty(textBoxCreatorName.Text) &&
                    userName == textBoxCreatorName.Text)
                {
                    var userModel = new UserModel()
                    {
                        Id   = userId,
                        Name = userName,
                    };

                    var eventModel = new EventModel()
                    {
                        UserId      = userId,
                        Description = textBoxDescription.Text,
                        Date        = GetDateTime(dateTimePickerDate.Value, Convert.ToInt32(comboBoxHour.SelectedItem)),
                        Location    = textBoxLocation.Text,
                        IsExclusive = checkBoxExclusive.Checked,
                        Guests      = invitationGuests.Keys.ToList(),
                    };

                    OnCreateEvent?.Invoke(eventModel, userModel);
                }
                else
                {
                    MessageBox.Show("Invalid Parameters!");
                }
            }
        }
Пример #4
0
        public void OnCreateValue()
        {
            if (IsValidValue())
            {
                OnCreateEvent?.Invoke(InternalValue);
            }

            Close();
        }
Пример #5
0
 private void OnCreate()
 {
     OnCreateEvent?.Invoke(Keyword);
 }