void Awake() { self = this; #if UNITY_IPHONE IOS.applicationDidFinishLaunching(); #endif }
internal NetworkDictionaryItem( IPAddress ipAddress, PingReply pingReply, PhysicalAddress macAddress, IPHostEntry hostEntry, IOS os ) { _ipAddress = ipAddress; _pingReply = pingReply; _macAddress = macAddress; _hostEntry = hostEntry; _os = os; _ports = new ConcurrentDictionary<ushort,ushort>(); }
protected override void LoadContent() { //BGM�̎擾�@���Ǘ\�� song[0] = Content.Load<Song>("Content/GLORIA"); font = Content.Load<SpriteFont>("Content/MS20"); sprite = new SpriteBatch(GraphicsDevice); ios = new IOS(Gm.GraphicsDevice, sprite,font ,song ,"Hoge.txt"); base.LoadContent(); }
static void MainOLD() { var androidBuilder = new AndroidBuilder(); androidBuilder.Build(); var iosBuilder = new IOS(); iosBuilder.Build(); }
public HostEntity(IList<IHost> hosts, string nameOs, string hostName, IPorts ports, IServer server, IFirewall firewall, IOS OS) { _hosts = new ReadOnlyCollection<IHost>(hosts); _nameOS = nameOs; _hostName = hostName; _ports = ports; _server = server; _firewall = firewall; _OS = OS; }
//Properties //Methods //Add a new cellphone according to the preference of the client. public void AddCellphone() { int opc = 0; double version = 0; string brand = string.Empty, model = string.Empty; string newPhoneNumber = Generator.GeneratePhoneNumber(); System.Collections.Generic.List <string> models = new System.Collections.Generic.List <string>(); models.Add("Legacy"); models.Add("Smartphone: Android"); models.Add("Smartphone: IOS"); System.Console.WriteLine("Let's add another cellphone"); System.Console.WriteLine("Select the type"); opc = Tools.Menu(models); switch (opc) { case 1: //Addinga legacy phone Legacy oldSchool = new Legacy(newPhoneNumber); System.Console.WriteLine("new Legacy cellphone added"); System.Console.WriteLine("New phone Number is {0}", newPhoneNumber); this.Cellphones.Add(oldSchool); break; case 2: //Adding android phone, with its attributes System.Console.WriteLine("New Android phone"); version = Tools.NumberValidation <double>(1.0, 10.0, Tools.InRange, "Please add the Operative System Version"); brand = Tools.StringValidator("Please input the brand of the new android phone"); model = Tools.StringValidator("Please input the model of the new android phone"); Android androidPhone = new Android(newPhoneNumber, version, brand, model); this.Cellphones.Add(androidPhone); System.Console.WriteLine("New Android phone added"); break; case 3: //Adding IOS phone, with its attributes System.Console.WriteLine("New IOS phone"); version = Tools.NumberValidation <double>(1.0, 10.0, Tools.InRange, "Please add the Operative System Version"); IOS iosPhone = new IOS(newPhoneNumber, version, this.UserFirstName, this.UserLastName); this.Cellphones.Add(iosPhone); System.Console.WriteLine("New IOS phone added"); break; case 4: System.Console.WriteLine("Process Finished"); break; default: System.Console.WriteLine("How do I get here?"); break; } }
/* * public void loadDataFromPath(string path) * { * FileStream fs = File.Open (path, FileMode.Open); * StreamReader sr = null; * * string line = null; * try { * sr = new StreamReader(fs); * if(sr != null) { * while(!string.IsNullOrEmpty(line = sr.ReadLine()) ) { * if(!line.StartsWith ("#")) { * SDK.Log("==="+line); * Dictionary<string,object> t = MiniJSON.Json.Deserialize(line) as Dictionary<string,object>; * // szConfig.Add(t["ID"].ToString(),t["txt"].ToString()); * } * } * } * } catch(IOException ex) { * SDK.Log(line+";"+ex.ToString()); * } finally { * if(fs != null) { fs.Close(); fs = null; } * if(sr != null) { sr.Close(); sr = null; } * } * } * public IEnumerator loadDataWithWWW(string path) * { * WWW www = new WWW("file:///"+path); * yield return www; * StreamReader sr = null; * string line = null; * try { * sr = new StreamReader(new MemoryStream(www.bytes)); * if(sr != null) { * while(!string.IsNullOrEmpty(line = sr.ReadLine()) ) { * if(!line.StartsWith ("#")) { * Dictionary<string,object> t = MiniJSON.Json.Deserialize(line) as Dictionary<string,object>; * // config.Add(t["ID"].ToString(),t["txt"].ToString()); * } * } * } * } catch(IOException ex) { * SDK.Log(line+";"+ex.ToString()); * } finally { * if(sr != null) { sr.Close(); sr = null; } * } * } */ public static string getText(int id) { if (instance.szConfig.ContainsKey(id)) { if (IOS.systemLanguage() == UnityEngine.SystemLanguage.Chinese) { return(instance.szConfig[id].txtCN); } else { return(instance.szConfig[id].txtEN); } } return("文字缺失:" + id); }
public static void SetMachineType(string _m) { _m = "psp"; // Allways PSP switch (_m.ToLower()) { case "nokia": case "symbian": case "qt": MachineType = new Symbian(); break; case "droid": case "android": MachineType = new Android(); break; case "ipad": case "iphone": case "ipod": case "ios": MachineType = new IOS(); break; case "psp": MachineType = new PSP(); break; case "windows": case "win": MachineType = new Windows(); break; case "html5": MachineType = new HTML5(); break; } if (MachineType != null) { TextureType[0] = MachineType.OpaqueTextureType; TextureType[1] = MachineType.AlphaTextureType; TexturePageWidth = MachineType.TPageWidth; TexturePageHeight = MachineType.TPageHeight; } }
protected override void LoadContent() { font = Content.Load<SpriteFont>("Content/MS20"); sprite = new SpriteBatch(GraphicsDevice); ios = new IOS(Gm.GraphicsDevice, sprite,font ); //using (Stream stream = File.OpenRead("hb0.png")) // bgi = Texture2D.FromStream(GraphicsDevice, stream); //using (Stream stream = File.OpenRead("masamne0.png")) // g1 = Texture2D.FromStream(GraphicsDevice, stream); //using (Stream stream = File.OpenRead("lu0.png")) // g2 = Texture2D.FromStream(GraphicsDevice, stream); //using (Stream stream = File.OpenRead("lu1.png")) // g3 = Texture2D.FromStream(GraphicsDevice, stream); //using (Stream stream = File.OpenRead("lu3.jpg")) // g4 = Texture2D.FromStream(GraphicsDevice, stream); //Tsprite = Cm.Load<Texture2D>("Content/sakura"); //Tsprite = Content.Load<Texture2D>("Content/sakura"); //Tsprite1 = Content.Load<Texture2D>("Content/sasuke"); //font1 = Content.Load<SpriteFont>("Content/SpriteFont2"); base.LoadContent(); }
internal NetworkDictionaryItem( IPAddress ipAddress, IOS os ) : this(ipAddress, null, null, null, os) { }
public bool Update( INetworkDictionaryItem networkDictionaryItem ) { //peut etre une methode plus mieu if( networkDictionaryItem.Host != null ) _host = networkDictionaryItem.Host; if( networkDictionaryItem.HostEntity != null ) _hostEntity = networkDictionaryItem.HostEntity; if( networkDictionaryItem.PingReply != null ) _pingReply = networkDictionaryItem.PingReply; if( networkDictionaryItem.IPAddress != null ) _ipAddress = networkDictionaryItem.IPAddress; if( networkDictionaryItem.MacAddress != null ) _macAddress = networkDictionaryItem.MacAddress; if( networkDictionaryItem.HostEntry != null ) _hostEntry = networkDictionaryItem.HostEntry; if( networkDictionaryItem.OS != null ) _os = networkDictionaryItem.OS; return true; //FAIL }
private static async Task <BaseResponse <T> > GetResponse <T>( string relativeUrl, PostSortBy?psort = null, UserSortBy?usort = null, BadgeSortBy?bsort = null, string site = null, int?page = null, bool includeSiteParam = true) where T : new() { if (site == null && includeSiteParam) { site = _site; } string url = "https://api.stackexchange.com/2.1/" + relativeUrl; if (site != null) { AddParam(ref url, "site", site); } if (psort.HasValue) { AddParam(ref url, "sort", psort.Value.ToString()); } if (usort.HasValue) { AddParam(ref url, "sort", usort.Value.ToString()); } if (bsort.HasValue) { AddParam(ref url, "sort", bsort.Value.ToString()); } if (page.HasValue) { AddParam(ref url, "page", page.ToString()); } AddParam(ref url, "key", _apiKey); string accessToken = Config.AccessToken; if (accessToken.IsNotNullOrEmpty()) { AddParam(ref url, "access_token", accessToken); } Console.WriteLine(url); var request = (HttpWebRequest)WebRequest.Create(url); request.Timeout = 15000; request.ReadWriteTimeout = 30000; request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; if (!IOS.IsStackApiReachable()) { return new BaseResponse <T> { Success = false, ErrorMessage = "No internet connection" } } ; try { using (var stream = (await request.GetResponseAsync().ConfigureAwait(false)).GetResponseStream()) using (var reader = new StreamReader(stream)) { string text = reader.ReadToEnd(); var data = JsonConvert.DeserializeObject <BaseResponse <T> >(text); data.Success = true; return(data); } } catch (WebException ex) { return(new BaseResponse <T> { Success = false, ErrorMessage = ex.Message }); } }
public void AddOrUpdate( IPAddress ipAddress, IOS os ) { if( ipAddress == null ) throw new ArgumentNullException( "ipAddress" ); if( os == null ) throw new ArgumentNullException( "OS" ); if( _networkDictionaryItems.ContainsKey( ipAddress ) ) { INetworkDictionaryItem networkDictionaryItem = _networkDictionaryItems[ipAddress]; networkDictionaryItem.Update( new NetworkDictionaryItem( ipAddress, os ) ); _isModified = _networkDictionaryItems.TryUpdate( ipAddress, networkDictionaryItem, networkDictionaryItem ); } else { _isModified = _networkDictionaryItems.TryAdd( ipAddress, new NetworkDictionaryItem( ipAddress, os ) ); } }
/** * Set the delegate implementation. * * @param _delegate The delegate implementing platform specific functions. */ public void SetDelegate(IOS _delegate) { this._delegate = _delegate; }
/** * Constructor with delegate. * * @param _delegate The delegate implementing platform specific functions. */ public OSBridge(IOS _delegate) : base() { this._delegate = _delegate; }