Пример #1
0
        public void Check_export_licence()
        {
            var file_path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Bimcc.BimEngine.lic";

            LicenseInfo licenseInfo = new LicenseInfo();

            if (File.Exists(file_path))
            {
                string LicenseKey = LicenseSession.LoadLicenseKeyFromFile(file_path);

                licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", LicenseKey);
            }
            else
            {
                licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine");
            }

            if (licenseInfo.IsActivated)
            {
                textBox_company.Enabled = false; textBox_data.Enabled = false;

                textBox_mail.Enabled = false; textbox_HardwareId.Enabled = false;

                textbox_HardwareId.BackColor = Color.MediumSpringGreen;
            }
        }
Пример #2
0
        private void Log_setting_Load(object sender, EventArgs e)
        {
            LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("BIMCC", "BIMCC.BIMEngine");

            textbox_HardwareId.Text = licenseInfo.HardwareId.ToString();

            Check_export_licence();
        }
Пример #3
0
        private void button_export_Click(object sender, EventArgs e)
        {
            openFileDialog.Filter = "授权文件(*.lic)|*.lic|所有文件(*.*)|*.*";

            openFileDialog.FileName = "";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                if (openFileDialog.FileName != null)
                {
                    var path = Path.GetFullPath(openFileDialog.FileName);

                    string LicenseKey = LicenseSession.LoadLicenseKeyFromFile(path);

                    File.WriteAllText(@"C:\Users\Administrator\Desktop\error.txt", LicenseKey);

                    LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", LicenseKey);

                    textBox1.Text  = "Bimcc.BimEngine.Revit";
                    textBox2.Text  = licenseInfo.ProductVersion.ToString();
                    textBox3.Text  = licenseInfo.ReleaseDate.ToString();
                    textBox4.Text  = licenseInfo.IsActivated.ToString();
                    textBox5.Text  = licenseInfo.LicenseMode.ToString();
                    textBox6.Text  = licenseInfo.LicenseStatus.ToString();
                    textBox7.Text  = licenseInfo.HardwareId.ToString();
                    textBox8.Text  = licenseInfo.ClientName.ToString();
                    textBox9.Text  = licenseInfo.LicenseExpiration.ToString();
                    textBox10.Text = licenseInfo.SubscriptionExpiration.ToString();

                    if (licenseInfo.IsActivated == false)
                    {
                        textBox4.BackColor  = Color.OrangeRed;
                        textBox5.BackColor  = Color.OrangeRed;
                        textBox6.BackColor  = Color.OrangeRed;
                        textBox3.BackColor  = Color.OrangeRed;
                        textBox9.BackColor  = Color.OrangeRed;
                        textBox10.BackColor = Color.OrangeRed;
                        button_ok.Enabled   = false;
                    }
                    else
                    {
                        button_ok.Enabled   = true;
                        textBox4.BackColor  = Color.MediumSpringGreen;
                        textBox5.BackColor  = Color.MediumSpringGreen;
                        textBox6.BackColor  = Color.MediumSpringGreen;
                        textBox3.BackColor  = Color.WhiteSmoke;
                        textBox9.BackColor  = Color.WhiteSmoke;
                        textBox10.BackColor = Color.WhiteSmoke;
                    }
                }
            }
        }
Пример #4
0
        private void label_platform_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", Application.licenseKey);

            if (licenseInfo.IsActivated)
            {
                new Platform_check().ShowDialog();
            }
            else
            {
                Tools.ShowMessageBox("请先对轻量化插件授权");
            }
        }
Пример #5
0
        private void License_Load(object sender, EventArgs e)
        {
            LicenseInfo licenseInfo = new LicenseInfo();

            if (Application.licenseKey.Length == 0)
            {
                Application.licenseKey = Tools.GetLicenseKey();
            }

            licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", Application.licenseKey);

            Fresh_form(licenseInfo);
        }
Пример #6
0
        private void Plugin_manage_FormClosing(object sender, FormClosingEventArgs e)
        {
            Move_file();

            var licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", Application.licenseKey);

            if (licenseInfo.IsActivated)
            {
                Setting.plugin.Text = "已授权";
            }
            else
            {
                Setting.plugin.Text = "未授权";
            }
        }
Пример #7
0
        private void button_export_Click(object sender, EventArgs e)
        {
            openFileDialog.Filter = "授权文件(*.lic)|*.lic|所有文件(*.*)|*.*";

            openFileDialog.FileName = "";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                var path_file = Path.GetFullPath(openFileDialog.FileName);

                string LicenseKey = LicenseSession.LoadLicenseKeyFromFile(path_file);

                LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", LicenseKey);

                Fresh(licenseInfo);
            }
        }
Пример #8
0
        private void License_Load(object sender, EventArgs e)
        {
            var filename = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Bimcc.BimEngine.lic";

            string LicenseKey = string.Empty;

            LicenseInfo licenseInfo = new LicenseInfo();

            if (File.Exists(filename))
            {
                LicenseKey = LicenseSession.LoadLicenseKeyFromFile(filename);
            }

            licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", LicenseKey);

            Fresh(licenseInfo);
        }
Пример #9
0
        public static void ShowDialog(IWin32Window parent)
        {
            var info = LicenseSession.GetLicenseInfo(CLIENT_ID, PRODUCT_NAME, LICENSE_KEY);

            LicenseSession.ShowLicenseDialog(CLIENT_ID, PRODUCT_NAME, parent);
        }
Пример #10
0
        public static void ShowDialog(LicenseSession session, IWin32Window parent)
        {
            var info = LicenseSession.GetLicenseInfo(CLIENT_ID, PRODUCT_NAME, LICENSE_KEY);

            LicenseSession.ShowLicenseDialog(session.ClientId, session.AppName, parent);
        }
Пример #11
0
        public static void ShowDialog(IWin32Window parent)
        {
            var info = LicenseSession.GetLicenseInfo(CLIENT_ID, PRODUCT_NAME, GetLicenseKey());

            LicenseSession.ShowLicenseDialog(CLIENT_ID, PRODUCT_NAME, parent, DeployLicenseFileAction);
        }
Пример #12
0
        private void License_Load(object sender, EventArgs e)
        {
            var filename = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Bimcc.BimEngine.lic";

            if (File.Exists(filename))
            {
                LicenseKey = LicenseSession.LoadLicenseKeyFromFile(filename);

                File.WriteAllText(@"C:\Users\Administrator\Desktop\error.txt", LicenseKey);

                LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", LicenseKey);

                textBox1.Text  = "Bimcc.BimEngine.Revit";
                textBox2.Text  = licenseInfo.ProductVersion.ToString();
                textBox3.Text  = licenseInfo.ReleaseDate.ToString();
                textBox4.Text  = licenseInfo.IsActivated.ToString();
                textBox5.Text  = licenseInfo.LicenseMode.ToString();
                textBox6.Text  = licenseInfo.LicenseStatus.ToString();
                textBox7.Text  = licenseInfo.HardwareId.ToString();
                textBox8.Text  = licenseInfo.ClientName.ToString();
                textBox9.Text  = licenseInfo.LicenseExpiration.ToString();
                textBox10.Text = licenseInfo.SubscriptionExpiration.ToString();
                if (licenseInfo.IsActivated == false)
                {
                    textBox4.BackColor  = Color.OrangeRed;
                    textBox5.BackColor  = Color.OrangeRed;
                    textBox6.BackColor  = Color.OrangeRed;
                    textBox3.BackColor  = Color.OrangeRed;
                    textBox9.BackColor  = Color.OrangeRed;
                    textBox10.BackColor = Color.OrangeRed;
                    button_ok.Enabled   = false;
                }
                else
                {
                    button_ok.Enabled   = true;
                    textBox4.BackColor  = Color.MediumSpringGreen;
                    textBox5.BackColor  = Color.MediumSpringGreen;
                    textBox6.BackColor  = Color.MediumSpringGreen;
                    textBox3.BackColor  = Color.WhiteSmoke;
                    textBox9.BackColor  = Color.WhiteSmoke;
                    textBox10.BackColor = Color.WhiteSmoke;
                }
            }
            else
            {
                LicenseInfo licenseInfo = LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine");

                textBox1.Text  = "Bimcc.BimEngine.Revit";
                textBox2.Text  = licenseInfo.ProductVersion.ToString();
                textBox3.Text  = licenseInfo.ReleaseDate.ToString();
                textBox4.Text  = licenseInfo.IsActivated.ToString();
                textBox5.Text  = licenseInfo.LicenseMode.ToString();
                textBox6.Text  = licenseInfo.LicenseStatus.ToString();
                textBox7.Text  = licenseInfo.HardwareId.ToString();
                textBox8.Text  = licenseInfo.ClientName.ToString();
                textBox9.Text  = licenseInfo.LicenseExpiration.ToString();
                textBox10.Text = licenseInfo.SubscriptionExpiration.ToString();
                if (licenseInfo.IsActivated == false)
                {
                    textBox4.BackColor  = Color.OrangeRed;
                    textBox5.BackColor  = Color.OrangeRed;
                    textBox6.BackColor  = Color.OrangeRed;
                    textBox3.BackColor  = Color.OrangeRed;
                    textBox9.BackColor  = Color.OrangeRed;
                    textBox10.BackColor = Color.OrangeRed;
                    button_ok.Enabled   = false;
                }
                else
                {
                    button_ok.Enabled   = true;
                    textBox4.BackColor  = Color.MediumSpringGreen;
                    textBox5.BackColor  = Color.MediumSpringGreen;
                    textBox6.BackColor  = Color.MediumSpringGreen;
                    textBox3.BackColor  = Color.WhiteSmoke;
                    textBox9.BackColor  = Color.WhiteSmoke;
                    textBox10.BackColor = Color.WhiteSmoke;
                }
            }
        }
Пример #13
0
 public LicenseInfo Check_export_licence()
 {
     return(LicenseSession.GetLicenseInfo("Bimcc", "Bimcc.BimEngine", Application.licenseKey));
 }