Exemplo n.º 1
0
        private void RebuildDetails()
        {
            CustomDetailRoot.Clear();
            DefaultLabel.Clear();

            var bifurcationsProp = CommandItem.CommandProperty.GetChildProperty("bifurcations");

            var count = bifurcationsProp.GetProperty().arraySize;

            for (int i = 0; i < count; i++)
            {
                var bifurcationBox = new VisualElement();

                var item      = bifurcationsProp.GetArrayElementAt(i);
                var labelProp = item.GetChildProperty("label").GetProperty();

                var a = new Foldout();
                a.text = $"「{labelProp.stringValue}」"; // new Label($"「{labelProp.stringValue}」");
                var toggle = a.Q <Toggle>();
                toggle.style.marginBottom    = 0f;
                a.style.marginTop            = 10f;
                toggle.style.backgroundColor = new Color(0, 0, 0, 0.5f);
                bifurcationBox.Add(a);
                DefaultLabel.Add(a);

                var l = new CommandListView(CommandItem.ParentList, item.GetChildProperty("commandList.commands"));
                a.Add(l);

                CustomDetailRoot.Add(bifurcationBox);
            }
        }
Exemplo n.º 2
0
        private void BuildNestedCommandList()
        {
            var commandProp       = CommandItem.CommandProperty;
            var nestedCommandProp = commandProp.GetChildProperty("commandList.commands");

            CustomDetailRoot.Clear();
            var commandListView = new CommandListView(CommandItem.ParentList, nestedCommandProp);

            CustomDetailRoot.Add(commandListView);
        }
Exemplo n.º 3
0
        private void reciveFromModel()
        {
            StepSlider.Maximum = Model.Steps;

            if (Model.Steps > 0)
            {
                StepSlider.IsEnabled        = true;
                AnalysisTabItem.IsEnabled   = true;
                StatisticsTabItem.IsEnabled = true;

                CommandListView.setDataBinding(Model.UpdateProgrammcodeView());
            }
        }
Exemplo n.º 4
0
        private void AddBifurcation(int index)
        {
            //データの更新
            var bifurcationsProp = CommandItem.CommandProperty.GetChildProperty("bifurcations");

            bifurcationsProp.InsertArrayElementAt(index);
            bifurcationsProp.SerializedObject.ApplyModifiedProperties();

            //UIの更新
            //リストの追加
            var bifurcationBox = new VisualElement();

            var item      = bifurcationsProp.GetArrayElementAt(index);
            var labelProp = item.GetChildProperty("label").GetProperty();

            var a = new Foldout();

            a.text = $"「{labelProp.stringValue}」";
            var toggle = a.Q <Toggle>();

            toggle.style.marginBottom    = 0f;
            a.style.marginTop            = 10f;
            toggle.style.backgroundColor = new Color(0, 0, 0, 0.5f);
            bifurcationBox.Add(a);
            DefaultLabel.Insert(index, a);

            item.GetProperty().FindPropertyRelative("commandList.commands").arraySize = 0;
            bifurcationsProp.SerializedObject.ApplyModifiedProperties();
            var commandArrayProp = item.GetChildProperty("commandList.commands");

            var l = new CommandListView(CommandItem.ParentList, commandArrayProp);

            a.Add(l);

            CustomDetailRoot.Insert(index, bifurcationBox);

            bifurcationsProp.SerializedObject.ApplyModifiedProperties();

            //CommandEditorの更新
            RebuildCommandEditor();
        }