protected virtual void OnTrackingFound() { var rendererComponents = GetComponentsInChildren <Renderer>(true); var colliderComponents = GetComponentsInChildren <Collider>(true); var canvasComponents = GetComponentsInChildren <Canvas>(true); // Enable rendering: foreach (var component in rendererComponents) { component.enabled = true; } // Enable colliders: foreach (var component in colliderComponents) { component.enabled = true; } // Enable canvas': foreach (var component in canvasComponents) { component.enabled = true; } // tell text object to update itself var root = new root(); root.CreateQuote("iPhone 6S 64GB LTE"); }
public DataTable GetCountryDetails([FromUri] root json) { //json = "{\"query\": [{\"SELECT\": [\"geo\",\"geo.name\",\"time\",\"pop\"], \"WHERE\": {\"geo\": [\"swe\",\"nor\"],\"time\": \"2000-2015\",\"ind\":\"1\"},\"FROM\": \"humnum\"}],\"lang\": \"en\"}"; //var json = "{\"query\": [{\"SELECT\": [\"geo\",\"geo.name\",\"time\",\"pop\"],\"FROM\": \"humnum\"}],\"lang\": \"en\"}"; //var a = JsonConvert.DeserializeObject<root>(json); StatsQuery sQ = new StatsQuery(json); var str = sQ.getData(); return(str); //SELECT s = new SELECT(); //s.select = new List<string> { "geo" }; //FROM f = new FROM(); //f.from = "dimTable"; //WHERE w = new WHERE(); //w.geo = new List<string> { "swe", "nor" }; //w.time = "2001-2010"; //query q = new query //{ // SELECT = new List<string> { "geo", "geo.name" }, // WHERE = w , // FROM = "directtable" //}; //var r = new root { query = new[] { q }, lang = "en" }; //var j = JsonConvert.SerializeObject(r); return(null); }
public bool add_tariph(string name, int cost, string provider_name) { root pr = find(provider_name); if (pr == null) { return(false); } if (pr.current_tariph == pr.max_tariph) { Array.Resize(ref pr.arr, pr.max_tariph + 10); pr.max_tariph += 10; } for (int i = 0; i < pr.max_tariph; i++) { if (pr.arr[i].name == name) { return(false); } } pr.arr[pr.current_tariph].name = name; pr.arr[pr.current_tariph].cost = cost; pr.current_tariph++; return(true); }
public IEnumerator loadMap() { root _data = DataSave.GetData(); numMap = _data._Level; gameStrategy = _data._strategy; Debug.Log(_data.height + " - " + _data.width + " list " + _data.data.Count); field = new Field(_data.height, _data.width); field.initField(true); Debug.Log(_data.data.Count); for (int i = 0; i < _data.data.Count; i++) { var coords = field.findCoordsById(_data.data[i]._id); field.array[coords.i, coords.j].setId(_data.data[i]._id); field.array[coords.i, coords.j].setRandomNum(_data.data[i]._randomNum); field.array[coords.i, coords.j].setState(_data.data[i]._state); } placeCells(); yield return(new WaitForEndOfFrame()); cellState = _data._scellState; //grid.enabled = false; // SortHierarchy(); }
public ActionResult Get(string cpr) { int GetBirthdayYear(rootGctpSystemServiceCprDataRolleTableRow m) => Int32.Parse(GetAttr(m, "PNR_FOEDDATO").Substring(4, 2)); int GetCurrentYear() => Int32.Parse(DateTime.Now.ToString("yy")); int GetYearDifference(rootGctpSystemServiceCprDataRolleTableRow m) => GetCurrentYear() - GetBirthdayYear(m); if (!Validate(cpr)) { return(BadRequest("Invalid CPR!")); } log.Info("Attempting familie lookup on: " + Hide(cpr)); GCTPLookupRequestType request = new GCTPLookupRequestType(); request.InvocationContext = GetInvocationContext(); request.gctpMessage = $"<Gctp v=\"1.0\"><System r=\"CprSoeg\"><Service r=\"Familie\"><CprServiceHeader r=\"Familie\"><Key><Field r=\"PNR\" v=\"{cpr}\"/></Key></CprServiceHeader></Service></System></Gctp>"; CprLookupServicePortTypeClient lookupService = new CprLookupServicePortTypeClient(Configuration["OmFamilieService:serviceUrl"], Configuration["OmFamilieService:certPath"], Configuration["OmFamilieService:certPassword"]); callGctpServiceResponse response = lookupService.callGctpServiceAsync(request).Result; XmlSerializer serializer = new XmlSerializer(typeof(root)); StringReader rdr = new StringReader(response.callGCTPCheckServiceResponse.result); root gctpResponse = (root)serializer.Deserialize(rdr); rootGctpSystemServiceCprDataRolleTableRow[] members = gctpResponse.Gctp.System.Service.CprData.Rolle.Table.Row; // Filter only underaged kids members = members.Where(m => GetYearDifference(m) > 0 && GetYearDifference(m) < 18).ToArray(); var result = members.Where(m => GetAttr(m, "FAMMRK").Equals("Barn")).Select(m => new { name = GetAttr(m, "ADRNVN"), cpr = GetAttr(m, "PNR_FOEDDATO") }).ToArray(); return(Ok(result)); }
public async Task sendToServiceBus(JObject data) { string dataJsonFormat = ""; queueClient = new QueueClient(connectionString, QueName); IStandardInstance StandarizedIssue; IstandardComment standarizedComment; root dataDeserializeObject = JsonConvert.DeserializeObject <root>(data.ToString()); if (dataDeserializeObject.Issue_event_type_name == issueCreated) { StandarizedIssue = mapx.standarizedIssue(dataDeserializeObject); msgs = JsonConvert.SerializeObject(StandarizedIssue); } else if (dataDeserializeObject.Issue_event_type_name == issueUpdated) { StandarizedIssue = mapx.standarizedIssue(dataDeserializeObject); msgs = JsonConvert.SerializeObject(StandarizedIssue); } else if (dataDeserializeObject.Issue_event_type_name == issueCommented) { standarizedComment = mapx.standarizedComment(dataDeserializeObject); msgs = JsonConvert.SerializeObject(standarizedComment); } await SendMessagesAsync(msgs); }
// GET api/<controller>/5 public async Task <HttpResponseMessage> Get(string currentIp) { using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri("http://" + currentIp); using (HttpResponseMessage response = await client.GetAsync("tvdevicedesc.xml")) { using (HttpContent content = response.Content) { XmlSerializer serializer = new XmlSerializer(typeof(root)); Stream reader = await content.ReadAsStreamAsync(); try { root deviceDescriptionRoot = (root)serializer.Deserialize(reader); return(Request.CreateResponse(HttpStatusCode.OK, deviceDescriptionRoot)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.ToString())); } } } } }
/* public struct info * { * public string size;// name; * public string date;//int cost; * } * public info[] arr = new info[5];*/ public root(string _size, string _date, spisok_tariph.nest _tariph)//, tree_providers.root _provider) { this.size = _size; //this.provider = _provider; this.tariph = _tariph; this.date = _date; left = right = null; }
public When_reading_from_example_file_namespaces() { var readAllText = File.OpenRead(Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\ExamplesFiles\\namespaces.xml")); var xmlSerializer = new XmlSerializer(typeof(root)); root = (root)xmlSerializer.Deserialize(readAllText); }
public void RootToScreen(root _root) { Console.WriteLine($"City: {_root.name}"); Console.WriteLine($"Country: {_root.sys.country}"); Console.WriteLine($"Wind speed: {_root.wind.speed} m/s"); Console.WriteLine($"Temperature: {_root.main.temp} C"); Console.WriteLine($"Pressure: {_root.main.pressure} hpa"); Console.WriteLine($"Clouds: {_root.clouds.all.ToString()} %"); }
public root(string name) { title = name; current_tariph = 0; left = right = null; max_tariph = 5; max_user = 5; current_user = 0; }
public root find(string size, spisok_tariph.nest tariph)//поиск { if (main == null) { //error return(null); } else { root curr = main; while (true) { int i = compare(size, curr.size); //int j = compare(tariph, curr.tariph); if (i == 0) { while (curr != null) { comparisons++; if (curr.tariph == tariph) { return(curr); } curr = curr.right; } return(null); } else if (i == -1) { comparisons++; if (curr.left != null) { curr = curr.left; } else { return(null); } } else if (i == 1) { comparisons++; if (curr.right != null) { curr = curr.right; } else { return(null); } } } } }
private void deserialiseJSON(string strJSON) { jDataRoot = JsonConvert.DeserializeObject <root>(strJSON); /*Console.WriteLine("Converted JSON data" + jDataRoot.currency[0].count); * Console.WriteLine(jDataRoot.clone.ToString()); * Console.WriteLine(jDataRoot.lobbychest_progress.ToString()); * Console.WriteLine(jDataRoot.xp.ToString()); * Console.WriteLine(jDataRoot.merchantData.Default__VillageMerchantDef.quests.Quest1.questState.targetCount.ToString());*/ //debugOutput(jData.pendingRewardItem.ToString()); }
//-------------------------Form Events----------------------------- //-------------------------Functions----------------------------- private void deserialiseJSON(string strJSON) { try { jDataRoot = JsonConvert.DeserializeObject <root>(strJSON); } catch (JsonReaderException e) { MessageBox.Show(e.ToString()); } }
// Use this for initialization void aa() { MethodInfo mi = this.GetType().GetMethod("AA"); object[] a = { "A", "A" }; mi.Invoke(this, a); Type type = Type.GetType(ClassType); root obj = Activator.CreateInstance(type) as root; obj.LogName(); }
public XMLReader(TextAsset gA) { this.GameAsset = gA; MemoryStream ms = new MemoryStream(GameAsset.bytes); XmlSerializer serializer = new XmlSerializer(typeof(root), new XmlRootAttribute("root")); xmlDataStruture = (root)serializer.Deserialize(ms); Debug.Log("Number of builds in xml = "+xmlDataStruture.Items.Length); }
public IstandardComment standarizedComment(root rootComment) { IstandardComment strdMessage = new IstandardComment(); strdMessage.MessageOrigin = rootComment.Issue_event_type_name.Split(':')[0]; strdMessage.Action = rootComment.Issue_event_type_name.Split('_')[1]; strdMessage.Created = rootComment.Comment.created; strdMessage.Author = rootComment.Comment.author.name + "_" + rootComment.Comment.author.emailAddress; strdMessage.Content = rootComment.Comment.body; return(strdMessage); }
public IStandardInstance standarizedIssue(root rootIssue) { IStandardInstance strdMessage = new IStandardInstance(); strdMessage.MessageOrigin = rootIssue.webhookEvent.Split(':')[0]; strdMessage.Action = rootIssue.Issue_event_type_name.Split('_')[1]; strdMessage.Summary = rootIssue.Issue.fields.Summary; strdMessage.Created = rootIssue.Issue.fields.created; strdMessage.Author = rootIssue.Issue.fields.creator.name + "_" + rootIssue.Issue.fields.creator.emailAddress; strdMessage.Type = rootIssue.Issue.fields.issueType.name; return(strdMessage); }
public override void PreRender() { base.PreRender(); // Do not use the factory because it loads the xml file with validation and it contains the schema as well. // this._root = rootFactory.Create<root>(base.ProjectItem); // use classic serialization with no validation. XmlSerializer xmlSerializer = new XmlSerializer(typeof(root)); using (XmlReader reader = XmlReader.Create(base.ProjectItem.FullPath)) { this._root = (root)xmlSerializer.Deserialize(reader); } }
public XMLReader(TextAsset gA) { this.GameAsset = gA; MemoryStream ms = new MemoryStream(GameAsset.bytes); XmlSerializer serializer = new XmlSerializer(typeof(root), new XmlRootAttribute("root")); xmlDataStruture = (root)serializer.Deserialize(ms); Debug.Log("Number of builds in xml = " + xmlDataStruture.Items.Length); }
public static void save(root _root) { //CellJson[] js = new CellJson[list.Count]; //for (int i = 0; i < list.Count; i++) //{ // js[i] = list[i].settings; //} string str = ""; str = JsonUtility.ToJson(_root, true); // string str = JsonUtility.ToJson(js); File.WriteAllText(Application.persistentDataPath + "/grid.json", str); }
public bool add_Provider(string name) { if (main == null) { main = new root(name); return(true); } else { root curr = main; while (true) { int i = compare(name, curr.title); if (i == -1) { if (curr.left == null) { root temp = new root(name); curr.left = temp; return(true); } else { curr = curr.left; } } else if (i == 1) { if (curr.right == null) { root temp = new root(name); curr.right = temp; return(true); } else { curr = curr.right; } } else if (i == 0) { return(false); } } } }
private void Export() { XML_PATH = Application.streamingAssetsPath + "/" + FileName + ".xml"; // 読み込み DataC sample = AssetDatabase.LoadAssetAtPath <DataC>(ASSET_PATH); if (sample == null) { sample = ScriptableObject.CreateInstance <DataC>(); } // 新規の場合は作成 if (!AssetDatabase.Contains(_sample as UnityEngine.Object)) { string directory = Path.GetDirectoryName(ASSET_PATH); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } // アセット作成 AssetDatabase.CreateAsset(_sample, ASSET_PATH); } // コピー sample.Copy(_sample); root testData = new root(); DataC test = sample; testData = test.DataSet(); XmlUtil.Seialize <root>(XML_PATH, testData); // インスペクターから設定できないようにする _sample.hideFlags = HideFlags.NotEditable; // 更新通知 EditorUtility.SetDirty(_sample); // 保存 AssetDatabase.SaveAssets(); // エディタを最新の状態にする AssetDatabase.Refresh(); }
public bool del_tariph(string name, root pr) { for (int i = 0; i < pr.current_tariph; i++) { if ((pr.arr[i].name == name)) { for (int j = i; j < pr.current_tariph - 1; j++) { pr.arr[j] = pr.arr[j + 1]; } pr.arr[pr.current_tariph - 1].name = ""; pr.arr[pr.current_tariph - 1].cost = 0; pr.current_tariph--; return(true); } } return(false); }
public static root GetData() { string filepath = Application.persistentDataPath + "/grid.json"; if (File.Exists(filepath)) { string dataAsJson = File.ReadAllText(filepath); root _root = JsonUtility.FromJson <root>(dataAsJson); return(_root); } else { return(null); } }
public root find(string name)//поиск { if (main == null) { comparisons++; //error return(null); } else { root curr = main; while (true) { int i = compare(name, curr.title); comparisons++; if (i == 0) { return(curr); } else if (i == -1) { if (curr.left != null) { curr = curr.left; } else { return(null); } } else if (i == 1) { if (curr.right != null) { curr = curr.right; } else { return(null); } } } } }
public void add_sale(string size, string date, spisok_tariph.nest tariph)//, tree_providers.root provider) { bool placed = false; if (main == null) { main = new root(size, date, tariph);//, provider); } else { root curr = main; while (!placed) { int i = compare(size, curr.size); if (i == -1) { if (curr.left == null) { root temp = new root(size, date, tariph);//, provider); curr.left = temp; placed = true; } else { curr = curr.left; } } else if ((i == 1) | (i == 0)) { if (curr.right == null) { root temp = new root(size, date, tariph);//, provider); curr.right = temp; placed = true; } else { curr = curr.right; } } } } }
public void Save() { root r = new root { height = field.heightField, width = field.widthField, time = _Timer._time, _scellState = cellState, _strategy = gameStrategy, _Level = numMap }; foreach (CellScr scr in AllCells) { r.data.Add(scr.settings); } DataSave.save(r); }
public root find_max(root from_this) { root curr; //root check; if (from_this.right != null) { curr = from_this.right; while (curr.left != null) { curr = curr.left; } return(curr); } else { return(null); } }
/* public void change_tariph(string name,int cost, string new_name,int new_cost, root pr) * { * for(int i = 0; i<pr.current_tariph;i++) * if ((pr.arr[i].name == name) && (pr.arr[i].cost == cost)) * { * if (new_name != "") * pr.arr[i].name = new_name; * if (new_cost != 0) * pr.arr[i].cost = new_cost; * } * * }*/ /*private root.info get_tariph(root pr,int ind) * { * return pr.arr[ind]; * }*/ /*public root print_provider(int ind,root parent,ref int curr) * { * if (parent == null) * return null; * if (parent.left != null) * { * root left = print_provider(ind, parent.left, ref curr); * if(left!=null) * return left; * } * * curr++; * if (ind == curr) * return parent; * else if (parent.right!=null) * * { * root right = print_provider(ind, parent.right, ref curr); * if (right != null) * return right; * } * return null; * * }*/ public bool add_user(string login, string provider_name) { root a = find(provider_name); if (a.current_user == a.max_user) { Array.Resize(ref a.users, a.max_user + 5); a.max_user += 5; } for (int i = 0; i < a.max_user; i++) { if (a.users[i] == login) { return(false); } } a.users[a.current_user] = login; a.current_user++; return(true); }
public root find_max(root from_this)//поиск макс слева { root curr; root check; if (from_this.left != null) { curr = from_this.left; check = from_this; } else { return(null); } if (curr.right == null) { check.left = curr.left; return(curr); } else { check = curr; curr = curr.right; } while (true) { if (curr.right == null) { check.right = curr.left; return(curr); } else { check = curr; curr = curr.right; } } }
//public void change_user() public bool delete_user(string login, string provider_name) { root pr = find(provider_name); if (pr == null) { return(false); } for (int i = 0; i < pr.max_user; i++) { if (pr.users[i] == login) { for (int j = i; j < pr.max_user - 1; j++) { pr.users[j] = pr.users[j + 1]; } pr.users[pr.current_user - 1] = ""; pr.current_user--; return(true); } } return(false); }
//sitemap kurzu s lokalizaci. Pro headerOnly => pouze jeden root node (pro pouziti v seznau produktu v q:\LMCom\rew\Web4\Schools\EACourses\courses.json ) public static root courseSitemapWithLoc(ProductsDefine.productDescrLow prod, bool headerOnly) { ProductsDefine.courseDescr cfg = null; Func<ProductsDefine.courseDescr, ProductsDefine.courseDescr> fake = c => { cfg = c; return c; }; // ROOT node var res = new root() { courseId = prod.courseId, line = CommonLib.CourseIdToLineId(prod.course), title = prod.title, fileName = prod.productId(), }; if (prod.hasPretest()) res.pretestCrsId = prod.course; //Add course tree and grammar (including localization) to sitemap if (!headerOnly) { res.courses = createCourses(prod).ToArray(); //sitemap tree //grammar s lokalizaci schools.grammarNode gram; var trados = Grammar.getGrammar(prod, out gram); //Pouziti grammar v course sitemap res.grammar = gram; trados.Add(Langs.no, JsonConvert.SerializeObject(res, Newtonsoft.Json.Formatting.Indented, EADeployLib.jsonSet)); //write EADeployLib.writeFiles(Machines.basicPath + @"rew\Web4\Schools\EACourses\", res.fileName + ".json", trados, true); //vypis zdroje i JSON prekladu XmlUtils.ObjectToFile(Machines.basicPath + @"rew\Web4\Schools\EACourses\" + res.fileName + ".xml", res); //pro info jeste do XML } return res; }