Beispiel #1
0
        private void ButtonAddFluent_Click(object sender, RoutedEventArgs e)
        {
            if (TextBoxFluents.Text == "")
            {
                LabelFluentsActionsValidation.Content = "Fluent name is required.";
                return;
            }
            if (!System.Text.RegularExpressions.Regex.IsMatch(TextBoxFluents.Text, @"[a-zA-Z]+[a-zA-Z0-9\-]*$"))
            {
                LabelFluentsActionsValidation.Content = "Fluent name should be alphanumeric.";
                return;
            }

            if (!Fluents.Contains(Fluents.FirstOrDefault(f => (f.Name == TextBoxFluents.Text))))
            {
                var f = new Fluent {
                    Name = this.TextBoxFluents.Text
                };
                Fluents.Add(f);
                TextBoxFluents.Text = "";
                LabelFluentsActionsValidation.Content = "";
            }
            else
            {
                LabelFluentsActionsValidation.Content = "Fluent with this name already exists.";
            }
        }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="contentFunc"></param>
 public DataTablesCustomColumn(Func <T, string> contentFunc) : base()
 {
     ContentFunc = contentFunc;
     IsSortable  = false;
     Fluent.WidthPixels(20);
     IsExportable = false;
 }
Beispiel #3
0
        protected World CreateITWorld()
        {
            var world = World.Instance;

            painted = new Fluent("painted");
            paint   = new Action("PAINT");
            clear   = new Action("CLEAR");
            Fred    = new Actor("Fred");
            Bill    = new Actor("Bill");

            world.SetActions(new List <Action>()
            {
                paint, clear
            });
            world.SetActors(new List <Actor>()
            {
                Fred, Bill
            });
            world.SetFluents(new List <Fluent> {
                painted
            });

            var domain = new Domain();

            domain.AddInitiallyClause(new Initially(new Negation(painted)));
            domain.AddCausesClause(new Causes(clear, true, new List <Actor>(), new Negation(painted)));
            domain.AddTypicallyCausesClause(new TypicallyCauses(paint, false, new List <Actor>()
            {
                Fred
            }, painted));
            world.SetDomain(domain);
            world.Build();
            return(world);
        }
Beispiel #4
0
        protected virtual void SerializesFluent()
        {
            var descriptor = NewDescriptor();

            Fluent?.Invoke(descriptor);
            SerializesNdjson(descriptor);
        }
Beispiel #5
0
        protected virtual void SerializesFluent()
        {
            var descriptor = NewDescriptor();

            Fluent?.Invoke(descriptor);
            RoundTripsOrSerializes(descriptor, false);
        }
Beispiel #6
0
        public OmniboxAutocomplete()
        {
            InitializeComponent();

            this.autoCompleteTb.ItemTemplate = Fluent.GetDataTemplate(() => new OmniboxTemplate());
            this.autoCompleteTb.Delay        = TimeSpan.FromMilliseconds(100);
        }
        public void SetUp()
        {
            _idWorldAction = "idWorldAction";
            _startTime     = 8;
            _durationTime  = 5;

            _worldAction = new WorldAction(_idWorldAction, _startTime, _durationTime);

            _fluent = new Fluent()
            {
                Name  = "a",
                Value = true
            };

            _state = new State
            {
                Fluents = new List <Fluent> {
                    new Fluent {
                        Name = "a", Value = true
                    },
                    new Fluent {
                        Name = "b", Value = true
                    },
                    new Fluent {
                        Name = "c", Value = true
                    },
                    new Fluent {
                        Name = "d", Value = true
                    }
                }
            };
        }
Beispiel #8
0
 protected override void OnCreate()
 {
     m_shipsQuery = Fluent.WithAll <ShipTag>(true).WithAll <FactionMember>(true).IncludeDisabled().Build();
     worldBlackboardEntity.AddComponentData(new CachedShipBaseHealth {
         health = 0f
     });
 }
Beispiel #9
0
 public async Task ListPersonsAsync()
 {
     this.Persons =
         await Fluent.Start(Queries.ListPersonQueryAsync.GetExecutor())
         .SetValue(x => x.FilterText, this.FilterText)
         .ExecuteAsync(true);
 }
 public ByReleasesIf(Action action, AgentsList agents, Fluent fluent, LogicExpression condition)
 {
     Action    = action;
     Agents    = agents;
     Fluent    = fluent;
     Condition = condition;
 }
        public void ReplaceAllNotifiesOfChangesMade()
        {
            IEnumerable <int> loadedInts = new int[] { 1, 2, 3, 4 };
            var replacements             = new int[] { 5, 6 };

            var expectedChanges = loadedInts.Select(i => new ItemChange <int>(ChangeType.Removed, i))
                                  .Concat(replacements.Select(i => new ItemChange <int>(ChangeType.Added, i)));

            var loader = new ThreadSafeAsyncLoader <int>(
                Seq.ListBased,
                loadDataAsync: tok => Task.FromResult(loadedInts),
                eventContext: new RunInlineSynchronizationContext());

            loader.LoadAsync();  // load initial values

            var listener = Substitute.For <CollectionChangedHandler <int> >();

            loader.CollectionChanged += listener;


            loader.Should().Equal(loadedInts);   // sanity check
            loader.ReplaceAll(replacements);     // --- Perform ---
            loader.Should().Equal(replacements); // sanity check


            listener.Received().Invoke(loader, Fluent.Match <IntChangesAlias>(
                                           changes => changes.Should().BeEquivalentTo(expectedChanges)));
        }
Beispiel #12
0
        public PickUpManager()
        {
            //半径
            var radius = 5;

            //间隔角度
            var deltaAngle = 30 * Mathf.Deg2Rad;

            for (var i = 0; i < 12; i++)
            {
                var currentAngle = deltaAngle * i;

                var x = Mathf.Cos(currentAngle) * radius;
                var y = Mathf.Sin(currentAngle) * radius;

                var cubeGameObj = Fluent.Cube("Pick up")
                                  .Color(Color.yellow)
                                  .Position(new Vector3(x, 0.5f, y))
                                  .LocalScale(new Vector3(0.5f, 0.5f, 0.5f))
                                  .EulerAngles(new Vector3(45, 45, 45))
                                  .Build();

                cubeGameObj.GetComponent <BoxCollider>().isTrigger = true;

                Fluent.MonoBehaviour(cubeGameObj).OnUpdate(() =>
                {
                    cubeGameObj.transform.Rotate(new Vector3(15, 30, 45) * Time.deltaTime);
                }).Build();
            }
        }
    // Start is called before the first frame update
    void Start()
    {
        //创建一个GameObject
        Fluent.GameObject()
        .Name("第一个GameObj")
        .Layer(1)
        .Tag("enemy")
        .Build();

        //调用生命周
        Fluent.MonoBehaviour(gameObject)
        .OnStart(() => { Debug.Log("On Satrt"); })
        .OnUpdate(() => { Debug.Log("On Update"); })
        .OnDestroy(() => { Debug.Log("On Destory"); })
        .Build();

        //前两个点得综合使用
        var gameObj = Fluent.GameObject()
                      .Name("GameObjWithMonoBehavior")
                      .Build();

        Fluent.MonoBehaviour(gameObj).OnStart(() =>
        {
            Debug.Log("start");
        }).Build();
    }
        public void GetResultCorrectTest()
        {
            _actionReleasesIfRecord = new ActionReleasesIfRecord(_worldAction, _fluent, _ifExpression);

            Fluent result = _actionReleasesIfRecord.GetResult(_startTime);

            Assert.IsTrue(result.Value);
        }
Beispiel #15
0
 public ActionReleasesIfRecord(WorldAction worldAction, Fluent fluent, string ifExpression)
     : base(WorldDescriptionRecordType.ActionReleasesIf)
 {
     this.logicExpression = ServiceLocator.Current.GetInstance <ILogicExpression>();
     this.ifExpression    = ifExpression;
     this.worldAction     = worldAction;
     this.fluent          = fluent;
 }
 public ActionReleasesIfRecord(WorldAction worldAction, Fluent fluent, string ifExpression)
     : base(WorldDescriptionRecordType.ActionReleasesIf)
 {
     this.logicExpression = ServiceLocator.Current.GetInstance<ILogicExpression>();
     this.ifExpression = ifExpression;
     this.worldAction = worldAction;
     this.fluent = fluent;
 }
Beispiel #17
0
 /// <summary>
 /// Creates instance of releases sentence for given action, actors, fluent and condition.
 /// </summary>
 /// <param name="action">action for sentence</param>
 /// <param name="exclusion">exclusion of actors</param>
 /// <param name="actors">actors for sentence</param>
 /// <param name="fluent">fluent for sentence</param>
 /// <param name="condition">condition for sentence</param>
 public Releases(Action action, bool exclusion, List <Actor> actors, Fluent fluent, ICondition condition)
 {
     Action    = action;
     Exclusion = exclusion;
     Actors    = actors;
     Fluent    = fluent;
     Condition = condition ?? new True();
 }
        public Player()
        {
            //创建 玩家
            mPlayerobj = Fluent.Sphere("Player")
                         .Position(new Vector3(0, 0.5f, 0))
                         .Build();

            mRigidbody = mPlayerobj.AddComponent <Rigidbody>();
        }
Beispiel #19
0
 private void deleteFluentButton_Click(object sender, EventArgs e)
 {
     if (fluentListBox.SelectedIndex >= 0)
     {
         Fluent selectedFluent = (Fluent)fluentListBox.SelectedItem;
         _fluents.Remove(selectedFluent);
         fluentListBox.Items.Remove(selectedFluent);
     }
 }
Beispiel #20
0
        public void DumpAsNeo4J_01()
        {
            foreach (var item in ListOfMethodsThatLinksToAnotherSingleOne)
            {
                Fluent.HashIdentifier(item, null);
            }

            Assert.AreEqual(Fluent.HashDone.Count, 10);
        }
Beispiel #21
0
        protected override void OnCreate()
        {
            m_oldPlayerShipQuery = Fluent.WithAll <ShipTag>(true).WithAll <PlayerTag>().WithAll <FactionMember>().IncludeDisabled().Build();
            m_newPlayerShipQuery = Fluent.WithAll <PlayerTag>(true).WithAll <NewShipTag>(true).IncludeDisabled().Build();
            m_oldShipQuery       = Fluent.WithAll <ShipTag>(true).WithAll <FactionMember>().IncludeDisabled().Build();
            m_newAiShipQuery     = Fluent.WithAll <NewShipTag>(true).Without <PlayerTag>().IncludeDisabled().Build();

            m_entityListCache = new NativeList <Entity>(Allocator.Persistent);
        }
Beispiel #22
0
 protected virtual async Task VerifyDescriptorJson()
 {
     if (VerifyJson)
     {
         var descriptor = NewDescriptor();
         Fluent?.Invoke(descriptor);
         await Verifier.VerifyJson(SerializeUsingClient(descriptor));
     }
 }
 public void AddBackStageTabItem(Fluent.BackstageTabItem BackstageTabItem)
 {
     var backstage = Ribbon.Menu;
     if (backstage is Fluent.Backstage)
     {
         var tabcontrol = (backstage as Fluent.Backstage).Content;
         if (tabcontrol is Fluent.BackstageTabControl)
             (tabcontrol as Fluent.BackstageTabControl).Items.Add(BackstageTabItem);
     }
 }
 /*开始检测碰撞*/
 public void StartCheckCollision()
 {
     Fluent.OnTriggerEnterBuilder(mPlayerobj).OnTriggerEnter(other =>
     {
         if (other.gameObject.name == "Pick up")
         {
             Object.Destroy(other.gameObject);
         }
     }).Build();
 }
Beispiel #25
0
        public void DumpAsNeo4J_02()
        {
            var entities = ListOfMethodsThatLinksToAnotherSingleOne.Union(ListOfMethodsThatLinksToAnotherSingleOne);

            foreach (var item in entities)
            {
                Fluent.HashIdentifier(item, null);
            }

            Assert.AreEqual(Fluent.HashDone.Count, 10);
        }
Beispiel #26
0
        public async Task DeletePersonAsync()
        {
            if (CurrentPerson.IsNew)
            {
                throw new Exception("A new Person cannot be deleted");
            }

            await Fluent.Start(Commands.DeletePersonCommandAsync.GetExecutor())
            .SetValue(x => x.Person, this.CurrentPerson)
            .ExecuteAsync(true);
        }
        public void LightLampTest()
        {
            var domain    = new Domain();
            var tom       = new Actor("Tom");
            var lighted   = new Fluent("lighted");
            var broken    = new Fluent("broken");
            var turnOn    = new Action("TurnOn");
            var turnOff   = new Action("TurnOff");
            var throwDown = new Action("ThrowDown");
            var world     = World.Instance;

            world.SetActions(new List <Action> {
                turnOn, turnOff, throwDown
            });
            world.SetFluents(new List <Fluent> {
                lighted, broken
            });
            world.SetActors(new List <Actor> {
                tom
            });
            domain.AddInitiallyClause(new Initially(new Conjunction(new Negation(broken), lighted)));
            domain.AddTypicallyCausesClause(new TypicallyCauses(throwDown, false, new List <Actor> {
                tom
            }, broken));
            domain.AddCausesClause(new Causes(turnOn, false, new List <Actor> {
                tom
            }, lighted));
            domain.AddCausesClause(new Causes(turnOff, false, new List <Actor> {
                tom
            }, new Negation(lighted)));
            domain.AddAlwaysClause(new Always(new Implication(lighted, new Negation(broken))));
            domain.AddPreservesClause(new Preserves(turnOn, false, new List <Actor> {
                tom
            }, broken, null));
            world.SetDomain(domain);
            world.Build();
            var scenario = new Scenario();

            scenario.AddScenarioStep(new ScenarioStep(throwDown, tom));
            scenario.AddScenarioStep(new ScenarioStep(turnOn, tom));

            var ever       = new AccessibleEverScenarioQuery(new Conjunction(new Negation(broken), lighted), lighted, scenario);
            var resultEver = ever.Evaluate(world);

            var typically       = new AccessibleTypicallyScenarioQuery(new Conjunction(new Negation(broken), lighted), lighted, scenario);
            var resultTypically = typically.Evaluate(world);

            var always       = new AccessibleAlwaysScenarioQuery(new Conjunction(new Negation(broken), lighted), lighted, scenario);
            var resultAlways = always.Evaluate(world);

            Assert.AreEqual(resultEver, true);
            Assert.AreEqual(resultTypically, false);
            Assert.AreEqual(resultAlways, true);
        }
        public void StartFollowPlayer(GameObject playerobj)
        {
            //计算 摄像机和玩家的偏移值
            var offset = mCameraobj.transform.position - playerobj.transform.position;

            Fluent.MonoBehaviour(mCameraobj).onLateUpdate(() =>
            {
                //每一帧都去设置偏移值,保证Camera永远与player的相对位置不变
                mCameraobj.transform.position = playerobj.transform.position + offset;
            }).Build();
        }
        /*开始监听用户输入*/
        public void StartListenUserInput()
        {
            Fluent.MonoBehaviour(mPlayerobj).onFixedUpdate(() =>
            {
                var moveHorizontal = Input.GetAxis("Horizontal");
                var moveVertical   = Input.GetAxis("Vertical");

                var movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
                mRigidbody.AddForce(movement * 5);
            }).Build();
        }
Beispiel #30
0
        public void DumpAsNeo4J_13()
        {
            Func <SimpleMethod, string, SimpleMethod, string, BaseRelationship> callsRelationshipFactory = (fromEntity, from, toEntity, to) => new CallsRelationship(@from, @to);

            Fluent.CypherObject(ListOfMethodsThatLinksToAnotherOneButWithADuplicate, new RelationFactory <SimpleMethod, SimpleMethod>(entity => entity.Calls, callsRelationshipFactory));

            Console.WriteLine(Fluent.DebugQueryText);

            var query = Fluent.DebugQueryText.Split(StringSeparators, StringSplitOptions.None).Where(l => l.Length > 0);

            Assert.AreEqual(query.Count(), Relations(10) + Nodes(2 * 10 - 1)); // 28
        }
        public NeroTests()
        {
            var burnedFluent      = new Fluent("burned");
            var entertainedFluent = new Fluent("entertained");
            var neroActor         = new Actor("Nero");
            var drinkAction       = new Action("Drink");
            var torchAction       = new Action("Torch");
            var restAction        = new Action("Rest");

            var domain = new Domain();

            domain.AddInitiallyClause(new Initially(new Conjunction(new Negation(burnedFluent), new Negation(entertainedFluent))));
            domain.AddReleasesClause(new Releases(drinkAction, false, new List <Actor> {
                neroActor
            }, entertainedFluent, new Negation(entertainedFluent)));
            domain.AddTypicallyCausesClause(new TypicallyCauses(torchAction, false, new List <Actor> {
                neroActor
            }, entertainedFluent));
            domain.AddCausesClause(new Causes(torchAction, false, new List <Actor> {
                neroActor
            }, burnedFluent));
            domain.AddCausesClause(new Causes(restAction, false, new List <Actor> {
                neroActor
            }, new Negation(entertainedFluent)));
            domain.AddImpossibleClause(new Impossible(torchAction, false, new List <Actor> {
                neroActor
            }, burnedFluent));

            _world.SetActors(new List <Actor> {
                neroActor
            });
            _world.SetActions(new List <Action> {
                drinkAction, torchAction, restAction
            });
            _world.SetFluents(new List <Fluent> {
                burnedFluent, entertainedFluent
            });
            _world.SetDomain(domain);

            _world.Build();



            _drinkRestTorchScenario = new Scenario();
            _drinkRestTorchScenario.AddScenarioStep(new ScenarioStep(drinkAction, neroActor));
            _drinkRestTorchScenario.AddScenarioStep(new ScenarioStep(restAction, neroActor));
            _drinkRestTorchScenario.AddScenarioStep(new ScenarioStep(torchAction, neroActor));

            _accessibleQueryGamma = new Negation(burnedFluent);
            _accessibleQueryPi    = null;
        }
        public GameCamera()
        {
            //默认摄像机的创建
            mCameraobj = Fluent.GameObject()
                         .Name("Main Camera")
                         .Build();


            //设置camera位置
            Fluent.Camera(mCameraobj)
            .Position(new Vector3(0, 10, -10))
            .EulerAngles(new Vector3(45, 0, 0))
            .Build();
        }
        /// <summary>
        /// Adds a <see cref="RibbonTabItem"/> to the collection. Considers the ContextualTabGroup
        /// </summary>
        /// <param name="RibbonTabItem"></param>
        public void AddTabItem(Fluent.RibbonTabItem RibbonTabItem)
        {
            if (RibbonTabItem.Group == null)
            {
                Ribbon.Tabs.Insert(GetIndexOfLastNormalTab(), RibbonTabItem);
            }
            else
            {
                var indexgroup = Ribbon.ContextualGroups.IndexOf(RibbonTabItem.Group);
                var insertindex = -1;
                while (insertindex == -1 && indexgroup >= 0)
                {
                    var list = (from item in Ribbon.Tabs orderby Ribbon.Tabs.IndexOf(item) where item.Group == Ribbon.ContextualGroups[indexgroup] select Ribbon.Tabs.IndexOf(item)).ToList();
                    if (list.Count == 0)
                        indexgroup -= 1;
                    else
                        insertindex = list.Last() + 1;
                }
                if (indexgroup == -1)
                    insertindex = GetIndexOfLastNormalTab();

                Ribbon.Tabs.Insert(insertindex, RibbonTabItem);
            }
        }
        /// <summary>
        /// Delay creation of ribbon menus.
        /// </summary>
        /// <param name="ribbonMenu"></param>
        public override void CreateRibbonMenu(Fluent.Ribbon ribbonMenu)
        {
            base.CreateRibbonMenu(ribbonMenu);

            // delay loading to the point where we start updating the property grid (item selection)
            if (!this.IsRibbonMenuForEditorsInitialized)
                if (this.IsInitialized)
                    this.CreateRibbonMenuBarForEditors(ribbonMenu);
        }
        /// <summary>
        /// Hide ribbon menu.
        /// </summary>
        /// <param name="ribbonMenu"></param>
        public override void HideRibbonMenu(Fluent.Ribbon ribbonMenu)
        {
            base.HideRibbonMenu(ribbonMenu);

            if (exampleTabGroup != null)
                exampleTabGroup.Visibility = System.Windows.Visibility.Collapsed;
        }
Beispiel #36
0
		protected virtual Fluent.RibbonTabItem CreateRibbonViewTab(Fluent.Ribbon ribbon)
		{
		    tabView = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit();
		    tabView.Header = "View";
		    
			// see if required
		    Fluent.RibbonGroupBox grpMC = new Fluent.RibbonGroupBox();
		    grpMC.Header = "Model Contexts";
		
		    ContentControl c = new ContentControl();
		    c.Template = (ControlTemplate)FindResource("RibbonViewTabMCTemplate");
		    grpMC.Items.Add(c);
		    tabView.Groups.Add(grpMC);
		    tabViewgrpMC = grpMC;
			
		    return tabView;
		}
 /// <summary>
 /// Create ribbon menu bars for editors.
 /// </summary>
 /// <param name="ribbonMenu"></param>
 public virtual void CreateRibbonMenuBarForEditors(Fluent.Ribbon ribbonMenu)
 {
     this.IsRibbonMenuForEditorsInitialized = true;
 }
 /// <summary>
 /// Show ribbon menu.
 /// </summary>
 /// <param name="ribbonMenu"></param>
 public override void ShowRibbonMenu(Fluent.Ribbon ribbonMenu)
 {
     base.ShowRibbonMenu(ribbonMenu);
     if (exampleTabGroup != null)
         exampleTabGroup.Visibility = System.Windows.Visibility.Visible;
 }
Beispiel #39
0
		protected virtual Fluent.RibbonTabItem CreateRibbonEditTab(Fluent.Ribbon ribbon)
		{
		    tabEdit = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit();
		    tabEdit.Header = "Edit";
		    tabEdit.LateInitializationTriggered += new EventHandler(tabEdit_LateInitializationTriggered);
		    return tabEdit;
		}
		/// <summary>
        /// Creates ribbon menu for property grid editors.
        /// </summary>
        /// <param name="ribbonMenu">Main ribbon menu.</param>
        public static void CreateRibbonMenuBarForEditorsHelper(Fluent.Ribbon ribbonMenu)
		{
	
		}
            /// <summary>
            /// Creates the ribbon menu bar for the html editor.
            /// </summary>
            /// <param name="ribbonMenu">Main ribbon menu.</param>
            public override void CreateRibbonMenuBar(Fluent.Ribbon ribbonMenu)
            {
                foreach (RibbonContextualTabGroup t in ribbonMenu.ContextualGroups)
                    if (t.Name == "tabGroupHtml")
                        return;

                // add contextual items for the html editor
                RibbonContextualTabGroup contextualTG = new RibbonContextualTabGroup();
                contextualTG.Name = "tabGroupHtml";
                contextualTG.BorderBrush = new SolidColorBrush(Colors.Orange);
                contextualTG.Background = new SolidColorBrush(Colors.OrangeRed);
                contextualTG.Header = "Html-Editor";

                Binding visibilityBinding = new Binding("ActiveViewModel.SelectedEditorViewModel.IsHtmlEditorViewModelVisible");
                visibilityBinding.Converter = new BooleanToVisibilityConverter();
                visibilityBinding.Mode = BindingMode.OneWay;
                contextualTG.SetBinding(RibbonContextualTabGroup.VisibilityProperty, visibilityBinding);

                // add the html editor tab item
                RibbonTabItem tab = new RibbonTabItem();
                tab.Group = contextualTG;
                tab.Header = "Design";

                // font group box
                RibbonGroupBox fontGP = new RibbonGroupBox();
                fontGP.Header = "Font";
                tab.Groups.Add(fontGP);

                #region Button Bold
                Fluent.ToggleButton btnBold = new Fluent.ToggleButton();
                btnBold.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnBold.SizeDefinition = "Large";
                btnBold.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-bold-32.png"));
                btnBold.Text = "Bold";

                Binding btnBoldCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleBoldCommand");
                btnBoldCmdn.Mode = BindingMode.OneWay;
                btnBold.SetBinding(Fluent.ToggleButton.CommandProperty, btnBoldCmdn);

                Binding btnBoldIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextBold");
                btnBoldIsChecked.Mode = BindingMode.TwoWay;
                btnBold.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnBoldIsChecked);

                fontGP.Items.Add(btnBold);
                #endregion

                #region Button Italic
                Fluent.ToggleButton btnItalic = new Fluent.ToggleButton();
                btnItalic.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnItalic.SizeDefinition = "Large";
                btnItalic.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-italic-32.png"));
                btnItalic.Text = "Italic";

                Binding btnItalicCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleItalicCommand");
                btnItalicCmdn.Mode = BindingMode.OneWay;
                btnItalic.SetBinding(Fluent.ToggleButton.CommandProperty, btnItalicCmdn);

                Binding btnItalicIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextItalic");
                btnItalicIsChecked.Mode = BindingMode.TwoWay;
                btnItalic.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnItalicIsChecked);

                fontGP.Items.Add(btnItalic);
                #endregion

                #region Button Underline
                Fluent.ToggleButton btnUnderline = new Fluent.ToggleButton();
                btnUnderline.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnUnderline.SizeDefinition = "Large";
                btnUnderline.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-text-underline-32.png"));
                btnUnderline.Text = "Underline";

                Binding btnUnderlineCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlToggleUnderlineCommand");
                btnUnderlineCmdn.Mode = BindingMode.OneWay;
                btnUnderline.SetBinding(Fluent.ToggleButton.CommandProperty, btnUnderlineCmdn);

                Binding btnUnderlineIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionTextUnderlined");
                btnUnderlineIsChecked.Mode = BindingMode.TwoWay;
                btnUnderline.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnUnderlineIsChecked);

                fontGP.Items.Add(btnUnderline);
                #endregion

                // format group box
                RibbonGroupBox formatGP = new RibbonGroupBox();
                formatGP.Header = "Format";
                tab.Groups.Add(formatGP);

                #region Button Decrease Indent
                Fluent.Button btnDecIndent = new Fluent.Button();
                btnDecIndent.SizeDefinition = "Large";
                btnDecIndent.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-indent-less-32.png"));
                btnDecIndent.Text = "Decrease Indent";

                Binding btnDecIndentCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlIndentLessCommand");
                btnDecIndentCmdn.Mode = BindingMode.OneWay;
                btnDecIndent.SetBinding(Fluent.Button.CommandProperty, btnDecIndentCmdn);

                formatGP.Items.Add(btnDecIndent);
                #endregion

                #region Button Increase Indent
                Fluent.Button btnIncIndent = new Fluent.Button();
                btnIncIndent.SizeDefinition = "Large";
                btnIncIndent.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-indent-more-32.png"));
                btnIncIndent.Text = "Increase Indent";

                Binding btnIncIndentCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlIndentMoreCommand");
                btnIncIndentCmdn.Mode = BindingMode.OneWay;
                btnIncIndent.SetBinding(Fluent.Button.CommandProperty, btnIncIndentCmdn);

                formatGP.Items.Add(btnIncIndent);
                #endregion

                // alignment group box
                RibbonGroupBox alignGP = new RibbonGroupBox();
                alignGP.Header = "Alignment";
                tab.Groups.Add(alignGP);

                #region Button Align Left
                Fluent.ToggleButton btnLeft = new Fluent.ToggleButton();
                btnLeft.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnLeft.SizeDefinition = "Large";
                btnLeft.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-left-32.png"));
                btnLeft.Text = "Left";

                Binding btnLeftCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignLeftCommand");
                btnLeftCmdn.Mode = BindingMode.OneWay;
                btnLeft.SetBinding(Fluent.ToggleButton.CommandProperty, btnLeftCmdn);

                Binding btnLeftIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedLeft");
                btnLeftIsChecked.Mode = BindingMode.TwoWay;
                btnLeft.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnLeftIsChecked);

                alignGP.Items.Add(btnLeft);
                #endregion

                #region Button Align Center
                Fluent.ToggleButton btnCenter = new Fluent.ToggleButton();
                btnCenter.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnCenter.SizeDefinition = "Large";
                btnCenter.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-center-32.png"));
                btnCenter.Text = "Center";

                Binding btnCenterCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignCenterCommand");
                btnCenterCmdn.Mode = BindingMode.OneWay;
                btnCenter.SetBinding(Fluent.ToggleButton.CommandProperty, btnCenterCmdn);

                Binding btnCenterIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedCenter");
                btnCenterIsChecked.Mode = BindingMode.TwoWay;
                btnCenter.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnCenterIsChecked);

                alignGP.Items.Add(btnCenter);
                #endregion

                #region Button Align Right
                Fluent.ToggleButton btnRight = new Fluent.ToggleButton();
                btnRight.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnRight.SizeDefinition = "Large";
                btnRight.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-right-32.png"));
                btnRight.Text = "Right";

                Binding btnRightCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignRightCommand");
                btnRightCmdn.Mode = BindingMode.OneWay;
                btnRight.SetBinding(Fluent.ToggleButton.CommandProperty, btnRightCmdn);

                Binding btnRightIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedRight");
                btnRightIsChecked.Mode = BindingMode.TwoWay;
                btnRight.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnRightIsChecked);

                alignGP.Items.Add(btnRight);
                #endregion

                #region Button Align Justify
                Fluent.ToggleButton btnJustify = new Fluent.ToggleButton();
                btnJustify.Margin = new System.Windows.Thickness(2, 0, 0, 0);
                btnJustify.SizeDefinition = "Large";
                btnJustify.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/format-justify-fill-32.png"));
                btnJustify.Text = "Justify";

                Binding btnJustifyCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlAlignJustifyCommand");
                btnJustifyCmdn.Mode = BindingMode.OneWay;
                btnJustify.SetBinding(Fluent.ToggleButton.CommandProperty, btnJustifyCmdn);

                Binding btnJustifyIsChecked = new Binding("ActiveViewModel.SelectedEditorViewModel.IsSelectionAlignedJustified");
                btnJustifyIsChecked.Mode = BindingMode.TwoWay;
                btnJustify.SetBinding(Fluent.ToggleButton.IsCheckedProperty, btnJustifyIsChecked);

                alignGP.Items.Add(btnJustify);
                #endregion

                // insert group box
                RibbonGroupBox insertGP = new RibbonGroupBox();
                insertGP.Header = "Insert";
                tab.Groups.Add(insertGP);

                #region Button Hyperlink
                Fluent.Button btnHyperlink = new Fluent.Button();
                btnHyperlink.SizeDefinition = "Large";
                btnHyperlink.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/Hyperlink.ico"));
                btnHyperlink.Text = "Hyperlink";

                Binding btnHyperlinkCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertHyperlinkCommand");
                btnHyperlinkCmdn.Mode = BindingMode.OneWay;
                btnHyperlink.SetBinding(Fluent.Button.CommandProperty, btnHyperlinkCmdn);

                insertGP.Items.Add(btnHyperlink);
                #endregion

                #region Button Image
                Fluent.Button btnImage = new Fluent.Button();
                btnImage.SizeDefinition = "Large";
                btnImage.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/insert-image-32.png"));
                btnImage.Text = "Image";

                Binding btnImageCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertImageCommand");
                btnImageCmdn.Mode = BindingMode.OneWay;
                btnImage.SetBinding(Fluent.Button.CommandProperty, btnImageCmdn);

                insertGP.Items.Add(btnImage);
                #endregion

                #region Button List
                Fluent.SplitButton btnList = new SplitButton();
                btnList.SizeDefinition = "Large";
                btnList.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/list-32.png"));
                btnList.Text = "List";
                insertGP.Items.Add(btnList);

                Fluent.Button btnBulletedList = new Fluent.Button();
                btnBulletedList.SizeDefinition = "Middle";
                btnBulletedList.Icon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/List_BulletsHS.png"));
                btnBulletedList.Text = "Bulleted List";

                Binding btnBulletedListCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertBulletListCommand");
                btnBulletedListCmdn.Mode = BindingMode.OneWay;
                btnBulletedList.SetBinding(Fluent.Button.CommandProperty, btnBulletedListCmdn);

                btnList.Items.Add(btnBulletedList);

                Fluent.Button btnNumberedList = new Fluent.Button();
                btnNumberedList.SizeDefinition = "Middle";
                btnNumberedList.Icon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/List_NumberedHS.png"));
                btnNumberedList.Text = "Numbered List";

                Binding btnNumberedListCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertNumberListCommand");
                btnNumberedListCmdn.Mode = BindingMode.OneWay;
                btnNumberedList.SetBinding(Fluent.Button.CommandProperty, btnNumberedListCmdn);

                btnList.Items.Add(btnNumberedList);
                #endregion

                #region Button Table
                Fluent.Button btnTable = new Fluent.Button();
                btnTable.SizeDefinition = "Large";
                btnTable.LargeIcon = new System.Windows.Media.Imaging.BitmapImage(
                    new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/table-32.png"));
                btnTable.Text = "Table";

                Binding btnTableCmdn = new Binding("ActiveViewModel.SelectedEditorViewModel.HtmlInsertTableCommand");
                btnTableCmdn.Mode = BindingMode.OneWay;
                btnTable.SetBinding(Fluent.Button.CommandProperty, btnTableCmdn);

                insertGP.Items.Add(btnTable);
                #endregion

                ribbonMenu.ContextualGroups.Add(contextualTG);
                ribbonMenu.Tabs.Add(tab);

                /*
                <fluent:RibbonGroupBox Header="Font">
                        <fluent:ToggleButton Text="Bold" Command="{Binding Path=HtmlToggleBoldCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-bold-32.png" IsChecked="{Binding Path=IsSelectionTextBold, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Italic" Command="{Binding Path=HtmlToggleItalicCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-italic-32.png" IsChecked="{Binding Path=IsSelectionTextItalic, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Underline" Command="{Binding Path=HtmlToggleUnderlineCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-text-underline-32.png" IsChecked="{Binding Path=IsSelectionTextUnderlined, Mode=TwoWay}" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Format">
                        <fluent:Button Text="Decrease Indent" Command="{Binding Path=HtmlIndentLessCommand}" LargeIcon="/Resources/Images/HtmlEditor/format-indent-less-32.png"  SizeDefinition="Large"/>
                        <fluent:Button Text="Increase Indent" Command="{Binding Path=HtmlIndentMoreCommand}" LargeIcon="/Resources/Images/HtmlEditor/format-indent-more-32.png" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Font">
                        <fluent:ToggleButton Text="Left" Command="{Binding Path=HtmlAlignLeftCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-left-32.png" IsChecked="{Binding Path=IsSelectionAlignedLeft, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Center" Command="{Binding Path=HtmlAlignCenterCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-center-32.png" IsChecked="{Binding Path=IsSelectionAlignedCenter, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Right" Command="{Binding Path=HtmlAlignRightCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-right-32.png" IsChecked="{Binding Path=IsSelectionAlignedRight, Mode=TwoWay}" SizeDefinition="Large"/>
                        <fluent:ToggleButton Text="Justify" Command="{Binding Path=HtmlAlignJustifyCommand}" Margin="2,0,0,0" LargeIcon="/Resources/Images/HtmlEditor/format-justify-fill-32.png" IsChecked="{Binding Path=IsSelectionAlignedJustified, Mode=TwoWay}" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>

                    <fluent:RibbonGroupBox Header="Insert">
                        <fluent:Button Text="Hyperlink" Command="{Binding Path=HtmlInsertHyperlinkCommand}" LargeIcon="/Resources/Images/Ico/Hyperlink.ico"  SizeDefinition="Large"/>
                        <fluent:Button Text="Image" Command="{Binding Path=HtmlInsertImageCommand}" LargeIcon="/Resources/Images/HtmlEditor/insert-image-32.png" SizeDefinition="Large"/>
                        <fluent:SplitButton Text="List" LargeIcon="/Resources/Images/HtmlEditor/list-32.png" SizeDefinition="Large">
                            <fluent:Button Text="Bulleted List" Command="{Binding Path=HtmlInsertBulletListCommand}" Icon="/Resources/Images/HtmlEditor/List_BulletsHS.png" SizeDefinition="Middle"/>
                            <fluent:Button Text="Numbered List" Command="{Binding Path=HtmlInsertNumberListCommand}" Icon="/Resources/Images/HtmlEditor/List_NumberedHS.png" SizeDefinition="Middle"/>
                        </fluent:SplitButton>
                        <fluent:Button Text="Table" Command="{Binding Path=HtmlInsertTableCommand}" LargeIcon="/Resources/Images/HtmlEditor/table-32.png" SizeDefinition="Large"/>
                    </fluent:RibbonGroupBox>
                */
            }
		/// <summary>
        /// Creates ribbon menu for property grid editors.
        /// </summary>
        /// <param name="ribbonMenu">Main ribbon menu.</param>
        public static void CreateRibbonMenuBarForEditorsHelper(Fluent.Ribbon ribbonMenu)
		{
			global::Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.ViewModel.HtmlEditorViewModel.HtmlEditorViewModelContextMenuBarCreater.Instance.CreateRibbonMenuBar(ribbonMenu);
	
		}
        /// <summary>
        /// This method needs to overriden in the actual instances of this class to create contextual
        /// or regular ribbon bars if required.
        /// </summary>
        /// <param name="ribbonMenu">Main ribbon menu.</param>
        public override void CreateRibbonMenuBarForEditors(Fluent.Ribbon ribbonMenu)
        {
            base.CreateRibbonMenuBarForEditors(ribbonMenu);
			
			Tum.VModellXT.Basis.ViewModel.VModellXTBasisPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
			Tum.VModellXT.Statik.ViewModel.VModellXTStatikPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
			Tum.VModellXT.Dynamik.ViewModel.VModellXTDynamikPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
			Tum.VModellXT.Anpassung.ViewModel.VModellXTAnpassungPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
			Tum.VModellXT.Konventionsabbildungen.ViewModel.VModellXTKonventionsabbildungenPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
			Tum.VModellXT.Aenderungsoperationen.ViewModel.VModellXTAenderungesoperationenPropertyGridViewModel.CreateRibbonMenuBarForEditorsHelper(ribbonMenu);
	
        }
 public void AddDocumentButton(Fluent.Button button)
 {
     GroupOrderFolder.Items.Add(button);
 }
Beispiel #45
0
		protected virtual Fluent.RibbonTabItem CreateRibbonHomeTab(Fluent.Ribbon ribbon)
		{
		    tabHome = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit();
		    tabHome.Header = "Home";
		    tabHome.LateInitializationTriggered += new EventHandler(TabHome_LateInitializationTriggered);
		
		    return tabHome;
		}
Beispiel #46
0
		protected virtual void CreateRibbonBackstage(Fluent.Ribbon ribbon)
		{
		    ribbon.BackstageItems.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(
		        "New", "pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/New-16.png", "Medium", "NewModelCommand"));
		    ribbon.BackstageItems.Add(Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(
		        "Open...", "pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Open-16.png", "Medium", "OpenModelCommand"));
		    
			backstageSaveModelButton = Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(
		        "Save", "pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Save-16.png", "Medium", "SaveModelCommand");
			ribbon.BackstageItems.Add(backstageSaveModelButton);
			backstageSaveModelButton.IsEnabled = false;
				
			backstageSaveAsModelButton = Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(
		        "Save As...", "pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/SaveAs-32.png", "Medium", "SaveAsModelCommand");
		    ribbon.BackstageItems.Add(backstageSaveAsModelButton);
			backstageSaveAsModelButton.IsEnabled = false;
		
		    Fluent.BackstageTabItem tabItemRecent = new Fluent.BackstageTabItem();
		    tabItemRecent.Header = "Recent";
		    ContentControl c = new ContentControl();
		    c.Template = (ControlTemplate)FindResource("RibbonBackstageRecentItemsTemplate");
		    tabItemRecent.Content = c;
		    ribbon.BackstageItems.Add(tabItemRecent);
		
		    // see if needed
		    tabItemFI = new Fluent.BackstageTabItem();
		    tabItemFI.Header = "Further Information";
		    ContentControl c2 = new ContentControl();
		    c2.Template = (ControlTemplate)FindResource("RibbonBackstageFurtherInformationTemplate");
		    tabItemFI.Content = c2;
		    ribbon.BackstageItems.Add(tabItemFI);
		
		    // see if needed
		    tabItemCredits = new Fluent.BackstageTabItem();
		    tabItemCredits.Header = "Credits";
		    ContentControl c3 = new ContentControl();
		    c3.Template = (ControlTemplate)FindResource("RibbonBackstageCreditsTemplate");
		    tabItemCredits.Content = c3;
		    ribbon.BackstageItems.Add(tabItemCredits);
		
			backstageCloseModelButton = Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonCreationHelper.CreateButton(
		        "Close", "pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/CloseDocument-32.png", "Medium", "CloseModelCommand");
		    ribbon.BackstageItems.Add(backstageCloseModelButton);
			backstageCloseModelButton.IsEnabled = false;
		
		    Fluent.Button b = new Fluent.Button();
		    b.Text = "Exit";
		    b.Click += new RoutedEventHandler(ExitButton_Click);
		    b.Icon = new System.Windows.Media.Imaging.BitmapImage(new Uri("pack://application:,,,/Tum.PDE.ToolFramework.Images;component/Ribbon/Exit-16.png", UriKind.Absolute));
		
		    ribbon.BackstageItems.Add(b);
		}
Beispiel #47
0
		protected virtual Fluent.RibbonTabItem CreateRibbonPluginsTab(Fluent.Ribbon ribbon)
		{
		    tabPlugins = new Tum.PDE.ToolFramework.Modeling.Visualization.Base.Controls.Ribbon.RibbonTabItemLateInit();
		    tabPlugins.Header = "Plugins";
		    tabPlugins.LateInitializationTriggered += new EventHandler(tabPlugins_LateInitializationTriggered);
		
		    return tabPlugins;
		}
 public RibbonFactory(Fluent.Ribbon ribbon)
 {
     Ribbon = ribbon;
 }
        /// <summary>
        /// This method needs to overriden in the actual instances of this class to create contextual
        /// or regular ribbon bars if required.
        /// </summary>
        /// <param name="ribbonMenu">Main ribbon menu.</param>
        public override void CreateRibbonMenuBarForEditors(Fluent.Ribbon ribbonMenu)
        {
            base.CreateRibbonMenuBarForEditors(ribbonMenu);
			
	
        }
 public void RemoveTabItem(Fluent.RibbonTabItem RibbonTabItem)
 {
     Ribbon.Tabs.Remove(RibbonTabItem);
 }
        private void SetSelectedTab(Fluent.RibbonTabItem item)
        {
            foreach (Fluent.RibbonTabItem t in Ribbon.Tabs)
                if (t != item)
                {
                    t.IsSelected = false;
                    t.IsOpen = false;
                }

            item.IsSelected = true;
            item.IsOpen = true;
        }
 /// <summary>
 /// Not required.
 /// </summary>
 /// <param name="ribbonMenu"></param>
 public override void CreateRibbonMenu(Fluent.Ribbon ribbonMenu)
 {
 }
 /// <summary>
 /// Adds a specified <see cref="Fluent.RibbonContextualTabGroup"/>
 /// </summary>
 /// <param name="ContextualTabGroup"></param>
 public void AddContextualGroup(Fluent.RibbonContextualTabGroup ContextualTabGroup)
 {
     Ribbon.ContextualGroups.Add(ContextualTabGroup);
 }