public RemeshActorWorker(PhysxScene scene, PhysxPrim actor, bool isPhysical, CompletedCallback callBack) { _scene = scene; _actor = actor; _isPhysical = isPhysical; _callBack = callBack; }
//public static void DeleteFileIfExists(string scanId) //{ // string path = GetResultsFilePath(scanId); // if (File.Exists(path)) // File.Delete(path); //} public static void SaveResults(CompletedCallback completedCallback, string scanId) { string json = JsonConvert.SerializeObject(completedCallback); string resultFilePath = GetResultsFilePath(scanId); File.WriteAllText(resultFilePath, json); }
public void mSyncProvider_Completed(WebBrowser wb) { // Navigation completed, raise event CompletedCallback handler = Completed; if (handler != null) { handler(wb); } }
public override void Send(string phoneNo, string content, object userToken, CompletedCallback callback) { const string url = ServerUrl + SendMsgMethod; var request = new HttpPost(url) { ContentEncoding = "UTF-8" }; request.Params.Add("apikey", _apiKey); request.Params.Add("mobile", phoneNo); request.Params.Add("text", "【】" + content); request.Request(); }
private void SendMail(MailMessage message, object userToken, CompletedCallback callback) { try { var smtp = new Smtp(_host, _port, _withSsl, _account, _password); //委托中转 if (callback != null) { smtp.SmtpClient.SendCompleted += (sender, e) => callback(sender, e); } //发送异步邮件 smtp.SmtpClient.SendAsync(message, userToken); } catch (Exception ex) { //Log.Exception(ex) } }
public ReadFileWorker( object sender, ProgressReporterInterface progress, string filename, ref FamilyTreeStoreBaseClass tree, CompletedCallback callback) { trace = new TraceSource("ReadFileWorker", SourceLevels.Warning); familyTree = tree; progressReporter = progress; backgroundWorker = new BackgroundWorker(); backgroundWorker.WorkerReportsProgress = true; backgroundWorker.DoWork += new DoWorkEventHandler(DoWork); backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Completed); backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(ProgressChanged); completedCallback = callback; codec = new FamilyFileTypeCollection(); if (codec.IsKnownFileType(filename)) { trace.TraceInformation("ReadFileWorker.DoWork(" + filename + "): OK!" + DateTime.Now); if (familyTree == null) { familyTree = codec.CreateFamilyTreeStore(filename, completedCallback); } codec.SetProgressTarget(backgroundWorker); familyTree.SetSourceFileName(filename); } else { trace.TraceInformation("ReadFileWorker(" + workerFileName + "): Filetype unknown!" + DateTime.Now); } workerFileName = filename; backgroundWorker.RunWorkerAsync(filename); }
private static async Task PerformTimeMeasuringAsync <T>(T profiler, TimeMeasureOptions options, Func <T, Task> handler) where T : TimeMeasureProfiler { try { profiler.Timer.Start(); await handler(profiler).ContinueWithSuppressedContext(); } catch (TargetInvocationException ex) { throw ex.InnerException ?? ex; // don't confuse the end-user with reflection related details; return the originating exception } finally { profiler.Timer.Stop(); if (options.TimeMeasureCompletedThreshold == TimeSpan.Zero || profiler.Elapsed > options.TimeMeasureCompletedThreshold) { CompletedCallback?.Invoke(profiler); } } }
/*public bool OpenWeb(String fileName, FamilyTreeStoreBaseClass inFamilyTree) * { * foreach (FamilyFileTypeBaseClass fileType in codecList) * { * trace.TraceInformation("OpenWeb(" + fileName + "):" + fileType.GetType() + ":" + fileType.IsKnownFileType(fileName)); * if (fileType.GetFileTypeWebName() == fileName) * { * //selectedType = GetType(fileType); * return fileType.OpenFile(fileName, inFamilyTree); * } * } * return false; * }*/ public FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { if ((fileName == null) || (fileName == "")) { FamilyTreeStoreRam nativeStore = new FamilyTreeStoreRam(); callback(true); return(nativeStore); } foreach (FamilyFileTypeBaseClass fileType in codecList) { trace.TraceInformation("CreateFamilyTreeStore " + fileType.GetType() + ":" + fileType.IsKnownFileType(fileName)); if (fileType.IsKnownFileType(fileName)) { selectedType = GetType(fileType); return(fileType.CreateFamilyTreeStore(fileName, callback)); } } trace.TraceInformation("CreateFamilyTreeStore():null"); callback(false); return(null); }
internal void register(object obj, float time, float delay, ETransition transition, IDictionary <string, object> properties, CompletedCallback callback) { _registerInfosInit.Add(new RegisterInfo() { obj = obj, time = time, delay = delay, transition = transition, // startTime = Time.time + delay, properties = properties, callback = callback, }); }
public override IFamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { trace.TraceInformation("GedcomDecoder::CreateFamilyTreeStore( " + fileName + ")"); callback(true); return(null); }
public override bool OpenFile(String fileName, ref IFamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { trace.TraceInformation("GedcomDecoder::OpenFile( " + fileName + ")"); bool result = ReadFile(fileName, ref inFamilyTree); callback(result); return(result); }
public override FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { FamilyTreeStoreRam ramStore = new FamilyTreeStoreRam(); trace.TraceInformation("XmlFileType::CreateFamilyTreeStore( " + fileName + ")" + DateTime.Now); ramStore.SetSourceFileName(fileName); //FileStream fileStream = new FileStream(fileName, FileMode.CreateNew); //ramStore.SetFile(fileName); callback(true); return((FamilyTreeStoreBaseClass)ramStore); }
public override bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { //FamilyTreeStoreRam ramStore = (FamilyTreeStoreRam)inFamilyTree; trace.TraceInformation("XmlFileType::OpenFile( " + fileName + ") start " + DateTime.Now); FileStream fileStream = new FileStream(fileName, FileMode.Open); if (fileStream != null) { //DataContractSerializer serializer = new DataContractSerializer(typeof(FamilyTreeStoreRam)); DataContractSerializer serializer = new DataContractSerializer(inFamilyTree.GetType()); try { inFamilyTree = (FamilyTreeStoreBaseClass)serializer.ReadObject(fileStream); } catch (SerializationException e) { trace.TraceInformation("Exceptions:" + e.ToString()); inFamilyTree = null; } catch (ArgumentNullException e) { trace.TraceInformation("Exceptions:" + e.ToString()); inFamilyTree = null; } fileStream.Close(); } trace.TraceInformation("XmlFileType::OpenFile( " + fileName + ") done " + DateTime.Now); //anarkivStore.SetFile(fileName); callback(true); return(true); }
public override FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { FamilyTreeStoreMyHeritage webStore = new FamilyTreeStoreMyHeritage(); if (printFlag) { trace.TraceInformation("MyHeritageFileType::CreateFamilyTreeStore( " + fileName + ")"); } webStore.SetFile(fileName); callback(true); return((FamilyTreeStoreBaseClass)webStore); }
public static void add(object obj, float time, float delay, ETransition transition, IDictionary <string, object> properties, CompletedCallback callback = null) { Tweener.get().register(obj, time, delay, transition, properties, callback); }
/// <summary> /// 发送短信 /// </summary> /// <param name="phoneNo">发送的手机号</param> /// <param name="content">发送的内容</param> /// <param name="userToken">回调用户标识</param> /// <param name="callback">回调函数</param> public abstract void Send(string phoneNo, string content,object userToken, CompletedCallback callback);
public override bool OpenFile(String fileName, ref IFamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { if (GeniStore != null) { trace.TraceData(TraceEventType.Warning, 0, "Tree is not null"); } GeniStore = (FamilyTreeStoreGeni2)inFamilyTree; trace.TraceInformation("GeniFileType::OpenFile( " + fileName + ")"); GeniStore.SetFile(fileName); if (!GeniStore.CallbackArmed()) { callback(true); } return(true); }
static extern int AbbinaCIE(string szPAN, string szPIN, int[] attempts, ProgressCallback progressCallBack, CompletedCallback completedCallBack);
public void Create(string xpacksFolder, ImageMapInformation map, UpdateCallback updateCallback, CompletedCallback completedCallback) { IsFetchingData = true; Cancel = false; try { // Create the Main texture. CreateTexture(xpacksFolder, map); if (!Cancel) { completedCallback?.Invoke(true); } } catch { completedCallback?.Invoke(false); // Report in that something went wrong. } IsFetchingData = false; }
public override FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { FamilyTreeStoreAnarkiv anarkivStore = new FamilyTreeStoreAnarkiv(); trace.TraceInformation("AnarkivFileType::CreateFamilyTreeStore( " + fileName + ")"); anarkivStore.SetFile(fileName); callback(true); return((FamilyTreeStoreBaseClass)anarkivStore); }
/// <summary> /// 发送邮件 /// </summary> /// <param name="email">收件地址,必须是有效的Email</param> /// <param name="title">邮件标题</param> /// <param name="body">邮件内容</param> /// <param name="userToken">传递的标识对象</param> /// <param name="callback">回调函数</param> public void SendMail(string email, string title, string body, object userToken, CompletedCallback callback) { var message = BuildMessageWith(email, title, body); SendMail(message, userToken, callback); }
public override bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { FamilyTreeStoreMyHeritage myHeritageStore = (FamilyTreeStoreMyHeritage)inFamilyTree; if (printFlag) { trace.TraceInformation("MyHeritageFileType::OpenFile( " + fileName + ")"); } myHeritageStore.SetFile(fileName); callback(true); return(true); }
public abstract FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback);
public void ScavengeCompleted(ScavengeResult result, string error, TimeSpan elapsed) { Completed = true; Result = result; CompletedCallback?.Invoke(this, EventArgs.Empty); }
public abstract bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback);
public void Resume(string xpacksFolder, UpdateCallback updateCallback, CompletedCallback completedCallback) { // Interrupting is not supported so nothing to do here. }
public override bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { FamilyTreeStoreAnarkiv anarkivStore; if (inFamilyTree.GetType() == typeof(FamilyTreeStoreAnarkiv)) { anarkivStore = (FamilyTreeStoreAnarkiv)inFamilyTree; } else { anarkivStore = (FamilyTreeStoreAnarkiv)CreateFamilyTreeStore(fileName, callback); ReadFile(ref inFamilyTree, anarkivStore); } trace.TraceInformation("AnarkivFileType::OpenFile( " + fileName + ")"); anarkivStore.SetFile(fileName); callback(true); return(true); }
public bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { foreach (FamilyFileTypeBaseClass fileType in codecList) { trace.TraceInformation("OpenFile(" + fileName + "):" + fileType.GetType() + ":" + fileType.IsKnownFileType(fileName)); if (fileType.IsKnownFileType(fileName)) { //selectedType = GetType(fileType); return(fileType.OpenFile(fileName, ref inFamilyTree, callback)); } } callback(false); return(false); }
/// <summary> /// 发送短信 /// </summary> /// <param name="phoneNo">发送的手机号</param> /// <param name="content">发送的内容</param> /// <param name="userToken">回调标识对象 </param> /// <param name="callback">回调函数</param> public override void Send(string phoneNo, string content, object userToken, CompletedCallback callback) { string url = _serverUrl + "/" + _sendMsgMethod; var request = new HttpPost(url) { ContentEncoding="gb2312" }; request.Params.Add("CorpID", _username); request.Params.Add("Pwd", _pwd); request.Params.Add("Mobile", phoneNo); request.Params.Add("Content", content); request.Params.Add("Cell", ""); request.Params.Add("SendTime",""); try { string result = request.Request(); callback(request, GetEventArgs(result, userToken)); } catch (Exception ex) { callback(request, new AsyncCompletedEventArgs(ex, false, userToken)); } }
public override IFamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback) { if (GeniStore == null) { GeniStore = new FamilyTreeStoreGeni2(callback, null); } trace.TraceInformation("GeniFileType::CreateFamilyTreeStore( " + fileName + ")"); GeniStore.SetFile(fileName); return((IFamilyTreeStoreBaseClass)GeniStore); }
public IActionResult CompletedProcess(string scanId, [FromBody] CompletedCallback scanResults) { // Do something with the scan results ResultFile.SaveResults(scanResults, scanId); return(Ok()); }
public override bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback) { FamilyTreeStoreGeni2 GeniStore = (FamilyTreeStoreGeni2)inFamilyTree; trace.TraceInformation("GeniFileType::OpenFile( " + fileName + ")"); GeniStore.SetFile(fileName); if (!GeniStore.CallbackArmed()) { callback(true); } return(true); }