Exemplo n.º 1
0
        public ElementType()
        {
            MetaService = LocalUtils.MetaService;

            Model   = LocalUtils.GetModel();
            Project = LocalUtils.GetActiveProjectNode();
        }
Exemplo n.º 2
0
        private void OnProjectContextMenuInvokeHandler(object sender, EventArgs e)
        {
            ModelInfo model = LocalUtils.GetActiveProjectNode().GetProjectsModelInfo();

            CreateModelInfo modelInfo = new CreateModelInfo();
            var             pages     = new ReadOnlyCollection <WizardPageBase>((IList <WizardPageBase>) new List <WizardPageBase>()
            {
                new UpdateModelParametersPageViewModel(modelInfo),
                new CreateModelSelectDependentModelsPageViewModel(modelInfo),
                new CreateModelSummaryPageViewModel(modelInfo)
            });

            var vm = new UpdateModelViewModel();

            vm.RequestClose += new EventHandler(this.UpdateModelViewModel_RequestClose);


            dialog = new UpdateModelWizardDialog();

            this.SetPrivatePropertyValue(dialog, "UpdateModelViewModel", vm);
            this.SetPrivatePropertyValue(vm, "CreateModelInfo", modelInfo);
            this.SetPrivateFieldValue(vm, "pages", pages);

            dialog.DataContext = vm;

            modelInfo.SelectedModel = model;
            this.SetPrivatePropertyValue(vm, "CurrentPage", vm.Pages[1]);

            dialog.ShowModal();
        }
Exemplo n.º 3
0
        static AotElementCreate()
        {
            Project = LocalUtils.GetActiveProjectNode();
            ModelInfo model = Project.GetProjectsModelInfo();

            Model = new ModelSaveInfo
            {
                Id    = model.Id,
                Layer = model.Layer,
            };
        }
        private void OnProjectContextMenuInvokeHandler(object sender, EventArgs e)
        {
            ModelInfo               myModel = LocalUtils.GetActiveProjectNode().GetProjectsModelInfo();
            BuildModelViewModel     buildVm = new BuildModelViewModel();
            BuildModelInfoViewModel modelVm = buildVm.Models.FirstOrDefault(model => model.ModelInfo.DisplayName == myModel.DisplayName);

            modelVm.IsChecked = true;
            ConstructorInfo[] constructors = typeof(BuildModelView).GetConstructors(
                BindingFlags.NonPublic | BindingFlags.Instance);
            BuildModelView buildView = (BuildModelView)constructors[0].Invoke(new [] { buildVm });

            buildView.ShowModal();
        }
Exemplo n.º 5
0
        static AotElementCreate()
        {
            Project = LocalUtils.GetActiveProjectNode();

            if (Project == null)
            {
                throw new InvalidOperationException("No project selected.");
            }

            var model = Project.GetProjectsModelInfo();

            Model = new ModelSaveInfo
            {
                Id    = model.Id,
                Layer = model.Layer
            };
        }