コード例 #1
0
        public HotKey AddHotKey(HotKey hotKey)
        {
            try
            {
                if (hotKey == null)
                {
                    throw new ArgumentNullException("value");
                }
                /* We let em add as many null keys to the list as they want, but never register them*/
                if (hotKey.Key != Key.None && hotKeys.ContainsValue(hotKey))
                {
                    throw new HotKeyAlreadyRegisteredException("HotKey already registered!", hotKey);
                    //Log.O("HotKey already registered!");
                }


                int id = idGen.Next();
                if (hotKey.Enabled && hotKey.Key != Key.None)
                {
                    RegisterHotKey(id, hotKey);
                }
                hotKey.PropertyChanging += hotKey_PropertyChanging;
                hotKey.PropertyChanged  += hotKey_PropertyChanged;
                hotKeys[id]              = hotKey;
                return(hotKey);
            }
            catch (HotKeyAlreadyRegisteredException e)
            {
                Log.O("HotKey already registered!");
            }
            return(null);
        }
コード例 #2
0
        /// <summary>
        /// 객체 생성
        /// </summary>
        /// <param name="readerName"></param>
        public reader(string readerName)
        {
            ReaderName = readerName;
            string path = string.Format(@"{0}\LOG_NL_RFID1000\{1}", System.Windows.Forms.Application.StartupPath, readerName);

            Log = new Util.Log(path, readerName, 30, true);

            Log.WLog(string.Format("NL RFID 1000 관리 객체를 생성합니다. [ReaderName]{0}", ReaderName));
        }
コード例 #3
0
ファイル: TaskBOT.cs プロジェクト: XtremeOwnage/WarBot
        public void Start(Util.Log Log)
        {
            Log.Debug("Start TaskBot() called.").Wait();

            ////Login  and start discord api.
            Client.LoginAsync(TokenType.Bot, BOT.Config.Discord_API_Token, true).Wait();
            Client.Ready += Client_Ready;
            Client.StartAsync().Wait();
        }
コード例 #4
0
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == WM_HotKey)
            {
                Log.O("HotKeys WndProc: IsEnabled - {0}", IsEnabled.ToString());
                if (IsEnabled && hotKeys.ContainsKey((int)wParam))
                {
                    HotKey h = hotKeys[(int)wParam];
                    Log.O("HotKeys WndProc: HotKey - {0}", h.KeysString);
                    if (h.Global)
                    {
                        if (h.Command != null)
                        {
                            h.Command.Execute(null, _window);
                        }
                    }
                }
            }

            return(new IntPtr(0));
        }
コード例 #5
0
        public bool Proccess(ProgramacaoTarefa programacaoTarefa)
        {
            var           log      = new Util.Log(ConfigurationManager.AppSettings["LogServico"]);
            RestDto <Log> response = null;

            try
            {
                _processBatch = new Repository.ApiClient.ProcessBatch(string.Empty, programacaoTarefa?.Tarefa.UrlAPI);
                response      = _processBatch.Process(programacaoTarefa).Result;
                if (response.StatusCode == HttpStatusCode.Unauthorized)
                {
                    this.RenovaToken();
                    this.Proccess(programacaoTarefa);
                }
            }
            catch (Exception ex)
            {
                log.Escreve_Log($"URL Chamada: { programacaoTarefa.Tarefa.UrlAPI}");
                log.Escreve_Log(ex.Message);
                log.Escreve_Log(ex?.StackTrace);
                log.Escreve_Log(ex?.InnerException?.Message);
            }
            return(response.Success);
        }
コード例 #6
0
        public static bool Insert_Order(OracleDB.strConnect strConn, System.Windows.Forms.ListView lv, string strOrderType, Util.Log clsLog, string strStationID, string strUser)
        {
            OracleDB clsDB = new OracleDB(strConn.strTNS, strConn.strID, strConn.strPass);

            OracleParameter[] param = new OracleParameter[] {
                new OracleParameter("ps_ORDERDATE", OracleDbType.Varchar2, 8),
                new OracleParameter("PS_ORDERTYPE", OracleDbType.Varchar2, 8),
                new OracleParameter("PS_STATIONID", OracleDbType.Varchar2, 10),
                new OracleParameter("PS_CARTYPE", OracleDbType.Varchar2, 15),
                new OracleParameter("PS_PARTCODE", OracleDbType.Varchar2, 15),
                new OracleParameter("PS_COLOR", OracleDbType.Varchar2, 10),
                new OracleParameter("PI_TARGET_CNT", OracleDbType.Int32, 8),
                new OracleParameter("ps_USER", OracleDbType.Varchar2, 50),
                new OracleParameter("PS_ALARM", OracleDbType.Varchar2, 2),
                new OracleParameter("PS_ALARMMSG", OracleDbType.Varchar2, 500)
            };



            param[8].Direction = ParameterDirection.Output;
            param[9].Direction = ParameterDirection.Output;


            string strLog = string.Empty;

            try
            {
                clsDB.BeginTransaction();

                strLog = "ORDER를저장을 시작 합니다.\r\n";

                foreach (System.Windows.Forms.ListViewItem li in lv.Items)
                {
                    string strField = string.Empty;

                    param[0].Value = li.SubItems[1].Text.ToString();
                    param[1].Value = strOrderType;
                    param[2].Value = strStationID;
                    param[3].Value = li.SubItems[3].Text.ToString();
                    if (strOrderType == "I")
                    {                                                    //사출 오더
                        param[4].Value = li.SubItems[5].Text.ToString(); //Partcode
                        param[5].Value = DBNull.Value;                   //color
                        strField       = "PARTCODE";
                    }
                    else
                    {                                                    //도장 오더
                        param[4].Value = DBNull.Value;                   //Partcode
                        param[5].Value = li.SubItems[5].Text.ToString(); //color
                        strField       = "COLOR";
                    }

                    int intV = int.Parse(li.SubItems[6].Text.ToString());

                    param[6].Value = intV;
                    param[7].Value = strUser;

                    strLog += string.Format("\t\t ORDERDATE [{0}] ORDERTYPE[{4}] STATIONID[{6}] CARTYPE [{1}] {5} [{2}] TARGET_CNT [{3}]"
                                            , param[0].Value, param[1].Value, param[3].Value, param[3].Value, strOrderType, strField, strStationID);

                    clsDB.intExcute_StoredProcedure("SP_ORDER_INSERT", param);



                    if (param[8].Value.ToString() != "00")
                    {
                        strLog += "\t==>저장실패 :" + param[9].Value.ToString() + "\r\n======>Rollback처리를 합니다.";
                        clsDB.RollBackTransaction();
                        throw new Exception(param[9].Value.ToString());
                    }

                    strLog += "\t==>저장성공\r\n";
                }

                strLog += "======>Commit처리를 합니다.";
                clsDB.CommitTransaction();

                return(true);
            }
            catch
            {
                throw;
            }
            finally
            {
                clsLog.WLog(strLog);
            }
        }