예제 #1
0
        //----------------------------------------------------------------
        // writes out settings to an ini file
        public void WriteSettingsToIni()
        {
            string projectDefaultButtonsFile = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\ClientConfigs\\" + MOG_ControllerProject.GetProject().GetProjectName() + ".Client.Buttons." + mPlatformName + ".info";

            if (projectDefaultButtonsFile.Length == 0)
            {
                return;
            }

            MOG_Ini pIni = new MOG_Ini(projectDefaultButtonsFile);

            pIni.Empty();

            int i = 0;

            foreach (ControlDefinition def in mControlsList)
            {
                string section = "Button" + i;

                pIni.PutString(section, "Type", "" + def.mEType);
                pIni.PutString(section, "BUTTONNAME", def.mButton.Text);
                pIni.PutString(section, "Command", def.mCommand);
                pIni.PutString(section, "HideWindow", "" + def.mHiddenOutput);

                if ((ETYPE)def.mEType == ETYPE.STD_BUTTON)
                {
                    pIni.PutString(section, "ARGUMENTS", def.mArguments);
                }

                if ((ETYPE)def.mEType == ETYPE.STD_BUTTON_EDIT)
                {
                    pIni.PutString(section, "FIELDNAME", def.mTextBox.Name);
                    pIni.PutString(section, "ARGUMENTS", def.mEditText);
                }

                if ((ETYPE)def.mEType == ETYPE.STD_FILETYPE_LIST ||
                    (ETYPE)def.mEType == ETYPE.STD_FOLDERBROWSER)
                {
                    pIni.PutString(section, "Directory", def.mDirectory);
                    pIni.PutString(section, "Extension", def.mExtension);
                    pIni.PutString(section, "FIELDNAME", def.mComboBox.Name);
                }

                i++;
            }

            pIni.Close();
        }
예제 #2
0
        /// <summary>
        /// Save our current listView items out to the target ini file
        /// </summary>
        /// <param name="filename"></param>
        private void SaveReportList(string filename)
        {
            ListOkButton.Enabled = false;

            MOG_Ini report = new MOG_Ini(filename);

            report.Empty();

            try
            {
                ProgressMax(ListListView.Items.Count);

                foreach (ListViewItem item in ListListView.Items)
                {
                    string extraInfo = "";

                    for (int i = 0; i < item.SubItems.Count; i++)
                    {
                        ProgressStep();

                        if (item.SubItems[i].Text.Length == 0)
                        {
                            extraInfo = extraInfo + " " + ",";
                        }
                        else
                        {
                            extraInfo = extraInfo + item.SubItems[i].Text + ",";
                        }
                    }
                    report.PutString("ASSETS", item.SubItems[FindColumn("Fullname")].Text, extraInfo);
                }
            }
            catch
            {
            }
            finally
            {
                report.Save();
                report.Close();
                ProgressReset();
                ListOkButton.Enabled = true;
            }
        }