コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
ファイル: PhxMainMenu.cs プロジェクト: Ben1138/SWBF2Phoenix
    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);
            }
        }
    }
コード例 #3
0
        public request()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
        }
コード例 #4
0
ファイル: Details.cs プロジェクト: ermirbeqiraj/bearer-tokens

        
コード例 #5
0
        public company()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
            loadData();
        }
コード例 #6
0
        public add_wallet()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
            panel1.Visible = false;
        }
コード例 #7
0
 private void Uninstall(object sender, RoutedEventArgs e)
 {
     if (ENV.IsAdministrator())
     {
         AdminUninstall();
     }
     else
     {
         Cmd.RunAsAdmin(ENV.EntryLocation, ARG_UNINSTALL);
     }
 }
コード例 #8
0
        public master_list()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
            DisplayFixer();
            displayEmployee();
        }
コード例 #9
0
ファイル: pending.cs プロジェクト: davidgualvez/aps
        public pending()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
            DisplayFixer();
            displayWalletRequest();
        }
コード例 #10
0
            public static string getEnv(string pName, string pDef)
            {
                ENV.LOAD();

                if (envKeys_.ContainsKey(pName))
                {
                    return(envKeys_[pName].val);
                }

                return(pDef);
            }
コード例 #11
0
ファイル: viewParkingFee.cs プロジェクト: davidgualvez/aps
        public viewParkingFee()
        {
            InitializeComponent();
            //--Connecting to Database------
            ENV i = new ENV();

            con = new MySqlConnection(i.constr);
            //------------------------------
            DisplayFixer();
            displayParkingFee();
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        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);
            }
        }
コード例 #15
0
        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);
        }
コード例 #16
0
            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);
                    }
                });
            }
コード例 #17
0
        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";
            }
        }
コード例 #18
0
        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";
            }
        }
コード例 #19
0
ファイル: PhxMainMenu.cs プロジェクト: Ben1138/SWBF2Phoenix
    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);
        }
    }
コード例 #20
0
                public static void ADD(string pName, string pVal)
                {
                    PARSE(pName + "," + pVal);

                    ENV.SAVE();
                }
コード例 #21
0
ファイル: Project.cs プロジェクト: ermirbeqiraj/bearer-tokens
        public void AddDetails(string url, string bearerToken, ENV env, string appInsights)
        {
            var details = new Details(url, bearerToken, env, appInsights);

            _details.Add(details);
        }
コード例 #22
0
ファイル: PhxMainMenu.cs プロジェクト: Ben1138/SWBF2Phoenix
    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
                });
            }
        }
    }
コード例 #23
0
    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;
    }