Пример #1
0
    public void SetupSteam()
    {
        // C++ Flags
        PublicDefinitions.Add("WARRIORB_WITH_STEAM=" + BoolToIntString(WARRIORB_WITH_STEAM));
        PublicDefinitions.Add("WARRIORB_STEAM_APP_ID=" + IntToString(WARRIORB_STEAM_APP_ID));
        PublicDefinitions.Add("WARRIORB_STEAM_DEMO_APP_ID=" + IntToString(WARRIORB_STEAM_DEMO_APP_ID));
        PublicDefinitions.Add("WARRIORB_RELAUNCH_IN_STEAM=" + BoolToIntString(WARRIORB_RELAUNCH_IN_STEAM));
        PublicDefinitions.Add("WARRIORB_STEAM_CHECK_IF_LIBRARY_CHECKSUM_MATCHES=" + BoolToIntString(WARRIORB_STEAM_CHECK_IF_LIBRARY_CHECKSUM_MATCHES));
        PublicDefinitions.Add(String.Format("WARRIORB_STEAM_LIBRARY_WINDOWS_API64_SHA1_SUM=\"{0}\"", WARRIORB_STEAM_LIBRARY_WINDOWS_API64_SHA1_SUM));

        ConfigHierarchy             ConfigEngineHierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, new DirectoryReference(ProjectRootPath), Target.Platform);
        Dictionary <string, string> SteamReplacements     = new Dictionary <string, string>();

        // Steam
        if (WARRIORB_WITH_STEAM)
        {
            // Replace the steam id with our own defined one
            // Same for the Game Version

            // SteamDevAppId
            {
                int CurrentAppid;
                ConfigEngineHierarchy.GetInt32("OnlineSubsystemSteam", "SteamDevAppId", out CurrentAppid);
                string FormatString = "SteamDevAppId={0}";
                SteamReplacements.Add(String.Format(FormatString, CurrentAppid), String.Format(FormatString, SteamAppid));
            }

            // GameVersion
            {
                string CurrentGameVersion;
                ConfigEngineHierarchy.GetString("OnlineSubsystemSteam", "GameVersion", out CurrentGameVersion);
                string FormatString = "GameVersion={0}";
                SteamReplacements.Add(String.Format(FormatString, CurrentGameVersion), String.Format(FormatString, WARRIORB_BUILD_VERSION));
            }

            // Relaunch in Steam?
            // https://partner.steamgames.com/doc/api/steam_api#SteamAPI_RestartAppIfNecessary
            // NOTE: disabled at it is broken anyways
            // {
            //  bool CurrentRelaunchInSteam;
            //  ConfigEngineHierarchy.GetBool("OnlineSubsystemSteam", "bRelaunchInSteam", out CurrentRelaunchInSteam);
            //  string FormatString = "bRelaunchInSteam={0}";
            //  SteamReplacements.Add(String.Format(FormatString, CurrentRelaunchInSteam), String.Format(FormatString, WARRIORB_RELAUNCH_IN_STEAM));
            // }

            // Include plugins
            PrivateDependencyModuleNames.Add("NotYetSteam");
            DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
        }

        // bEnabled
        // {
        //  bool CurrentEnabled;
        //  ConfigEngineHierarchy.GetBool("OnlineSubsystemSteam", "bEnabled", out CurrentEnabled);
        //  string FormatString = "bEnabled={0}";
        //  SteamReplacements.Add(String.Format(FormatString, CurrentEnabled), String.Format(FormatString, WARRIORB_WITH_STEAM));
        // }

        PatchFile(DefaultEngineConfigPath, SteamReplacements);
    }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="paramNames"></param>
        /// <param name="paramValues"></param>
        /// <param name="dbName"></param>
        /// <returns></returns>
        public new DataSet ExecuteX(string sql, String[] paramNames, Object[] paramValues, string dbName, CommandType pCommandType)
        {
            using (Connection = DBUtil.GetConnection(dbName))
            {
                try
                {
                    Connection.Open();
                    this.dbType      = ConfigCache.GetDBType(dbName);
                    this.Transaction = this.Connection.BeginTransaction();
                    m_CommandType    = pCommandType;
                    DataSet result = ExecuteX(sql, paramNames, paramValues);
                    this.Transaction.Commit();

                    return(result);
                }
                catch (Exception e)
                {
                    this.Transaction.Rollback();
                    throw e;
                }
                finally
                {
                    if (Connection != null && ConnectionState.Open == Connection.State)
                    {
                        Connection.Close();
                    }
                }
            }
        }
    public OnlineSubsystemApple(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

        if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
        {
            ConfigHierarchy PlatformGameConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Target.ProjectFile), UnrealTargetPlatform.IOS);
            PlatformGameConfig.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableSignInWithAppleSupport", out bSignInWithAppleSupported);
        }
        else if (Target.Platform == UnrealTargetPlatform.Mac)
        {
            // TODO: Mark.Fitt enable Mac support
        }

        PrivateIncludePaths.Add("Private");

        PublicDefinitions.Add("ONLINESUBSYSTEMAPPLE_PACKAGE=1");
        PublicDefinitions.Add("ONLINESUBSYSTEMAPPLE_IDENTITY_ENABLE_SIWA=" + (bSignInWithAppleSupported ? "1" : "0"));

        PrivateDependencyModuleNames.AddRange(
            new string[] {
            "Core",
            "CoreUObject",
            "Engine",
            "OnlineSubsystem",
        });

        if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
        {
            if (bSignInWithAppleSupported)
            {
                PublicWeakFrameworks.Add("AuthenticationServices");
            }
        }
    }
Пример #4
0
 private void SetMembersFromWpDoc()
 {
     _numbering  = _wpDoc.MainDocumentPart.NumberingDefinitionsPart?.Numbering;
     _body       = _wpDoc.MainDocumentPart.Document.Body;
     _styles     = _wpDoc.MainDocumentPart.StyleDefinitionsPart.Styles;
     _nconfCache = new ConfigCache(_numbering, _styles, new ConfigFactory());
 }
Пример #5
0
        public void Get_CacheLevel1Test()
        {
            var numberingPart     = NumberingSample1.GenerateNumbering();
            var abstractNum       = numberingPart.Elements <AbstractNum>().Single();
            var numberingInstance = numberingPart.Elements <NumberingInstance>().Single();

            var numberingConfigFac    = Substitute.For <IConfigFactory>();
            var mockAbstractNumConfig = new Config();

            numberingConfigFac.CreateFromAbstractNumbering(Arg.Is(abstractNum)).Returns(mockAbstractNumConfig);
            var mockNumberingConfig = new Config();

            numberingConfigFac
            .CreateFromNumbering(Arg.Is(mockAbstractNumConfig), Arg.Is(numberingInstance))
            .Returns(mockNumberingConfig);

            var instance = new ConfigCache(numberingPart, null, numberingConfigFac);

            instance.Get(numberingInstance.NumberID.Value);
            var result = instance.Get(numberingInstance.NumberID.Value);

            Assert.AreSame(mockNumberingConfig, result);

            numberingConfigFac.Received(1).CreateFromAbstractNumbering(Arg.Is(abstractNum));
        }
        public object Create(Type type)
        {
            logger.DebugFormat("Trying to find local reference to type {0}...", TypesHelper.GetFlatClassName(type));

            object obj = ServiceLocationFactory.Do[ConfigCache].TryGet(type);

            if (obj != null)
            {
                logger.DebugFormat("Found it, returning...");
                return(obj);
            }
            logger.DebugFormat("Creating remoting proxy to type {0}...", TypesHelper.GetFlatClassName(type));

            Uri    uriBase     = ConfigCache.GetUriFromAddressBase();
            string relativeUri = ConfigCache.GetEndpointKey(type);
            Uri    uriFinal;



            if (Uri.TryCreate(uriBase, relativeUri, out uriFinal))
            {
                logger.DebugFormat("Constructed URI: {0}...", uriFinal);

                ConfigCache.TryRegisterClientChannel();
                obj = RemotingServices.Connect(type, uriFinal.AbsoluteUri);

                return(obj);
            }
            throw new InvalidOperationException("Invalid uri pair in configuration: '" +
                                                uriBase.AbsoluteUri + "' and '" + relativeUri + "'.");
        }
        public void Host(object server, Type contract)
        {
            lock (this)
            {
                if (!(server is MarshalByRefObject))
                {
                    throw new ArgumentException("The server class must inherit from MarshalByRefObject");
                }
                if (!started)
                {
                    Start();
                }

                services.Add(server);
                ServiceLocationFactory.Do[ConfigCache].Set(server, contract);

                string key = ConfigCache.GetEndpointKey(contract);

                if (!ConfigCache.LocalOnly)
                {
                    logger.DebugFormat("Registering contract {0} at endpoint {1}...", contract.GetRealClassName(), key);
                    RemotingServices.Marshal(server as MarshalByRefObject, key, contract);
                    logger.InfoFormat("{0} hosted", key);

                    foreach (string url in channel.GetUrlsForUri(key))
                    {
                        logger.DebugFormat("* {0}.", url);
                    }
                }
                else
                {
                    logger.InfoFormat("{0} locally hosted", key);
                }
            }
        }
Пример #8
0
 [TestMethod]//获取数据库连接语句 oracle
 public void GetDBConnectStrTest_ORACLE()
 {
     ConfigCache.LoadAppConfig(null);
     Assert.AreEqual(
         "Data Source=172.30.1.65:1522/xe;user id=czjd_sd;password=czjd_sd;",
         ConfigCache.GetDBConnectStr("ORACLE"));
 }
Пример #9
0
 [TestMethod]//获取数据库连接语句 sqlserver
 public void GetDBConnectStrTest_SQLSERVER()
 {
     ConfigCache.LoadAppConfig(null);
     Assert.AreEqual(
         "User ID=sa;initial catalog=DCETLBig;Data Source=sep;Password=Pw123456;",
         ConfigCache.GetDBConnectStr("SQLSERVER"));
 }
    public AndroidDeviceProfileSelector(ReadOnlyTargetRules Target) : base(Target)
    {
        ShortName = "AndroidDPS";

        // get a value from .ini (ConfigFile attribute doesn't work in Build.cs files it seems)
        ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, Target.ProjectFile != null ? Target.ProjectFile.Directory : null, Target.Platform);
        string          SecretGuid;

        Ini.GetString("AndroidDPSBuildSettings", "SecretGuid", out SecretGuid);
        if (!string.IsNullOrEmpty(SecretGuid))
        {
            PrivateDefinitions.Add("HASH_PEPPER_SECRET_GUID=" + SecretGuid);
        }

        PublicDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
        }
            );

        PrivateDependencyModuleNames.AddRange(
            new string[]
        {
            "Core",
            "CoreUObject",
            "Engine",
        }
            );
    }
Пример #11
0
        public void RejectCachesWithMoreConfigEntriesThanResultEntries()
        {
            var configCache = new ConfigCache();

            configCache.AddConfiguration(new BuildRequestConfiguration(configId: 1, new BuildRequestData("path", new Dictionary <string, string>()
            {
                ["p"] = "v"
            }, "13", new [] { "a", "b" }, null), "13"));
            configCache.AddConfiguration(new BuildRequestConfiguration(configId: 2, new BuildRequestData("path2", new Dictionary <string, string>()
            {
                ["p"] = "v"
            }, "13", new [] { "c", "d" }, null), "13"));

            var resultsCache = new ResultsCache();
            var buildResult  = new BuildResult(new BuildRequest(1, 2, configurationId: 1, new List <string>()
            {
                "a", "b"
            }, null, BuildEventContext.Invalid, null));

            buildResult.AddResultsForTarget("a", GetNonEmptySucceedingTargetResult());
            resultsCache.AddResult(buildResult);

            aggregator.Add(configCache, resultsCache);

            using (var env = TestEnvironment.Create())
            {
                env.SetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER", "1");
                var e = Should.Throw <InternalErrorException>(() => aggregator.Aggregate());
                e.Message.ShouldContain("Assuming 1-to-1 mapping between configs and results. Otherwise it means the caches are either not minimal or incomplete");
            }
        }
Пример #12
0
 private void saveConfig_Click(object sender, EventArgs e)
 {
     this.configInfo.groupId      = this.groupId.Text;
     this.configInfo.replyContent = this.replyContent.Text;
     this.configInfo.startTime    = this.startTime.Value;
     this.configInfo.endTime      = this.endTime.Value;
     this.configInfo.msgLen       = int.Parse(this.msgLen.Text);
     if ("".Equals(this.configInfo.groupId) || null == this.configInfo.groupId || this.configInfo.groupId.Length == 0)
     {
         MessageBox.Show("监控群号不能为空!");
     }
     else if (this.configInfo.msgLen <= 0)
     {
         MessageBox.Show("监控消息长度不能为空且大于零!");
     }
     else if ("".Equals(this.configInfo.replyContent) || null == this.configInfo.replyContent || this.configInfo.replyContent.Length == 0)
     {
         MessageBox.Show("回复内容不能为空!");
     }
     else
     {
         if (this.index >= 0)
         {
             ConfigCache.configInfosBind.RemoveAt(index);
             ConfigCache.configInfosBind.Insert(index, configInfo);
         }
         else
         {
             ConfigCache.configInfosBind.Add(configInfo);
         }
         ConfigCache.saveConfigToFile();
         this.Close();
     }
 }
Пример #13
0
        public static (IConfigCache ConfigCache, IResultsCache ResultsCache, Exception exception) DeserializeCaches(string inputCacheFile)
        {
            try
            {
                ConfigCache  configCache  = null;
                ResultsCache resultsCache = null;

                using (var fileStream = File.OpenRead(inputCacheFile))
                {
                    using var translator = BinaryTranslator.GetReadTranslator(fileStream, null);

                    translator.Translate(ref configCache);
                    translator.Translate(ref resultsCache);
                }

                ErrorUtilities.VerifyThrowInternalNull(configCache, nameof(configCache));
                ErrorUtilities.VerifyThrowInternalNull(resultsCache, nameof(resultsCache));

                return(configCache, resultsCache, null);
            }
            catch (Exception e)
            {
                return(null, null, e);
            }
        }
Пример #14
0
        public void ConfigCacheShouldBeTranslatable(object obj)
        {
            var initial = (ConfigCache)obj;

            TranslationHelpers.GetWriteTranslator().Translate(ref initial);

            ConfigCache copy = null;

            TranslationHelpers.GetReadTranslator().Translate(ref copy);

            // test _configurations
            var initialConfigurations = initial.GetEnumerator().ToArray();
            var copiedConfigurations  = copy.GetEnumerator().ToArray();

            Assert.Equal(copiedConfigurations, initialConfigurations, EqualityComparer <BuildRequestConfiguration> .Default);

            // test _configurationIdsByMetadata
            copiedConfigurations.ShouldAllBe(config => initial.GetMatchingConfiguration(new ConfigurationMetadata(config)).Equals(config));
            initialConfigurations.ShouldAllBe(config => copy.GetMatchingConfiguration(new ConfigurationMetadata(config)).Equals(config));

            // test relevant fields not covered by BuildRequestConfiguration.Equals
            foreach (var initialConfiguration in initial)
            {
                copy[initialConfiguration.ConfigurationId].ProjectDefaultTargets.ShouldBe(initialConfiguration.ProjectDefaultTargets);
                copy[initialConfiguration.ConfigurationId].ProjectInitialTargets.ShouldBe(initialConfiguration.ProjectInitialTargets);
            }
        }
Пример #15
0
        public void Init()
        {
            ConfigCache.LoadAppConfig(null);
            string s = UnitTest.Config.resource.sql.ToString();

            SqlProvider.LoadXml(new string[] { s });
        }
Пример #16
0
 [TestMethod]//加载指定的xml文件
 public void LoadAppConfigTest_files()
 {
     ConfigCache.LoadAppConfig(
         new string[] { "DB_PSW", "ZIP_PASSWORD_FORMAT", "MAIL_PASSWORD" },
         new string[] { "app.xml", "app.config" });
     Assert.IsTrue(ConfigCache.DC.Tables[0].Rows.Count == 25);
 }
Пример #17
0
        public void RejectCachesWithMismatchedIds()
        {
            // one entry in each cache but different config ids

            var configCache = new ConfigCache();

            configCache.AddConfiguration(new BuildRequestConfiguration(configId: 1, new BuildRequestData("path", new Dictionary <string, string>()
            {
                ["p"] = "v"
            }, "13", new [] { "a", "b" }, null), "13"));

            var resultsCache = new ResultsCache();
            var buildResult  = new BuildResult(new BuildRequest(1, 2, configurationId: 2, new List <string>()
            {
                "a", "b"
            }, null, BuildEventContext.Invalid, null));

            buildResult.AddResultsForTarget("a", GetNonEmptySucceedingTargetResult());
            resultsCache.AddResult(buildResult);

            aggregator.Add(configCache, resultsCache);

            using (var env = TestEnvironment.Create())
            {
                env.SetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER", "1");
                var e = Should.Throw <InternalErrorException>(() => aggregator.Aggregate());
                e.Message.ShouldContain("Each result should have a corresponding configuration. Otherwise the caches are not consistent");
            }
        }
Пример #18
0
        public void TestPerforman()
        {
            DateTime timeNow = DateTime.Now;

            //Console.Out.WriteLine("time now:" + (DateTime.Now));

            for (int i = 0; i < 1000; i++)
            {
                string constr = ConfigCache.GetDBConnectStr("SQLSERVER");
                MySQLHelper.ExecuteDataset(constr, CommandType.Text, "select * from city ", null);
                MySQLHelper.ExecuteDataset(constr, CommandType.Text, "select * from city ", null);
                MySQLHelper.ExecuteDataset(constr, CommandType.Text, "select * from city ", null);
            }

            //Console.Out.WriteLine("time now:" + (DateTime.Now));
            Console.Out.WriteLine("Aop use time:" + timeNow.Subtract(DateTime.Now).Duration());

            timeNow = DateTime.Now;
            //Console.Out.WriteLine("time now:" + (DateTime.Now));

            for (int i = 0; i < 1000; i++)
            {
                BizBO bizBo = TransactionAOP.newInstance(typeof(BizBO)) as BizBO;

                bizBo.queryCity();
            }

            //Console.Out.WriteLine("time now:" + (DateTime.Now));
            Console.Out.WriteLine("No Aop use time:" + timeNow.Subtract(DateTime.Now).Duration());
        }
Пример #19
0
        /// <summary>
        /// release all resources.
        /// </summary>
        /// <exception cref="Exception">dispose exception</exception>
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            try
            {
                if (_configCache != null)
                {
                    _configCache.Dispose();
                    _configCache = null;
                }
                if (_files != null)
                {
                    _files.Clear();
                    _files = null;
                }
                _disposed = true;
            }
            catch (Exception ex)
            {
                _disposed = false;
                throw new Exception($"'Dispose' error :{ ex.Message } .", ex.InnerException);
            }
        }
Пример #20
0
        protected void EncryptSettings_Click(object sender, EventArgs e)
        {
            verifyAllowed();

            Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);

            ConfigCache.EncryptAppSettings(config);
        }
Пример #21
0
        public static bool HasPlatformBundleSource(DirectoryReference ProjectDir, UnrealTargetPlatform Platform)
        {
            ConfigHierarchy BundleConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.InstallBundle, ProjectDir, Platform);

            return
                (BundleConfig.GetArray("InstallBundleManager.BundleSources", "DefaultBundleSources", out List <string> InstallBundleSources) &&
                 InstallBundleSources.Contains("Platform"));
        }
Пример #22
0
        public void CacheInsert_AddsValueToCache()
        {
            ConfigCache sut = new ConfigCache();

            sut.CacheInsert("SomeKey", "SomeValue");

            Assert.That(sut.GetCachedValue("SomeKey").Equals("SomeValue", StringComparison.InvariantCulture));
        }
Пример #23
0
 /// <summary>
 ///     Constructs an initial update performer.
 /// </summary>
 /// <param name="cache">The configuration cache that will receive the channel and directory counts.</param>
 /// <param name="directories">The controller set for accessing directory controllers.</param>
 /// <param name="system">The system controller.</param>
 /// <param name="config">The config controller.</param>
 public InitialUpdatePerformer(ConfigCache?cache, DirectoryControllerSet?directories,
                               SystemController?system, ConfigController?config)
 {
     _cache       = cache ?? throw new ArgumentNullException(nameof(cache));
     _directories = directories ?? throw new ArgumentNullException(nameof(directories));
     _system      = system ?? throw new ArgumentNullException(nameof(system));
     _config      = config ?? throw new ArgumentNullException(nameof(config));
 }
Пример #24
0
    protected void DoBuildCookRun(ProjectParams Params)
    {
        const ProjectBuildTargets ClientTargets = ProjectBuildTargets.ClientCooked | ProjectBuildTargets.ServerCooked;
        bool bGenerateNativeScripts             = Params.RunAssetNativization;
        int  WorkingCL = -1;

        if (P4Enabled && GlobalCommandLine.Submit && AllowSubmit)
        {
            WorkingCL = P4.CreateChange(P4Env.Client, String.Format("{0} build from changelist {1}", Params.ShortProjectName, P4Env.Changelist));
        }

        Project.Build(this, Params, WorkingCL, bGenerateNativeScripts ? (ProjectBuildTargets.All & ~ClientTargets) : ProjectBuildTargets.All);
        Project.Cook(Params);
        if (bGenerateNativeScripts)
        {
            // crash reporter is built along with client targets, so we need to
            // include that target flag here as well - note: that its not folded
            // into ClientTargets because the editor needs its own CrashReporter
            // as well (which would be built above)
            Project.Build(this, Params, WorkingCL, ClientTargets | ProjectBuildTargets.CrashReporter);
        }
        else
        {
            ConfigHierarchy GameIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, Params.RawProjectPath.Directory, HostPlatform.Current.HostEditorPlatform);
            if (GameIni != null)
            {
                List <string> NativizeBlueprintAssets                = null;
                string        BlueprintNativizationMethod            = "Disabled";
                bool          bWarnIfPackagedWithoutNativizationFlag = true;
                GameIni.GetString("/Script/UnrealEd.ProjectPackagingSettings", "BlueprintNativizationMethod", out BlueprintNativizationMethod);
                GameIni.GetBool("/Script/UnrealEd.ProjectPackagingSettings", "bWarnIfPackagedWithoutNativizationFlag", out bWarnIfPackagedWithoutNativizationFlag);
                GameIni.GetArray("/Script/UnrealEd.ProjectPackagingSettings", "NativizeBlueprintAssets", out NativizeBlueprintAssets);

                if (bWarnIfPackagedWithoutNativizationFlag && BlueprintNativizationMethod != "Disabled")
                {
                    // Warn if we're cooking without the -nativizeAssets flag, when the project settings specify a nativization method.
                    // If the "exclusive" (whitelist) method is set, we only warn if at least one asset has been selected for conversion.
                    if (BlueprintNativizationMethod != "Exclusive" || (NativizeBlueprintAssets != null && NativizeBlueprintAssets.Count > 0))
                    {
                        LogWarning("Project is configured for Blueprint nativization, but the conversion flag (-nativizeAssets) was omitted from the command line. No nativized assets have been built as a result.");
                    }
                }
            }
        }
        Project.CopyBuildToStagingDirectory(Params);
        Project.Package(Params, WorkingCL);
        Project.Archive(Params);
        Project.Deploy(Params);
        PrintRunTime();
        Project.Run(Params);

        // Check everything in!
        if (WorkingCL != -1)
        {
            int SubmittedCL;
            P4.Submit(WorkingCL, out SubmittedCL, true, true);
        }
    }
Пример #25
0
        private void trackListContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            var tl = (TrackList)sender;

            Debug.Assert(tl != null, "menu strip doesn't have a source control!");

            var cmd = Command.CONFIG | Command.SETCONFIGVALUE | Command.CONFIG_USEVALUEMASK | (Command)tl.Channel;

            if (e.ClickedItem == BAPSChannel.automaticAdvanceToolStripMenuItem)
            {
                var oci        = ConfigCache.getOption("Automatically advance");
                var newSetting = "Yes";
                if (BAPSChannelautomaticAdvanceToolStripMenuItem.Checked)
                {
                    newSetting = "No";
                }
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)oci.optionid, (uint)oci.type, (uint)(int)oci.choiceList[newSetting]));
            }
            else if (e.ClickedItem == BAPSChannelplayOnLoadToolStripMenuItem)
            {
                var oci        = ConfigCache.getOption("Play on load");
                var newSetting = "Yes";
                if (playOnLoadToolStripMenuItem.Checked)
                {
                    newSetting = "No";
                }
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)oci.optionid, (uint)oci.type, (uint)(int)oci.choiceList[newSetting]));
            }
            else if (e.ClickedItem == repeatNoneToolStripMenuItem && !repeatNoneToolStripMenuItem.Checked)
            {
                var oci = ConfigCache.getOption("Repeat");
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)oci.optionid, (uint)oci.type, (uint)(int)oci.choiceList["No repeat"]));
            }
            else if (e.ClickedItem == repeatOneToolStripMenuItem && !repeatOneToolStripMenuItem.Checked)
            {
                var oci = ConfigCache.getOption("Repeat");
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)oci.optionid, (uint)oci.type, (uint)(int)oci.choiceList["Repeat one"]));
            }
            else if (e.ClickedItem == repeatAllToolStripMenuItem && !repeatAllToolStripMenuItem.Checked)
            {
                var oci = ConfigCache.getOption("Repeat");
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)oci.optionid, (uint)oci.type, (uint)(int)oci.choiceList["Repeat all"]));
            }
            else if (e.ClickedItem == deleteItemToolStripMenuItem)
            {
                cmd = Command.PLAYLIST | Command.DELETEITEM | (Command)tl.Channel;
                core.SendAsync(new BAPS.Client.Common.Message(cmd).Add(, (uint)tl.LastIndexClicked));
            }
            else if (e.ClickedItem == resetChannelStripMenuItem)
            {
                cmd = Command.PLAYLIST | Command.RESETPLAYLIST | (Command)tl.Channel;
                core.SendAsync(new BAPS.Client.Common.Message(cmd));
            }
            else if (e.ClickedItem == showAudioWallToolStripMenuItem)
            {
                OpenAudioWall(tl);
            }
        }
Пример #26
0
 /// <summary>
 ///     Constructs a channel factory.
 /// </summary>
 /// <param name="controllerSet">
 ///     The controller set from which we get controllers for each channel (to talk to the BAPS server).
 /// </param>
 /// <param name="audioWallService">
 ///     The audio wall service that the channel view models should use to request an audio wall.
 /// </param>
 /// <param name="config">
 ///     The config cache used to check for channel configuration and related updates.
 /// </param>
 public ChannelFactoryService(
     ChannelControllerSet?controllerSet,
     AudioWallService?audioWallService,
     ConfigCache?config)
 {
     _controllerSet    = controllerSet ?? throw new ArgumentNullException(nameof(controllerSet));
     _audioWallService = audioWallService ?? throw new ArgumentNullException(nameof(audioWallService));
     _config           = config ?? throw new ArgumentNullException(nameof(config));
 }
Пример #27
0
 /// <summary>
 /// Setup for each tests
 /// </summary>
 public void Setup()
 {
     this.host             = new QAMockHost(this.GetComponent);
     this.testDataProvider = new TestDataProvider();
     this.requestEngine    = new BuildRequestEngine();
     this.requestEngine.InitializeComponent(this.host);
     this.requestEngine.InitializeForBuild(new NodeLoggingContext(host.LoggingService, 0, false));
     this.configCache = new ConfigCache();
 }
Пример #28
0
        public void CacheInsert_AddingSecondValueForSameKeyOverwritesCachedValue()
        {
            ConfigCache sut = new ConfigCache();

            sut.CacheInsert("SomeKey", "SomeValue");
            sut.CacheInsert("SomeKey", "SomeNewValue");

            Assert.That(sut.GetCachedValue("SomeKey").Equals("SomeNewValue", StringComparison.InvariantCulture));
        }
Пример #29
0
 public ConfigObjectCreator(Type objectType, ConfigCache configCache, UsageTracking usageTracking, ILog log, Func <string, AggregatingHealthStatus> getAggregatedHealthCheck)
 {
     UsageTracking = usageTracking;
     Log           = log;
     ObjectType    = objectType;
     ConfigCache   = configCache;
     ConfigPath    = GetConfigPath();
     healthStatus  = getAggregatedHealthCheck("Configuration");
     Validator     = new DataAnnotationsValidator.DataAnnotationsValidator();
 }
Пример #30
0
 /// <summary>
 ///     Constructs a <see cref="V2Client"/>.
 ///     <para>
 ///         This constructor takes in a lot of dependencies; generally,
 ///         code using <see cref="V2Client"/> will just ask for one from
 ///         a dependency injector rather than manually constructing
 ///         one.
 ///     </para>
 /// </summary>
 /// <param name="connectionManager">
 ///     A <see cref="MessageConnectionManager"/>, used to build and hold onto
 ///     message-passing connections to a BAPS server.
 /// </param>
 /// <param name="configCache">
 ///     A server configuration cache, used to hold onto config
 ///     information received from the BAPS server.
 /// </param>
 /// <param name="init">
 ///     An initial update performer, used to send certain set-up
 ///     messages to a BAPS server on connecting to one.
 /// </param>
 /// <param name="serverSelector">
 ///     An object that performs server selection.
 /// </param>
 /// <param name="login">
 ///     An object that performs authentication for low-level connections to the BAPS server, returning
 ///     <see cref="TcpPrimitiveConnection"/>s that are then sent to the
 ///     <paramref name="connectionManager"/>.
 /// </param>
 public V2Client(MessageConnectionManager connectionManager, ConfigCache configCache, InitialUpdatePerformer init,
                 ServerSelector serverSelector,
                 ClientSideLoginPerformer <SeededPrimitiveConnection, IMessageConnection> login)
 {
     _connectionManager = connectionManager;
     _configCache       = configCache;
     _init           = init;
     _serverSelector = serverSelector;
     _login          = login;
 }