コード例 #1
0
        public static void LoadTemplateAsset(GameObject gameObject, Package.Asset asset)
        {
            if (gameObject.GetComponent <MarkingInfo>() is not MarkingInfo markingInfo)
            {
                return;
            }

            Mod.Logger.Debug($"Start load template asset \"{asset.fullName}\" from {asset.package.packagePath}");
            try
            {
                var templateConfig = XmlExtension.Parse(markingInfo.data);
                if (TemplateAsset.FromPackage(templateConfig, asset, out TemplateAsset templateAsset))
                {
                    templateAsset.Template.Manager.AddTemplate(templateAsset.Template);
                    Mod.Logger.Debug($"Template asset loaded: {templateAsset} ({templateAsset.Flags})");
                }
                else
                {
                    Mod.Logger.Error($"Could not load template asset");
                }
            }
            catch (Exception error)
            {
                Mod.Logger.Error($"Could not load template asset", error);
            }
        }
コード例 #2
0
        public RootJsonReponse MatchRoute(IEnumerable <GeoPointDTO> geoPointDTOs)
        {
            gpx gpxItem = GetGpxXml(geoPointDTOs);

            var bytes = XmlExtension.SerializeToByteArray(gpxItem);

            var client = new RestClient(BaseUrl);

            var requestAdress = string.Format("?app_id={0}&app_code={1}&routemode=car&filetype=GPX", HereApiConfDTO.AppId, HereApiConfDTO.AppCode);

            var request = new RestRequest(requestAdress, Method.POST);

            request.AddHeader("Content-Type", "application/gpx+xml");
            request.AddParameter("application/gpx+xml", bytes, ParameterType.RequestBody);

            var response = client.Execute(request);

            if (response.StatusCode != System.Net.HttpStatusCode.OK)
            {
                throw new Exception("MatchRoute ex");
            }

            var jsonObj = JsonConvert.DeserializeObject <RootJsonReponse>(response.Content);

            return(jsonObj);
        }
コード例 #3
0
        public override void OnAssetLoaded(string name, object asset, Dictionary <string, byte[]> userData)
        {
            if (asset is not BuildingInfo prefab || userData == null || !userData.TryGetValue(DataId, out byte[] data) || !userData.TryGetValue(MapId, out byte[] map))
            {
                return;
            }

            Mod.Logger.Debug($"Start load prefab data \"{prefab.name}\"");
            try
            {
                var decompress = Loader.Decompress(data);
                var config     = XmlExtension.Parse(decompress);

                var count    = map.Length / 6;
                var segments = new ushort[count];
                var nodes    = new ushort[count * 2];

                for (var i = 0; i < count; i += 1)
                {
                    segments[i]      = GetUShort(map[i * 6], map[i * 6 + 1]);
                    nodes[i * 2]     = GetUShort(map[i * 6 + 2], map[i * 6 + 3]);
                    nodes[i * 2 + 1] = GetUShort(map[i * 6 + 4], map[i * 6 + 5]);
                }

                AssetMarkings[prefab] = new AssetMarking(config, segments, nodes);

                Mod.Logger.Debug($"Prefab data was loaded; Size = {data.Length} bytes");
            }
            catch (Exception error)
            {
                Mod.Logger.Error("Could not load prefab data", error);
            }
        }
コード例 #4
0
        /////////////////////////////////////////////////////////////////////////////



        //////////////////////////////////////////////////////////////////////
        /// <summary>protected virtual int SaveXmlAttributes(XmlWriter writer)</summary>
        /// <param name="writer">the XmlWriter to save to</param>
        //////////////////////////////////////////////////////////////////////
        protected virtual void SaveXmlAttributes(XmlWriter writer)
        {
            //Tracing.Assert(writer != null, "writer should not be null");
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            // this will save the base and language attributes, if we have them
            if (Utilities.IsPersistable(this.uriBase))
            {
                //Lookup the prefix and then write the ISBN attribute.
                writer.WriteAttributeString("xml", "base", BaseNameTable.NSXml, this.Base.ToString());
            }
            if (Utilities.IsPersistable(this.atomLanguageTag))
            {
                writer.WriteAttributeString("xml", "lang", BaseNameTable.NSXml, this.Language);
            }

            ISupportsEtag se = this as ISupportsEtag;

            if (se != null && se.Etag != null)
            {
                writer.WriteAttributeString(BaseNameTable.gDataPrefix, BaseNameTable.XmlEtagAttribute, BaseNameTable.gNamespace, se.Etag);
            }


            // first go over all attributes
            foreach (IExtensionElementFactory ele in this.ExtensionElements)
            {
                XmlExtension x = ele as XmlExtension;
                // what we need to do here is:
                // go over all the attributes. look at all attributes that are namespace related
                // if the attribute is another default atomnamespace declaration, change it to some rnd prefix

                if (x != null)
                {
                    if (x.Node.NodeType == XmlNodeType.Attribute)
                    {
                        ele.Save(writer);
                    }
                }
            }
            AddOtherNamespaces(writer);

            // now just the non attributes
            foreach (IExtensionElementFactory ele in this.ExtensionElements)
            {
                XmlExtension x = ele as XmlExtension;
                if (x != null)
                {
                    if (x.Node.NodeType == XmlNodeType.Attribute)
                    {
                        // skip the guy
                        continue;
                    }
                }
                ele.Save(writer);
            }
        }
コード例 #5
0
        private void Load()
        {
            Rules.Clear();

            if (!File.Exists(ConfigFile))
            {
                SingletonMod <Mod> .Logger.Debug($"Config file not exist, create default");

                AddRule(new Rule());
                Save();
            }
            else
            {
                var file = XmlExtension.Load(ConfigFile);

                foreach (var config in file.Root.Elements(nameof(Rule)))
                {
                    var rule = new Rule();
                    rule.FromXml(config);
                    AddRule(rule);
                }
            }

            IsLoaded = true;

            SingletonMod <Mod> .Logger.Debug($"Config loaded: {Rules.Count} rules");
        }
コード例 #6
0
        public override void OnLoadData()
        {
            Mod.Logger.Debug($"Start load map data");

            if (serializableDataManager.LoadData(Loader.Id) is byte[] data)
            {
                try
                {
                    var sw = Stopwatch.StartNew();

                    var decompress = Loader.Decompress(data);
#if DEBUG
                    Mod.Logger.Debug(decompress);
#endif
                    var config = XmlExtension.Parse(decompress);
                    MarkupManager.FromXml(config, new ObjectsMap());

                    sw.Stop();
                    Mod.Logger.Debug($"Map data was loaded in {sw.ElapsedMilliseconds}ms; Size = {data.Length} bytes");
                }
                catch (Exception error)
                {
                    Mod.Logger.Error("Could not load map data", error);
                    MarkupManager.SetFailed();
                }
            }
            else
            {
                Mod.Logger.Debug($"Saved map data not founded");
            }
        }
コード例 #7
0
        public async Task <ActionResult <IList <string> > > GetCars(string brand, string model, short?year, EnumColor[] colors, string[] optionals)
        {
            IEnumerable <CarModel> cars = CarRepository.Cars;

            if (!string.IsNullOrEmpty(brand))
            {
                cars = cars.Where(x => x.Brand.Contains(brand, StringComparison.OrdinalIgnoreCase));
            }

            if (!string.IsNullOrEmpty(model))
            {
                cars = cars.Where(x => x.Model.Contains(model, StringComparison.OrdinalIgnoreCase));
            }

            if (year != null && year >= 0)
            {
                cars = cars.Where(x => x.Year == year);
            }

            if (colors != null && colors.Count() > 0)
            {
                cars = cars.Where(x => colors.Any(y => y == x.Color));
            }

            if (optionals != null && optionals.Count() > 0 && !string.IsNullOrEmpty(optionals.FirstOrDefault()))
            {
                cars = cars.Where(car => optionals.Any(v => car.Optionals.Any(o => o.Contains(v, StringComparison.OrdinalIgnoreCase))));
            }

            Request.HttpContext.Response.Headers.Add("Access-Control-Expose-Headers", "X-Total-Count");
            Request.HttpContext.Response.Headers.Add("X-Total-Count", cars?.Count().ToString());

            return(await Task.FromResult <ActionResult>(this.Ok(XmlExtension.ObjectToXml(cars.ToList()))));
        }
コード例 #8
0
        private bool IsAtomDefaultNamespace(XmlWriter writer)
        {
            string prefix = writer.LookupPrefix(BaseNameTable.NSAtom);

            if (prefix == null)
            {
                // if it is not defined, we need to make a choice
                // go over all attributes
                foreach (IExtensionElementFactory ele in this.ExtensionElements)
                {
                    XmlExtension x = ele as XmlExtension;
                    // what we need to do here is:
                    // go over all the attributes. look at all attributes that are namespace related
                    // if the attribute is another default atomnamespace declaration, change it to some rnd prefix

                    if (x != null)
                    {
                        if (x.Node.NodeType == XmlNodeType.Attribute &&
                            (String.Compare(x.Node.Name, "xmlns") == 0) &&
                            (String.Compare(x.Node.Value, BaseNameTable.NSAtom) != 0))
                        {
                            return(false);
                        }
                    }
                }

                return(true);
            }
            if (prefix.Length > 0)
            {
                return(false);
            }
            return(true);
        }
コード例 #9
0
ファイル: FlatFileAdapter.cs プロジェクト: jeffaristi92/owl
        OwlFlatFileConfig GetConfig(string filename)
        {
            XmlDocument xml = new XmlDocument();

            xml.Load(filename);
            OwlFlatFileConfig owlConfig = XmlExtension.Deserialize <OwlFlatFileConfig>(xml);

            return(owlConfig);
        }
コード例 #10
0
ファイル: FlatFileAdapter.cs プロジェクト: jeffaristi92/owl
        public void ValidateSerialize()
        {
            OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\1\owl-config-flatfile.xml");

            FlatFileDocument document = new FlatFileDocument();

            document.LoadContent(owlConfig, GetContent(@"examples\flatfile\1\test.txt"));

            XmlDocument xmlResult = XmlExtension.Serialize(document);
        }
コード例 #11
0
ファイル: Rzhunemogu.cs プロジェクト: baranovskis/TProject
        /// <summary>
        /// Get random fact.
        /// </summary>
        /// <returns></returns>
        public string GetJoke()
        {
            var url = "http://rzhunemogu.ru/Rand.aspx";

            var founded    = false;
            var categoryId = 0;

            if (!string.IsNullOrEmpty(JokesManager.Instance.Category))
            {
                foreach (var category in Categories)
                {
                    if (category.Equals(JokesManager.Instance.Category))
                    {
                        founded = true;
                        break;
                    }

                    ++categoryId;
                }
            }

            if (founded)
            {
                url += $"?CType={categoryId}";
            }

            try
            {
                var reqGET       = WebRequest.Create(url);
                var resp         = reqGET.GetResponse();
                var stream       = resp.GetResponseStream();
                var streamReader = new StreamReader(stream, Encoding.GetEncoding(1251));

                var joke = XmlExtension.Deserialize <Model.Rzhunemogu>(streamReader.ReadToEnd());

                if (joke == null)
                {
                    Log.Instance.Error("Rzhunemogu deserialize object failed! JSON: {0}", joke);
                    return(string.Empty);
                }

                return(joke.Content);
            }

            catch (Exception ex)
            {
                Log.Instance.Error(ex);
            }

            return(string.Empty);
        }
コード例 #12
0
        /// <summary>
        /// 系统资源初始化
        /// </summary>
        public static void Startup(string processName, string moduleName = "")
        {
            ConfigPath  = Path.GetFullPath($"{BasePath}../../Cfg");
            ProcessName = processName;
            ModuleName  = moduleName;

            if (!Directory.Exists(ConfigPath))
            {
                Directory.CreateDirectory(ConfigPath);
            }

            MainConfigFile   = Path.Combine(ConfigPath, $"Main.json");
            DeviceConfigFile = Path.Combine(ConfigPath, $"{ProcessName}.device.xml");

            Logger.Main.Info($"加载主配置文件{SysConf.MainConfigFile}");
            Main = JsonExtension.GetDefKey(SysConf.MainConfigFile, "MAIN", new SysConfModel());

            if (File.Exists(SysConf.DeviceConfigFile))
            {
                var dc = XmlExtension.LoadXMLFile <DeviceConfig>(SysConf.DeviceConfigFile);
                if (dc.IsSuccess)
                {
                    Logger.Main.Info($"加载设备配置文件: {SysConf.DeviceConfigFile} 成功");
                    Device = dc.Data;
                    Device.Recombine();
                    //foreach (var d in Device.Devices)
                    //{
                    //    foreach (var p in d.Value.Properties)
                    //    {
                    //        System.Console.WriteLine(p.Value.Id);
                    //    }
                    //}
                }
                else
                {
                    Logger.Main.Error($"加载设备配置文件: {SysConf.DeviceConfigFile} 失败");
                }
            }

            if (SysConf.Main.RunEnv != "EVOC")
            {
                RunInEvoc = false;
            }

            KeyPlant        = $"LD:{Main.Factory.Id}:{Main.Plant.Id}";
            KeyAssemblyLine = $"{KeyPlant}:{Main.AssemblyLine.Id}";

            SysBootStrapper.Initialize("");
            ServiceManager.Start();
        }
コード例 #13
0
        public void getRevisionFeed(String entryId)
        {
            FeedQuery query   = new FeedQuery();
            String    feedUri = makeFeedUri("revision") + entryId;

            query.Uri = new Uri(feedUri);
            AtomFeed feed = service.Query(query);


            foreach (AtomEntry entry in feed.Entries)
            {
                XmlExtension revisionNum = (XmlExtension)entry.FindExtension("revision", SitesService.SITES_NAMESPACE);
                Console.WriteLine(String.Format("revision id: {0}", revisionNum.Node.InnerText));
                Console.WriteLine(String.Format("  html: {0}...", entry.Content.Content.Substring(0, 100)));
                Console.WriteLine(String.Format("  site link: {0}", entry.AlternateUri.ToString()));
            }
        }
コード例 #14
0
        /// <summary>
        /// Check for RaumfeldZones
        /// http://www.hifi-forum.de/index.php?action=browseT&forum_id=212&thread=420&postID=220#220
        /// http://www.hifi-forum.de/index.php?action=browseT&forum_id=212&thread=420&postID=271#271
        /// Add CancelationTokkens if necessary
        /// </summary>
        /// <returns></returns>
        private async Task raumfeldGetZones()
        {
            if (mediaServer == null)
            {
                return;
            }

            try
            {
                using (HttpClient client = new HttpClient())
                {
                    using (HttpRequestMessage request = new HttpRequestMessage()
                    {
                        RequestUri = new Uri(HtmlExtension.CompleteHttpString(mediaServer.IpAddress, RaumFeldStaticDefinitions.PORT_WEBSERVICE, RaumFeldStaticDefinitions.GETZONES)), Method = HttpMethod.Get
                    })
                    {
                        if (!string.IsNullOrEmpty(raumfeldGetZonesUpdateId))
                        {
                            request.Headers.Add("updateID", raumfeldGetZonesUpdateId);
                        }
                        using (HttpResponseMessage response = await client.SendRequestAsync(request))
                        {
                            if (response.StatusCode == HttpStatusCode.Ok)
                            {
                                raumfeldGetZonesUpdateId = response.Headers["updateID"];
                                string xmlResponse = await response.Content.ReadAsStringAsync();

                                raumFeldZoneConfig = XmlExtension.Deserialize <RaumFeldZoneConfig>(xmlResponse);

                                await matchRaumfeldZones();

                                await raumfeldGetZones();
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                throw new Exception();

                await messagingService.ShowErrorDialogAsync(exception);
            }
        }
コード例 #15
0
        protected override void LoadData()
        {
            try
            {
                ClearData();
                var xml = Saved.value;
                if (!string.IsNullOrEmpty(xml))
                {
                    var config = XmlExtension.Parse(xml);
                    FromXml(config);
                }

                SingletonMod <Mod> .Logger.Debug($"Road templates was loaded: {Templates.Count} items");
            }
            catch (Exception error)
            {
                SingletonMod <Mod> .Logger.Error($"Could not load road templates", error);
            }
        }
コード例 #16
0
        public override void Load()
        {
            try
            {
                Clear();
                var xml = Saved.value;
                if (!string.IsNullOrEmpty(xml))
                {
                    var config = XmlExtension.Parse(xml);
                    FromXml(config);
                }

                Mod.Logger.Debug($"{typeof(TemplateType).Name} was loaded: {TemplatesDictionary.Count} items");
            }
            catch (Exception error)
            {
                Mod.Logger.Error($"Could not load {typeof(TemplateType).Name}", error);
            }
        }
コード例 #17
0
        public async Task <ActionResult <string> > GetCar(string id)
        {
            Guid identifier = Guid.Empty;

            if (!Guid.TryParse(id, out identifier))
            {
                return(await Task.FromResult <ActionResult>(this.BadRequest(new ErrorModel(1, "Id", "Invalid ID!").ToList())));
            }

            var car = this.SelectCar(identifier);

            if (car == null)
            {
                return(await Task.FromResult <ActionResult>(this.NotFound()));
            }
            else
            {
                return(await Task.FromResult <ActionResult>(this.Ok(XmlExtension.ObjectToXml(car))));
            }
        }
コード例 #18
0
        public static Notice FromAtomEntry(AtomEntry entry)
        {
            Notice notice = new Notice();

            notice.DatePublished = entry.Published;
            notice.DateUpdated   = entry.Updated;
            notice.Id            = entry.Id.Uri.Content;
            notice.ContentType   = entry.Content.Type;
            notice.Content       = entry.Content.Content;
            notice.Subject       = entry.Title.Text;
            IExtensionElementFactory factory = entry.FindExtension("ContinuityOfCareRecord", "urn:astm-org:CCR");

            if (factory != null)
            {
                XmlExtension  extension  = factory as XmlExtension;
                XmlSerializer serializer = new XmlSerializer(typeof(ContinuityOfCareRecord));
                XmlTextReader reader     = new XmlTextReader(new StringReader(extension.Node.OuterXml));
                notice.CareRecord = serializer.Deserialize(reader) as ContinuityOfCareRecord;
            }
            return(notice);
        }
コード例 #19
0
        /// <summary>
        /// Queries the profile feed for the list of available CCR records. Available
        /// for ClientLogin related queries.
        /// </summary>
        /// <param name="profileId">The profile to query against.</param>
        /// <param name="digest">True to aggregate all CCR into a single CCR element, false otherwise.</param>
        /// <returns>The list of CCR records available.</returns>
        public List <ContinuityOfCareRecord> GetCareRecords(string profileId, bool digest)
        {
            HealthQuery query = new HealthQuery(ProfileFeed + profileId);

            query.Digest = true;
            HealthFeed feed = this.Query(query);
            List <ContinuityOfCareRecord> ccrs = new List <ContinuityOfCareRecord>();

            foreach (AtomEntry entry in feed.Entries)
            {
                IExtensionElementFactory factory = entry.FindExtension("ContinuityOfCareRecord", "urn:astm-org:CCR");
                if (factory != null)
                {
                    XmlExtension  extension  = factory as XmlExtension;
                    XmlSerializer serializer = new XmlSerializer(typeof(ContinuityOfCareRecord));
                    XmlTextReader reader     = new XmlTextReader(new StringReader(extension.Node.OuterXml));
                    ccrs.Add(serializer.Deserialize(reader) as ContinuityOfCareRecord);
                }
            }
            return(ccrs);
        }
コード例 #20
0
        public override void BeforeStartup()
        {
            // 创建消息监听服务
            ServiceManager.Services.Add(new MsgRecvService());

            //注册日志
            WorkFlowEngine.Loged      += Logger.Device.Info;
            WorkFlowEngine.ErrorLoged += Logger.Device.Error;

            //加载设备配置
            var device = Path.Combine(SysConf.ConfigPath, $"{SysConf.ProcessName}.device.json");

            ModbusConf.CnfModel = JsonExtension.GetDefKey(device, "Modbus", new ModbusConfModel[] { });
            //加载配置文件
            var plccfgPath   = Path.Combine(SysConf.ConfigPath, "PLCConfig.xml");
            var workflowPath = Path.Combine(SysConf.ConfigPath, "WorkFlow.xml");

            if (File.Exists(plccfgPath) && File.Exists(workflowPath))
            {
                var plc  = XmlExtension.LoadXMLFile <PlcConfig>(plccfgPath);
                var work = XmlExtension.LoadXMLFile <WorkFolwConfig>(workflowPath);
                if (!plc.IsSuccess)
                {
                    Logger.Main.Info("加载modbusplc配置失败");
                }
                if (!work.IsSuccess)
                {
                    Logger.Main.Info("加载modbusworkflow配置失败");
                }
                if (plc.IsSuccess && work.IsSuccess)
                {
                    ModBusDataFactory.Initialization(plc.Data, work.Data);
                }
            }
            else
            {
                Example();
            }
        }
コード例 #21
0
        private static bool ImportData(string file, Action <XElement> processData)
        {
            Mod.Logger.Debug($"Import data");

            try
            {
                using var fileStream = File.OpenRead(file);
                using var reader     = new StreamReader(fileStream);
                var xml    = reader.ReadToEnd();
                var config = XmlExtension.Parse(xml);

                processData(config);

                Mod.Logger.Debug($"Data was imported");

                return(true);
            }
            catch (Exception error)
            {
                Mod.Logger.Error("Could not import data", error);
                return(false);
            }
        }
コード例 #22
0
ファイル: GameWindow.cs プロジェクト: michaelblawrence/learnr
        public static bool SaveNetwork(NeuralNetworkLSTM network)
        {
            SaveFileDialog save = new SaveFileDialog();

            save.Filter           = Global.ConfigNetworkFileFilter;
            save.InitialDirectory = Environment.CurrentDirectory;
            if (save.ShowDialog() == DialogResult.OK)
            {
                using (TextWriter reader = new StreamWriter(save.FileName))
                {
                    NetworkManagerLSTM.NetworkSaveFile data = new NetworkManagerLSTM.NetworkSaveFile()
                    {
                        Axons      = network.Axons,
                        LSTM       = network.LSTM.ToArray(),
                        LSTM_Gates = network.LSTM.Gates
                    };
                    string s = XmlExtension.Serialize(data);
                    reader.WriteLine(s);
                }
                return(true);
            }
            return(false);
        }
コード例 #23
0
 private static void GetPlaylistEntriesAsCategories(Category parentCategory, YouTubeFeed feed)
 {
     foreach (PlaylistsEntry entry in feed.Entries)
     {
         RssLink playlistLink = new RssLink();
         playlistLink.Name = entry.Title.Text;
         playlistLink.EstimatedVideoCount = (uint)entry.CountHint;
         XmlExtension playlistExt = entry.FindExtension(YouTubeNameTable.PlaylistId, YouTubeNameTable.NSYouTube) as XmlExtension;
         if (playlistExt != null)
         {
             playlistLink.Url = string.Format(PLAYLIST_FEED, playlistExt.Node.InnerText);
             parentCategory.SubCategories.Add(playlistLink);
             playlistLink.ParentCategory = parentCategory;
         }
     }
     // if there are more results add a new NextPageCategory
     if (feed.NextChunk != null)
     {
         parentCategory.SubCategories.Add(new NextPageCategory()
         {
             ParentCategory = parentCategory, Url = feed.NextChunk
         });
     }
 }
コード例 #24
0
 public void SetUp()
 {
     _xml = new XmlExtension(new StringWriter());
 }
コード例 #25
0
ファイル: GK10.cs プロジェクト: sreenandini/test_buildscripts
        public GK10(string xmlData)
        {
            try
            {
                oDoc = new XmlDocument();
                oDoc.LoadXml(xmlData);
                _Flags = "0";
                //_PacketNumber = "0";="0" -- to be updated while formatting
                _ProcessId = "0";
                _CommandId = "0";
                //_SequenceNumber ="0" -- to be updated while formatting
                _SDSVersion      = Settings.Version;
                _MessageType     = "GK";
                _TransactionCode = "10";

                //handle Jackpot /HandPay/PROG
                this.ExceptionCode = oDoc.SelectSingleNode("Polled_Event/ExceptionCode").GetInnerText().NullToInt().ToString("X");

                _CasinoNumber = oDoc.SelectSingleNode("Polled_Event/Site_Code").GetInnerText().STMFormat(3);
                //_CBMessageNumber = string.Empty;
                _SlotDoorFlags   = oDoc.SelectSingleNode("Polled_Event/DoorFlags").GetInnerText();
                _TransactionDate = DateTime.Now.ToString("yyyyMMdd");
                _TransactionTime = DateTime.Now.ToString("HHmmss");
                //_QueueID = string.Empty;
                _SideID = oDoc.SelectSingleNode("Polled_Event/Site_Code").GetInnerText();
                GMUINFO oAssetInfo = _Installations[oDoc.SelectSingleNode("Polled_Event/Serial_No").GetInnerText().NullToInt()];
                _SlotNumber = oAssetInfo.Asset;
                _Stand      = oAssetInfo.Position;
                //_Stand = string.Empty;
                _EmployeeID       = oDoc.SelectSingleNode("Polled_Event/EmpID").GetInnerText();
                _HomeCasinoID     = oDoc.SelectSingleNode("Polled_Event/Site_Code").GetInnerText();
                _PlayerCardNumber = oDoc.SelectSingleNode("Polled_Event/CardNumber").GetInnerText();

                /* Will be filed on Jacpot/handpay
                 * _TransactionAmount = string.Empty;
                 * _OriginalJackpotAmount = string.Empty;
                 * _JackpotID = string.Empty;
                 */

                _BonusPoints           = oDoc.SelectSingleNode("Polled_Event/BonusPoints").GetInnerText();
                _OptionsFlag           = oDoc.SelectSingleNode("Polled_Event/OptionsFlag").GetInnerText();
                _TotalBets             = oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=50]").GetInnerText(); ///50
                _TotalWins1            = oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=51]").GetInnerText(); // 51
                _TotalCoinDrop         = oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=52]").GetInnerText(); //52
                _TotalPlays            = oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=54]").GetInnerText(); //54
                _TotalHandPaidJackpots = oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=53]").GetInnerText(); //53
                // _TotalMachineFills = string.Empty;
                // _TotalBillsAccepted = string.Empty; // sum all bills
                // _TotalCouponsAccepted = string.Empty; NA
                // _TotalCoinPurchases = string.Empty;
                // _TotalCoinsCollected = string.Empty;
                // _TotalNonCashableeCashIn = string.Empty; //91
                // _TotalNonCashableeCashOut = string.Empty; //92
                // _TotalCashableeCashIn = string.Empty; //89
                // _TotalCashableeCashOut = string.Empty;//90
                _LastSMICode = oDoc.SelectSingleNode("Polled_Event/SMICode").GetInnerText();
                // _TicketInPromo = string.Empty; //?
                // _TicketOutPromo = string.Empty;//?
                _TicketIn  = XmlExtension.GetInnerText(oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=89]")); //89
                _TicketOut = XmlExtension.GetInnerText(oDoc.SelectSingleNode("Polled_Event/sector/counter[@counterid=90]")); //90
                _Region    = SiteDetails.GetInstance().Region;
            }
            catch
            {
                Logger.Error("Error Parsing XML as Gk10 [ XML Message ]" + oDoc.OuterXml);
                throw;
            }
        }
コード例 #26
0
        private static IEnumerable<XmlExtension> ReadExtenstionList(XElement extensionList)
        {
            if (extensionList == null)
                yield break;

            foreach (var extension in extensionList.Descendants("ext"))
            {
                var xmlExtension = new XmlExtension(extension.Value, false);
                var utfAttribute = extension.Attribute("utf");

                if (utfAttribute != null)
                    xmlExtension.UseUtf8Encoding = ParseXmlBoolean(utfAttribute.Value);

                yield return xmlExtension;
            }
        }
コード例 #27
0
        private async Task loadServicesAsync()
        {
            ServiceTypes serviceType;

            foreach (Service service in deviceDescription.Device.Services)
            {
                switch (service.ServiceType)
                {
                case ServiceTypesString.AVTRANSPORT:
                    AVTransport = await XmlExtension.DeserializeUriAsync <AVTransport>(new Uri(HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL)));

                    AVTransport.SetParent();
                    serviceType = ServiceTypes.AVTRANSPORT;
                    break;

                case ServiceTypesString.CONNECTIONMANAGER:
                    ConnectionManager = await XmlExtension.DeserializeUriAsync <ConnectionManager>(new Uri(HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL)));

                    ConnectionManager.SetParent();
                    serviceType = ServiceTypes.CONNECTIONMANAGER;
                    break;

                case ServiceTypesString.CONTENTDIRECTORY:
                    ContentDirectory = await XmlExtension.DeserializeUriAsync <ContentDirectory>(new Uri(HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL)));

                    ContentDirectory.SetParent();
                    serviceType = ServiceTypes.CONTENTDIRECTORY;
                    break;

                case ServiceTypesString.MEDIARECEIVERREGISTRAR:
                    MediaReceiverRegistrar = await XmlExtension.DeserializeUriAsync <MediaReceiverRegistrar>(new Uri(HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL)));

                    MediaReceiverRegistrar.SetParent();
                    serviceType = ServiceTypes.MEDIARECEIVERREGISTRAR;
                    break;

                case ServiceTypesString.RENDERINGCONTROL:
                    RenderingControl = await XmlExtension.DeserializeUriAsync <RenderingControl>(new Uri(HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL)));

                    RenderingControl.SetParent();
                    serviceType = ServiceTypes.RENDERINGCONTROL;
                    break;

                default:
                    serviceType = ServiceTypes.NEUTRAL;
                    break;
                }

                if (serviceType != ServiceTypes.NEUTRAL)
                {
                    serviceSCPDs.Add(new NetWorkSubscriberPayload {
                        MediaDevice = this, URI = HtmlExtension.CompleteHttpString(ipAddress, port, service.SCPDURL), ServiceType = serviceType,
                    });
                    serviceControls.Add(new NetWorkSubscriberPayload {
                        MediaDevice = this, URI = HtmlExtension.CompleteHttpString(ipAddress, port, service.ControlURL), ServiceType = serviceType,
                    });
                    serviceEvents.Add(new NetWorkSubscriberPayload {
                        MediaDevice = this, URI = HtmlExtension.CompleteHttpString(ipAddress, port, service.EventSubURL), ServiceType = serviceType,
                    });
                }
            }
        }
コード例 #28
0
 public Callable(XmlExtension xml)
 {
     _xml = xml;
 }