Exemplo n.º 1
0
        protected override void OnInitialize()
        {
            if (AvailableTypes != null)
            {
                SelectedEventType = AvailableTypes.FirstOrDefault();
            }

            CloseWithInvoker(true);
            base.OnInitialize();
        }
        private void OnSearchTextUpdated()
        {
            var foundItem = AvailableTypes.FirstOrDefault(t => t.TypeName == SearchText);

            if (foundItem is null)
            {
                DestinationName = new(PrependedNamespace + SearchText);
                return;
            }

            DestinationName = foundItem;
        }
 public override void CopyFrom(IPropertyModel property)
 {
     if (property is SubtypingProperty subtypingProperty)
     {
         // 具象型が未設定の時はコピー先も未設定にする
         if (subtypingProperty.SelectedType.Value != null)
         {
             SelectedType.Value = AvailableTypes.FirstOrDefault(x => x.Type == subtypingProperty.SelectedType.Value.Type);
             Model.Value.CopyFrom(subtypingProperty.Model.Value);
         }
     }
 }
    //editor methods------------------------------------------------------------------------------


#if UNITY_EDITOR
    protected override void Draw(ref Rect pos)
    {
        pos.height = SingleLineHeight;

        var selectedType = AvailableTypes.FirstOrDefault(x => selectedTypeName.Equals(x.FullName));

        if (selectedType == null)
        {
            EditorGUI.LabelField(pos, "please select a type in edit mode");
            pos.y += pos.height;
        }

        else
        {
            DrawObjectField(ref pos);
        }
    }
Exemplo n.º 5
0
        protected override void OnInitialize()
        {
            if (AvailableTypes != null)
            {
                SelectedEventType = AvailableTypes.FirstOrDefault();
            }

            var list = GetSelectedAgents(null).Cast <IAgent>().ToArray();

            EmployeeSelectionWay = list.Length > 1 ? 1 : 0;

            CurrentAgent  = list.Length > 0 ? list[0] : default(IAgent);
            SelectedCount = CurrentAgent.If <ISelectable>(o => o.IsSelected == true) ? list.Length : list.Length > 0 ? list.Length - 1 : 0;


            base.OnInitialize();
        }
Exemplo n.º 6
0
 private Type GetTypeByFullName(string name) => AvailableTypes
 .FirstOrDefault(i => string.Equals(i.FullName, name, StringComparison.OrdinalIgnoreCase));