Exemplo n.º 1
0
        public ComponentViewModel(BCFViewModel bcfViewModel, Dictionary <string, RevitLinkProperties> links, Dictionary <string, RevitComponent> comps, BCFHandler handler, ExternalEvent extEvent)
        {
            try
            {
                bcfView        = bcfViewModel;
                m_handler      = handler;
                m_event        = extEvent;
                linkDictionary = links;
                compDictionary = comps;

                moveComponentCommand    = new RelayCommand(param => this.MoveComponentExecuted(param));
                writeParametersCommand  = new RelayCommand(param => this.WriteParametersExecuted(param));
                applyViewCommand        = new RelayCommand(param => this.ApplyViewExecuted(param));
                highlightCommand        = new RelayCommand(param => this.HighlightExecuted(param));
                isolateCommand          = new RelayCommand(param => this.IsolateExecuted(param));
                sectionboxCommand       = new RelayCommand(param => this.SectionBoxExecuted(param));
                componentChangedCommand = new RelayCommand(param => this.ComponentChanged(param));

                RefreshComponents();
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Exemplo n.º 2
0
        public AddViewModel(BCFViewModel bcfViewModel, ExternalEvent exEvent, BCFHandler handler)
        {
            bcfView   = bcfViewModel;
            m_handler = handler;
            m_event   = exEvent;

            browseCommand   = new RelayCommand(param => this.BrowseExecuted(param));
            addCommand      = new RelayCommand(param => this.AddExecuted(param));
            snapshotCommand = new RelayCommand(param => this.SnapshotExecuted(param));
            SetSelectedMarkup();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Open Modeless Dialog
        /// </summary>
        /// <param name="uiapp"></param>
        public void ShowWindow(UIApplication uiapp)
        {
            if (mainWindow == null)
            {
                BCFHandler    handler = new BCFHandler(uiapp);
                ExternalEvent exEvent = ExternalEvent.Create(handler);

                mainWindow         = new MainWindow(exEvent, handler);
                mainWindow.Closed += WindowClosed;
                mainWindow.Show();
            }
        }
Exemplo n.º 4
0
        public WindowViewModel(ExternalEvent exEvent, BCFHandler handler)
        {
            m_event        = exEvent;
            m_handler      = handler;
            bcfViewModel   = new BCFViewModel(true);
            linkDictionary = CollectLinkInfo();
            compDictionary = CollectElementInfo();

            componentCommad         = new RelayCommand(param => this.ComponentExecuted(param));
            issueChangedCommand     = new RelayCommand(param => this.IssueChanged(param));
            componentChangedCommand = new RelayCommand(param => this.ComponentChanged(param));
            addViewCommand          = new RelayCommand(param => this.AddViewCommandExecuted(param));
        }
Exemplo n.º 5
0
        public MainWindow(ExternalEvent exEvent, BCFHandler handler)
        {
            m_event     = exEvent;
            m_handler   = handler;
            viewModel   = new WindowViewModel(m_event, m_handler);
            DataContext = viewModel;

            //get database file
            string databaseFile = DataStorageUtil.ReadLinkedDatabase(m_handler.ActiveDoc);

            if (!string.IsNullOrEmpty(databaseFile))
            {
                if (File.Exists(databaseFile))
                {
                    bool opened = viewModel.BCFView.OpenDatabase(databaseFile);
                }
            }

            InitializeComponent();
            this.Title = "SmartBCF AddIn v." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }