/// <summary> /// 初始化基准组件 /// </summary> /// <param name="fComponent"></param> /// <param name="baseArgs"></param> private static void InitBaseArgs(FComponent fComponent, BaseArgs baseArgs) { if (fComponent == null) { return; } if (baseArgs == null) { return; } fComponent.SetXY(baseArgs.xy); fComponent.SetSize(baseArgs.size); fComponent.SetPivot(baseArgs.pivot.x, baseArgs.pivot.y, baseArgs.pivotAsAnchor); fComponent.SetScale(baseArgs.scale.x, baseArgs.scale.y); fComponent.SetAlpha(baseArgs.alpha); fComponent.SetText(baseArgs.title); if (baseArgs.center) { fComponent.Center(); } if (baseArgs.parent != null) { baseArgs.parent.AddChild(fComponent); } }
private static T1 NewT <T1, T2>(BaseArgs baseArgs) where T1 : FComponent, new() where T2 : GObject, new() { var fComponent = NewT <T1>(new T2(), baseArgs); InitBaseArgs(fComponent, baseArgs); return(fComponent); }
private static T NewT <T>(GObject fguiObj, BaseArgs baseArgs) where T : FComponent, new() { T fComponent = null; if (baseArgs != null && !string.IsNullOrEmpty(baseArgs.packageName)) { fComponent = FComponent.Create <T>(baseArgs.packageName, baseArgs.componentName); } else { fComponent = FComponent.Create <T>(fguiObj); } InitBaseArgs(fComponent, baseArgs); return(fComponent); }
private static void OnWebsocketEvent(object sender, BaseArgs e) { switch (e.WebsocketArgsType) { case WebsocketArgsType.Connection: ConnectionEvents((ConnectionEventArgs)e); break; case WebsocketArgsType.Message: MessageEvents((MessageEventargs)e); break; case WebsocketArgsType.Error: ErrorEvents((ErrorEventargs)e); break; default: break; } }
public BaseCommandRunner(BaseArgs baseArgs) { var packArgs = new PackArgs { CurrentDirectory = baseArgs.CurrentDirectory, Logger = baseArgs.Console, Arguments = new string[0], MsBuildDirectory = new Lazy <string>(() => MsBuildUtility.GetMsBuildDirectoryFromMsBuildPath(null, null, baseArgs.Console).Value.Path) }; // Get the input file packArgs.Path = PackCommandRunner.GetInputFile(packArgs); // Set the current directory if the files being packed are in a different directory PackCommandRunner.SetupCurrentDirectory(packArgs); packArgs.Build = false; packArgs.Exclude = new string[0]; switch (baseArgs.Verbosity) { case Verbosity.Detailed: { packArgs.LogLevel = LogLevel.Verbose; break; } case Verbosity.Normal: { packArgs.LogLevel = LogLevel.Information; break; } case Verbosity.Quiet: { packArgs.LogLevel = LogLevel.Minimal; break; } } this._packArgs = packArgs; }
/// <summary> /// Creates a state controller that is hooked to the given db name. /// </summary> /// <param name="dbName"></para> public TestState(BaseArgs args) { _dbName = args.DatabaseName; _stateBackupFolder = Path.Combine(IntegrationTestBase.GetTestTempBasePath(), "DbStateBackups"); }
public override void OnRequest(BaseArgs args) { base.OnRequest(args); }
public static void FireWebsocketEvent(object sender, BaseArgs e) { _websocketEvent?.Invoke(sender, e); }
/////////////////////////// public static FComponent NewComponent(BaseArgs baseArgs = null) { var fComponent = NewT <FComponent, GComponent>(baseArgs); return(fComponent); }