public static OptionContainer Load(string path)
    {
        TextAsset _xml = Resources.Load <TextAsset>(path);

        XmlSerializer serializer = new XmlSerializer(typeof(OptionContainer));

        StringReader reader = new StringReader(_xml.text);

        OptionContainer options = serializer.Deserialize(reader) as OptionContainer;

        reader.Close();

        return(options);
    }
        private static OptionContainer createOptions(int numberOfOption, int position, int length)
        {
            OptionContainer opContainer1 = new OptionContainer();

            opContainer1.Name     = "opCon" + position;
            opContainer1.Length   = length;
            opContainer1.Position = position;

            for (int i = 0; i < numberOfOption; i++)
            {
                opContainer1.insertOption("Option" + i, ValueDefinitionTest.repeat("00", length - 1) + i.ToString("X2"));
            }

            return(opContainer1);
        }
Example #3
0
        protected override async Task InitializeAsync(CancellationToken CancellationToken, IProgress <ServiceProgressData> Progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync(CancellationToken);

            Instance = this;
            DTE      = GetGlobalService(typeof(DTE)) as DTE;

            KnownUIContexts.ShellInitializedContext.WhenActivated(() => {
                ThreadHelper.ThrowIfNotOnUIThread();
                DebugListener.Initialize();
                ThemeListener.Initialize(GetService(typeof(SVsShell)) as IVsShell);
                ProjectListener.Initialize();
                NuGetListener.Initialize();
                PackageInstaller = (GetService(typeof(SComponentModel)) as IComponentModel2)?.GetService <IVsPackageInstaller>();
            });

            await Commands.ShowDumpWindowCommand.InitializeAsync(this);

            await OptionContainer.InitializeAsync();

            VisualDumpContainer.Initialize();
        }
Example #4
0
 public static void LoadOptionStream(string path)
 {
     oContainer = OptionContainer.Load(path);
 }
Example #5
0
 public DefaultCaptcha(string CaptchaQuestion, string CaptchaAnswer, string type) : base(OptionContainer.GetOptions(type + "Options"))
 {
     this.CaptchaQuestion = CaptchaQuestion;
     this.CaptchaAnswer   = CaptchaAnswer;
     this.type            = type;
 }