public void Execute(UIApplication app) { Transaction trans = new Transaction(app.ActiveUIDocument.Document, "Получить выбранные семейства"); trans.Start(); UIDocument uidoc = app.ActiveUIDocument; Autodesk.Revit.DB.Document doc = uidoc.Document; Selection sel = app.ActiveUIDocument.Selection; ICollection <Autodesk.Revit.DB.ElementId> selectedIds = uidoc.Selection.GetElementIds(); //Reference annotation = sel.PickObject(ObjectType.Element, "Select item"); FamilyInstance elem = doc.GetElement(selectedIds.FirstOrDefault()) as FamilyInstance; FamilySymbol familySymbol = elem.Symbol; FamilyDto famDto = new FamilyDto(); if (FamilyName == null || FamilyName == "") { famDto.Name = familySymbol.Name; } else { famDto.Name = FamilyName; } famDto.FamilySymbolDto = familySymbol; famDto.ImagePath = Path; famDto.ID = familySymbol.Id.ToString(); MainWindowViewModel.familyDto = famDto; //MainWindowViewModel.FamilySymbolList.Add(famDto); trans.Commit(); ChangeUI?.Invoke(this); }
private void button1_Click(object sender, EventArgs e) { myUI = new ChangeUI(ChangeText); //treeNode = new TreeNode(); string folder = ""; FolderBrowserDialog DirDialog = new FolderBrowserDialog(); DirDialog.Description = "Выбор директории"; DirDialog.SelectedPath = @"C:\"; if (DirDialog.ShowDialog() == DialogResult.OK) { folder = DirDialog.SelectedPath; } if (folder != "") { // t = new Threads(myUI, folder); treeView1.Nodes.Clear(); treeNode = new TreeNode(folder + " " + "(" + File.GetCreationTime(folder) + ")"); var gettingInformation = Task.Factory.StartNew(() => { GettingInformation(folder, treeNode); }); var outputInformation = gettingInformation.ContinueWith((previous) => { treeView1.Nodes.Add(treeNode);//Доступ к UI контрлам }, TaskScheduler.FromCurrentSynchronizationContext()); var saveInformatio = gettingInformation.ContinueWith((previous) => { exportToXml(treeNode, "data.xml"); }, TaskScheduler.FromCurrentSynchronizationContext()); } }
private void Printbtn_Click(object sender, EventArgs e) { //Метод отображения информации в текстовом поле myUI = new ChangeUI(Changed); //Передаём ссылку на делегат _myThreads = new Threads(myUI); _myThreads.Run(Convert.ToInt32(number_of_documentsn_ud.Value)); }
private void startButton_Click(object sender, EventArgs e) { textBox1.Clear(); myUI = new ChangeUI(ChangeText); threads = new Threads(myUI); threads.Run(); startButton.Text = "Restart"; stopButton.Visible = true; resumeButton.Visible = false; }
public void Handle(ChangeUI message) { switch (message.Type) { case "AppTreeChange": (ModelClass as SoftwareGroup).CheckStyle = GetCheckStyle(); (ModelClass as SoftwareGroup).IconStyle = GetIconStyle(); break; } }
public void Handle(ChangeUI message) { switch (message.Type) { case "ImportComplete": (PreviewViewModel as Preview.UserAuthViewModel).PreviewBackButtonVisible = ShowBack; (PreviewViewModel as Preview.UserAuthViewModel).PreviewCancelButtonVisible = DisableCancel; (PreviewViewModel as Preview.UserAuthViewModel).Domain = Domain; (PreviewViewModel as Preview.UserAuthViewModel).Title = Title; break; } }
public void Handle(ChangeUI message) { switch (message.Type) { case "ImportComplete": (PreviewViewModel as Preview.PreflightViewModel).PreviewBackButtonVisible = ShowBack == true ? true : false; (PreviewViewModel as Preview.PreflightViewModel).PreviewCancelButtonVisible = ShowCancel == true ? true : false; (PreviewViewModel as Preview.PreflightViewModel).CenterTitle = CenterTitle; (PreviewViewModel as Preview.PreflightViewModel).Title = Title; (PreviewViewModel as Preview.PreflightViewModel).WindowHeight = SelectedSize; break; } }
public void Handle(ChangeUI message) { switch (message.Type) { case "AppTreeChange": (ModelClass as SoftwareRef).CheckStyle = GetCheckStyle(); (ModelClass as SoftwareRef).IconStyle = GetIconStyle(); break; case "SoftwareChange": (ModelClass as SoftwareRef).Label = GetSoftwareLabel((ModelClass as SoftwareRef).Id); break; } }
public void Handle(ChangeUI message) { switch (message.Type) { case "ImportComplete": (PreviewViewModel as Preview.InfoViewModel).InfoViewText = Content; (PreviewViewModel as Preview.InfoViewModel).Title = Title; (PreviewViewModel as Preview.InfoViewModel).PreviewBackButtonVisible = ShowBack == true ? true : false; (PreviewViewModel as Preview.InfoViewModel).PreviewCancelButtonVisible = ShowCancel == true ? true : false; (PreviewViewModel as Preview.InfoViewModel).CenterTitle = CenterTitle; (PreviewViewModel as Preview.InfoViewModel).Image = Image; (PreviewViewModel as Preview.InfoViewModel).InfoImage = InfoImage; (PreviewViewModel as Preview.InfoViewModel).InfoViewText = Content; break; } }
public void Handle(ChangeUI message) { switch (message.Type) { case "ImportComplete": (PreviewViewModel as Preview.AppTreeViewModel).PreviewBackButtonVisible = ShowBack; (PreviewViewModel as Preview.AppTreeViewModel).PreviewCancelButtonVisible = ShowCancel; (PreviewViewModel as Preview.AppTreeViewModel).Title = Title; (PreviewViewModel as Preview.AppTreeViewModel).CenterTitle = CenterTitle; if (null != SelectedSize) { (PreviewViewModel as Preview.AppTreeViewModel).WindowHeight = SelectedSize; } break; } }
public void SetNewLog(string loadTime, string dicription, int projectId) { LogDto newLog = new LogDto(); newLog.Date = DateTime.Today.ToString(); newLog.LoadTime = loadTime; newLog.Description = dicription; newLog.ComputerName = Environment.MachineName; newLog.UserName = Environment.UserName; newLog.ProjectId = projectId; context.LogsDto.Add(newLog); context.SaveChanges(); ChangeUI?.Invoke(this); }
void Start() { changeUIComponent = (ChangeUI)gameObject.GetComponent<ChangeUI>(); }
public Threads(ChangeUI ui) { this.ui = ui; }
public _Threads(ChangeUI ui) { _ui = ui; }
public Threads(ChangeUI ui) { _ui = ui; }