示例#1
0
        public FormCode()
        {
            InitializeComponent();
            this.DialogResult = DialogResult.Cancel;
            mDirectoryName    = MiscFunction.GetInstance().GetAssemblyPath() + Parameter.GetInstance().TemplateDirectory + "\\";

            string[] directories = Directory.GetDirectories(mDirectoryName);
            cmbTemplate.Items.Add("(默认模板)");
            foreach (string directory in directories)
            {
                string[] strings = directory.Split(new string[] { "\\" }, StringSplitOptions.None);
                if (strings.Length >= 2)
                {
                    cmbTemplate.Items.Add(strings[strings.Length - 1]);
                }
            }
            if (cmbTemplate.Items.Contains(Parameter.GetInstance().DefaultTemplateName))
            {
                cmbTemplate.SelectedItem = (Parameter.GetInstance().DefaultTemplateName);
            }
            else
            {
                cmbTemplate.SelectedIndex = 0;
            }
        }
示例#2
0
 private void LoadOptionFile()
 {
     if (!File.Exists(mConfigurationFilePath))
     {
         CreateDefualtConfigurationFile();
     }
     mSingletonConfiguration = (Configuration)MiscFunction.GetInstance().DeSerializeBinaryFile(mConfigurationFilePath);
     mSingletonConfiguration.ConfigurationFilePath = mConfigurationFilePath;
 }
示例#3
0
        public Configuration(bool isResetConfiguration)
        {
            mConfigurationFilePath = MiscFunction.GetInstance().GetAssemblyPath() + mConfigurationFileName;

            if (isResetConfiguration)
            {
                CreateDefualtConfigurationFile();
            }
            LoadOptionFile();
        }
示例#4
0
 public bool LoadUserConfigurationFile()
 {
     try
     {
         mSingletonConfiguration = (UserConfiguration)MiscFunction.GetInstance().DeSerializeBinaryFile(MiscFunction.GetInstance().GetAssemblyPath() + mConfigurationFilePath);
         mSingletonConfiguration.ConfigurationFilePath = mConfigurationFilePath;
         return(true);
     }
     catch (System.Exception ex)
     {
         CreateDefualtUserConfigurationFile();
         System.Console.Out.WriteLine(ex.Message);
         return(false);
     }
 }
示例#5
0
        //button1,Excel测试按键
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                //Excel测试
                mAccessExcel          = AccessExcel.CreateInstance();
                mDestinationExcelFile = MiscFunction.GetInstance().GetAssemblyPath() + Parameter.GetInstance().ReportDirectory + "\\" + "temp.xlsx";
                File.Copy(mExcelModalFileName, mDestinationExcelFile, true);
                Application.DoEvents();
                string ret = mAccessExcel.OpenExcelFile(mDestinationExcelFile);

                mAccessExcel.SetExcelVisible();
                for (int i = 0; i < 1500; i++)
                {
                    mAccessExcel.AddChipStatus(i, 1);
                }
                SaveResultToExcelFile();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#6
0
 public void SaveConfigurationFile(string fileName)
 {
     MiscFunction.GetInstance().SerializeBinaryFile(fileName, FileMode.Create, this);
 }
示例#7
0
 public void SaveConfigurationFile()
 {
     MiscFunction.GetInstance().SerializeBinaryFile(mConfigurationFilePath, FileMode.Create, this);
 }