コード例 #1
0
        private static void loadResourcesFromAssembly(Assembly assembly)
        {
            // try loading resources from the executing assembly.
            try
            {
                string[] resourceNames = assembly.GetManifestResourceNames();

                foreach (string resourceName in resourceNames)
                {
                    if (resourceName.ToLower().EndsWith(".driver.resources"))
                    {
                        DriverResource newDriverResource = new DriverResource(assembly.GetManifestResourceStream(resourceName));
                        ResourceList.Add(newDriverResource);
                        InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "{0} loaded", newDriverResource.DisplayName);
                    }
                }
            }
            catch (Exception ex)
            {
                InfWizardStatus.Log(CategoryType.DriverResource,
                                    StatusType.Warning,
                                    "Failed loading driver resources from executing assembly: {0}",
                                    ex.Message);
            }
        }
コード例 #2
0
ファイル: InfWizardForm.cs プロジェクト: tmcqueen2/GSharp
        private void wizardPageFinished_ShowFromNext(object sender, EventArgs e)
        {
            rtfFinishedSatus.Clear();
            wizardPageFinishedEnable(false);
            labelInstallDriver.Image = null;
            labelInstallDriver.Text  = "please wait..";
            mCurrentDriverResource   = comboBoxDriverResource.SelectedItem as DriverResource;
            mCurrentInfWriter        = new InfWriter(mCurrentDeviceItem, mCurrentDriverResource);

            Thread writeSetupThread = new Thread(writeSetupPackageFn);

            writeSetupThread.Start(null);
        }
コード例 #3
0
        private static void loadResourcesFromPath(string path)
        {
            // try loading resources from the working directory.
            try
            {
                if (!Directory.Exists(path))
                {
                    return;
                }

#if DEBUG
                InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "loading resource(s) from {0}", path);
#endif
                string[] files = Directory.GetFiles(path, "*.driver.resources");
                foreach (string file in files)
                {
                    DriverResource newDriverResource = new DriverResource(file);
                    if (!ResourceList.Add(newDriverResource))
                    {
#if DEBUG
                        InfWizardStatus.Log(CategoryType.DriverResource,
                                            StatusType.Warning,
                                            "skipping duplicate driver resource {0} found in {1}",
                                            newDriverResource.DisplayName,
                                            file);
#endif
                    }
                    else
                    {
                        InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "{0} loaded", newDriverResource.DisplayName);
                    }
                }
                if (ResourceList.Count > 0)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "failed loading driver resources from working directory :{0}", ex.ToString());
            }
            return;
        }