public MainWindow() { InitializeComponent(); this.DataContext = this; if (Environment.Is64BitOperatingSystem != Environment.Is64BitProcess) { MessageBox.Show($"Please run x64 version instead."); App.Current.Shutdown(); } if (ENV.IsAdministrator()) { Title += " (Admin)"; } if (Environment.GetCommandLineArgs().Length == 2) { switch (Environment.GetCommandLineArgs()[1]) { case ARG_INSTALL: Install(null, null); App.Current.Shutdown(); return; case ARG_UNINSTALL: Uninstall(null, null); App.Current.Shutdown(); return; } } }
void AddMap() { if (LstMaps.CurrentSelection < 0) { return; } string mapluafile = MapLuaFiles[LstMaps.CurrentSelection]; int[] modeIndices = LstModes.GetCheckedIndices(); int[] eraIndices = LstEras.GetCheckedIndices(); for (int i = 0; i < modeIndices.Length; ++i) { SubIcon modeSub = ModeSubs[modeIndices[i]]; for (int j = 0; j < eraIndices.Length; j++) { SubIcon eraSub = EraSubs[eraIndices[j]]; string mapName = ENV.GetLocalizedMapName(mapluafile); PhxListBoxItem item = LstRotation.AddItem(mapName); item.SetIcon(modeSub.Icon); item.SetIcon2(eraSub.Icon); string mapScript = SWBFHelpers.Format(mapluafile, eraSub.Sub, modeSub.Sub); RotationLuaFiles.Add(mapScript); } } }
public request() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ }
public company() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ loadData(); }
public add_wallet() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ panel1.Visible = false; }
private void Uninstall(object sender, RoutedEventArgs e) { if (ENV.IsAdministrator()) { AdminUninstall(); } else { Cmd.RunAsAdmin(ENV.EntryLocation, ARG_UNINSTALL); } }
public master_list() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ DisplayFixer(); displayEmployee(); }
public pending() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ DisplayFixer(); displayWalletRequest(); }
public static string getEnv(string pName, string pDef) { ENV.LOAD(); if (envKeys_.ContainsKey(pName)) { return(envKeys_[pName].val); } return(pDef); }
public viewParkingFee() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ DisplayFixer(); displayParkingFee(); }
public newParking() { InitializeComponent(); //--Connecting to Database------ ENV i = new ENV(); con = new MySqlConnection(i.constr); //------------------------------ // Initialize MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE); }
private void Install(object sender, RoutedEventArgs e) { if (ENV.IsAdministrator()) { AdminInstall(); } else { Cmd.RunAsAdmin(ENV.EntryLocation, ARG_INSTALL); } var globalfile = Path.Combine(ENV.BaseDirectory, Env.GlobalSettingFileName); if (!File.Exists(globalfile)) { ResetGlobalSettingFile(false); } }
public MainWindow() { InitializeComponent(); var listener = new XJK.Logger.Listener(s => { LogText(s); }) { Registered = true }; this.Title = ENV.IsAdministrator() ? "Administrator" : "Normal User"; this.CommandBox.Text = ENV.EntryLocation; //"D:\\space space.exe"; foreach (var x in Environment.GetCommandLineArgs()) { LogText(x + Environment.NewLine); } }
public static string GetConnectionString(ENV env, BU bu, PERIOD period, bool useLocalIS = true) { string BUPart = bu == (int)BU.ILVB ? "ILH" : "ILSB"; string periodPart = period == (int)PERIOD.DAG ? "DAG" : "MAAND"; string databasePart = "; Database=" + BUPart + "_LOGGING_" + periodPart; string cs = ""; switch ((int)env) { case (int)ENV.LOCAL: if (useLocalIS == false) { cs = NNConnectionStrings.SQL_LOCALHOST.Replace("<LocalAdminPassword>", Utility.DecryptString(Properties.Settings.Default.LocalAdminPassword)) + databasePart; } else { cs = NNConnectionStrings.SQL_LOCALHOST_IS + databasePart; } //cs = NNConnectionStrings.SQL_LOCALHOST.Replace("<LocalAdminPassword>", "MacyMarle2") + databasePart; break; case (int)ENV.DEV: cs = (BUPart == "ILH" ? NNConnectionStrings.SQL_ILH_DEV_IS : NNConnectionStrings.SQL_ILSB_DEV_IS) + databasePart; break; case (int)ENV.TEST: cs = (BUPart == "ILH" ? NNConnectionStrings.SQL_ILH_TEST_IS : NNConnectionStrings.SQL_ILSB_TEST_IS) + databasePart; break; case (int)ENV.ACC: cs = (BUPart == "ILH" ? NNConnectionStrings.SQL_ILH_ACC_IS : NNConnectionStrings.SQL_ILSB_ACC_IS) + databasePart; break; case (int)ENV.PROD: cs = (BUPart == "ILH" ? NNConnectionStrings.SQL_ILH_PROD_IS : NNConnectionStrings.SQL_ILSB_PROD_IS) + databasePart; break; default: cs = ""; break; } return(cs); }
public static void initNs(EventHandler pHandler) { string val_ = ENV.getEnvString(NSLIST, string.Empty); if (string.IsNullOrEmpty(val_)) { return; } var arr_ = ToolString.explodeList(val_); ToolMsg.askList(null, arr_, (s, e) => { if (pHandler != null) { var ns_ = arr_[e.Which]; nsPerfix = ns_; pHandler.Invoke(s, EventArgs.Empty); } }); }
protected void StartRun() { if (ENV == Utility.ENV.LOCAL) { try { string envMessage = BU.ToString() + " - " + ENV.ToString() + " - " + Period.ToString(); if (MessageBox.Show("Start run " + envMessage + " ?", "Start Run", MessageBoxButtons.YesNo) == DialogResult.Yes) { string cs = Utility.GetConnectionString(ENV, BU, Period); string startRunQuery = (BU == Utility.BU.ILVB ? SQLQueries.SQL_START_RUN_ILH : SQLQueries.SQL_START_RUN_ILSB); startRunQuery = startRunQuery.Replace("<PERIOD>", Period == Utility.PERIOD.MAAND ? "MAAND" : "DAG"); startRunQuery = startRunQuery.Replace("<Kalenderdatum>", FormatDate4DB(CalendarDate)); int rc = this.SqlDA.ExecuteSQLCommand(cs, startRunQuery); string message = "Run Started, " + envMessage; _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": " + message; MessageBox.Show(message); this.Close(); } } catch (Exception ex) { string message = ex.Message; if (message.Length > 100) { message = message.Substring(0, 100); } _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": " + message; MessageBox.Show(ex.Message); } } else { _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": Function only available on local machine"; } }
protected void AbortRun() { if (ENV == Utility.ENV.LOCAL) { if (SsisRunID > 0) { try { string envMessage = BU.ToString() + " - " + ENV.ToString() + " - " + Period.ToString(); if (MessageBox.Show("Abort run " + envMessage + " ?", "Abort Run", MessageBoxButtons.YesNo) == DialogResult.Yes) { string cs = Utility.GetConnectionString(ENV, BU, Period); string abortRunQuery = SQLQueries.SQL_ABORT_RUN.Replace("<RunID>", this.SsisRunID.ToString()); int rc = SqlDA.ExecuteSQLCommand(cs, abortRunQuery); string message = "Run Aborted, " + envMessage; _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": " + message; MessageBox.Show(message); this.Close(); } } catch (Exception ex) { ShowMessage(ex.Message); } } else { _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": No valid SSIS Run ID available"; } } else { _toolStripStatusLabel.Text = DateTime.Now.ToString() + ": Function only available on local machine"; } }
void Start() { Debug.Assert(LstMaps != null); Debug.Assert(LstModes != null); Debug.Assert(LstEras != null); Debug.Assert(LstRotation != null); Debug.Assert(BtnAdd != null); Debug.Assert(BtnRemove != null); Debug.Assert(BtnRemoveAll != null); Debug.Assert(BtnStart != null); Debug.Assert(BtnQuit != null); LstMaps.OnSelect += OnMapSelectionChanged; BtnAdd.onClick.AddListener(AddMap); BtnRemove.onClick.AddListener(RemoveSelectionFromRotation); BtnRemoveAll.onClick.AddListener(ClearRotation); BtnStart.onClick.AddListener(StartRotation); BtnQuit.onClick.AddListener(Quit); bool bForMP = false; RT.CallLuaFunction("missionlist_ExpandMaplist", 0, bForMP); PhxLuaRuntime.Table spMissions = RT.GetTable("missionselect_listbox_contents"); foreach (KeyValuePair <object, object> entry in spMissions) { PhxLuaRuntime.Table map = entry.Value as PhxLuaRuntime.Table; string mapluafile = map.Get <string>("mapluafile"); bool bIsModLevel = map.Get <bool>("isModLevel"); string mapName = ENV.GetLocalizedMapName(mapluafile); LstMaps.AddItem(mapName, bIsModLevel); MapLuaFiles.Add(mapluafile); } }
public static void ADD(string pName, string pVal) { PARSE(pName + "," + pVal); ENV.SAVE(); }
public void AddDetails(string url, string bearerToken, ENV env, string appInsights) { var details = new Details(url, bearerToken, env, appInsights); _details.Add(details); }
void OnMapSelectionChanged(int newIdx) { string mapluafile = MapLuaFiles[newIdx]; LstModes.Clear(); LstEras.Clear(); ModeSubs.Clear(); EraSubs.Clear(); object[] res = RT.CallLuaFunction("missionlist_ExpandModelist", 1, mapluafile); PhxLuaRuntime.Table modes = res[0] as PhxLuaRuntime.Table; foreach (KeyValuePair <object, object> entry in modes) { PhxLuaRuntime.Table mode = entry.Value as PhxLuaRuntime.Table; string modeNamePath = mode.Get <string>("showstr"); if (mode.Get("bIsWildcard") == null) { PhxListBoxItem item = LstModes.AddItem(ENV.GetLocalized(modeNamePath)); Texture2D icon = TextureLoader.Instance.ImportUITexture(mode.Get <string>("icon")); item.SetIcon(icon); string key = mode.Get <string>("key"); item.SetChecked(LastCheckedModes.Contains(key)); item.OnCheckChanged += (bool check) => { if (check) { LastCheckedModes.Add(key); } else { LastCheckedModes.Remove(key); } }; ModeSubs.Add(new SubIcon { Sub = mode.Get <string>("subst"), Icon = icon }); } } res = RT.CallLuaFunction("missionlist_ExpandEralist", 1, mapluafile); PhxLuaRuntime.Table eras = res[0] as PhxLuaRuntime.Table; foreach (KeyValuePair <object, object> entry in eras) { PhxLuaRuntime.Table era = entry.Value as PhxLuaRuntime.Table; string eraNamePath = era.Get <string>("showstr"); if (era.Get("bIsWildcard") == null) { PhxListBoxItem item = LstEras.AddItem(ENV.GetLocalized(eraNamePath)); Texture2D icon = TextureLoader.Instance.ImportUITexture(era.Get <string>("icon2")); item.SetIcon(icon); string key = era.Get <string>("key"); item.SetChecked(LastCheckedEras.Contains(key)); item.OnCheckChanged += (bool check) => { if (check) { LastCheckedEras.Add(key); } else { LastCheckedEras.Remove(key); } }; EraSubs.Add(new SubIcon { Sub = era.Get <string>("subst"), Icon = icon }); } } }
public void InitClass(EntityClass ec) { Name = ec.Name; ClassType = ec.ClassType; if (ClassType == EEntityClassType.WeaponClass) { string locPath = "weapons."; int splitIdx = Name.IndexOf('_'); locPath += Name.Substring(0, splitIdx) + ".weap." + Name.Substring(splitIdx + 1).Replace("weap_", ""); LocalizedName = ENV?.GetLocalized(locPath); } else { string locPath = "entity."; int splitIdx = Name.IndexOf('_'); locPath += Name.Substring(0, splitIdx) + '.' + Name.Substring(splitIdx + 1); LocalizedName = ENV?.GetLocalized(locPath); } Type type = GetType(); MemberInfo[] members = type.GetMembers(); foreach (MemberInfo member in members) { if (member.MemberType == MemberTypes.Field) { if (typeof(IPhxPropRef).IsAssignableFrom(type.GetField(member.Name).FieldType)) { IPhxPropRef refValue = type.GetField(member.Name).GetValue(this) as IPhxPropRef; P.Register(member.Name, refValue); PhxPropertyDB.AssignProp(ec, member.Name, refValue); } else if (typeof(PhxPropertySection).IsAssignableFrom(type.GetField(member.Name).FieldType)) { PhxPropertySection section = type.GetField(member.Name).GetValue(this) as PhxPropertySection; // Read properties from top to bottom to fill property sections ec.GetAllProperties(out uint[] propHashes, out string[] propValues); Debug.Assert(propHashes.Length == propValues.Length); var foundSections = new List <Dictionary <string, IPhxPropRef> >(); Dictionary <string, IPhxPropRef> currSection = null; for (int i = 0; i < propHashes.Length; ++i) { // Every time we encounter the section header, start a new section if (propHashes[i] == section.NameHash) { foundSections.Add(new Dictionary <string, IPhxPropRef>()); currSection = foundSections[foundSections.Count - 1]; } if (currSection != null) { for (int j = 0; j < section.Properties.Length; ++j) { string propName = section.Properties[j].Item1; uint propNameHash = HashUtils.GetFNV(propName); // if we encounter a matching property, grab it if (propHashes[i] == propNameHash) { IPhxPropRef prop = section.Properties[j].Item2.ShallowCopy(); prop.SetFromString(propValues[i]); currSection.Add(propName, prop); } } } } section.SetSections(foundSections.ToArray()); } } } EntityClass = ec; }