コード例 #1
0
 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
ファイル: RemeshActorWorker.cs プロジェクト: kf6kjg/halcyon
 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
ファイル: YunPianSender.cs プロジェクト: gowhy/MicroWish
        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
ファイル: EmailSender.cs プロジェクト: gowhy/LoveBank
        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);
        }
コード例 #8
0
 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
ファイル: Form1.cs プロジェクト: sluckywhh/cie-middleware
 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
ファイル: EmailSender.cs プロジェクト: gowhy/LoveBank
        /// <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
ファイル: InoLinkSender.cs プロジェクト: gowhy/LoveBank
        /// <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);
        }
コード例 #32
0
 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);
        }