public RemeshActorWorker(PhysxScene scene, PhysxPrim actor, bool isPhysical, CompletedCallback callBack)
 {
     _scene      = scene;
     _actor      = actor;
     _isPhysical = isPhysical;
     _callBack   = callBack;
 }
예제 #2
0
        //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);
        }
예제 #3
0
 public RemeshActorWorker(PhysxScene scene, PhysxPrim actor, bool isPhysical, CompletedCallback callBack)
 {
     _scene = scene;
     _actor = actor;
     _isPhysical = isPhysical;
     _callBack = callBack;
 }
예제 #4
0
    public void mSyncProvider_Completed(WebBrowser wb)
    {
        // Navigation completed, raise event
        CompletedCallback handler = Completed;

        if (handler != null)
        {
            handler(wb);
        }
    }
예제 #5
0
        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();
        }
예제 #6
0
        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)
            }
        }
예제 #7
0
        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);
         }
     }
 }
예제 #9
0
        /*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);
        }
예제 #10
0
 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,
     });
 }
예제 #11
0
 public override IFamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback)
 {
     trace.TraceInformation("GedcomDecoder::CreateFamilyTreeStore( " + fileName + ")");
     callback(true);
     return(null);
 }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
        }
예제 #16
0
 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);
 }
예제 #17
0
파일: SMSSender.cs 프로젝트: gowhy/LoveBank
 /// <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);
예제 #18
0
        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);
        }
예제 #19
0
 static extern int AbbinaCIE(string szPAN, string szPIN, int[] attempts, ProgressCallback progressCallBack, CompletedCallback completedCallBack);
예제 #20
0
        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;
        }
예제 #21
0
        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);
        }
예제 #22
0
        /// <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);
        }
예제 #23
0
        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);
        }
예제 #24
0
 public abstract FamilyTreeStoreBaseClass CreateFamilyTreeStore(String fileName, CompletedCallback callback);
예제 #25
0
 public void ScavengeCompleted(ScavengeResult result, string error, TimeSpan elapsed)
 {
     Completed = true;
     Result    = result;
     CompletedCallback?.Invoke(this, EventArgs.Empty);
 }
예제 #26
0
 public abstract bool OpenFile(String fileName, ref FamilyTreeStoreBaseClass inFamilyTree, CompletedCallback callback);
예제 #27
0
 public void Resume(string xpacksFolder, UpdateCallback updateCallback, CompletedCallback completedCallback)
 {
     // Interrupting is not supported so nothing to do here.
 }
예제 #28
0
        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);
        }
예제 #29
0
 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);
 }
예제 #30
0
        /// <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));
            }
        }
예제 #31
0
        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());
 }
예제 #33
0
        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);
        }