/// <summary> InitializeAssetIcons /// Loads all the bmp's specified in the asset declarations /// in the Project.ini files. Each bmp is added to a /// list allong with its key added to a corresponding list /// for later searching. /// </summary> static public void ClassIconInitialize() { // Check to see if our project is loaded if (!MOG_ControllerProject.IsProject()) { return; } // Only allow population of the images array once if (mAssetTypes.Count > 0) { return; } // Add the active item icon first // Get the image AddIcon("Images", "BaseNode.bmp", "dot"); AddIcon("Images", MOG_ControllerProject.GetProjectName() + ".bmp", MOG_ControllerProject.GetProjectName()); AddIcon("Images", "MOG Relationship.bmp", "Relationships"); AddIcon("Images", "Group.bmp", "group"); AddIcon("Images", "FileLocked.png", "locked"); //mAssetTypeImages.TransparentColor = Color.Magenta; mAssetTypeImages.ColorDepth = ColorDepth.Depth32Bit; // Load our file icons as small icons mFileTypeManager = new IconListManager(mAssetTypeImages, IconReader.IconSize.Small); }
public void Refresh() { if (mInitialized) { //Refresh everything mainForm.LibraryExplorer.Refresh(); } else if (MOG_ControllerProject.IsProject() && MOG_ControllerProject.IsUser()) { Initialize(); } }
/// <summary> InitializeAssetIcons /// Loads all the bmp's specified in the asset declarations /// in the Project.ini files. Each bmp is added to a /// list allong with its key added to a corresponding list /// for later searching. /// </summary> static public void ClassIconInitialize() { // Check to see if our project is loaded if (!MOG_ControllerProject.IsProject()) { return; } // Only allow population of the images array once if (mAssetTypes.Count > 0) { return; } lock (mAssetTypes) { // Add the active item icon first // Get the image if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp"))) { // Get the group image Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp")); // Add the image and the type to the arrayLists mAssetTypeImages.Images.Add(myImage); mAssetTypes.Add("dot"); } if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "Group.bmp"))) { // Get the group image Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "Group.bmp")); // Add the image and the type to the arrayLists mAssetTypeImages.Images.Add(myImage); mAssetTypes.Add("group"); } } mAssetTypeImages.TransparentColor = Color.Magenta; // Initialize state icons FileInfo [] stateImages = DosUtils.FileGetList(MOG_ControllerSystem.LocateTool("Images\\States", ""), "*.bmp"); foreach (FileInfo stateImage in stateImages) { LoadRawIcon(mStateTypeImages, mStateTypes, stateImage.FullName, Path.GetFileNameWithoutExtension(stateImage.Name)); } // Load our file icons as small icons mFileTypeManager = new IconListManager(mAssetTypeImages, IconReader.IconSize.Small); }
public void LatentInitialize() { mainForm.AssetManagerInboxListView.ContextMenuStrip = mInboxContextMenu.InitializeContextMenu("{Inbox}"); mainForm.AssetManagerDraftsListView.ContextMenuStrip = mDraftsContextMenu.InitializeContextMenu("{Inbox}"); mainForm.AssetManagerSentListView.ContextMenuStrip = mOutboxContextMenu.InitializeContextMenu("{Outbox}"); mainForm.AssetManagerTrashListView.ContextMenuStrip = mTrashContextMenu.InitializeContextMenu("{Trash}"); if (!MOG_ControllerProject.IsProject() || !MOG_ControllerProject.IsUser()) { return; } RefreshAllWindows(); guiUserPrefs.LoadDynamic_LayoutPrefs("AssetManager", mainForm); mLocal.InitialiseLocalView(); mainForm.AssetManagerLocalDataExplorerSplitter.SplitPosition = mLocalExplorer.Width; mainForm.myLocalExplorerToolStripMenuItem.Checked = mLocalExplorer.Opened; mainForm.AssetManagerTasksSplitter.SplitPosition = mToDo.Width; MainMenuViewClass.bChangeLocalBranchRightPanelWidth = true; mainForm.AssetManagerLocalDataSplitter.SplitPosition = mTools.Width; MainMenuViewClass.bChangeLocalBranchRightPanelWidth = false; mainForm.myToolboxToolStripMenuItem.Checked = mTools.Opened; // Initialize our users toolBox MOG_ControllerSyncData sync = MOG_ControllerProject.GetCurrentSyncDataController(); if (sync != null) { // Initialize the local tools window mainForm.CustomToolsBox.Initialize(sync.GetPlatformName()); // DVC } else { mainForm.CustomToolsBox.Visible = false; } mInitialized = true; }
/// <summary> InitializeAssetIcons /// Loads all the bmp's specified in the asset declarations /// in the Project.ini files. Each bmp is added to a /// list allong with its key added to a corresponding list /// for later searching. /// </summary> static public void ClassIconInitialize() { // Check to see if our project is loaded if (!MOG_ControllerProject.IsProject()) { return; } // Only allow population of the images array once if (mAssetTypes.Count > 0) { return; } // Add the active item icon first // Get the image AddIcon("Images", "BaseNode.bmp", "dot"); AddIcon("Images", "Group.bmp", "group"); AddIcon("Images", "FileLocked.png", "locked"); //mAssetTypeImages.TransparentColor = Color.Magenta; mAssetTypeImages.ColorDepth = ColorDepth.Depth32Bit; // Initialize state icons FileInfo [] stateImages = DosUtils.FileGetList(MOG_ControllerSystem.LocateTool("Images\\States", ""), "*.bmp"); foreach (FileInfo stateImage in stateImages) { LoadRawIcon(mStateTypeImages, mStateTypes, stateImage.FullName.ToLower(), Path.GetFileNameWithoutExtension(stateImage.Name).ToLower()); } // Initialize state icons stateImages = DosUtils.FileGetList(MOG_ControllerSystem.LocateTool("Images\\States", ""), "*.png"); foreach (FileInfo stateImage in stateImages) { LoadRawIcon(mStateTypeImages, mStateTypes, stateImage.FullName.ToLower(), Path.GetFileNameWithoutExtension(stateImage.Name).ToLower()); } // Load our file icons as small icons mFileTypeManager = new IconListManager(mAssetTypeImages, IconReader.IconSize.Small); }
static public void BuildUserMenu(MenuItem parent) { // Initialize the Explorer context menu parent.MenuItems.Clear(); parent.MenuItems.Add("User"); parent.MenuItems.Add("-"); if (MOG_ControllerProject.IsProject()) { // Add all the users to the AssignTo subMenu ArrayList users = MOG_ControllerProject.GetProject().GetUsers(); for (int u = 0; u < users.Count; u++) { MOG_User user = (MOG_User)users[u]; MenuItem Item = new MenuItem(user.GetUserName()); //if (e != null) Item.Click += new System.EventHandler(e); parent.MenuItems.Add(Item); } } }
public void Initialize() { if (!MOG_ControllerProject.IsProject() || !MOG_ControllerProject.IsUser()) { return; } MogControl_AssetContextMenu classificationTreeContextMenu = new MogControl_AssetContextMenu(mainForm.ProjectManagerClassificationTreeView); MogControl_AssetContextMenu packageTreeContextMenu = new MogControl_AssetContextMenu(mainForm.ProjectManagerPackageTreeView); MogControl_AssetContextMenu syncTargetContextMenu = new MogControl_AssetContextMenu(mainForm.ProjectManagerSyncTargetTreeView); MogControl_AssetContextMenu archiveContextMenu = new MogControl_AssetContextMenu(mainForm.ProjectManagerArchiveTreeView); // Add context menus for our ProjMgr Explorer TreeViews mainForm.ProjectManagerClassificationTreeView.ContextMenuStrip = classificationTreeContextMenu.InitializeContextMenu("{Project}"); mainForm.ProjectManagerPackageTreeView.ContextMenuStrip = packageTreeContextMenu.InitializeContextMenu("{Project}"); mainForm.ProjectManagerSyncTargetTreeView.ContextMenuStrip = syncTargetContextMenu.InitializeContextMenu("{SyncTargetTreeView}"); mainForm.ProjectManagerArchiveTreeView.ContextMenuStrip = archiveContextMenu.InitializeContextMenu("{Project}"); // Make sure we show all of the packages mainForm.ProjectManagerClassificationTreeView.ShowPlatformSpecific = true; mainForm.ProjectManagerPackageTreeView.ShowPlatformSpecific = true; // Build (or rebuild) our trees BuildRepositoryTrees(true); // Re-apply our current tree sort if (mLoaded) { ResetPackageTreeSort(); } #if MOG_LIBRARY ProjectTreeButtonClick(mainForm.ProjectTreeArchiveViewtoolStripButton, mainForm.ProjectManagerArchiveTreeView, "Archive"); #endif // Initialize task tree //mainForm.ProjectManagerTaskWindow.InitializeForProject(); }
/// <summary> InitializeAssetIcons /// Loads all the bmp's specified in the asset declarations /// in the Project.ini files. Each bmp is added to a /// list allong with its key added to a corresponding list /// for later searching. /// </summary> static public void AssetIconInitialize() { // Check to see if our project is loaded if (!MOG_ControllerProject.IsProject()) { return; } // Only allow population of the images array once if (mAssetTypes.Count > 0) { return; } // Add the active item icon first // Get the image if (DosUtils.FileExist(string.Concat(MOG_ControllerSystem.GetSystem().GetSystemToolsPath(), "\\Images\\SelectIcon.bmp"))) { // Get the group image Image myImage = new Bitmap(string.Concat(MOG_ControllerSystem.GetSystem().GetSystemToolsPath(), "\\Images\\SelectIcon.bmp")); // Add the image and the type to the arrayLists mAssetTypeImages.Images.Add(myImage); mAssetTypes.Add("dot"); } // Open the project.ini MOG_Ini ini = new MOG_Ini(MOG_ControllerProject.GetProject().GetProjectConfigFilename()); // Walk through all the assets for (int x = 0; x < ini.CountKeys("Assets"); x++) { // Get the asset name string imageName = ini.GetString(ini.GetKeyNameByIndex("Assets", x), "Icon"); // Check if we have an image? if (imageName.Length > 0) { string assetKey = ini.GetKeyNameByIndex("Assets", x).ToLower(); LoadIcon(imageName, ini.GetKeyNameByIndex("Assets", x).ToLower()); // Check for a lock image string lockImageName = Path.GetFileNameWithoutExtension(imageName) + "_locked"; string lockFullImageName = imageName.Replace(Path.GetFileNameWithoutExtension(imageName), lockImageName); LoadIcon(lockFullImageName, assetKey + "_locked"); // Check for a ReadLock image lockImageName = Path.GetFileNameWithoutExtension(imageName) + "_readlocked"; lockFullImageName = imageName.Replace(Path.GetFileNameWithoutExtension(imageName), lockImageName); LoadIcon(lockFullImageName, assetKey + "_readlocked"); } } if (DosUtils.FileExist(string.Concat(MOG_ControllerSystem.GetSystem().GetSystemToolsPath(), "\\Images\\Group.bmp"))) { // Get the group image Image myImage = new Bitmap(string.Concat(MOG_ControllerSystem.GetSystem().GetSystemToolsPath(), "\\Images\\Group.bmp")); // Add the image and the type to the arrayLists mAssetTypeImages.Images.Add(myImage); mAssetTypes.Add("group"); } mAssetTypeImages.TransparentColor = Color.Magenta; // Initialize state icons if (DosUtils.DirectoryExist(MOG_ControllerSystem.GetSystem().GetSystemToolsPath() + "\\Images\\States")) { FileInfo [] stateImages = DosUtils.FileGetList(MOG_ControllerSystem.GetSystem().GetSystemToolsPath() + "\\Images\\States", "*.bmp"); foreach (FileInfo stateImage in stateImages) { LoadRawIcon(mStateTypeImages, mStateTypes, stateImage.FullName, Path.GetFileNameWithoutExtension(stateImage.Name)); } } }
/// <summary> /// Find the correct listview for this new asset name /// </summary> /// <param name="box"></param> /// <param name="type"></param> /// <param name="userName"></param> /// <returns></returns> public ListView IsolateListView(string box, MOG_FILENAME_TYPE type, string userName) { // Bail if this is an event for anothers box but not if the username is blank. Blank user names are from our local data window if (MOG_ControllerProject.IsProject() && MOG_ControllerProject.GetActiveUser() != null && (string.Compare(userName, MOG_ControllerProject.GetActiveUser().GetUserName(), true) != 0) && (userName.Length != 0)) { return(null); } if (string.Compare(box, "Inbox", true) == 0) { mActiveAssetsDirectory = mInboxAssetsDirectory; switch (type) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: case MOG_FILENAME_TYPE.MOG_FILENAME_Group: case MOG_FILENAME_TYPE.MOG_FILENAME_Link: return(mainForm.AssetManagerInboxListView); default: return(null); } } else if (string.Compare(box, "Drafts", true) == 0) { mActiveAssetsDirectory = mInboxAssetsDirectory; switch (type) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: case MOG_FILENAME_TYPE.MOG_FILENAME_Group: case MOG_FILENAME_TYPE.MOG_FILENAME_Link: return(mainForm.AssetManagerDraftsListView); default: return(null); } } else if (string.Compare(box, "Outbox", true) == 0) { mActiveAssetsDirectory = mOutboxAssetsDirectory; switch (type) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: case MOG_FILENAME_TYPE.MOG_FILENAME_Group: case MOG_FILENAME_TYPE.MOG_FILENAME_Link: return(mainForm.AssetManagerSentListView); default: return(null); } } else if (string.Compare(box, "Trash", true) == 0) { mActiveAssetsDirectory = ""; switch (type) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: case MOG_FILENAME_TYPE.MOG_FILENAME_Group: case MOG_FILENAME_TYPE.MOG_FILENAME_Link: return(mainForm.AssetManagerTrashListView); default: return(null); } } else if (string.Compare(box, "", true) == 0) { mActiveAssetsDirectory = ""; switch (type) { case MOG_FILENAME_TYPE.MOG_FILENAME_Asset: // This is an asset in the local data area case MOG_FILENAME_TYPE.MOG_FILENAME_Group: case MOG_FILENAME_TYPE.MOG_FILENAME_Link: return(this.mLocal.GetLocalWorkSpaceListView()); default: return(null); } } return(null); }
static public void MOGGlobalLaunchProjectLogin(string projectName, bool forceLogin) { // Launch the login dialog LoginForm login = new LoginForm(projectName); mainForm.Enabled = false; Login: // Show the dialog if (login.ShowDialog(mainForm) == DialogResult.OK) { try { // Login to the specified Project if (guiProject.SetLoginProject(login.LoginProjectsComboBox.Text, login.LoginBranchesComboBox.Text)) { // Set the login user guiUser guiUsers = new guiUser(mainForm); if ((string.Compare(login.LoginUsersComboBox.Text, "Choose Valid User", true) == 0) || (login.LoginUsersComboBox.Text.Length == 0)) { MessageBox.Show("A valid user must be selected!", "Missing User"); goto Login; } if (guiUsers.SetLoginUser(login.LoginUsersComboBox.Text)) { mainForm.Enabled = true; // Disable the Change SQL Server menu item if the logged in user is not an administrator MOGGlobalSetSQLConnectionMenuItemEnabled(login.LoginUsersComboBox.Text); // Disable the Configure Project menu item if the logged in user is not an administrator MOGGlobalSetToolsConfigureProjectMenuItemEnabled(login.LoginUsersComboBox.Text); // Disable the Set MOG Repository menu item if the logged in user is not an administrator MOGGlobalSetFileMOGRepositoryMenuItemEnabled(login.LoginUsersComboBox.Text); } else { MessageBox.Show("A valid user must be selected!", "Login Error"); goto Login; } } else { MessageBox.Show("A valid project and branch must be selected!", "Login Error"); goto Login; } } catch (Exception e) { MOG_Report.ReportMessage("Login Project", e.Message, e.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.ERROR); goto Login; } } else if (login.DialogResult == DialogResult.Cancel && forceLogin) { if (MessageBox.Show(mainForm, "Do you wish to exit MOG?", "Exit?", MessageBoxButtons.YesNo) == DialogResult.Yes) { mainForm.Close(); mainForm.Shutdown(); } else { goto Login; } } else { if (!MOG_ControllerProject.IsProject() || !MOG_ControllerProject.IsUser()) { MessageBox.Show("A valid project and user must be selected!", "Missing Project or User"); goto Login; } mainForm.Enabled = true; } // Always initialize our Database before leaving because the dialog loads projects that will leave us in a dirty state MOG_ControllerSystem.InitializeDatabase("", MOG_ControllerProject.GetProjectName(), MOG_ControllerProject.GetBranchName()); }
/// <summary> /// A new Package was selected, populate the group control now. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AssetPackageComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { if (!MOG_ControllerProject.IsProject()) { return; } // mBuilding = true; // // // Clear our list // AssetGroupComboBox.Items.Clear(); // AssetGroupComboBox.Text = ""; // AssetGroupComboBox.Enabled = true; // // string Key = AssetAssetKeyComboBox.Text; // string Package = ((ComboBox)sender).Text; // // // Find the asset that is in the key ComboBox // foreach (MOG_AssetType packageName in MOG_ControllerProject.GetProject().GetProperties(Key).mAssetTypes) // { // // Find this type in the assets tyle lists // if (string.Compare(packageName.mTypeName, Package, true) == 0) // { // // Add all the group names for this type // foreach (string groupName in packageName.mSubTypes) // { // if (string.Compare(groupName, "*") == 0) // { // // Lets try and guess a possible group names // Array names = FindWildCardNames(Package); // if (names != null) // { // foreach (string wildGroupName in names) // { // AssetGroupComboBox.Items.Add(wildGroupName); // } // } // } // else // { // AssetGroupComboBox.Items.Add(groupName); // } // } // } // // // Set the package as the first valid package in the combo box // if (AssetGroupComboBox.Items.Count > 0) // { // AssetGroupComboBox.SelectedIndex = 0; // } // // // only allow changing of the combo box if there are more than one options // if (AssetGroupComboBox.Items.Count == 1) // { // AssetGroupComboBox.Enabled = false; // } // } // // // Attempt to fill in the rest of the name // MOG_Filename autoFile = new MOG_Filename(); //// JohnRen - Removed - Should simply check database to construct the assetFilename //// autoFile.ConstructAssetName(mFullFilename, string.Concat(MOG_ControllerProject.GetProject().GetProjectKey(), ".", Key,".All")); // // // Update our valid icon // UpdateAssetVerifyIcon(autoFile); // // if (autoFile.GetAssetSubClass().Length != 0) // { // string Group = ""; // // Check to see if the group is a wildcard // if (string.Compare(autoFile.GetAssetSubClass(), "*") == 0) // { // Group = (string)AssetGroupComboBox.Items[0]; // } // else // { // Group = autoFile.GetAssetSubClass(); // mField[3] = Group; // } // // AssetGroupComboBox.Text = Group; // } // mBuilding = false; }
/// <summary> /// A new asset key was selected. Now go and pupulate the package and group controls /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AssetAssetKeyComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { if (!MOG_ControllerProject.IsProject()) { return; } // mBuilding = true; // // // Clear our list // AssetPackageComboBox.Items.Clear(); // // // Clear both, group and package // AssetPackageComboBox.Text = ""; // AssetGroupComboBox.Text = ""; // AssetPackageComboBox.Enabled = true; // // string Key = ((ComboBox)sender).Text; // // // if (MOG_ControllerProject.GetProject().GetProperties(Key).mAssetTypes.Count > 0) // { // // Add all the type names for this asset key // foreach (MOG_AssetType packageName in MOG_ControllerProject.GetProject().GetProperties(Key).mAssetTypes) // { // AssetPackageComboBox.Items.Add(packageName.mTypeName); // } // // // Attempt to fill in the rest of the name // MOG_Filename autoFile = new MOG_Filename(); //// JohnRen - Removed - Should simply check database to construct the assetFilename //// autoFile.ConstructAssetName(mFullFilename, string.Concat(MOG_ControllerProject.GetProject().GetProjectKey(), ".", Key,".All")); // // // Update our valid icon // //UpdateAssetVerifyIcon(autoFile); // // if (autoFile.GetAssetClassification().Length != 0) // { // string Package = autoFile.GetAssetClassification(); // AssetPackageComboBox.Text = Package; // mField[2] = Package; // } // } // else // { // MessageBox.Show("Asset_Types ini file was not initialized correctly. Cannot populate the packages and groups!", "ERROR", MessageBoxButtons.OK); // Close(); // } // // // Set the package as the first valid package in the combo box // if (AssetPackageComboBox.Items.Count > 0 && AssetPackageComboBox.SelectedItem == null) // { // AssetPackageComboBox.SelectedIndex = 0; // } // // // only allow changing of the combo box if there are more than one options // if (AssetPackageComboBox.Items.Count == 1) // { // AssetPackageComboBox.Enabled = false; // } mBuilding = false; }
//------------------------------------------------------ public void LoadCustomButtons(string platformName) { if (MOG_ControllerProject.IsProject()) { UnloadCustomButtons(); mPlatformName = platformName; // Get the project defaults string projectDefaultButtonsFile = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\ClientConfigs\\" + MOG_ControllerProject.GetProject().GetProjectName() + ".Client.Buttons." + platformName + ".info"; if (DosUtils.FileExist(projectDefaultButtonsFile)) { MOG_Ini pIni = new MOG_Ini(projectDefaultButtonsFile); int i = 0; string section = "BUTTON" + i; while (pIni.SectionExist(section)) { int val = pIni.GetValue(section, "TYPE"); // glk: This can be replaced by a bool instead of an int... (more clear) int hide = pIni.GetValue(section, "HIDEWINDOW"); switch ((ETYPE)val) { case ETYPE.STD_BUTTON: CreateStdButton(pIni.GetString(section, "BUTTONNAME"), pIni.GetString(section, "COMMAND"), pIni.GetString(section, "ARGUMENTS"), hide, section); break; case ETYPE.STD_BUTTON_EDIT: CreateEditButton(pIni.GetString(section, "BUTTONNAME"), pIni.GetString(section, "FIELDNAME"), pIni.GetString(section, "ARGUMENTS"), pIni.GetString(section, "COMMAND"), hide, section); break; case ETYPE.STD_FILETYPE_LIST: CreateFileTypeButton(pIni.GetString(section, "BUTTONNAME"), pIni.GetString(section, "FIELDNAME"), pIni.GetString(section, "DIRECTORY"), pIni.GetString(section, "EXTENSION"), pIni.GetString(section, "COMMAND"), hide); break; case ETYPE.STD_FOLDERBROWSER: CreateFileBrowser(pIni.GetString(section, "BUTTONNAME"), pIni.GetString(section, "FIELDNAME"), pIni.GetString(section, "DIRECTORY"), pIni.GetString(section, "EXTENSION")); break; } section = "BUTTON" + ++i; } } } ScrollButtons(0); }