Exemple #1
0
        /*
         * qui ho lo schermo per
         */
        //private readonly LavorazioneViewModel _lavorazioneViewModel;

        //private readonly EditStageTreeViewItem _stageInputProfile;
        //private readonly EditStageTreeViewItem _stageParametriLavorazione;

        /*
         * faccio 5 costruttori ??
         *
         * faccio metodo che da operazione fa viewmodel
         * listviewmodel
         * metodo per screen parametri lavorazione
         */

        public ForaturaCommonViewModel(DrillBaseClass foraturaBaseClass)
            : base(foraturaBaseClass)
        {
            _foratura = foraturaBaseClass;

            //    StageOperazioni = new ForaturaCommonOperazioniViewModel(foraturaBaseClass, this);

            if (!_foratura.ForaturaCentraleTornio)
            {
                _foraturaPatternSelectionViewModel = new ForaturaPatternSelectionViewModel(foraturaBaseClass, this);
            }

            _foraturaParametriViewModel = GetParameterViewModel(foraturaBaseClass);

            TreeView.Add(_foraturaParametriViewModel);

            if (_foraturaPatternSelectionViewModel != null)
            {
                TreeView.Add(_foraturaPatternSelectionViewModel);
            }

            //   TreeView.Add(StageOperazioni);

            Initialize();
        }
        public TornituraSfacciaturaViewModel(TornituraSfacciatura sfacciatura)
            : base(sfacciatura)
        {
            _stageParameter = new SfacciaturaParametriViewModel(sfacciatura, this);

            TreeView.Add(_stageParameter);

            Initialize();
        }
        //private readonly EditStageTreeViewItem _stageParametriLavorazione;

        //   private readonly EditStageTreeViewItem _patternStage;

        public TornituraScanalaturaViewModel(TornituraScanalatura scanalatura)
            : base(scanalatura)
        {
            _parameterStage = new TornituraScanalaturaCommonViewModel(scanalatura, this);

            TreeView.Add(_parameterStage);

            Initialize();
        }
        //private readonly EditStageTreeViewItem _stageParametriLavorazione;

        public TornituraProfiloLiberoViewModel(Model.ConversationalStructure.Lavorazioni.Tornitura.Tornitura tornitura)
            : base(tornitura)
        {
            _stageInputProfile = new ProfileEditorViewModel(tornitura.Profile, this, ProfileEditorViewModel.AxisSystem.Xz);

            TreeView.Add(_stageInputProfile);

            Initialize();
        }
Exemple #5
0
        public TornituraFilettaturaViewModel(TornituraFilettatura scanalatura)
            : base(scanalatura)
        {
            _parameterStage = new TornituraFilettaturaParametriViewModel(scanalatura, this);

            TreeView.Add(_parameterStage);

            Initialize();
        }
Exemple #6
0
        /// <summary>
        /// Adds the specified tree node as the last child of the given parent node if the nodes implement ITreeNode.
        /// </summary>
        public static void Add(this TreeView treeView, TreeNode parentNode, TreeNode nodeToAdd)
        {
            ArgumentNullException.ThrowIfNull(parentNode, nameof(parentNode));

            if (GetRelatedObject(parentNode) is ITreeNode parentObj &&
                GetRelatedObject(nodeToAdd) is ITreeNode objToAdd)
            {
                objToAdd.Parent = parentObj;
                treeView.Add(parentNode, nodeToAdd, parentObj.Children, objToAdd);
            }
        }
Exemple #7
0
        /// <summary>
        /// Добавить узел в конец списка дочерних узлов заданного родительского узла
        /// </summary>
        /// <remarks>Аргумент parentNode не может быть равен null</remarks>
        public static void Add(this TreeView treeView, TreeNode parentNode, TreeNode nodeToAdd)
        {
            if (parentNode == null)
            {
                throw new ArgumentNullException("parentNode");
            }

            if (parentNode.Tag is ITreeNode)
            {
                treeView.Add(parentNode, (ITreeNode)parentNode.Tag, nodeToAdd);
            }
        }
        public SpianaturaViewModel(Model.ConversationalStructure.Lavorazioni.Fresatura.Spianatura spianatura)
            : base(spianatura)
        {
            // StageOperazioni = new SpianaturaOperazioni(spianatura, this);

            _spianaturaParametriViewModel = new SpianaturaParametriViewModel(this, spianatura);

            TreeView.Add(_spianaturaParametriViewModel);

            // TreeView.Add(StageOperazioni);

            Initialize();
        }
 /// <summary>
 /// Clears and updates the treeview for Spells. Typically called as part of AddQuality or UpdateCharacterInfo.
 /// </summary>
 /// <param name="treSpells">Treenode that will be cleared and populated.</param>
 /// <param name="cmsSpell">ContextMenuStrip that will be added to each power.</param>
 protected static void RefreshSpells(TreeView treSpells, ContextMenuStrip cmsSpell, Character _objCharacter)
 {
     //Clear the default nodes of entries.
     foreach (TreeNode objNode in treSpells.Nodes)
     {
         objNode.Nodes.Clear();
     }
     //Add the Spells that exist.
     foreach (Spell s in _objCharacter.Spells)
     {
         treSpells.Add(s, cmsSpell);
     }
 }
Exemple #10
0
        /// <summary>
        /// Добавить узел в конец списка дочерних узлов заданного родительского узла
        /// </summary>
        /// <remarks>Аргумент parentNode не может быть равен null</remarks>
        public static void Add(this TreeView treeView, TreeNode parentNode, TreeNode nodeToAdd)
        {
            if (parentNode == null)
            {
                throw new ArgumentNullException("parentNode");
            }

            if (GetRelatedObject(parentNode) is ITreeNode parentObj &&
                GetRelatedObject(nodeToAdd) is ITreeNode objToAdd)
            {
                treeView.Add(parentNode, nodeToAdd, parentObj.Children, objToAdd);
            }
        }
Exemple #11
0
        public FresaturaLatoViewModel(Model.ConversationalStructure.Lavorazioni.Fresatura.FresaturaLato fresaturaLato)
            : base(fresaturaLato)
        {
            //  StageOperazioni = new CommonMillOperationViewModel(fresaturaLato, this);

            _spianaturaParametriViewModel = new FresaturaLatoParametriViewModel(this, fresaturaLato);

            TreeView.Add(_spianaturaParametriViewModel);

            //   TreeView.Add(StageOperazioni);

            Initialize();
        }
        public FresaturaCavaViewModel(FresaturaCava fresaturaContornatura)
            : base(fresaturaContornatura)
        {
            _fresaturaContornatura = fresaturaContornatura;

            _millingPatternSelectionViewModel = new MillingPatternSelectionViewModel(_fresaturaContornatura, this);

            _parametriViewModel = new FresaturaCavaParametriViewModel(fresaturaContornatura, this);

            TreeView.Add(_millingPatternSelectionViewModel);

            TreeView.Add(_parametriViewModel);

            Initialize();
        }
        /// <summary>
        /// Clears and updates the treeview for Spells. Typically called as part of AddQuality or UpdateCharacterInfo.
        /// </summary>
        /// <param name="treSpells">Treenode that will be cleared and populated.</param>
        /// <param name="cmsSpell">ContextMenuStrip that will be added to each power.</param>
        protected static void RefreshSpells(TreeView treSpells, ContextMenuStrip cmsSpell, Character _objCharacter, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs = null)
        {
            if (notifyCollectionChangedEventArgs == null)
            {
                //Clear the default nodes of entries.
                foreach (TreeNode objNode in treSpells.Nodes)
                {
                    objNode.Nodes.Clear();
                }
                //Add the Spells that exist.
                foreach (Spell objSpell in _objCharacter.Spells)
                {
                    treSpells.Add(objSpell, cmsSpell);
                }
            }
            else
            {
                switch (notifyCollectionChangedEventArgs.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (Spell objSpell in notifyCollectionChangedEventArgs.NewItems)
                    {
                        treSpells.Add(objSpell, cmsSpell);
                    }
                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (Spell objSpell in notifyCollectionChangedEventArgs.OldItems)
                    {
                        TreeNode t = treSpells.FindNode(objSpell.InternalId);
                        treSpells.Nodes.Remove(t);
                    }
                    break;
                }
            }
        }
        public ScanalaturaChiusaViewModel(FresaturaScanalaturaChiusa fresaturaScanalaturaChiusa)
            : base(fresaturaScanalaturaChiusa)
        {
            _fresaturaScanalaturaChiusa = fresaturaScanalaturaChiusa;

            _millingPatternSelectionViewModel = new MillingPatternSelectionViewModel(_fresaturaScanalaturaChiusa, this);

            _contornaturaParametriViewModel = new ScanalaturaChiusaParametriViewModel(fresaturaScanalaturaChiusa, this);

            TreeView.Add(_millingPatternSelectionViewModel);

            TreeView.Add(_contornaturaParametriViewModel);

            Initialize();
        }
        public TextEngravingViewModel(TextEngravingModel fresaturaContornatura)
            : base(fresaturaContornatura)
        {
            _fresaturaContornatura = fresaturaContornatura;

            /* Stage Vuoto*/
            // StageOperazioni = new EditStageTreeViewItem("Operation", this);

            _contornaturaParametriViewModel = new TextEngravingParametriViewModel(fresaturaContornatura, this);

            TreeView.Add(_contornaturaParametriViewModel);

            //  TreeView.Add(StageOperazioni);

            Initialize();
        }
        public FresaturaFilettaturaViewModel(FresaturaFilettatura fresaturaFilettatura)
            : base(fresaturaFilettatura)
        {
            _fresaturaFilettatura = fresaturaFilettatura;

            _foraturaPatternSelectionViewModel = new ForaturaPatternSelectionViewModel(fresaturaFilettatura, this);

            _contornaturaParametriViewModel = new FresaturaFilettaturaParametriViewModel(fresaturaFilettatura, this);

            TreeView.Add(_contornaturaParametriViewModel);

            TreeView.Add(_foraturaPatternSelectionViewModel);


            //TreeView.Add(_stageInputProfile);
            //      TreeView.Add(StageOperazioni);

            Initialize();
        }
 private void OnMaterialCreated(Material material)
 {
     TreeView.Add(material);
     TreeView.SelectedItem = material;
     TreeView.ScrollIntoView(material);
 }
 private void OnMaterialAdded(Material material)
 {
     TreeView.Add(material);
 }