public void InitializeSystem(SplashForm SplashScreen) { // Initialize the .Net style menus SplashScreen.updateSplash("Initializing menu system...", 10); // Initialize MOG SplashScreen.updateSplash("Connecting MOG SQL\\Server...", 40); try { // Check to see if we can init the server? if (!MOG_Main.Init_Client("", "Event Viewer")) { string message = "Was unable to initialize because there is another viewer already running."; throw(new Exception(message)); } criticalEventViewerControl1.RefreshEvents(); } catch (Exception e) { string message = e.Message + "\n" + e.StackTrace; throw(new Exception(message)); } MOG_Prompt.ClientForm = this; SplashScreen.updateSplash("Connected...", 100); SplashScreen.updateSplash("Done", 1); SplashScreen.mInitializationComplete = true; MogUtils_Settings.CreateSettings(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "EventViewerPrefs.ini")); }
public string GetColumnText(ListView view, ListViewItem item, string defaultColumn) { // Load our last group from the ini string columnText = MogUtils_Settings.LoadSetting_default(view.Name, "SortedGroup", defaultColumn); return(item.SubItems[ColumnNameFind(view.Columns, columnText)].Text); }
public static bool ImportSeparately(string[] sourceFullNames, bool looseFileMatching) { bool rc = false; // Import all previously imported assets ImportPrevious(sourceFullNames, looseFileMatching); if (mInvalidAssetNames.Count > 0) { DialogResult result = DialogResult.Ignore; // Has the user told us to only start with the MOG asset Imorter string StartInAdvancedMode = MogUtils_Settings.LoadSetting("ImportWizard", "StartupMode"); if (StartInAdvancedMode != "Advanced") { // Try running the import wizard first rc = ImportWithWizard(sourceFullNames, out result); } // Did the user descide to use the MOG Asset Importer if (result == DialogResult.Ignore) { rc = ImportWithMOGAssetImporter(); } } return(rc); }
private void MOG_EventViewerMainForm_Load(object sender, EventArgs e) { // Set the size Width = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "Width", 800); Height = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "Height", 600); // Set the location on screen if (MogUtils_Settings.Settings.PropertyExist("GuiLayout", "Gui", "left")) { Left = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "left"); } if (MogUtils_Settings.Settings.PropertyExist("GuiLayout", "Gui", "top")) { Top = MogUtils_Settings.LoadIntSetting("GuiLayout", "Gui", "top"); } // Check for client being visible Rectangle workArea = Screen.GetWorkingArea(this); if (Top < 0) { Top = 0; } if (Left < 0) { Left = 0; } if (Top > workArea.Bottom) { Top = workArea.Bottom - Height; } if (Left > workArea.Right) { Left = workArea.Left - Width; } }
private void ListForm_Load(object sender, EventArgs e) { MogUtils_Settings.LoadListView("ReportWindow", ListListView); Top = MogUtils_Settings.LoadIntSetting("ReportWindow", "Top", Top); Left = MogUtils_Settings.LoadIntSetting("ReportWindow", "Left", Left); Width = MogUtils_Settings.LoadIntSetting("ReportWindow", "Width", Width); Height = MogUtils_Settings.LoadIntSetting("ReportWindow", "Height", Height); }
internal void ToggleFilter(bool enabled) { // Refresh our list Initialize(); // Save our settings MogUtils_Settings.SaveSetting("LockManager", "Filtered", enabled.ToString()); }
private void ListForm_FormClosing(object sender, FormClosingEventArgs e) { MogUtils_Settings.SaveListView("ReportWindow", ListListView); MogUtils_Settings.SaveIntSetting("ReportWindow", "Top", Top); MogUtils_Settings.SaveIntSetting("ReportWindow", "Left", Left); MogUtils_Settings.SaveIntSetting("ReportWindow", "Width", Width); MogUtils_Settings.SaveIntSetting("ReportWindow", "Height", Height); }
public MainForm() { string PrefsLocation = String.Concat(Environment.CurrentDirectory, "\\MOGPrefs.ini"); MogUtils_Settings.CreateSettings(PrefsLocation); InitializeComponent(); InitializeMOG(); }
public guiProjectManager(MogMainForm main) { mainForm = main; ProjectTreeSetFilter(MogUtils_Settings.LoadSetting_default("ProjectTreeFilter", "current", "Classification")); Initialize(); mLoaded = true; }
private void SetImageAndTextDisplayStyle() { TopPanel.Height = 37; foreach (ToolStripItem item in WorkspaceToolStrip.Items) { item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; } MogUtils_Settings.SaveSetting(WorkspaceName, "DisplayStyle", "ImageAndText"); }
private void XboxPropertiesForm_Closed(object sender, System.EventArgs e) { string prefsString = MOG_ControllerProject.GetProjectName() + "." + MOG_ControllerProject.GetCurrentSyncDataController().GetPlatformName(); mUserMap = SyncUserMapComboBox.Text; mProjectMap = SyncProjectMapComboBox.Text; // Set the full filename of the selected user syncfile MogUtils_Settings.SaveSetting(prefsString, "UserSyncFile", mUserMap); MogUtils_Settings.SaveSetting(prefsString, "ProjectSyncFile", mProjectMap); }
void TagMenuItem_CheckChanged(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; if (item != null && item.OwnerItem != null) { item.OwnerItem.Tag = item.Text; ResetToolTip(item.OwnerItem.OwnerItem as ToolStripSplitButton); MogUtils_Settings.SaveSetting(WorkspaceName, "GetLatestTag", item.Text); } }
public void Initialize() { // Load server nodes TreeNode root = LoadServerNodes(); // Load all the projects of that server LoadProjects(root); RemoteEnableCheckBox.Checked = MogUtils_Settings.LoadBoolSetting("RemoteServer", "RemoteEnabled", "Enabled", false); LoadSettings(); }
internal void AdjustFilter(string filterString) { // Are we currently filtering? if (mainForm.LockManagerToggleFilterToolStripButton.Checked) { // Then refresh our list Initialize(); } // Save our settings MogUtils_Settings.SaveSetting("LockManager", "FilterString", filterString); }
public guiLockManager(MogMainForm main) { mainForm = main; // Initialize context menus mLocksContextMenu = new MogControl_AssetContextMenu("LABEL, CLASSIFICATION, USER, DESCRIPTION, MACHINE, IP, ID, TIME, FULLNAME, TYPE", mainForm.LockManagerLocksListView); mainForm.LockManagerLocksListView.ContextMenuStrip = mLocksContextMenu.InitializeContextMenu("{LockManager}"); mListViewSort_Manager = new ArrayList(); mGroups = new guiAssetManagerGroups(); mGroups.Add(mainForm.LockManagerLocksListView, "User"); mainForm.LockManagerLocksListView.ShowGroups = mainForm.showGroupsToolStripMenuItem.Checked; mainForm.LockManagerToggleFilterToolStripButton.Checked = MogUtils_Settings.LoadBoolSetting("LockManager", "Filtered", false); mainForm.LockManagerFilterToolStripTextBox.Text = MogUtils_Settings.LoadSetting_default("LockManager", "FilterString", ""); }
void view_ColumnClick(object sender, ColumnClickEventArgs e) { ListView view = sender as ListView; if (view != null) { string group = view.Columns[e.Column].Text; if (mSaveSettings) { MogUtils_Settings.SaveSetting(view.Name, "SortedGroup", group); } SetGroup(view, group); UpdateGroups(view); } }
private void SaveLastSettings() { string builds = ""; foreach (string build in BuildRequests.Items) { if (builds.Length > 0) { builds = builds + "," + build; } else { builds = build; } } MogUtils_Settings.SaveSetting("RequestBuild", "Builds", builds); }
public void UpdateGroupItem(ListView view, ListViewItem item, string defaultGroup) { // Load our last group from the ini defaultGroup = MogUtils_Settings.LoadSetting_default(view.Name, "SortedGroup", defaultGroup); string groupText = item.SubItems[ColumnNameFind(view.Columns, defaultGroup)].Text; ListViewGroup group = new ListViewGroup(groupText, groupText); if (view.Groups[groupText] != null) { group = view.Groups[groupText]; } else { view.Groups.Add(group); } item.Group = group; }
private void MOG_EventViewerMainForm_FormClosing(object sender, FormClosingEventArgs e) { if (WindowState == FormWindowState.Maximized) { MogUtils_Settings.Settings.PutPropertyString("GuiLayout", "Gui", "Width", Convert.ToString(Width - 8)); MogUtils_Settings.Settings.PutPropertyString("GuiLayout", "Gui", "Height", Convert.ToString(Height - 8)); } // Else save normally... else { MogUtils_Settings.SaveSetting("GuiLayout", "Gui", "Width", Convert.ToString(Width)); MogUtils_Settings.SaveSetting("GuiLayout", "Gui", "Height", Convert.ToString(Height)); } MogUtils_Settings.SaveSetting("GuiLayout", "Gui", "top", Convert.ToString(Top)); MogUtils_Settings.SaveSetting("GuiLayout", "Gui", "left", Convert.ToString(Left)); MogUtils_Settings.Save(); }
public void RefreshWorkspaceToolbar() { // Update the 'ActiveTag' UpdateGetActiveButton(); string displayStyle = MogUtils_Settings.LoadSetting_default(WorkspaceName, "DisplayStyle", "ImageAndText"); switch (displayStyle.ToLower()) { case "image": SetImageOnlyDisplayStyle(); break; case "imageandtext": SetImageAndTextDisplayStyle(); break; } GetLatestFiltersToolStripMenuItem.Tag = MogUtils_Settings.LoadSetting_default(WorkspaceName, "GetLatestFilter", ""); GetLatestTagsToolStripMenuItem.Tag = MogUtils_Settings.LoadSetting_default(WorkspaceName, "GetLatestTag", ""); GetLatestUpdateModifiedMissingToolStripMenuItem.Checked = MogUtils_Settings.LoadBoolSetting(WorkspaceName, "GetLatestForce", false); GetLatestCleanUnknownFilesToolStripMenuItem.Checked = MogUtils_Settings.LoadBoolSetting(WorkspaceName, "CleanUnknownFiles", false); autoPackageToolStripMenuItem.Checked = MogUtils_Settings.LoadBoolSetting(WorkspaceName, "AutoPackage", true); alwaysActiveToolStripMenuItem.Checked = MogUtils_Settings.LoadBoolSetting(WorkspaceName, "AlwaysActive", false); autoUpdateToolStripMenuItem.Checked = MogUtils_Settings.LoadBoolSetting(WorkspaceName, "AutoUpdate", true); if (mWorkspace != null) { mWorkspace.SetAlwaysActive(alwaysActiveToolStripMenuItem.Checked); mWorkspace.EnableAutoPackaging(autoPackageToolStripMenuItem.Checked); mWorkspace.EnableAutoUpdating(autoUpdateToolStripMenuItem.Checked); } UpdateAutoPackageToolStripMenuItemVisuals(); UpdateAutoUpdateToolStripMenuItemVisuals(); UpdateGetLatestUpdateModifiedMissingToolStripMenuItemVisuals(); UpdateGetActiveButton(); ResetToolTip(GetLatestToolStripButton); }
internal void ProjectTreeSaveFilter(string filter) { MogUtils_Settings.SaveSetting("ProjectTreeFilter", "current", filter); }
private void WorkspaceAlwaysActiveToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { MogUtils_Settings.SaveSetting(WorkspaceName, "AlwaysActive", alwaysActiveToolStripMenuItem.Checked.ToString()); UpdateAutoUpdateToolStripMenuItemVisuals(); }
private void GetLatestCleanUnknownFilesToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { MogUtils_Settings.SaveSetting(WorkspaceName, "CleanUnknownFiles", GetLatestCleanUnknownFilesToolStripMenuItem.Checked.ToString()); }
private void GetLatestUpdateModifiedMissingToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { MogUtils_Settings.SaveSetting(WorkspaceName, "GetLatestForce", GetLatestUpdateModifiedMissingToolStripMenuItem.Checked.ToString()); UpdateGetLatestUpdateModifiedMissingToolStripMenuItemVisuals(); }
private void autoPackageToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { MogUtils_Settings.SaveSetting(WorkspaceName, "AutoPackage", autoPackageToolStripMenuItem.Checked.ToString()); mWorkspace.EnableAutoPackaging(autoPackageToolStripMenuItem.Checked); UpdateAutoPackageToolStripMenuItemVisuals(); }
private void RemoteEnableCheckBox_CheckedChanged(object sender, EventArgs e) { RemoteSettingsGroupBox.Enabled = RemoteEnableCheckBox.Checked; MogUtils_Settings.SaveSetting("RemoteServer", "RemoteEnabled", "Enabled", RemoteEnableCheckBox.Checked.ToString()); }
static public void MOGGlobalToolsSoundEnable(MogMainForm mainForm, bool enabled) { mainForm.mSoundManager.Enabled = enabled; MogUtils_Settings.SaveSetting("Gui", "Sounds", mainForm.mSoundManager.Enabled.ToString()); MogUtils_Settings.Save(); }