Exemplo n.º 1
0
        public void CreateAssetConfigs()
        {
            RaiseAssetImport_Begin();

            try
            {
                MOG_Project proj = MOG_ControllerProject.GetProject();
                if (proj != null)
                {
                    ProgressDialog progress = new ProgressDialog("Importing Assets", "Please wait while the Assets are imported into the Project's Repository.", CreateAssetConfigs_Worker, null, true);
                    progress.ShowDialog();

                    // Post the projects new assets skipping the PostScanProcess
                    MOG_ControllerProject.PostAssets(MOG_ControllerProject.GetProjectName(), MOG_ControllerProject.GetBranchName(), MOG_ControllerProject.GetProjectName(), true);
                }
            }
            catch (Exception e)
            {
                MOG_Report.ReportMessage("Unable to import asset", e.Message, e.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL);
            }
            finally
            {
                RaiseAssetImport_Finish();
            }
        }
        private void OKButton_Click(object sender, System.EventArgs e)
        {
            if (this.NewClassificationTextBox.Text == null || this.NewClassificationTextBox.Text.Length < 1)
            {
                MessageBox.Show(this, "Please enter a valid classification name, or click 'Cancel' "
                                + "to close the dialog.", "No classification name found!",
                                MessageBoxButtons.OK);
                return;
            }

            if (this.FullClassificationNameTextBox.Text.IndexOf("{") > -1 ||
                this.FullClassificationNameTextBox.Text.IndexOf("}") > -1)
            {
                MessageBox.Show(this, "Invalid character (for Classification), '{' and/or '}', detected.\r\n\r\n"
                                + "Classification name:\r\n" + this.FullClassificationNameTextBox.Text,
                                "Invalid Character(s) for Classification Name Found!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.CurrentClassificationTextBox.Text  = this.CurrentClassificationTextBox.Text.Replace("{", "");
                this.CurrentClassificationTextBox.Text  = this.CurrentClassificationTextBox.Text.Replace("}", "");
                this.FullClassificationNameTextBox.Text = this.FullClassificationNameTextBox.Text.Replace("{", "");
                this.FullClassificationNameTextBox.Text = this.FullClassificationNameTextBox.Text.Replace("}", "");
                return;
            }

            MOG_Project project = MOG_ControllerProject.GetProject();

            project.ClassificationAdd(FullClassificationNameTextBox.Text);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 3
0
        public ConfigureProjectForm(MOG_Project project)
        {
            InitializeComponent();

            this.project = project;

            this.Text = "Project Configuration - Project: " + project.GetProjectName() + "     ( Branch: " + MOG_ControllerProject.GetBranchName() + " )";

            // project info
            this.projectInfoControl1.LoadFromProject(project);

            // platforms
            this.platformEditor.LoadDefaults();
            this.platformEditor.LoadFromProject(project);

            //departments
            departmentManager.LoadFromProject(project);

            // users
            this.userManager.LoadFromProject(project);

            // Privileges
            MOG_ControllerProject.RefreshPrivileges();
            this.MogControl_Privileges.Initialize_Control(MOG_ControllerProject.GetPrivileges());

            // asset classes
            this.assetClassificationConfigControl1.LoadProjectClassifications2(project);
            //this.assetClassificationConfigControl1.LoadProjectClassifications(project);
        }
Exemplo n.º 4
0
        public PackageCreator()
        {
            InitializeComponent();

            // Make sure we are not in the designer / DesignMode
            //if (GetService(typeof(System.ComponentModel.Design.IDesignerHost)) == null)
            if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
            {
                MOG_Project project = MOG_ControllerProject.GetProject();
                if (project != null)
                {
                    PlatformCombo.Items.Add("All");
                    PlatformCombo.SelectedIndex = 0;

                    foreach (MOG_Platform platform in project.GetPlatforms())
                    {
                        PlatformCombo.Items.Add(platform.mPlatformName);
                    }

                    PlatformCombo.Items.Add(MOG_ControllerProject.GetAllPlatformsString());

                    ClassificationTreeView.Initialize(DrillToClassification);
                    SyncTargetTreeView.InitializeVirtual(Platform);

                    PlatformCombo.BackColor = Color.PaleGreen;
                }
            }

            IsTextBoxValid(this.PackageNameTextBox);
            IsTextBoxValid(this.SyncTargetTextBox);
            IsTextBoxValid(this.ClassificationTextBox);
        }
Exemplo n.º 5
0
        public bool ToolNewerCheck(MOG_Filename mogAsset, string version, MOG_Project pProject, ref string failedString)
        {
            MOG_Time assetTime        = new MOG_Time(version);
            MOG_Time correctAssetTime = new MOG_Time();

            DirectoryInfo [] dirs = DosUtils.DirectoryGetList(MOG_ControllerRepository.GetAssetBlessedPath(mogAsset).GetEncodedFilename(), "*.*");

            if (dirs != null)
            {
                foreach (DirectoryInfo dir in dirs)
                {
                    string   checkVersion = dir.Name.Substring(dir.Name.LastIndexOf(".") + 1);
                    MOG_Time dirTime      = new MOG_Time(checkVersion);

                    // Is this asset equal or newer than this dir version?
                    if (assetTime.Compare(dirTime) < 0)
                    {
                        failedString = "Out of date," + failedString;
                        return(false);
                    }
                }
            }

            return(true);
        }
        private TreeNode CreateProjectNode(MOG_Project pProject)
        {
            TreeNode project = CreateNode(pProject.GetProjectName(), "Project", new RemoteSettings());

            // Load all the branches of each project
            ArrayList branches = MOG_DBProjectAPI.GetAllBranchNames(pProject.GetProjectName());

            if (branches != null)
            {
                TreeNode branchNode = CreateNode("Branches", "Branches", new RemoteSettings());
                foreach (MOG_DBBranchInfo branch in branches)
                {
                    branchNode.Nodes.Add(CreateNode(branch.mBranchName, "Branch", new RemoteSettings()));
                }

                project.Nodes.Add(branchNode);
            }

            // Load all the users of the project
            LoadProjectUsers(pProject, project);

            // Load all the tool directories
            // Load misc

            return(project);
        }
Exemplo n.º 7
0
        public AssetConfigureForm(MOG_Project proj)
        {
            InitializeComponent();

            this.project = proj;
            this.project.SetProjectName(this.project.GetProjectName());
        }
Exemplo n.º 8
0
        private void btnCreate_Click(object sender, System.EventArgs e)
        {
            if (!DuplicateProjectNameCheck(this.projectInfoControl.ProjectName, true))
            {
                this.projectInfoControl.FocusProjectName();
                return;
            }

            if (this.executeCreate)
            {
                MOG_Project proj = CreateProject(true);
                if (proj == null)
                {
                    // If project creation failed, return
                    return;
                }

                MOG_ControllerProject.LoginProject(proj.GetProjectName(), "");

                try
                {
                    Hide();
                    ConfigureProjectWizardForm wiz = new ConfigureProjectWizardForm(proj);
                    wiz.ShowDialog(this);
                }
                catch (Exception ex)
                {
                    MOG_Prompt.PromptResponse("Configure Error", ex.Message, ex.StackTrace, MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
                }
            }

            this.DialogResult = DialogResult.OK;
            Hide();
        }
Exemplo n.º 9
0
        public void SaveChanges()
        {
            MOG_Project proj = MOG_ControllerProject.GetProject();

            if (proj != null)
            {
                // removed nodes
                foreach (classTreeNode tn in this.removedClasses)
                {
                    proj.ClassificationRemove(tn.props.Classification);
                }
                this.removedClasses.Clear();

                // new nodes
                foreach (classTreeNode tn in this.newClasses)
                {
                    if (!tn.IsAssetFilenameNode)
                    {
                        tn.props.Classification = tn.FullPath;
                        proj.ClassificationAdd(tn.FullPath);
                    }
                }
                this.newClasses.Clear();

                SaveConfigTree(this.tvClassifications.Nodes, proj);
            }
        }
Exemplo n.º 10
0
        public EditUserForm(MOGUserManager userManager, MOG_Project project, MOG_Privileges privileges, MOG_User user)
        {
            mProject     = project;
            mUserManager = userManager;
            mUser        = user;
            mPrivileges  = privileges;

            InitializeComponent();
        }
Exemplo n.º 11
0
        private void AddNewClasses_Worker(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker   worker       = sender as BackgroundWorker;
            TreeNodeCollection nodes        = e.Argument as TreeNodeCollection;
            int         classificationTotal = CountClassifications_Recursive(nodes);
            MOG_Project project             = MOG_ControllerProject.GetProject();

            AddNewClasses(worker, 0, classificationTotal, project, nodes);
        }
Exemplo n.º 12
0
        public bool ToolExistsCheck(MOG_Filename mogAsset, string version, MOG_Project pProject, ref string failedString)
        {
            if (!Directory.Exists(MOG_ControllerRepository.GetAssetBlessedVersionPath(mogAsset, version).GetEncodedFilename()))
            {
                failedString = "Doesn't exist," + failedString;
                return(false);
            }

            return(true);
        }
Exemplo n.º 13
0
        public void LoadFromProject(MOG_Project project)
        {
            this.tbProjectName.Text = project.GetProjectName();
            this.tbProjectNameInSourceControl.Text = project.GetProjectName();
            this.tbProjectKey.Text  = project.GetProjectName();
            this.tbProjectPath.Text = project.GetProjectPath();
            this.tbBuildTool.Text   = "UNKNOWN";

            this.projectsPath = Path.GetDirectoryName(project.GetProjectPath());
        }
Exemplo n.º 14
0
        public void LoadFromProject(MOG_Project proj)
        {
            lvPlatforms.Clear();

            // Loop and add 'em
            foreach (MOG_Platform platform in proj.GetPlatforms())
            {
                AddPlatform(platform);
            }
        }
Exemplo n.º 15
0
        public void LoadProjectClasses(MOG_Project proj)
        {
            this.tvClasses.Nodes.Clear();

            foreach (string rootClassName in proj.GetRootClassificationNames())
            {
                imTreeNode rootNode = LoadProjectClasses_Helper(proj, rootClassName);
                this.tvClasses.Nodes.Add(rootNode);
                rootNode.Expand();
            }
        }
Exemplo n.º 16
0
 public void LoadClassesFromProject(MOG_Project proj)
 {
     this.classLoadType             = CLASS_LOAD_TYPE.PROJECT;
     this.lblTemplatesLabel.Enabled = false;
     this.lblTemplatesLabel.Hide();
     this.cbClassTemplates.Items.Clear();
     this.cbClassTemplates.Text    = "";
     this.cbClassTemplates.Enabled = false;
     this.cbClassTemplates.Hide();
     this.tvAssets.LoadClassesFromProject(proj);
 }
Exemplo n.º 17
0
        private classTreeNode BuildClassificationTree_Helper(string className, MOG_Project proj)
        {
            // create a new class treenode
            classTreeNode classNode = new classTreeNode(className.Substring(className.LastIndexOf("~") + 1));                   // extract only last part of the name

            foreach (string subclassName in proj.GetSubClassificationNames(className))
            {
                classNode.Nodes.Add(BuildClassificationTree_Helper(className + "~" + subclassName, proj));
            }

            return(classNode);
        }
Exemplo n.º 18
0
        private ArrayList BuildClassificationTree(MOG_Project proj)
        {
            ArrayList nodeList = new ArrayList();

            foreach (string rootName in proj.GetRootClassificationNames())
            {
                classTreeNode rootNode = BuildClassificationTree_Helper(rootName, proj);
                nodeList.Add(rootNode);
            }

            return(nodeList);
        }
Exemplo n.º 19
0
        public void LoadFromProject(MOG_Project project)
        {
            mProject = project;

            foreach (MOG_UserDepartment department in project.GetUserDepartments())
            {
                AddDepartment(department.mDepartmentName);
            }

            foreach (ColumnHeader column in DepartmentList.Columns)
            {
                column.Width = DepartmentList.Width - 1;
            }
        }
Exemplo n.º 20
0
        public FileImportForm(MOG_Project proj)
        {
            InitializeComponent();

            this.project = proj;

            this.assetImportPlacer.ProjectName = proj.GetProjectName();
            this.assetImportPlacer.Platforms   = new ArrayList(proj.GetPlatformNames());
            this.assetImportPlacer.LoadClassesFromProject(proj);

            // Hook up events
            this.assetImportPlacer.Event_LoadingDirectories     += new EventHandler(assetImportPlacer_Event_LoadingDirectories);
            this.assetImportPlacer.Event_DoneLoadingDirectories += new EventHandler(assetImportPlacer_Event_DoneLoadingDirectories);
        }
Exemplo n.º 21
0
        private void LoadProjects(TreeNode root)
        {
            // Clear all the projects
            //this.lvProjects.Items.Clear();

            // Get all the projects listed in the mog system
            foreach (string projectName in MOG_ControllerSystem.GetSystem().GetProjectNames())
            {
                MOG_Project pProject = MOG_ControllerSystem.GetSystem().GetProject(projectName);
                if (pProject != null)
                {
                    root.Nodes.Add(CreateProjectNode(pProject));
                }
            }
        }
Exemplo n.º 22
0
        private void CreateAllExtantClasses_Helper(MOG_Project proj, classTreeNode ctn)
        {
            if (ctn == null || ctn.TreeView == null)
            {
                return;
            }

            string fullClass = ctn.FullPath.Replace(ctn.TreeView.PathSeparator, "~");

            proj.ClassificationAdd(fullClass);

            foreach (classTreeNode subNode in ctn.Nodes)
            {
                CreateAllExtantClasses_Helper(proj, subNode);
            }
        }
Exemplo n.º 23
0
        public void CreateAll()
        {
            MOG_Project proj = MOG_ControllerProject.GetProject();

            if (proj != null)
            {
                foreach (classTreeNode tn in BuildAllClassNodesList(this.tvClassifications.Nodes))
                {
                    if (!tn.IsAssetFilenameNode)
                    {
                        proj.ClassificationAdd(tn.FullPath);
                        MOG_Properties props = new MOG_Properties(tn.FullPath);
                        props.SetProperties(tn.props.GetPropertyList());
                    }
                }
            }
        }
Exemplo n.º 24
0
        public void LoadFromProject(MOG_Project project)
        {
            mProject = project;

            lvUsers.Items.Clear();

            foreach (MOG_User user in project.GetUsers())
            {
                AddUser(user, mPrivileges.GetUserGroup(user.GetUserName()));
            }

            // Load up the SMTP server
            if (project.GetConfigFile().KeyExist("PROJECT", "EmailSmtp"))
            {
                tbEmailSMTP.Text = project.GetConfigFile().GetString("PROJECT", "EmailSmtp");
            }
        }
Exemplo n.º 25
0
        private imTreeNode LoadProjectClasses_Helper(MOG_Project proj, string baseClass)
        {
            string baseClassName = baseClass;

            if (baseClassName.IndexOf("~") != -1)
            {
                baseClassName = baseClass.Substring(baseClass.LastIndexOf("~") + 1);
            }

            imTreeNode node = new imTreeNode(baseClassName, "class");

            foreach (string className in proj.GetSubClassificationNames(baseClass))
            {
                node.Nodes.Add(LoadProjectClasses_Helper(proj, baseClass + "~" + className));
            }

            return(node);
        }
Exemplo n.º 26
0
        private void SaveConfigTree(TreeNodeCollection nodes, MOG_Project proj)
        {
            if (nodes == null || proj == null)
            {
                return;
            }

            foreach (classTreeNode tn in nodes)
            {
                if (!tn.IsAssetFilenameNode)
                {
                    //tn.props.SetClassification(tn.FullPath);
                    //proj.ClassificationUpdate(tn.props);

                    SaveConfigTree(tn.Nodes, proj);
                }
            }
        }
Exemplo n.º 27
0
        private void LoadProjectUsers(MOG_Project pProject, TreeNode project)
        {
            SortedList <string, List <string> > departments = new SortedList <string, List <string> >();

            // Add all the users to the AssignTo subMenu
            ArrayList users = pProject.GetUsers();

            if (users != null)
            {
                TreeNode Users = CreateNode("Users", "Users", new RemoteSettings());

                for (int u = 0; u < users.Count; u++)
                {
                    MOG_User user = (MOG_User)users[u];

                    // Does this department exist?
                    if (departments.ContainsKey(user.GetUserDepartment().ToLower()) == false)
                    {
                        // No, then add it with the user
                        List <string> userList = new List <string>();
                        userList.Add(user.GetUserName());

                        departments.Add(user.GetUserDepartment().ToLower(), userList);
                    }
                    else
                    {
                        // yup, its already there so add this user to the array
                        departments[user.GetUserDepartment().ToLower()].Add(user.GetUserName());
                    }
                }

                foreach (string department in departments.Keys)
                {
                    TreeNode departmentNode = CreateNode(department, "Users", new RemoteSettings());
                    foreach (string userName in departments[department])
                    {
                        departmentNode.Nodes.Add(CreateNode(userName, "User", new RemoteSettings()));
                    }
                    Users.Nodes.Add(departmentNode);
                }

                project.Nodes.Add(Users);
            }
        }
Exemplo n.º 28
0
        public override void Initialize(MethodInvoker OnInitializeDone)
        {
            this.OnInitializeDone = OnInitializeDone;

            UseWaitCursor = true;
            Nodes.Clear();

            //Before we do anything here we need to make sure there is going to be a library classification
            string classification = MOG_Filename.GetProjectLibraryClassificationString();

            if (classification.Length > 0)
            {
                //Before we do anything here we need to make sure there is going to be a library classification
                MOG_Project project = MOG_ControllerProject.GetProject();
                if (project != null)
                {
                    if (!project.ClassificationExists(classification))
                    {
                        //Oh no there's not one!  No big deal, just create it.
                        if (project.ClassificationAdd(classification))
                        {
                            MOG_Properties props = MOG_Properties.OpenClassificationProperties(classification);
                            if (props != null)
                            {
                                // This is a library
                                props.IsLibrary = true;

                                props.AssetIcon = "Images\\FileTypes\\MOG Library.bmp";
                                props.ClassIcon = "Images\\FileTypes\\MOG Library Folder.bmp";

                                // And we want to checkout all assets to a dir under the project name
                                props.SyncTargetPath = "{AssetClassificationPath.Full}";
                                props.Close();
                            }
                        }
                    }
                }
            }
            mWorker                     = new BackgroundWorker();
            mWorker.DoWork             += InitializeLibraryClassificationList_Worker;
            mWorker.RunWorkerCompleted += OnWorkerCompleted;

            mWorker.RunWorkerAsync();
        }
Exemplo n.º 29
0
        internal static List <string> GetDepartments(string projectname)
        {
            List <string> departments = new List <string>();

            MOG_Project project = MOG_ControllerSystem.GetSystem().GetProject(projectname);

            if (project != null)
            {
                foreach (MOG_User user in project.GetUsers())
                {
                    if (departments.Contains(user.GetUserDepartment()) == false)
                    {
                        departments.Add(user.GetUserDepartment());
                    }
                }
            }

            return(departments);
        }
Exemplo n.º 30
0
        public void LoadProjectClassifications2(MOG_Project proj)
        {
            if (proj != null)
            {
                this.tvClassifications.Nodes.Clear();
                this.newClasses.Clear();

                this.imageList      = new ImageList();
                this.imageArrayList = new ArrayList();

                this.tvClassifications.Enabled = true;


                foreach (string rootClassName in proj.GetRootClassificationNames())
                {
                    classTreeNode rootClassNode = new classTreeNode(rootClassName);
                    if (proj.GetSubClassificationNames(rootClassName).Count > 0)
                    {
                        rootClassNode.Nodes.Add(new classTreeNode("DUMMY_NODE"));
                    }

                    this.tvClassifications.Nodes.Add(rootClassNode);
                }

                // setup events
                this.tvClassifications.MouseDown    -= new MouseEventHandler(tvClassifications_MouseDown);
                this.tvClassifications.MouseDown    += new MouseEventHandler(tvClassifications_MouseDown2);
                this.tvClassifications.AfterSelect  += new TreeViewEventHandler(tvClassifications_AfterSelect2);
                this.tvClassifications.BeforeExpand += new TreeViewCancelEventHandler(tvClassifications_BeforeExpand);

                // expand the first level of nodes
                foreach (TreeNode tn in this.tvClassifications.Nodes)
                {
                    tn.Expand();
                }
            }
            else
            {
                // disable everything
                this.tvClassifications.Nodes.Add(new classTreeNode("<NO CURRENT PROJECT>"));
                this.tvClassifications.Enabled = false;
            }
        }