示例#1
0
        private void prototypes_ViewPrototypeCode(Prototype p)
        {
            RadCodeDocumentPane doc = new RadCodeDocumentPane();

            documentPaneGroup.AddItem(doc, Telerik.Windows.Controls.Docking.DockPosition.Center);
            doc.Editor.Text = p.GetLuaCode();
            Binding myBinding = new Binding();

            myBinding.Source = p;
            myBinding.Path   = new PropertyPath("name");
            myBinding.Mode   = BindingMode.TwoWay;
            myBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            BindingOperations.SetBinding(doc, RadDocumentPane.TitleProperty, myBinding);
        }
示例#2
0
        private void modStructure_OpenFile(FileInfo file)
        {
            prototypes.ParseCodeFile(file);
            foreach (RadCodeDocumentPane d in documentPaneGroup.Items)
            {
                if (d.codeFile == file)
                {
                    d.IsSelected = true;
                    return;
                }
            }
            RadCodeDocumentPane doc = new RadCodeDocumentPane();

            documentPaneGroup.AddItem(doc, Telerik.Windows.Controls.Docking.DockPosition.Center);
            doc.OpenFile(file);
        }