Exemplo n.º 1
0
        public static void CreateDialogControlsForCommand(Type commandType, ExolutioObject scopeObject, ProjectVersion projectVersion, StackPanel stackPanel, out List <Control> controls)
        {
            CommandDescriptor commandDescriptior = PublicCommandsHelper.GetCommandDescriptor(commandType);

            commandDescriptior.ScopeObject = scopeObject;
            controls = OperationParametersControlCreator.CreateControls
                           (commandDescriptior, projectVersion);

            int  tabOrder   = 0;
            bool foundFirst = false;

            foreach (Control control in controls)
            {
                if (control is ScopePropertyEditor)
                {
                    ((ScopePropertyEditor)control).Value = scopeObject;
                }
                if (!foundFirst && !(control is System.Windows.Controls.Label))
                {
                    control.Focus();
                    foundFirst = true;
                }
                control.TabIndex            = tabOrder++;
                control.HorizontalAlignment = HorizontalAlignment.Left;
                control.Margin = new Thickness(0, 0, 0, 5);
                if (control is System.Windows.Controls.Label)
                {
                    control.Margin = new Thickness(0, 5, 0, 5);
                }
                control.MinWidth = 180;
                stackPanel.Children.Add(control);
            }
        }
Exemplo n.º 2
0
 public IEnumerator<KeyValuePair<IVersionedItem, IVersionedItem>> GetEnumerator()
 {
     foreach (KeyValuePair<Guid, Guid> keyValuePair in copyDictionaryGuid)
     {
         ExolutioObject objectKey = SourceProject.TranslateComponent<ExolutioObject>(keyValuePair.Key);
         if (objectKey is ProjectVersion)
         {
             continue;
         }
         ExolutioObject objectValue = TargetProject.TranslateComponent<ExolutioObject>(keyValuePair.Value);
         if (objectKey.GetType() != objectValue.GetType())
         {
             throw new ExolutioModelException();
         }
         IVersionedItem keyItem = (IVersionedItem) objectKey;
         IVersionedItem valueItem = (IVersionedItem) objectValue;
         yield return new KeyValuePair<IVersionedItem, IVersionedItem>(keyItem, valueItem);
     }
 }
Exemplo n.º 3
0
        internal override PropagationMacroCommand PostPropagation()
        {
            PropagationMacroCommand command = new PropagationMacroCommand(Controller)
            {
                CheckFirstOnlyInCanExecute = true
            };
            ExolutioObject component = Project.TranslateComponent(NamedComponentGuid);

            if (component is PIMComponent)
            {
                PIMComponent pimComponent = (PIMComponent)component;
                foreach (PSMComponent psmComponent in pimComponent.GetInterpretedComponents())
                {
                    if (psmComponent.IsNamed && psmComponent.Name == oldname)
                    {
                        command.Commands.Add(new acmdRenameComponent(Controller, psmComponent, NewName));
                    }
                }
            }

            return(command);
        }
Exemplo n.º 4
0
 private static void CheckExolutioObject(ExolutioObject exolutioObject)
 {
     Assert.AreNotEqual(exolutioObject, Guid.Empty);
     Assert.IsNotNull(exolutioObject.Project);
 }
Exemplo n.º 5
0
 public void PrepareGuid(ExolutioObject exolutioObject)
 {
     Guid copyGuid = KeepGuids ? exolutioObject.ID : Guid.NewGuid();
     copyDictionaryGuid[exolutioObject.ID] = copyGuid;
 }