public Load(Controllers.Controller c, Autodesk.Revit.UI.UIApplication uiApp, string filename = null)
        {
            InitializeComponent();
            _controller = c;
            //_controller.View = this;
            _uiApp = uiApp;

            //register for idling callback
            _uiApp.Idling += _uiApp_Idling;
            _action        = ActionEnum.None;

            btn_Generate.Enabled = false;
            cbColorBy.Items.Add("Diameter");
            cbColorBy.Items.Add("Airflow");
            cbColorBy.SelectedIndex = 0;

            try
            {
                if (filename != null)
                {
                    loadResults(filename);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Loading Issue: " + ex.GetType().Name + ": " + ex.Message);
            }

            cartesianChart1.DataClick += CartesianChart1_DataClick;
        }
 public CatalogProducts()
 {
     InitializeComponent();
     try
     {
         Controllers.Controller controller = new Controllers.Controller();
         lb_products.ItemsSource = controller.Viewers;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        public AddOrChanger(Controllers.Viewer viewer)
        {
            InitializeComponent();
            cb_box.ItemsSource    = new DB.ProductServiceEntities().Manufacters.ToList();
            cb_retail.ItemsSource = new string[] { "активен", "неактивен" };
            Controllers.Controller controller = new Controllers.Controller(viewer);
            stack.DataContext = controller.Product;



            cb_retail.SelectedItem = (cb_retail.ItemsSource as string[]).Single(x => x == controller.Product.Status);

            cb_box.SelectedItem = (cb_box.ItemsSource as List <DB.Manufacters>).Single(x => x.IdManufacter == controller.Product.IdManufacter);
        }
        public CreateForm(Controllers.Controller c, Objects.Solution sol, IList <Objects.Node> nodes)
        {
            InitializeComponent();
            _controller = c;
            _nodes      = nodes;
            _sol        = sol;

            var ductSystems = Controllers.MEPController.GetDuctSystemTypes(c.GetDocument());

            cbSystem.Items.AddRange(ductSystems.ToArray());
            cbDuctTypes.Items.AddRange(Controllers.MEPController.GetDuctTypes(c.GetDocument(), Controllers.MEPController.DuctShapeEnum.Round).ToArray());


            cbSystem.SelectedItem     = ductSystems.FirstOrDefault(s => s.Name.ToUpper().Contains("SUPPLY"));
            cbDuctTypes.SelectedIndex = 0;
        }
        private void Btn_edit_Click(object sender, RoutedEventArgs e)
        {
            var tp = e.OriginalSource as Button;


            var bt = e.OriginalSource as Button;

            var product = bt.DataContext as Controllers.Viewer;

            MessageBox.Show(e.OriginalSource.ToString());

            Forms.AddOrChanger addOrChanger = new AddOrChanger(product);

            if (addOrChanger.ShowDialog() == true)
            {
                Controllers.Controller controller = new Controllers.Controller();
                lb_products.ItemsSource = controller.Viewers;
            }
        }
示例#6
0
 private void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     Controllers.Controller controller = new Controllers.Controller();
     controller.CheckLogin(UsernameBox.Text, PasswordBox.Password, this);
 }
示例#7
0
 internal void SetController(Controllers.Controller controller)
 {
     this.controller = controller;
     anim.SetBool("Controlled", controller != null);
     anim.SetBool("Control", false);
 }
示例#8
0
 public void BindController(Controller controller) /*nothing,the state is irrecoverable*/ }