public List <string> getDefaultMgrPlats(string userId, string platFatherId) { List <string> currPlats = findSubPlatId(platFatherId); List <string> userPlats = findPlatsByUserId(userId); return(ComUtil.getIntersection(currPlats, userPlats)); }
/// <summary> /// Inicializar pantalla actual /// </summary> protected override void OnInit() { Instance = this; List <Transform> findPages = new List <Transform>(); ComUtil.GetTransformInChild(mFindNames, CacheTransform, ref findPages); List <Transform> findLevels = new List <Transform>(); for (int i = 0; i < findPages.Count; i++) { if (findPages[i].name.Equals(mFindNames[0]) || findPages[i].name.Equals(mFindNames[1]) || findPages[i].name.Equals(mFindNames[2])) { Image mPage1 = findPages[i].GetComponent <Image>(); mPages.Add(mPage1); string s = findPages[i].name.Substring(findPages[i].name.Length - 1, 1); int page = 0; int.TryParse(s, out page); if (page != 0) { findLevels.Clear(); ComUtil.GetTransformInChild(mFindNames1, findPages[i], ref findLevels); for (int j = 0; j < findLevels.Count; j++) { int level = 0; int.TryParse(findLevels[j].name, out level); if (level != 0) { Button btn = findLevels[j].GetComponent <Button>(); LevelBtn levelBtn = new LevelBtn(btn, level + ((page - 1) * 3)); btn.onClick.AddListener(levelBtn.SelectLevel); mLevels.Add(levelBtn); } } } } else { Button btn = findPages[i].GetComponent <Button>(); btn.onClick.AddListener(() => { OnBtnClick(btn); }); if (findPages[i].name.Equals(mFindNames[4])) { mBtnDown = btn; } else { mBtnUp = btn; } } } mCurPage = mPages[0]; DetectionPageBtn(); mLevels.Sort((LevelBtn a, LevelBtn b) => { return(a.level.CompareTo(b.level)); }); }
public List <string> getAllIp() { if (lstIPCache.Count <= 0) { lstIPCache = ComUtil.findAllIp(); } return(lstIPCache); }
/// <summary> /// 查询平台ID /// </summary> /// <param name="handlerId"></param> /// <param name="operate"></param> /// <param name="flag"></param> /// <returns></returns> public List <string> getPlats(string handlerId, string operate, UserInfo ui, bool flag) { List <string> functionRole = findRoleListByHandlerIdAndOperate(operate, handlerId, flag); List <string> currentRoles = findRolesByUserIdAndPlatId(ui.UserId, ui.LastLoginPlat); List <string> rolePlats = findPlatsByRoleId(ComUtil.getIntersection(functionRole, currentRoles)); List <string> userPlats = findPlatsByUserId(ui.UserId); return(ComUtil.getIntersection(rolePlats, userPlats)); }
public void Show(Action callback) { if (GameCfgMgr.Instance.resCfg != null) { ResMgr.Intstance.LoadGroup("Loading", () => { _Show(); if (callback != null) { callback(); } }); return; } List <string> allLoad = new List <string>(); foreach (string ab in loadingAbs) { allLoad.Add(ab); } allLoad.Add(AppConst.CoreDef.CfgABName); Action a = null; a = () => { ComUtil.WWWLoad(AppConst.SourceResPathUrl + "/" + allLoad[0], www => { CompressHelper.DecompressBytesLZMA(www.bytes, AppConst.AppExternalDataPath + "/" + allLoad[0]); allLoad.RemoveAt(0); if (allLoad.Count > 0) { if (a != null) { a(); } } else { GameCfgMgr.Instance.Init(); ResMgr.Intstance.LoadGroup("Loading", () => { _Show(); if (callback != null) { callback(); } }); } }); }; a(); }
public ParticleEmitter(ParticleResourceModel _md, int _maxRenderTime) { md = _md; //zIndex = _zIndex; maxRenderTime = _maxRenderTime; attrBufferId = Gl.GenBuffer(); //bufferId = Gl.GenVertexArray(); texId = Gl.GenTexture(); //texFraBufferId = Gl.GenFramebuffer(); string[] vetex = ComUtil.loadEmbedShader("vParticleEmitter.glsl"); string[] fragment = ComUtil.loadEmbedShader("fParticleEmitter.glsl"); using (GlObject vObject = new GlObject(ShaderType.VertexShader, vetex)) using (GlObject fObject = new GlObject(ShaderType.FragmentShader, fragment)) { // Create program ProgramName = Gl.CreateProgram(); // Attach shaders Gl.AttachShader(ProgramName, vObject.ShaderName); Gl.AttachShader(ProgramName, fObject.ShaderName); // Link program Gl.LinkProgram(ProgramName); // Check linkage status Gl.GetProgram(ProgramName, ProgramProperty.LinkStatus, out int linked); if (linked == 0) { const int logMaxLength = 1024; StringBuilder infolog = new StringBuilder(logMaxLength); int infologLength; Gl.GetProgramInfoLog(ProgramName, 1024, out infologLength, infolog); throw new InvalidOperationException($"unable to link program: {infolog}"); } LocationMVP = getUniformId("uMVP"); LocationIndex = getAttrId("index"); LocationCoord = getAttrId("vCoord"); LocationTex = getUniformId("tex"); LocationNowTime = getUniformId("nowTime"); //LocationZIndex = getUniformId("zIndex"); LocationTotalLifeTime = getUniformId("totalLifeTime"); LocationParticleCount = getUniformId("particleCount"); LocationStartPos = getUniformId("startPos"); } updateImage(); updateAttr(); }
public LevelBtn(Button btn, int level) { this.btn = btn; this.level = level; if (!mImagelock) { Transform tran = ComUtil.FindTransformInChild(btn.transform, "Lock", true); if (tran != null) { mImagelock = tran.GetComponent <Image>(); } } }
/// <summary> /// 组织输入参数实体 /// </summary> /// <returns></returns> private SalerReturnModel GetInput() { SalerReturnModel mdl = new SalerReturnModel(); mdl.CurOrgId = this.CurrentUserOrgId; mdl.ReturnState = cmbReturnStatus.SelectedValue.ToString(); mdl.StrType = cmbType.SelectedValue.ToString(); mdl.StrKeyValue = txtName.Text; mdl.StartDate = ComUtil.formatDate(this.dtStartDate.Text.ToString()); mdl.EndDate = ComUtil.formatDate(this.dtEndDate.Text.ToString()); return(mdl); }
private void Window_Loaded(object sender, RoutedEventArgs e) { IntPtr Handle = new WindowInteropHelper(this).Handle; //隐藏边框 int oldstyle = ComUtil.GetWindowLong(Handle, ComUtil.GWL_STYLE); ComUtil.SetWindowLong(Handle, ComUtil.GWL_STYLE, oldstyle & (~(ComUtil.WS_CAPTION | ComUtil.WS_CAPTION_2)) | ComUtil.WS_EX_LAYERED); //不在Alt+Tab中显示 int oldExStyle = ComUtil.GetWindowLong(Handle, ComUtil.GWL_EXSTYLE); ComUtil.SetWindowLong(Handle, ComUtil.GWL_EXSTYLE, oldExStyle & (~ComUtil.WS_EX_APPWINDOW) | ComUtil.WS_EX_TOOLWINDOW); }
/// <summary> /// 获取对接产品对照表实体 /// </summary> /// <param name="row"></param> /// <returns></returns> protected GpoOutReceiveModel GetGpoCorp_MapModelByRow(DataRow row) { GpoOutReceiveModel Model = new GpoOutReceiveModel(); if (row == null) { return(null); } Model.Psqybm = ComUtil.getStringValue(row, "psqybm", ""); Model.Psqymc = ComUtil.getStringValue(row, "psqymc", ""); return(Model); }
protected override void LoadExternal() { if (isExternal()) { Texture texture = null; if (mAllTextureDic.ContainsKey(this.url)) { if (mAllTextureDic[this.url] == null) { mAllTextureDic.Remove(this.url); texture = null; } else { texture = mAllTextureDic[this.url]; } } if (texture != null) { this.onExternalLoadSuccess(new NTexture(texture)); } else { ComUtil.WWWLoad(this.url, www => { if (www != null && string.IsNullOrEmpty(www.error) && www.texture != null) { mAllTextureDic[www.url] = www.texture; } if (this != null && this.displayObject != null && !this.displayObject.isDisposed) { if (mAllTextureDic.ContainsKey(this.url)) { this.onExternalLoadSuccess(new NTexture(mAllTextureDic[this.url])); } else { this.onExternalLoadFailed(); } } }); } } else { base.LoadExternal(); } }
public async Task SaveData() { App.snapShotViewModel.DeleteAlreadySaved(); string filePath = Path.Combine(ComUtil.GetProcessRootPath(), ComDef.LOGFILENAME); await Task.Run(() => { try { using (FileStream fs = new FileStream(filePath, FileMode.Append, FileAccess.Write)) { using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8)) { List <SnapShot> lstSnapShot = new List <SnapShot>(App.snapShotViewModel.Items); StringBuilder dat = new StringBuilder(); foreach (SnapShot item in lstSnapShot) { dat.Append(item.Id + ComDef.SEPARATECHAT.ToString()); dat.Append(item.CaptureDateTime + ComDef.SEPARATECHAT.ToString()); dat.Append(item.Path + ComDef.SEPARATECHAT.ToString()); dat.Append(item.Category + ComDef.SEPARATECHAT.ToString()); dat.Append(item.IsEmpty + ComDef.SEPARATECHAT.ToString()); dat.Append(item.Accuracy + ComDef.SEPARATECHAT.ToString()); dat.Append(item.Message + ComDef.SEPARATECHAT.ToString()); dat.Append(item.LoadingTime + Environment.NewLine); } string strData = dat.ToString(); sw.Write(strData); sw.Close(); fs.Close(); } } } catch (Exception ex) { App.Current.Dispatcher.Invoke(() => { string msg = "인식 기록 저장 시 에러가 발생하였습니다\n" + ex.Message; MessageBox.Show(msg); }); } }); return; }
//插入操作 private void SaveAdd(Gpo_Product_MapModel productmapitem) { bool flag = ProductCodeCompareBLL.GetInstance("ClientDB").JudgeHisProductCode(productmapitem.ProductCode); if (flag == false) { //产品编码没有重复 ProductCodeCompareBLL.GetInstance("ClientDB").Add_Gpo_Product_Map(productmapitem, out strID); InitCommListDT(); Filter(); issaved = true; ComUtil.MsgBox("保存成功!"); } else { ComUtil.MsgBox("该产品编码已存在!"); } }
//导出作业 public static bool ExportReceive(System.Data.DataTable inDt, string inPath) { bool flag; try { Config config = Config.Intance(); EmedDB.ConnectionString = GetExcelConStr(config, inPath); flag = ExportData10(config, inDt); } catch (Exception exception1) { ComUtil.MsgBox("导出到货错误!"); flag = false; } return(flag); }
protected override void OnInit() { List <Transform> findTrans = new List <Transform>(); ComUtil.GetTransformInChild(mFindNames, CacheTransform, ref findTrans); for (int i = 0; i < findTrans.Count; i++) { if (findTrans[i].name.StartsWith("Btn")) { EventTrigger btn = findTrans[i].GetComponent <EventTrigger>(); EventTrigger.Entry ev = new EventTrigger.Entry(); ev.callback.AddListener((BaseEventData arg0) => { OnBtnClick(btn.gameObject); }); ev.eventID = EventTriggerType.PointerClick; btn.triggers.Add(ev); } } }
/// <summary> /// 取得检索条件 /// </summary> private SalerOrderListModel getSearchKey() { //检索条件 SalerOrderListModel model = new SalerOrderListModel(); model.Order_state = this.cmbItemState.SelectedValue.ToString(); //model.Order_type = this.cmbOrderType.SelectedValue.ToString(); //model.Medical_name = this.txtProductName.Text; switch (cmbType.SelectedValue.ToString()) { case "1": model.BuyerName = StringUtils.repalceSepStr(this.txtName.Text.ToString()); break; case "2": model.OrderCode = StringUtils.repalceSepStr(this.txtName.Text.ToString()); break; } if (this.dtStartDate.Checked == true) { model.StartDate = ComUtil.formatDate(this.dtStartDate.Text.ToString()); } else { model.StartDate = null; } if (this.dtEndDate.Checked == true) { model.EndDate = ComUtil.formatDate(this.dtEndDate.Text.ToString()); } else { model.EndDate = null; } model.OrgId = this.CurrentUserOrgId; model.AreaList = this.CurrentUserAreaList; model.IsFactory = this.CurrentUserIsFactory; model.UserId = this.CurrentUserId; model.PageNum = this.pageNavigator1.CurrentPageIndex; model.PageSize = this.pageNavigator1.PageSize; return(model); }
//private int count = 0; public bool enumWindowsProc(IntPtr hwnd, IntPtr lParam) { int size = 255; StringBuilder lpClassName = new StringBuilder(size); ComUtil.GetClassName(hwnd, lpClassName, lpClassName.Capacity); string text = lpClassName.ToString(); if (!text.Contains("WorkerW")) { return(true); } //if (!text.Contains("WorkerW") && !text.Contains("Progman")) { // return true; //} //++count; //if(count < 12) { // Debug.WriteLine("aa:" + count); // return true; //} IntPtr pWnd = hwnd; pWnd = ComUtil.FindWindowEx(hwnd, IntPtr.Zero, "SHELLDLL_DefView", null); if (pWnd == IntPtr.Zero) { return(true); } pWnd = ComUtil.FindWindowEx(pWnd, IntPtr.Zero, "SysListView32", null); if (pWnd == IntPtr.Zero) { return(true); } //isFindWindow = true; IntPtr Handle = new WindowInteropHelper(GetWindow(this)).Handle; ComUtil.SetParent(Handle, pWnd); return(false); }
private static string GetExcelConStr(Config inConfig, string inPath) { string text2; try { if (inConfig != null) { return("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + inPath + ";Extended Properties=Excel 8.0"); } text2 = ""; } catch (Exception exception1) { ComUtil.MsgBox("Excel数据连接出错!"); text2 = ""; } return(text2); }
public string ValidPath() { string strTodayDir = ComUtil.GetSnapshotDir(); string savePath = ComUtil.GetProcessRootPath() + ComDef.SAVEIMAGEDIR; if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } savePath += strTodayDir; if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } return(savePath); }
private void ignoreMouseEvent() { IntPtr Handle = new WindowInteropHelper(this).Handle; //var mainWindowSrc = HwndSource.FromHwnd(Handle); //if (mainWindowSrc != null) { // if (mainWindowSrc.CompositionTarget != null) { // mainWindowSrc.CompositionTarget.BackgroundColor = Color.FromArgb(0, 0, 0, 0); // } //} if (ComUtil.DwmIsCompositionEnabled()) { ComUtil.MARGINS margin = new ComUtil.MARGINS(); margin.Right = margin.Left = margin.Bottom = margin.Top = -1; ComUtil.DwmExtendFrameIntoClientArea(Handle, ref margin); } //SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_TRANSPARENT | WS_EX_LAYERED); //SetLayeredWindowAttributes(Handle, 0, 128, LWA_ALPHA); }
public static RegistryCaptureKey RegisterAssembly(string fullPath) { // Capture the registration. RegistryCaptureKey captureKey; using (RegistryCapture registryCapture = new RegistryCapture(Constants.Wix.RegistryCaptureName)) { Assembly assembly = Assembly.LoadFile(fullPath); ComUtil.RegisterForInterop(assembly); captureKey = registryCapture.Capture(); } // The assembly may have been loaded from the GAC which will be reflected in paths etc. Need to fix them up. string fileName = Path.GetFileName(fullPath); ResolvePaths(captureKey, fileName, fullPath); return(captureKey); }
private async void Capture() { SnapShot snapShot = new SnapShot(); string now = ComUtil.GetSnapshotDir(); string savePath = ComUtil.GetProcessRootPath() + ComDef.SAVEIMAGEDIR; if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } savePath += now; if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } string filename = DateTime.Now.ToString("yyyyMMdd_HHmmssfff"); string imagePath = savePath + "\\" + filename; string strResult = string.Empty;//WebcamViewer.TakeSnapshot(imagePath); if (string.IsNullOrEmpty(strResult)) return; image.Source = new BitmapImage(new Uri(strResult, UriKind.Absolute)); snapShot = await CheckDish(strResult); snapShot.CaptureDateTime = DateTime.Now.ToString("G"); snapShot.Id = filename; snapShot.Path = strResult; App.snapShotViewModel.Add(snapShot); EnableRecog(false); return; }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { AddLog("프로그램이 시작되었습니다."); string ip = ComUtil.CheckPublicIP(); if (ip == null) { AddLog("IP를 알 수 없습니다" + ip, false); } else { AddLog("IP: " + ip); } NetWorkChange(); Thread netcheckThread = new Thread(new ThreadStart(Run)); netcheckThread.IsBackground = true; netcheckThread.Start(); }
protected override void OnInit() { mCurrentLevel = LevelMgr.Instance.mCurrentLevel; List <Transform> findTrans = new List <Transform>(); ComUtil.GetTransformInChild(mFindNames, CacheTransform, ref findTrans); for (int i = 0; i < findTrans.Count; i++) { if (findTrans[i].name.Equals(mFindNames[0])) { mScoreText = findTrans[i].GetComponent <Text>(); } else { Button btn = findTrans[i].GetComponent <Button>(); btn.onClick.AddListener(OnRestartClick); } } }
private void appendToWindow() { IntPtr Handle = new WindowInteropHelper(this).Handle; //隐藏边框 int oldstyle = ComUtil.GetWindowLong(Handle, ComUtil.GWL_STYLE); ComUtil.SetWindowLong(Handle, ComUtil.GWL_STYLE, oldstyle & (~(ComUtil.WS_CAPTION | ComUtil.WS_CAPTION_2)) | ComUtil.WS_EX_LAYERED); //不在Alt+Tab中显示 int oldExStyle = ComUtil.GetWindowLong(Handle, ComUtil.GWL_EXSTYLE); ComUtil.SetWindowLong(Handle, ComUtil.GWL_EXSTYLE, oldExStyle & (~ComUtil.WS_EX_APPWINDOW) | ComUtil.WS_EX_TOOLWINDOW); //win7 if (Environment.OSVersion.Version.Major <= 6.1) { return; } IntPtr pWnd = ComUtil.FindWindow("Progman", null); if (pWnd != IntPtr.Zero) { IntPtr pWnd2 = ComUtil.FindWindowEx(pWnd, IntPtr.Zero, "SHELLDLL_DefView", null); if (pWnd2 != IntPtr.Zero) { ComUtil.SendMessage(pWnd, 0x052c, IntPtr.Zero, IntPtr.Zero); } else { //SendMessage(pWnd, 0x052c, (IntPtr)1, IntPtr.Zero); } } enumWinCallBack = new ComUtil.CallBack(enumWindowsProc); ComUtil.EnumWindows(enumWinCallBack, IntPtr.Zero); }
internal ComMethodDesc(ITypeInfo typeInfo, FUNCDESC funcDesc) : this(funcDesc.memid) { InvokeKind = funcDesc.invkind; string[] rgNames = new string[1 + funcDesc.cParams]; typeInfo.GetNames(DispId, rgNames, rgNames.Length, out int cNames); bool skipLast = false; if (IsPropertyPut && rgNames[rgNames.Length - 1] == null) { rgNames[rgNames.Length - 1] = "value"; cNames++; skipLast = true; } Debug.Assert(cNames == rgNames.Length); Name = rgNames[0]; ParamCount = funcDesc.cParams; ReturnType = ComUtil.GetTypeFromTypeDesc(funcDesc.elemdescFunc.tdesc); ParameterInformation = ComUtil.GetParameterInformation(funcDesc, skipLast); }
public override void OnInit() { List <Transform> findTrans = new List <Transform>(); ComUtil.GetTransformInChild(mFindNames, this.transform, ref findTrans); for (int i = 0; i < findTrans.Count; i++) { Transform tran = findTrans[i]; //处理所有按钮 if (tran.name.Contains("Btn")) { Button button = tran.GetComponent <Button>(); button.onClick.AddListener(() => { OnBtnClick(button); }); } //处理所有文本 else if (tran.name.Contains("Text")) { InitTextLayer(tran); } } }
public void Init(Action callBack) { Debug.LogWarning("准备获取下载网址"); RemotelyVersionInfo allinfo = null; //string allverinfoName = LocalGameCfg.IsPublic ? "allverinfo.json" : "allverinfoTest.json"; string url = GameCfgMgr.Instance.localGameCfg.RemotelyResUrl; ComUtil.WWWLoad(url, a => { if (a != null && string.IsNullOrEmpty(a.error)) { try { allinfo = JsonUtility.FromJson <RemotelyVersionInfo>(a.text); Debug.LogWarning("远程版本信息" + a.text); if (allinfo.vers.Count > GameCfgMgr.Instance.localGameCfg.chanelType) { downLoadInfo = allinfo.vers[GameCfgMgr.Instance.localGameCfg.chanelType]; } } catch (Exception) { Debug.LogError("请求下载网址出错 错误:" + a.text); } Debug.Log("资源下载地址:" + url); a.Dispose(); } else { Debug.LogError("请求下载网址出错 错误:" + url); } RefreshLocalVerInfo(callBack); }); }
public string RegisterDll(string fullPath) { // It may be a .NET DLL or a COM dll. Try .NET first. Assembly assembly = null; try { // Use LoadFile since the assembly is just being examined and not executed. assembly = Assembly.LoadFile(fullPath); } catch (System.BadImageFormatException) { } if (assembly != null) { // If needed register the assembly for COM interop. if (ComUtil.CanRegisterForInterop(assembly)) { ComUtil.RegisterForInterop(assembly); return(string.Format(Messages.RegisteredForInterop, fullPath)); } } else { // Try registering the file as a COM DLL. //RegisterUtil.RegisterDll(fullPath); //return string.Format(Resources.Messages.RegisteredForCom, fullPath); } return(null); }
/// <summary> /// 获取对接产品对照表实体 /// </summary> /// <param name="row"></param> /// <returns></returns> protected GpoOutReceiveModel GetGpoProductMapModelByRow(DataRow row) { GpoOutReceiveModel Model = new GpoOutReceiveModel(); if (row == null) { return(null); } Model.Ypbm = ComUtil.getStringValue(row, "product_code", ""); Model.Ypmc = ComUtil.getStringValue(row, "common_name", ""); Model.Cpmc = ComUtil.getStringValue(row, "product_name", ""); Model.Jxmc = ComUtil.getStringValue(row, "mode_name", ""); Model.Ggmc = ComUtil.getStringValue(row, "medicalspec", ""); Model.Bzdw = ComUtil.getStringValue(row, "BASE_MEASURE", ""); Model.Zxsydw = ComUtil.getStringValue(row, "BASEMEASURESPEC", ""); Model.Zhb = ComUtil.getStringValue(row, "stand_rate", ""); Model.Scqybm = ComUtil.getStringValue(row, "factory_code", ""); Model.Scqymc = ComUtil.getStringValue(row, "factory_name", ""); Model.Ykbm = ComUtil.getStringValue(row, "stock_id", ""); Model.Ykmc = ComUtil.getStringValue(row, "stock_name", ""); return(Model); }