Пример #1
0
 static CommandLineParser()
 {
     stringDecrypterTypes.Add(DecrypterType.None, "none", "Don't decrypt strings");
     stringDecrypterTypes.Add(DecrypterType.Default, "default", "Use default string decrypter type (usually static)");
     stringDecrypterTypes.Add(DecrypterType.Static, "static", "Use static string decrypter if available");
     stringDecrypterTypes.Add(DecrypterType.Delegate, "delegate", "Use a delegate to call the real string decrypter");
     stringDecrypterTypes.Add(DecrypterType.Emulate, "emulate", "Call real string decrypter and emulate certain instructions");
 }
    //ToDo add rotation info
    public void loop()
    {
        float time = Time.time - lastTime;

        if (time > 0)
        {
            position    = userCamera.transform.position;
            velocity    = (position - lastPosition) / time;
            orientation = userCamera.transform.localRotation;
            Infos info = new Infos(8);
            info.Add("Time", time);
            info.Add("Velocity X", velocity.x);
            info.Add("Velocity Y", velocity.y);
            info.Add("Velocity Z", velocity.z);
            info.Add("Orientation X", orientation.x);
            info.Add("Orientation Y", -1 * orientation.y);
            info.Add("Orientation Z", -1 * orientation.z);
            info.Add("Orientation W", orientation.w);
            if (VadRAnalyticsManager.IsMediaActive())
            {
                VadRAnalyticsManager.RegisterEvent("vadrMedia Position", position, info);
            }
            else
            {
                VadRAnalyticsManager.RegisterEvent("vadrPosition", position, info);
            }
            lastPosition = position;
            lastTime     = Time.time;
        }
    }
Пример #3
0
        public DBPropertyConvertInfo FindBaseInfo(string _typeName)
        {
            if (_typeName.Length == 0)
            {
                return(null);
            }
            var result = Infos.Find((v) => { return(v.IsType(_typeName)); });

            if (result != null)
            {
                return(result);
            }
            else
            {
                var type = CustomEnum.Find((v) => { return(_typeName == v.Name); });

                if (type != null)
                {
                    result = new DBPropertyConvertInfo(type, null, new DBDataEnum(type), ObjectTo);
                    Infos.Add(result);
                    return(result);
                }
            }

            return(null);
        }
 private ButtonState checkClick(OVRInput.Button button, OVRInput.Controller controller, string key, string eventName)
 {
     if (OVRInput.Get(button, controller))
     {
         if (clickTime[key] > 0)
         {
             return(ButtonState.Pressed); // Pressed
         }
         clickTime[key]     = Time.timeSinceLevelLoad;
         clickPosition[key] = userCamera.transform.position;
         return(ButtonState.Down); // Down
     }
     else if (clickTime[key] > 0)
     {
         Infos info = new Infos(1);
         info.Add("Duration", Time.timeSinceLevelLoad - clickTime[key]);
         VadRAnalyticsManager.RegisterEvent(eventName, clickPosition[key], filterDictionary[key], info, clickTime[key]);
         VadRLogger.debug("Event Registered: " + eventName);
         clickTime[key] = 0.0f;
         return(ButtonState.Up); // Up
     }
     else
     {
         clickTime[key] = 0.0f;
         return(ButtonState.None);
     }
 }
Пример #5
0
 private void Register()
 {
     ServiceProvider = new Incubator();
     ServiceProvider.Set <DbProviderFactory>(NpgsqlFactory.Instance);
     NpgsqlRegistrar.Register(this);
     Infos.Add(new DatabaseInfo(this));
 }
Пример #6
0
 private void Register()
 {
     ServiceProvider = new Incubator();
     ServiceProvider.Set <DbProviderFactory>(OracleClientFactory.Instance);
     OracleRegistrar.Register(this);
     Infos.Add(new DatabaseInfo(this));
 }
Пример #7
0
        /// <summary>
        /// Runs in the Context of a lock, and therefor can contain non thread safe calls.
        /// </summary>
        /// <param name="logicalName">Name of the logical.</param>
        private void SingleThreadAdd(string logicalName)
        {
            DependencyOrderLog.Enqueue("Processing entity type: " + logicalName);

            var info = new EntityDependencyNodeInfo(logicalName);

            Infos.Add(logicalName, info);

            if (Types.Count == 0)
            {
                DependencyOrderLog.Enqueue("No values in the list.  Adding it as first.");
                info.Node = Types.AddFirst(info);
                return;
            }

            var lastDependOn         = Types.LastOrDefault(t => info.DependsOn(t));
            var firstDependOnCurrent = Types.FirstOrDefault(t => t.DependsOn(info));

            if (lastDependOn == null)
            {
                if (firstDependOnCurrent == null)
                {
                    DependencyOrderLog.Enqueue($"{logicalName} does not depend any any already processed types, and no already processed types depend on it.  Adding to end.");
                    info.Node = Types.AddLast(info);
                }
                else
                {
                    DependencyOrderLog.Enqueue($"{logicalName} does not depend any any already processed types, but {firstDependOnCurrent.LogicalName} depends on it.  Adding before.");
                    info.Node = Types.AddBefore(firstDependOnCurrent.Node, info);
                }
                return;
            }

            if (!lastDependOn.DependsOn(info) && !Types.TakeWhile(t => !t.Equals(lastDependOn)).Any(t => t.DependsOn(info)))
            {
                DependencyOrderLog.Enqueue($"No type that has already been processed that occurs before the last type that {logicalName} depends on ({lastDependOn.LogicalName}), depends on the new type.  Adding to end.");
                info.Node = Types.AddAfter(lastDependOn.Node, info);
                return;
            }

            DependencyOrderLog.Enqueue("Reordering Types");
            var newOrder = new LinkedList <EntityDependencyNodeInfo>();

            foreach (var type in Types)
            {
                // Clear IsCurrentlyCyclic
                foreach (var dependency in type.Dependencies.Values)
                {
                    dependency.IsCurrentlyCyclic = false;
                }
                type.Node = null;
            }
            foreach (var type in Infos.Values.OrderByDescending(v => v.Dependencies.Values.Any(d => d.IsRequired)).ThenBy(v => v.LogicalName))
            {
                PopulateNewOrder(newOrder, type);
            }

            Types = newOrder;
        }
Пример #8
0
 public void AddButton(IHeaderButtonInfo info, bool refresh = false)
 {
     Infos.Add(info);
     if (refresh)
     {
         Refresh();
     }
 }
Пример #9
0
 public void AppendInfo(string msg)
 {
     if (Infos == null)
     {
         Infos = new List <string>();
     }
     Infos.Add(msg);
 }
Пример #10
0
 private void Register()
 {
     SelectStar      = true;
     ServiceProvider = new Incubator();
     ServiceProvider.Set <DbProviderFactory>(CacheFactory.Instance);
     CacheRegistrar.Register(this);
     Infos.Add(new DatabaseInfo(this));
 }
Пример #11
0
 public void AppendError(string msg)
 {
     if (Infos == null)
     {
         Infos = new List <string>();
     }
     HasError = true;
     Infos.Add(msg);
 }
Пример #12
0
 private void trackingAcquired()
 {
     if (trackingLostTime >= 0 && !VadRAnalyticsManager.IsDefaultCollectionPause())
     {
         Infos info = new Infos(1);
         info.Add("Time", Time.timeSinceLevelLoad - trackingLostTime);
         VadRAnalyticsManager.RegisterEvent("vadrRift Tracking Lost", trackingLostPos, headsetFilter, info, trackingLostTime);
         trackingLostTime = -1.0f;
     }
 }
Пример #13
0
 public PartiesListViewModel(Entities.Country country, List <Entities.Party> parties, PagingParam pagingParam)
 {
     CountryID   = country.ID;
     CountryName = country.Entity.Name;
     PagingParam = pagingParam;
     foreach (var party in parties)
     {
         Infos.Add(new PartyInfoViewModel(party));
     }
 }
Пример #14
0
 private void ChangeDirectory(DirectoryInfo directory)
 {
     CurrentDirectory     = directory;
     CurrentDirectoryPath = directory.ToString();
     Infos.Clear();
     foreach (var dir in CurrentDirectory.EnumerateDirectories())
     {
         Infos.Add(dir.ToInfo());
     }
     foreach (var file in CurrentDirectory.EnumerateFiles())
     {
         Infos.Add(file.ToInfo());
     }
 }
    public void loop()
    {
        if (totalFrames > 0)
        {
            Vector3 position = userCamera.transform.position;
            float   fps      = fpsSum / totalFrames;
            Infos   info     = new Infos();
            info.Add("FPS", fps);
#if UNITY_ANDROID
            if (cpuUsage > 0)
            {
                info.Add("Cpu Usage", cpuUsage);
            }
            if (residentStorage >= 0 && swapStorage >= 0)
            {
                info.Add("Memory ResidentUsage", residentStorage);
                info.Add("Memory SwapUsage", swapStorage);
            }
#endif
            VadRAnalyticsManager.RegisterEvent("vadrPerformance", position, info);
            fpsSum      = 0;
            totalFrames = 0;
        }
    }
        private void load()
        {
            var responsedhy = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/pricing/uk2/v1.0/%2F" + ms + "?pageIndex=0&pageSize=10")
                              .header("X-RapidAPI-Key", "107dc24922mshbd9bd597451997fp19a55fjsnc869fe1003a4")
                              .asJson <string>();



            res = JsonConvert.DeserializeObject <Info>(responsedhy.Body);

            Console.WriteLine(res.Itineraries[0].PricingOptions[0].Price);

            int ag = res.Itineraries[0].PricingOptions[0].Agents[0];

            foreach (var item in res.Itineraries)
            {
                Useful newo = new Useful();
                Itineraries.Add(item);
                newo.Price         = $"{item.PricingOptions[0].Price}$";
                newo.OutboundLegId = item.OutboundLegId;

                var value  = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).OriginStation;
                var value2 = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).DestinationStation;
                newo.Duration = $"{ res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Duration / 60}h { res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Duration%60} ";
                newo.Deals    = $"{item.PricingOptions.Count}  deals";
                var photo = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Carriers[0];
                newo.Photo = res.Carriers.First(itemm => itemm.Id == photo).ImageUrl;
                if (res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).SegmentIds.Count == 2)
                {
                    newo.Mode = "Direct";
                }
                else
                {
                    newo.Mode = $"{(res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).SegmentIds.Count - 2).ToString()} stop";
                }

                newo.Departuretime = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Departure.Split('T').Last();;
                newo.Departuredate = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Departure.Split('T').First();;
                newo.Arrival       = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Arrival.Split('T').Last();
                newo.ArrivalDate   = res.Legs.First(itemm => itemm.Id == newo.OutboundLegId).Arrival.Split('T').First();
                newo.OriginPlace   = res.Places.First(itemm => itemm.Id == value).Code;
                newo.DestPlace     = res.Places.First(itemm => itemm.Id == value2).Code;
                newo.Destcity      = res.Places.First(itemm => itemm.Id == value2).Name;
                Application.Current.Dispatcher.Invoke(new Action(() => { Infos.Add(newo); }));
                //Infos.Add(newo);
            }
        }
Пример #17
0
        public DBPropertyConvertInfo FindBaseInfo(Type _type)
        {
            var result = Infos.Find((v) => { return(v.BaseType.Equals(_type)); });

            if (result != null)
            {
                return(result);
            }
            else if (_type.IsEnum && false == _type.IsArray)
            {
                result = new DBPropertyConvertInfo(_type, null, new DBDataEnum(_type), ObjectTo);
                Infos.Add(result);
                return(result);
            }

            return(null);
        }
Пример #18
0
        /// <summary>
        /// Runs in the Context of a lock, and therefor can contain non thread safe calls.
        /// </summary>
        /// <param name="logicalName">Name of the logical.</param>
        private void SingleThreadAdd(string logicalName)
        {
            var info = new EntityDependencyInfo(logicalName);

            Infos.Add(logicalName, info);

            if (Types.Count == 0 || Types.First.Value.DependsOn(info))
            {
                // No values in the list or the first value depends on the new info value
                info.Node = Types.AddFirst(info);

                /* Check for any Types that this new type is dependent on.
                 * Consider the Case of A -> B and B -> C
                 * A is added first, it becomes first.  C is added next, and it has no dependency on A or visa versa, so it is added last, then B is added, and it is added first, but C isn't moved
                 * Need to move C to the front, or list discrepency
                 */

                var existingDependent = Types.Skip(1).FirstOrDefault(existingInfo => info.DependsOn(existingInfo));
                if (existingDependent == null)
                {
                    return;
                }

                foreach (var type in Types)
                {
                    if (type == existingDependent)
                    {
                        // Have walked the entire list and come to the one that needs to be moved without finding anything that it depends on, free to move.
                        Types.Remove(existingDependent);
                        existingDependent.Node = Types.AddFirst(existingDependent);
                        return;
                    }
                    if (existingDependent.Dependencies.Contains(type.LogicalName))
                    {
                        Conflicts.Add(string.Format("Circular Reference Found!  {0} was added, which depends on {1}, but {2} depends on {0} and was found before {1}.  If {1} is needed first, add it after {0}", logicalName, existingDependent.LogicalName, type.LogicalName));
                        return;
                    }
                }
            }

            var dependent = Types.Skip(1).FirstOrDefault(existingInfo => existingInfo.DependsOn(info));

            info.Node = dependent == null?Types.AddLast(info) : Types.AddBefore(dependent.Node, info);
        }
Пример #19
0
        public void Update()
        {
            if (LastGet >= DateTime.Now.AddHours(1))
            {
                return;
            }

            LastGet = DateTime.Now;

            string           url  = "https://www.gaitameonline.com/rateaj/getrate";
            string           json = (new System.Net.WebClient()).DownloadString(url);
            ExchangeRateInfo eri  = JsonConvert.DeserializeObject <ExchangeRateInfo>(json);

            Infos.Clear();
            Support.Clear();

            foreach (ExchangeRateInfo.Quote ei in eri.quotes)
            {
                string Frm  = ei.currencyPairCode.Substring(0, 3);
                string Dst  = ei.currencyPairCode.Substring(3, 3);
                float  Rate = float.Parse(ei.bid);

                Infos.Add(new Info()
                {
                    From = Frm,
                    To   = Dst,
                    Rate = Rate,
                    Div  = false
                });

                Infos.Add(new Info()
                {
                    From = Dst,
                    To   = Frm,
                    Rate = Rate,
                    Div  = true
                });

                Support.Add($"{Frm}/{Dst}");
                Support.Add($"{Dst}/{Frm}");
            }
        }
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            Infos.Clear();
            var reader = new StreamReader(File.OpenRead(@"C:\Users\afa\Desktop\Book1.csv"));

            while (!reader.EndOfStream)
            {
                Info i      = new Info();
                var  line   = reader.ReadLine();
                var  values = line.Split(',');
                i.Name      = values[0];
                i.Id        = values[1];
                i.Telephone = values[2];
                i.Date      = DateTime.Now;
                Infos.Add(i);
            }

            DateTime d = new DateTime(2017, 2, 12);

            DateTest.Add(d);
        }
Пример #21
0
        public void Register(string userId, long price, DateTime createdDate)
        {
            if (IsProcessed)
            {
                return;
            }

            var model = Infos?.FirstOrDefault(m => m.UserId.Equals(userId));

            if (model == null)
            {
                model = new BidLastTimeInfo()
                {
                    UserId = userId
                };

                Infos.Add(model);
            }

            model.Price          = price;
            model.CreatedDate    = createdDate;
            model.RegisteredDate = DateTime.UtcNow;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     VerifyPage("", false);
     ePath = Server.MapPath("/UpLoad/");
     try
     {
         var sortnum = Request.Form["sortnum"];
         var itid    = Request.Form["itid"];
         var batta   = HttpUtility.UrlDecode(Request.Form["batta"]);
         var tiid    = Request.Form["tiid"];
         var name    = HttpUtility.UrlDecode(Request.Form["name"]);
         var iid     = Request.Form["iid"];
         var context = HttpUtility.UrlDecode(Request.Form["context"]);
         var csize   = Request.Form["csize"];
         var ccolor  = Request.Form["ccolor"];
         var cposi   = Request.Form["cposi"];
         if (!string.IsNullOrEmpty(itid))
         {
             var itmodel = _infoTypeDal.GetModel(Convert.ToInt32(itid));
             if (null != itmodel)
             {
                 if (!string.IsNullOrEmpty(iid))
                 {
                     var infomodel = _infosDal.GetModel(Convert.ToInt32(iid));
                     infomodel.IName       = name;
                     infomodel.Context     = context;
                     infomodel.ConColor    = ccolor;
                     infomodel.ConPosition = cposi;
                     infomodel.ConSize     = csize;
                     if (batta != infomodel.PicAttID)
                     {
                         var fi = new FileInfo(ePath + batta);
                         if (fi.Exists)
                         {
                             fi.MoveTo(Server.MapPath("/UploadFiles/" + batta));
                             if (!string.IsNullOrEmpty(infomodel.PicAttID))
                             {
                                 var ofi = new FileInfo(Server.MapPath("/UploadFiles/" + infomodel.PicAttID));
                                 if (ofi.Exists)
                                 {
                                     ofi.Delete();
                                 }
                             }
                             infomodel.PicAttID = batta;
                         }
                     }
                     var upres = _infosDal.Update(infomodel);
                     if (upres)
                     {
                         Response.Write("0|~|" + iid);
                         Response.End();
                     }
                     else
                     {
                         Response.Write("1|~|操作失败");
                         Response.End();
                     }
                 }
                 else
                 {
                     var inmodel = new Admin.Model.Infos();
                     inmodel.IName       = name;
                     inmodel.Context     = context;
                     inmodel.ConColor    = ccolor;
                     inmodel.ConPosition = cposi;
                     inmodel.ConSize     = csize;
                     inmodel.Status      = 1;
                     inmodel.IType       = 4;
                     inmodel.TIID        = Convert.ToInt32(tiid);
                     inmodel.NType       = 0;
                     var fi = new FileInfo(ePath + batta);
                     if (fi.Exists)
                     {
                         fi.MoveTo(Server.MapPath("/UploadFiles/" + batta));
                         inmodel.PicAttID = batta;
                     }
                     inmodel.SortNum = Convert.ToInt32(sortnum);
                     var aiid = _infosDal.Add(inmodel);
                     Response.Write("0|~|" + aiid);
                     Response.End();
                 }
             }
             else
             {
                 Response.Write("1|~|操作失败");
                 Response.End();
             }
         }
         else
         {
             Response.Write("1|~|操作失败");
             Response.End();
         }
     }
     catch (System.Threading.ThreadAbortException ex)
     {
     }
     catch (Exception ee)
     {
         Response.Write("1|~|" + ee.Message);
         Response.End();
     }
 }
Пример #23
0
 private static void LogInfo(string error)
 {
     Infos.Add(error);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            VerifyPage("", false);
            ePath = Server.MapPath("/UpLoad/");
            try
            {
                var      id        = Request.QueryString["spid"];
                var      sortnum   = Request.QueryString["sortnum"];
                var      itid      = Request.QueryString["itid"];
                var      batta     = HttpUtility.UrlDecode(Request.QueryString["batta"]);
                var      tiid      = Request.QueryString["tiid"];
                var      name      = HttpUtility.UrlDecode(Request.QueryString["name"]);
                var      iid       = Request.QueryString["iid"];
                var      xPosition = Request.QueryString["xposition"];
                var      yPosition = Request.QueryString["yposition"];
                var      diid      = Request.QueryString["diid"];
                var      bpic      = HttpUtility.UrlDecode(Request.QueryString["bpic"]);
                var      aatta     = HttpUtility.UrlDecode(Request.QueryString["aatta"]);
                var      adtype    = Request.QueryString["adtype"];
                Database db        = DatabaseFactory.CreateDatabase();

                #region 设置背景图

                if (!string.IsNullOrEmpty(bpic) && !string.IsNullOrEmpty(tiid))
                {
                    var timodel = _tempInfoDal.GetModel(Convert.ToInt32(tiid));
                    if (null != timodel)
                    {
                        if (bpic != timodel.AttID)
                        {
                            if (File.Exists(ePath + bpic))
                            {
                                var fi = new FileInfo(ePath + bpic);
                                fi.MoveTo(Server.MapPath("/UploadFiles/" + bpic));
                                timodel.AttID = bpic;
                                var res = _tempInfoDal.Update(timodel);
                                if (res)
                                {
                                    Response.Write("0|~|" + tiid);
                                    Response.End();
                                }
                                else
                                {
                                    Response.Write("1|~|操作失败");
                                    Response.End();
                                }
                            }
                        }
                        else
                        {
                            Response.Write("0|~|" + tiid);
                            Response.End();
                        }
                    }
                }

                #endregion

                #region  除热点

                if (!string.IsNullOrEmpty(diid))
                {
                    var infomodel = _infosDal.GetModel(Convert.ToInt32(diid));
                    if (null != infomodel)
                    {
                        _infosDal.Delete(infomodel.IID);
                        List <SqlParameter> parameters = new List <SqlParameter>();
                        var dtatta = _attaListDal.GetList(" IID=" + infomodel.IID, parameters).Tables[0];
                        if (dtatta.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtatta.Rows.Count; i++)
                            {
                                var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] +
                                          "'; ";
                                DbCommand dbCommanddel = db.GetSqlStringCommand(del);
                                db.ExecuteNonQuery(dbCommanddel);
                                if (DBNull.Value != dtatta.Rows[i]["AttID"])
                                {
                                    if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString()))
                                    {
                                        if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])))
                                        {
                                            var fi = new FileInfo(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]));
                                            fi.Delete();
                                        }
                                    }
                                }
                            }
                        }
                        Response.Write("0|~|" + iid);
                        Response.End();
                    }
                }

                #endregion

                var attsql = string.Empty;

                #region 修改热点

                if (!string.IsNullOrEmpty(iid))
                {
                    var infomodel = _infosDal.GetModel(Convert.ToInt32(iid));
                    infomodel.IName     = name;
                    infomodel.XPosition = xPosition;
                    infomodel.YPosition = yPosition;
                    infomodel.HotType   = Convert.ToInt32(adtype);

                    #region 热点图片/视频

                    List <SqlParameter> parameters = new List <SqlParameter>();
                    var dtatta = _attaListDal.GetList(" IID=" + infomodel.IID, parameters).Tables[0];
                    if (!string.IsNullOrEmpty(batta))
                    {
                        var list = batta.Split(':');
                        foreach (var s in list)
                        {
                            if (!string.IsNullOrEmpty(s))
                            {
                                if (dtatta.Select(" AttID='" + s + "' ").Length <=
                                    0)
                                {
                                    if (File.Exists(ePath + s))
                                    {
                                        var fi = new FileInfo(ePath + s);
                                        fi.MoveTo(Server.MapPath("/UploadFiles/" + s));
                                        attsql += "insert into AttaList(AttID,IID)values (N'" + s + "','" +
                                                  infomodel.IID + "');";
                                    }
                                }
                            }
                        }

                        if (dtatta.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtatta.Rows.Count; i++)
                            {
                                if (!list.Contains(dtatta.Rows[i]["AttID"]))
                                {
                                    var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] +
                                              "'; ";
                                    DbCommand dbCommanddel = db.GetSqlStringCommand(del);
                                    db.ExecuteNonQuery(dbCommanddel);
                                    if (DBNull.Value != dtatta.Rows[i]["AttID"])
                                    {
                                        if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString()))
                                        {
                                            if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])))
                                            {
                                                var fi =
                                                    new FileInfo(
                                                        Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]));
                                                fi.Delete();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        for (int i = 0; i < dtatta.Rows.Count; i++)
                        {
                            var del = "delete from AttaList where ALID='" + dtatta.Rows[i]["ALID"] +
                                      "'; ";
                            DbCommand comdel = db.GetSqlStringCommand(del);
                            db.ExecuteNonQuery(comdel);
                            if (DBNull.Value != dtatta.Rows[i]["AttID"])
                            {
                                if (!string.IsNullOrEmpty(dtatta.Rows[i]["AttID"].ToString()))
                                {
                                    if (File.Exists(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"])))
                                    {
                                        var fi =
                                            new FileInfo(Server.MapPath("/UploadFiles/" + dtatta.Rows[i]["AttID"]));
                                        fi.Delete();
                                    }
                                }
                            }
                        }
                    }

                    #endregion

                    #region 热点图标

                    if (!string.IsNullOrEmpty(aatta))
                    {
                        if (aatta != infomodel.ADPic)
                        {
                            if (File.Exists(ePath + aatta))
                            {
                                var fi = new FileInfo(ePath + aatta);
                                fi.MoveTo(Server.MapPath("/UploadFiles/" + aatta));
                                infomodel.ADPic = aatta;
                            }
                        }
                    }
                    else
                    {
                        infomodel.ADPic = "";
                    }

                    #endregion

                    if (!string.IsNullOrEmpty(attsql))
                    {
                        DbCommand dbCommandAtt = db.GetSqlStringCommand(attsql);
                        db.ExecuteNonQuery(dbCommandAtt);
                    }
                    var upres = _infosDal.Update(infomodel);

                    if (upres)
                    {
                        Response.Write("0|~|" + iid);
                        Response.End();
                    }
                    else
                    {
                        Response.Write("1|~|操作失败");
                        Response.End();
                    }
                }
                #endregion

                #region 新增热点

                else
                {
                    var inmodel = new Admin.Model.Infos();
                    inmodel.IName     = name;
                    inmodel.Status    = 1;
                    inmodel.IType     = 5;
                    inmodel.TIID      = Convert.ToInt32(tiid);
                    inmodel.XPosition = xPosition;
                    inmodel.YPosition = yPosition;
                    inmodel.SortNum   = 1;
                    inmodel.NType     = 0;
                    inmodel.HotType   = Convert.ToInt32(adtype);
                    if (!string.IsNullOrEmpty(aatta))
                    {
                        if (File.Exists(ePath + aatta))
                        {
                            var fi = new FileInfo(ePath + aatta);
                            fi.MoveTo(Server.MapPath("/UploadFiles/" + aatta));
                            inmodel.ADPic = aatta;
                        }
                    }
                    var aiid = _infosDal.Add(inmodel);
                    if (!string.IsNullOrEmpty(batta))
                    {
                        var labArray = batta.Split(':');
                        foreach (var s in labArray)
                        {
                            if (!string.IsNullOrEmpty(s))
                            {
                                if (File.Exists(ePath + s))
                                {
                                    var fi = new FileInfo(ePath + s);
                                    fi.MoveTo(Server.MapPath("/UploadFiles/" + s));
                                    var ilmodel = new Admin.Model.AttaList();
                                    ilmodel.IID   = aiid;
                                    ilmodel.AttID = s;
                                    _attaListDal.Add(ilmodel);
                                }
                            }
                        }
                    }
                    Response.Write("0|~|" + aiid);
                    Response.End();
                }

                #endregion
            }
            catch (System.Threading.ThreadAbortException ex)
            {
            }
            catch (Exception ee)
            {
                Response.Write("1|~|" + ee.Message);
                Response.End();
            }
        }
Пример #25
0
 private void Register()
 {
     SQLiteRegistrar.Register(this);
     Infos.Add(new DatabaseInfo(this));
 }
Пример #26
0
 public void Info(string message, params object[] args)
 {
     Infos.Add(message);
 }
    public void loop()
    {
#if VADR_GEARVR
        if (OVRInput.GetActiveController() == OVRInput.Controller.RTrackedRemote)
        {
            orientation                   = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTrackedRemote);
            controllerPosition            = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTrackedRemote);
            controllerVelocity            = OVRInput.GetLocalControllerVelocity(OVRInput.Controller.RTrackedRemote);
            controllerAcceleration        = OVRInput.GetLocalControllerAcceleration(OVRInput.Controller.RTrackedRemote);
            controllerAngularVelocity     = OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.RTrackedRemote);
            controllerAngularAcceleration = OVRInput.GetLocalControllerAngularAcceleration(OVRInput.Controller.RTrackedRemote);
            Infos info = new Infos(19);
            // Changing between left handed and right handed system.
            // Refer https://gamedev.stackexchange.com/questions/129204/switch-axes-and-handedness-of-a-quaternion
            info.Add("Orientation X", orientation.x);
            info.Add("Orientation Y", -1 * orientation.y);
            info.Add("Orientation Z", -1 * orientation.z);
            info.Add("Orientation W", orientation.w);
            info.Add("Position X", -1 * controllerPosition.x);
            info.Add("Position Y", controllerPosition.y);
            info.Add("Position Z", controllerPosition.z);
            info.Add("Velocity X", -1 * controllerVelocity.x);
            info.Add("Velocity Y", controllerVelocity.y);
            info.Add("Velocity Z", controllerVelocity.z);
            info.Add("Acceleration X", -1 * controllerAcceleration.x);
            info.Add("Acceleration Y", controllerAcceleration.y);
            info.Add("Acceleration Z", controllerAcceleration.z);
            info.Add("Ang Velocity X", controllerAngularVelocity.x);
            info.Add("Ang Velocity Y", -1 * controllerAngularVelocity.y);
            info.Add("Ang Velocity Z", -1 * controllerAngularVelocity.z);
            info.Add("Ang Acceleration X", controllerAngularAcceleration.x);
            info.Add("Ang Acceleration Y", -1 * controllerAngularAcceleration.y);
            info.Add("Ang Acceleration Z", -1 * controllerAngularAcceleration.z);
            VadRAnalyticsManager.RegisterEvent("vadrGearVR Controller Orientation", userCamera.transform.position, filterDictionary["RController"], info);
        }
        if (OVRInput.GetActiveController() == OVRInput.Controller.LTrackedRemote)
        {
            orientation                   = OVRInput.GetLocalControllerRotation(OVRInput.Controller.LTrackedRemote);
            controllerPosition            = OVRInput.GetLocalControllerPosition(OVRInput.Controller.LTrackedRemote);
            controllerVelocity            = OVRInput.GetLocalControllerVelocity(OVRInput.Controller.LTrackedRemote);
            controllerAcceleration        = OVRInput.GetLocalControllerAcceleration(OVRInput.Controller.LTrackedRemote);
            controllerAngularVelocity     = OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.LTrackedRemote);
            controllerAngularAcceleration = OVRInput.GetLocalControllerAngularAcceleration(OVRInput.Controller.LTrackedRemote);
            Infos info = new Infos(19);
            // Changing between left handed and right handed system.
            // Refer https://gamedev.stackexchange.com/questions/129204/switch-axes-and-handedness-of-a-quaternion
            info.Add("Orientation X", orientation.x);
            info.Add("Orientation Y", -1 * orientation.y);
            info.Add("Orientation Z", -1 * orientation.z);
            info.Add("Orientation W", orientation.w);
            info.Add("Position X", -1 * controllerPosition.x);
            info.Add("Position Y", controllerPosition.y);
            info.Add("Position Z", controllerPosition.z);
            info.Add("Velocity X", -1 * controllerVelocity.x);
            info.Add("Velocity Y", controllerVelocity.y);
            info.Add("Velocity Z", controllerVelocity.z);
            info.Add("Acceleration X", -1 * controllerAcceleration.x);
            info.Add("Acceleration Y", controllerAcceleration.y);
            info.Add("Acceleration Z", controllerAcceleration.z);
            info.Add("Ang Velocity X", controllerAngularVelocity.x);
            info.Add("Ang Velocity Y", -1 * controllerAngularVelocity.y);
            info.Add("Ang Velocity Z", -1 * controllerAngularVelocity.z);
            info.Add("Ang Acceleration X", controllerAngularAcceleration.x);
            info.Add("Ang Acceleration Y", -1 * controllerAngularAcceleration.y);
            info.Add("Ang Acceleration Z", -1 * controllerAngularAcceleration.z);
            VadRAnalyticsManager.RegisterEvent("vadrGearVR Controller Orientation", userCamera.transform.position, filterDictionary["LController"], info);
        }
#endif
    }
Пример #28
0
    // Checking one object in a frame for better performance.
    IEnumerator CheckObjectTracking()
    {
        rayCastHit = new RaycastHit();
        objectHit  = Physics.Raycast(userCamera.transform.position, cameraForward,
                                     out rayCastHit, Mathf.Infinity);
        planes = GeometryUtility.CalculateFrustumPlanes(userCamera);
        for (int i = 0; i < trackObjectsMetadata.Count; i++)
        {
            if (trackObjectsMetadata[i].gameObject != null)
            {
                if (isInView(trackObjectsMetadata[i], planes) ||
                    (objectHit && isParent(rayCastHit.transform, trackObjectsMetadata[i].gameObject.transform)))
                {
                    if (isInSight(trackObjectsMetadata[i].gameObject))
                    {
                        // Assuming object is visible for more than one second for observable
                        if (Time.time - trackObjectsMetadata[i].timeVisible > 1.0f)
                        {
                            cameraForward = userCamera.transform.forward;
                            // Ray Cast in camera froward direction to see if it hit the object.
                            // If hit the object angle = 0.
                            objectAngle = 0;
                            if (objectHit && isParent(rayCastHit.transform, trackObjectsMetadata[i].gameObject.transform))
                            {
                                objectAngle = 0;
                                infoGaze    = new Infos(1);
                                filterGaze  = new Filters(1);
                                filterGaze.Add("Object", trackObjectsMetadata[i].gameObject.name);
                                infoGaze.Add("Time", Time.time - trackObjectsMetadata[i].lastCheckTime);
                                VadRLogger.debug("Object Gazed: " + trackObjectsMetadata[i].gameObject.name + (Time.time - trackObjectsMetadata[i].lastCheckTime));
                                VadRAnalyticsManager.RegisterEvent("vadrObject Gaze", rayCastHit.transform.position,
                                                                   filterGaze, infoGaze);
                            }
                            else
                            {
                                objectAngle = angleBetweenVectors(cameraForward,
                                                                  trackObjectsMetadata[i].gameObject.transform.position - userCamera.transform.position);
                            }

                            objectDistance = Vector3.Distance(userCamera.transform.position,
                                                              trackObjectsMetadata[i].gameObject.transform.position);
                            focusIndex = calculateFocus(objectAngle, objectDistance, trackObjectsMetadata[i].size);
                            if (focusIndex > 0)
                            {
                                filter = new Filters(1);
                                filter.Add("Object", trackObjectsMetadata[i].gameObject.name);
                                info = new Infos(1);
                                info.Add("Focus", focusIndex);
                                VadRAnalyticsManager.RegisterEvent("vadrObject Focus", userCamera.transform.position,
                                                                   filter, info);
                            }
                        }
                    }
                    else
                    {
                        trackObjectsMetadata[i].timeVisible = Time.time; // Resetting time if not visible
                    }
                }
                else
                {
                    trackObjectsMetadata[i].timeVisible = Time.time; // Resetting time if not visible
                }
            }
            trackObjectsMetadata[i].lastCheckTime = Time.time;
            yield return(null);
        }
    }
Пример #29
0
 public TextureStack(string filename, TextureTranslation translation, RotateFlipType rotation)
 {
     Infos.Add(new TextureInfo(filename, translation, rotation));
 }
Пример #30
0
 private static void LogInfo(string message)
 {
     Infos.Add(message);
 }