public ActionResult ImportTransportTypes() { String[] transportTypes = new[] { "Автобусы", "Троллейбусы", "Маршрутные такси" }; using (DataContext dataContext = new DataContext()) { foreach (String typeName in transportTypes) { TransportType type = new TransportType() { Name = typeName }; dataContext.TransportTypes.Add(type); dataContext.SaveChanges(); } } return this.Content("Transport types imported"); }
private void InitializeSpreadsheet() { LoadFunctions(); _extensions = new Extensions(); _vm = new SpreadsheetViewModel(_extensions, CreateDynamicModule(), 15, 52); Spreadsheet.ItemsSource = _vm.DataSource; }
public Result(JObject jobj) { if (jobj["completion"] != null) { completion = jobj.Value<Boolean>("completion"); } if (jobj["success"] != null) { success = jobj.Value<Boolean>("success"); } if (jobj["response"] != null) { response = jobj.Value<String>("response"); } if (jobj["duration"] != null) { duration = XmlConvert.ToTimeSpan(jobj.Value<String>("duration")); } if (jobj["score"] != null) { score = (Score)jobj.Value<JObject>("score"); } if (jobj["extensions"] != null) { extensions = (Extensions)jobj.Value<JObject>("extensions"); } }
public virtual void TestGetExtDelimiter() { assertEquals(Extensions.DEFAULT_EXTENSION_FIELD_DELIMITER, this.ext .ExtensionFieldDelimiter); ext = new Extensions('?'); assertEquals('?', this.ext.ExtensionFieldDelimiter); }
public virtual void TestSplitExtensionField() { assertEquals("field\\:key", ext.BuildExtensionField("key", "field")); assertEquals("\\:key", ext.BuildExtensionField("key")); ext = new Extensions('.'); assertEquals("field.key", ext.BuildExtensionField("key", "field")); assertEquals(".key", ext.BuildExtensionField("key")); }
public Classic.QueryParser GetParser(Analyzer a, Extensions extensions) { if (a == null) a = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true); Classic.QueryParser qp = extensions == null ? new ExtendableQueryParser( TEST_VERSION_CURRENT, DefaultField, a) : new ExtendableQueryParser( TEST_VERSION_CURRENT, DefaultField, a, extensions); qp.DefaultOperator = QueryParserBase.OR_OPERATOR; return qp; }
public ExtensionSearchBlock(Extensions.ExtensionResult extensionResult, String highlight) : base(extensionResult.Text, highlight, RowType.WindowsSearch) { this._category = extensionResult.Extension.Name; if (this._part != null) { this._part.Style = Styles.ResultHighlight; } this.Style = Styles.Result; this.ExtensionResult = extensionResult; }
public About(JObject jobj) { if (jobj["version"] != null) { version = new List<TCAPIVersion>(); foreach (String item in jobj.Value<JArray>("version")) { version.Add((TCAPIVersion)item); } } if (jobj["extensions"] != null) { extensions = new Extensions(jobj.Value<JObject>("extensions")); } }
public Context(JObject jobj) { if (jobj["registration"] != null) { registration = new Guid(jobj.Value<String>("registration")); } if (jobj["instructor"] != null) { // TODO: can be Group? instructor = (Agent)jobj.Value<JObject>("instructor"); } if (jobj["team"] != null) { // TODO: can be Group? team = (Agent)jobj.Value<JObject>("team"); } if (jobj["contextActivities"] != null) { contextActivities = (ContextActivities)jobj.Value<JObject>("contextActivities"); } if (jobj["revision"] != null) { revision = jobj.Value<String>("revision"); } if (jobj["platform"] != null) { platform = jobj.Value<String>("platform"); } if (jobj["language"] != null) { language = jobj.Value<String>("language"); } if (jobj["statement"] != null) { statement = (StatementRef)jobj.Value<JObject>("statement"); } if (jobj["extensions"] != null) { extensions = (Extensions)jobj.Value<JObject>("extensions"); } }
private static Extensions getExtensions() { string configPath = ExtensionsConfigFilePath; Extensions _extensions = null; if (File.Exists(configPath)) { try { XmlSerializer reader = new XmlSerializer(typeof(Extensions)); using (System.IO.StreamReader file = new System.IO.StreamReader(configPath)) { _extensions = (Extensions)reader.Deserialize(file); } } catch { _extensions = new Extensions(); } } else _extensions = new Extensions(); return _extensions; }
/// <summary> /// Initalizes a new instance of the <see cref="RoslynCompilationService"/> class. /// </summary> /// <param name="environment">The environment for the executing application.</param> /// <param name="libraryExporter">The library manager that provides export and reference information.</param> /// <param name="host">The <see cref="IMvcRazorHost"/> that was used to generate the code.</param> /// <param name="optionsAccessor">Accessor to <see cref="RazorViewEngineOptions"/>.</param> /// <param name="fileProviderAccessor">The <see cref="IRazorViewEngineFileProviderAccessor"/>.</param> public RoslynCompilationService( IApplicationEnvironment environment, Extensions.CompilationAbstractions.ILibraryExporter libraryExporter, IMvcRazorHost host, IOptions<RazorViewEngineOptions> optionsAccessor, IRazorViewEngineFileProviderAccessor fileProviderAccessor, ILoggerFactory loggerFactory) { _environment = environment; _libraryExporter = libraryExporter; _applicationReferences = new Lazy<List<MetadataReference>>(GetApplicationReferences); _fileProvider = fileProviderAccessor.FileProvider; _classPrefix = host.MainClassNamePrefix; _compilationCallback = optionsAccessor.Value.CompilationCallback; _parseOptions = optionsAccessor.Value.ParseOptions; _compilationOptions = optionsAccessor.Value.CompilationOptions; _logger = loggerFactory.CreateLogger<RoslynCompilationService>(); #if DOTNET5_5 _razorLoadContext = new RazorLoadContext(); #endif }
public ActivityDefinition(JObject jobj) { if (jobj["type"] != null) { type = new Uri(jobj.Value<String>("type")); } if (jobj["moreInfo"] != null) { moreInfo = new Uri(jobj.Value<String>("moreInfo")); } if (jobj["name"] != null) { name = (LanguageMap)jobj.Value<JObject>("name"); } if (jobj["description"] != null) { description = (LanguageMap)jobj.Value<JObject>("description"); } if (jobj["extensions"] != null) { extensions = (Extensions)jobj.Value<JObject>("extensions"); } }
public static ISelectorForCast FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject val = Extensions.Value <JObject>((IEnumerable <JToken>)token); JToken val2 = default(JToken); if (!val.TryGetValue("type", ref val2)) { Debug.LogWarning((object)"Malformed json: no 'type' property in object of class ISelectorForCast"); return(null); } string text = Extensions.Value <string>((IEnumerable <JToken>)val2); ISelectorForCast selectorForCast; switch (text) { case "ConditionalSelectorForCast": selectorForCast = new ConditionalSelectorForCast(); break; case "UnionOfCoordsSelector": selectorForCast = new UnionOfCoordsSelector(); break; case "UnionOfEntitiesSelector": selectorForCast = new UnionOfEntitiesSelector(); break; case "OwnerOfEffectHolderSelector": selectorForCast = new OwnerOfEffectHolderSelector(); break; case "CasterSelector": selectorForCast = new CasterSelector(); break; case "CasterHeroSelector": selectorForCast = new CasterHeroSelector(); break; case "FilteredEntitySelector": selectorForCast = new FilteredEntitySelector(); break; case "FilteredCoordSelector": selectorForCast = new FilteredCoordSelector(); break; case "AllEntitiesSelector": selectorForCast = new AllEntitiesSelector(); break; case "OwnerOfSelector": selectorForCast = new OwnerOfSelector(); break; default: Debug.LogWarning((object)("Unknown type: " + text)); return(null); } selectorForCast.PopulateFromJson(val); return(selectorForCast); }
/// <summary> /// Creates a string directory for the user. /// </summary> /// <param name="fileName">The file name to use.</param> /// <param name="directory">The directory to access.</param> /// <param name="extension">The extention to append to the file name.</param> /// <returns>A valid directory with all parameters applied.</returns> public static string GetFileDirectory(string fileName, Directories directory, Extensions extension) { // Validate the directory before trying to return the string ValidateDirectory(directory); // Return the string accessor to the directory item return($"{AppDir}/{directory}/{fileName}.{extension}"); }
public bool LoadPluginSettings() { if (pluginFilePath != null && File.Exists(pluginFilePath)) { try { foreach (string line in File.ReadAllLines(pluginFilePath)) { string[] tokens = line.Split('='); if (tokens.Length != 2) { continue; } switch (tokens[0].Trim().ToUpper()) { case "FILE": DllFilePath = tokens[1].Trim(); break; case "ENABLED": Enabled = Utils.ParseBoolean(tokens[1].Trim(), true); break; case "EXTENSIONS": Extensions.Clear(); foreach (string extension in tokens[1].Trim().Split(',')) { Extensions.Add(extension.Trim().ToLower()); } break; } } string tempDllFilePath = DllFilePath; if (!File.Exists(tempDllFilePath)) { tempDllFilePath = Path.GetDirectoryName(pluginFilePath) + "\\" + tempDllFilePath; } if (File.Exists(tempDllFilePath)) { List <string> domainSearchPaths = new List <string>(); if (System.AppDomain.CurrentDomain.RelativeSearchPath != null) { domainSearchPaths = new List <string>(System.AppDomain.CurrentDomain.RelativeSearchPath.Split(';', ',')); } if (!domainSearchPaths.Contains(Path.GetDirectoryName(tempDllFilePath))) { AppDomain.CurrentDomain.AppendPrivatePath(Path.GetDirectoryName(tempDllFilePath)); } Assembly assembly = Assembly.LoadFile(tempDllFilePath); Type[] types = assembly.GetTypes(); foreach (Type type in types) { if (type.GetInterface("IGrepEngine") != null) { IGrepEngine engine = (IGrepEngine)Activator.CreateInstance(type); Engine = engine; break; } } } } catch (Exception ex) { throw ex; } } if (Engine != null) { return(true); } else { return(false); } }
private void ConvertSingle() { var value = Extensions.GetSingle("Type Single value: "); Console.WriteLine($"Value: {value}"); }
private void ConvertTime() { var value = Extensions.GetDateTime("Type DateTime (time) value: "); Console.WriteLine($"Value: {value.TimeOfDay}"); }
/// <summary> /// Will save an abstract item to a specified directory. /// NOTE: Remember to mark your object as [System.Serializable] /// </summary> /// <param name="dataToSave">Object to serialize and save. Remember to mark your object as [System.Serializable]</param> /// <param name="fileName">File name for the object to save.</param> /// <param name="directory">Directory to put the object after serialization.</param> /// <param name="extension">Extension to use to save the object.</param> public static void Save(object dataToSave, string fileName, Directories directory = Directories.global, Extensions extension = Extensions.dat) { string dir = GetFileDirectory(fileName, directory, extension); if (extension == Extensions.json || extension == Extensions.txt) { // Create a json file and save all our data to it File.WriteAllText($"{dir}", JsonUtility.ToJson(dataToSave)); } else { // Create a binary file and save all our date to it var formatter = GetBinaryFormatter(); var file = File.Create($"{dir}"); formatter.Serialize(file, dataToSave); // Don't forget to close your files! file.Close(); } }
public override string ToString() => Extensions.ToString(this);
///GENMHASH:D50E5343B7C7C1B41E095AD98B40D4AD:5517706AAC27788C4749AAF1BF4416DC public IReadOnlyList <Microsoft.Azure.Management.Sql.Fluent.ISqlRestorableDroppedDatabase> ListRestorableDroppedDatabases() { return(Extensions.Synchronize(() => this.ListRestorableDroppedDatabasesAsync())); }
///GENMHASH:1130C7B9E2673D9024ACFFC4705A8B49:182C479ECA149DB94974EDE6D0E58994 public void RemoveActiveDirectoryAdministrator() { Extensions.Synchronize(() => this.Manager.Inner.ServerAzureADAdministrators.DeleteAsync(this.ResourceGroupName, this.Name)); }
public void LoadData() { oldPlayer = GameObject.FindWithTag("Player"); if ((bool)oldPlayer) { UnityEngine.Object.Destroy(this.gameObject); return; } lastPosition.x = PlayerPrefs.GetFloat("PlayerX"); lastPosition.y = PlayerPrefs.GetFloat("PlayerY") + 0.2f; lastPosition.z = PlayerPrefs.GetFloat("PlayerZ"); GameObject gameObject = UnityEngine.Object.Instantiate(player, lastPosition, transform.rotation); ((Status)gameObject.GetComponent(typeof(Status))).level = PlayerPrefs.GetInt("TempPlayerLevel"); ((Status)gameObject.GetComponent(typeof(Status))).characterId = PlayerPrefs.GetInt("TempID"); ((Status)gameObject.GetComponent(typeof(Status))).characterName = PlayerPrefs.GetString("TempName"); ((Status)gameObject.GetComponent(typeof(Status))).atk = PlayerPrefs.GetInt("TempPlayerATK"); ((Status)gameObject.GetComponent(typeof(Status))).def = PlayerPrefs.GetInt("TempPlayerDEF"); ((Status)gameObject.GetComponent(typeof(Status))).matk = PlayerPrefs.GetInt("TempPlayerMATK"); ((Status)gameObject.GetComponent(typeof(Status))).mdef = PlayerPrefs.GetInt("TempPlayerMDEF"); ((Status)gameObject.GetComponent(typeof(Status))).mdef = PlayerPrefs.GetInt("TempPlayerMDEF"); ((Status)gameObject.GetComponent(typeof(Status))).exp = PlayerPrefs.GetInt("TempPlayerEXP"); ((Status)gameObject.GetComponent(typeof(Status))).maxExp = PlayerPrefs.GetInt("TempPlayerMaxEXP"); ((Status)gameObject.GetComponent(typeof(Status))).maxHealth = PlayerPrefs.GetInt("TempPlayerMaxHP"); ((Status)gameObject.GetComponent(typeof(Status))).health = PlayerPrefs.GetInt("TempPlayerMaxHP"); ((Status)gameObject.GetComponent(typeof(Status))).maxMana = PlayerPrefs.GetInt("TempPlayerMaxMP"); ((Status)gameObject.GetComponent(typeof(Status))).mana = PlayerPrefs.GetInt("TempPlayerMaxMP"); ((Status)gameObject.GetComponent(typeof(Status))).statusPoint = PlayerPrefs.GetInt("TempPlayerSTP"); mainCam = GameObject.FindWithTag("MainCamera").transform; ((ARPGcamera)mainCam.GetComponent(typeof(ARPGcamera))).target = gameObject.transform; ((Inventory)gameObject.GetComponent(typeof(Inventory))).cash = PlayerPrefs.GetInt("TempCash"); int num = Extensions.get_length((System.Array)((Inventory)player.GetComponent(typeof(Inventory))).itemSlot); int i = 0; if (num > 0) { for (; i < num; i++) { ((Inventory)gameObject.GetComponent(typeof(Inventory))).itemSlot[i] = PlayerPrefs.GetInt("TempItem" + i.ToString()); ((Inventory)gameObject.GetComponent(typeof(Inventory))).itemQuantity[i] = PlayerPrefs.GetInt("TempItemQty" + i.ToString()); } } int num2 = Extensions.get_length((System.Array)((Inventory)player.GetComponent(typeof(Inventory))).equipment); i = 0; if (num2 > 0) { for (; i < num2; i++) { ((Inventory)gameObject.GetComponent(typeof(Inventory))).equipment[i] = PlayerPrefs.GetInt("TempEquipm" + i.ToString()); } } ((Inventory)gameObject.GetComponent(typeof(Inventory))).weaponEquip = 0; ((Inventory)gameObject.GetComponent(typeof(Inventory))).armorEquip = PlayerPrefs.GetInt("TempArmoEquip"); if (PlayerPrefs.GetInt("TempWeaEquip") == 0) { ((Inventory)gameObject.GetComponent(typeof(Inventory))).RemoveWeaponMesh(); } else { ((Inventory)gameObject.GetComponent(typeof(Inventory))).EquipItem(PlayerPrefs.GetInt("TempWeaEquip"), ((Inventory)gameObject.GetComponent(typeof(Inventory))).equipment.Length + 5); } Screen.lockCursor = true; GameObject[] array = null; array = GameObject.FindGameObjectsWithTag("Enemy"); int j = 0; GameObject[] array2 = array; for (int length = array2.Length; j < length; j++) { if ((bool)array2[j]) { ((AIset)array2[j].GetComponent(typeof(AIset))).followTarget = gameObject.transform; } } GameObject gameObject2 = GameObject.FindWithTag("Minimap"); if ((bool)gameObject2) { GameObject minimapCam = ((MinimapOnOff)gameObject2.GetComponent(typeof(MinimapOnOff))).minimapCam; ((MinimapCamera)minimapCam.GetComponent(typeof(MinimapCamera))).target = gameObject.transform; } ((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questProgress = new int[PlayerPrefs.GetInt("TempQuestSize")]; int num3 = Extensions.get_length((System.Array)((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questProgress); i = 0; if (num3 > 0) { for (; i < num3; i++) { ((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questProgress[i] = PlayerPrefs.GetInt("TempQuestp" + i.ToString()); } } ((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questSlot = new int[PlayerPrefs.GetInt("TempQuestSlotSize")]; int num4 = Extensions.get_length((System.Array)((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questSlot); i = 0; if (num4 > 0) { for (; i < num4; i++) { ((QuestStat)gameObject.GetComponent(typeof(QuestStat))).questSlot[i] = PlayerPrefs.GetInt("TempQuestslot" + i.ToString()); } } for (i = 0; i <= 2; i++) { ((SkillWindow)gameObject.GetComponent(typeof(SkillWindow))).skill[i] = PlayerPrefs.GetInt("TempSkill" + i.ToString()); } for (i = 0; i < Extensions.get_length((System.Array)((SkillWindow)gameObject.GetComponent(typeof(SkillWindow))).skillListSlot); i++) { ((SkillWindow)gameObject.GetComponent(typeof(SkillWindow))).skillListSlot[i] = PlayerPrefs.GetInt("TempSkillList" + i.ToString()); } ((SkillWindow)gameObject.GetComponent(typeof(SkillWindow))).AssignAllSkill(); UnityEngine.Object.Destroy(this.gameObject); }
/// <summary> /// Creates a new instance with the provided properties. /// </summary> public IridiumSatellite(string name, IEnumerable <TwoLineElementSet> tles, Font font, double targetFrequency) { var earth = CentralBodiesFacet.GetFromContext().Earth; //Set the name and create the point from the TLE. Name = name; LocationPoint = new Sgp4Propagator(tles).CreatePoint(); OrientationAxes = new AxesVehicleVelocityLocalHorizontal(earth.InertialFrame, LocationPoint); //Create a transceiver modeled after Iridium specs. m_transceiver = new Transceiver { Name = Name + " Transceiver", Modulation = new ModulationQpsk(), OutputGain = 100.0, OutputNoiseFactor = 1.2, CarrierFrequency = targetFrequency, Filter = new RectangularFilter { Frequency = targetFrequency, UpperBandwidthLimit = 20.0e6, LowerBandwidthLimit = -20.0e6 }, InputAntennaGainPattern = new GaussianGainPattern(1.0, 0.55, 0.001), OutputAntennaGainPattern = new GaussianGainPattern(1.0, 0.55, 0.001) }; m_transceiver.InputAntenna.LocationPoint = new PointFixedOffset(ReferenceFrame, new Cartesian(0, -1.0, 0)); m_transceiver.OutputAntenna.LocationPoint = new PointFixedOffset(ReferenceFrame, new Cartesian(0, +1.0, 0)); // setup Marker graphics for the satellites var satelliteTexture = SceneManager.Textures.FromUri(Path.Combine(Application.StartupPath, "Data/Markers/smallsatellite.png")); m_markerGraphicsExtension = new MarkerGraphicsExtension(new MarkerGraphics { Texture = new ConstantGraphicsParameter <Texture2D>(satelliteTexture), DisplayParameters = new DisplayParameters { // hide marker when camera is closer than the below distance MinimumDistance = new ConstantGraphicsParameter <double>(17500000.0) } }); Extensions.Add(m_markerGraphicsExtension); // setup Model graphics for the satellites var modelUri = new Uri(Path.Combine(Application.StartupPath, "Data/Models/iridium.mdl")); m_modelGraphicsExtension = new ModelGraphicsExtension(new ModelGraphics { Uri = new ConstantGraphicsParameter <Uri>(modelUri), Scale = new ConstantGraphicsParameter <double>(50000.0), DisplayParameters = new DisplayParameters { // hide model when camera is further than the marker minimum distance above MaximumDistance = m_markerGraphicsExtension.MarkerGraphics.DisplayParameters.MinimumDistance } }); Extensions.Add(m_modelGraphicsExtension); // setup text graphics for the satellites m_textGraphicsExtension = new TextGraphicsExtension(new TextGraphics { Color = new ConstantGraphicsParameter <Color>(Color.Red), Font = new ConstantGraphicsParameter <Font>(font), Outline = new ConstantGraphicsParameter <bool>(true), OutlineColor = new ConstantGraphicsParameter <Color>(Color.Black), Text = new ConstantGraphicsParameter <string>(Name), Origin = new ConstantGraphicsParameter <Origin>(Origin.TopCenter), PixelOffset = new ConstantGraphicsParameter <PointF>(new PointF(0, -satelliteTexture.Template.Height / 2)) }); if (TextureFilter2D.Supported(TextureWrap.ClampToEdge)) { m_textGraphicsExtension.TextGraphics.TextureFilter = new ConstantGraphicsParameter <TextureFilter2D>(TextureFilter2D.NearestClampToEdge); } Extensions.Add(m_textGraphicsExtension); }
/// <summary> /// Get a set of campaigns. /// </summary> /// <param name="status">Returns list of email campaigns with specified status.</param> /// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param> /// <param name="modifiedSince">limit campaigns to campaigns modified since the supplied date</param> /// <param name="pag">Pagination object returned by a previous call to GetCampaigns</param> /// <returns>Returns a ResultSet of campaigns.</returns> public ResultSet <EmailCampaign> GetCampaigns(CampaignStatus?status, int?limit, DateTime?modifiedSince, Pagination pag) { string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.Campaigns, GetQueryParameters(new object[] { "status", status, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) })) : pag.GetNextUrl(); RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey); try { var results = response.Get <ResultSet <EmailCampaign> >(); return(results); } catch (Exception ex) { throw new CtctException(ex.Message, ex); } }
///GENMHASH:C4C74C5CA23BE3B4CAFEFD0EF23149A0:B6DE3F3ADD30CF80937F7E47989E73C7 public ICheckNameAvailabilityResult CheckNameAvailability(string name) { return(Extensions.Synchronize(() => this.CheckNameAvailabilityAsync(name))); }
public ISqlElasticPool Apply() { return(Extensions.Synchronize(() => this.ApplyAsync())); }
///GENMHASH:82950C798CC6991658642EDBCBD92E5B:4E8DA28B26E404EF73C23230E63E7137 public IReadOnlyList <Microsoft.Azure.Management.Sql.Fluent.ISqlDatabaseMetric> ListDatabaseMetrics(string filter) { return(Extensions.Synchronize(() => this.ListDatabaseMetricsAsync(filter))); }
internal NameServiceClient(int lport, IPAddress laddr) { this._lport = lport; this.laddr = laddr; try { Baddr = Config.GetInetAddress("jcifs.netbios.baddr", Extensions.GetAddressByName("255.255.255.255")); } catch (Exception e) { LogStream.GetInstance().WriteLine(e); } _sndBuf = new byte[SndBufSize]; _rcvBuf = new byte[RcvBufSize]; if (string.IsNullOrEmpty(Ro)) { if (NbtAddress.GetWinsAddress() == null) { _resolveOrder = new int[2]; _resolveOrder[0] = ResolverLmhosts; _resolveOrder[1] = ResolverBcast; } else { _resolveOrder = new int[3]; _resolveOrder[0] = ResolverLmhosts; _resolveOrder[1] = ResolverWins; _resolveOrder[2] = ResolverBcast; } } else { int[] tmp = new int[3]; StringTokenizer st = new StringTokenizer(Ro, ","); int i = 0; while (st.HasMoreTokens()) { string s = st.NextToken().Trim(); if (Runtime.EqualsIgnoreCase(s, "LMHOSTS")) { tmp[i++] = ResolverLmhosts; } else { if (Runtime.EqualsIgnoreCase(s, "WINS")) { if (NbtAddress.GetWinsAddress() == null) { if (_log.Level > 1) { _log.WriteLine("NetBIOS resolveOrder specifies WINS however the " + "jcifs.netbios.wins property has not been set" ); } continue; } tmp[i++] = ResolverWins; } else { if (Runtime.EqualsIgnoreCase(s, "BCAST")) { tmp[i++] = ResolverBcast; } else { if (Runtime.EqualsIgnoreCase(s, "DNS")) { } else { // skip if (_log.Level > 1) { _log.WriteLine("unknown resolver method: " + s); } } } } } } _resolveOrder = new int[i]; Array.Copy(tmp, 0, _resolveOrder, 0, i); } }
public void Retry() { Extensions.Log(GetType(), "Retry pressed"); LevelManager.ToggleGameOver(); LevelManager.SceneData.Storage.SceneFader.FadeTo(SceneManager.GetActiveScene().name); }
private void ConvertDate() { var value = Extensions.GetDateTime("Type DateTime (date) value: "); Console.WriteLine($"Value: {value.ToShortDateString()}"); }
/// <summary> /// Creates a new <see cref="ExtendableQueryParser"/> instance /// </summary> /// <param name="matchVersion">the lucene version to use.</param> /// <param name="f">the default query field</param> /// <param name="a">the analyzer used to find terms in a query string</param> /// <param name="ext">the query parser extensions</param> public ExtendableQueryParser(LuceneVersion matchVersion, string f, Analyzer a, Extensions ext) : base(matchVersion, f, a) { this.defaultField = f; this.extensions = ext; }
private void ConvertInt32() { var value = Extensions.GetInt32("Type Int32 value: "); Console.WriteLine($"Value: {value}"); }
private void LoadDictionary(IDictionary dictionary) { DetachEvents(); this.dictionary = dictionary; this.extensions = new Extensions(dictionary); Open(); if (!(dictionary is MLifter.DAL.Preview.PreviewDictionary)) PrepareDictionary(); if (slideShowCards == null) LoadSlideShowContent(); }
static HandlerXmlWriter() { _objectWriters = Extensions.GetImplementersOf <IHandlerObjectXmlWriter>() .ToDictionary(x => x.ObjectType); }
/// <summary> /// Will load an item from a given directory. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="fileName">Name of the file to search for.</param> /// <param name="directory">Directory to extra the file from.</param> /// <param name="extension">Extension type to look for.</param> /// <returns></returns> public static T Load <T>(string fileName, Directories directory = Directories.global, Extensions extension = Extensions.dat) { string dir = GetFileDirectory(fileName, directory, extension); // If no file exists at the input directory return default null. if (File.Exists(dir) == false) { Debug.LogError($"No file at: {dir}"); return(default);
private string HandlerName(RefreshHandler h) { return(h.GetType().FullName + '@' + Extensions.ToHexString(h.GetHashCode( ))); }
public SpreadsheetViewModel(Extensions extensions, ModuleBuilder mb, int rows, int cols) { Type rowType = RowViewModelBase.Initialize(mb, cols); Type gt = typeof(ObservableCollection<>); Type cgt = gt.MakeGenericType(rowType); _getItem = CreateGetItemDelegate(cgt); _add = CreateAddDelegate(cgt, rowType); _rows = Activator.CreateInstance(cgt); _model = new SpreadsheetModel(extensions); for (int i = 0; i < rows; i++) { RowViewModelBase row = RowViewModelBase.Create(mb, this, i + 1, cols); _add(_rows, row); } }
private MetadataReference ConvertMetadataReference( Extensions.CompilationAbstractions.IMetadataReference metadataReference) { var roslynReference = metadataReference as IRoslynMetadataReference; if (roslynReference != null) { return roslynReference.MetadataReference; } var embeddedReference = metadataReference as Extensions.CompilationAbstractions.IMetadataEmbeddedReference; if (embeddedReference != null) { return MetadataReference.CreateFromImage(embeddedReference.Contents); } var fileMetadataReference = metadataReference as Extensions.CompilationAbstractions.IMetadataFileReference; if (fileMetadataReference != null) { return CreateMetadataFileReference(fileMetadataReference.Path); } var projectReference = metadataReference as Extensions.CompilationAbstractions.IMetadataProjectReference; if (projectReference != null) { using (var ms = new MemoryStream()) { projectReference.EmitReferenceAssembly(ms); return MetadataReference.CreateFromImage(ms.ToArray()); } } throw new NotSupportedException(); }
private void IconLeave(object sender, MouseEventArgs e) { ((Border)sender).Background = Extensions.HexToBrush("#ffffff", false); }
///GENMHASH:65E6085BB9054A86F6A84772E3F5A9EC:379E136E5A42BFD01E1A9EB17A980D88 public void Delete() { Extensions.Synchronize(() => this.DeleteResourceAsync()); }
public void Menu() { Extensions.Log(GetType(), "Menu pressed"); LevelManager.ToggleGameOver(); LevelManager.SceneData.Storage.SceneFader.FadeTo(LevelManager.SceneData.SceneNode.Parent.Data); }
private static void saveExtensions(Extensions extensions) { try { string configPath = ExtensionsConfigFilePath; XmlSerializer writer = new XmlSerializer(typeof(Extensions)); using (StreamWriter file = new StreamWriter(configPath)) { writer.Serialize(file, extensions); } } catch { } }
///GENMHASH:ADBA306EFFDD56AD4F8EFBD9057E1EAF:27B2CC85FAA243FA66F22CA2837DDCBD public IReadOnlyList <Microsoft.Azure.Management.Sql.Fluent.ISqlDatabaseMetricDefinition> ListDatabaseMetricDefinitions() { return(Extensions.Synchronize(() => this.ListDatabaseMetricDefinitionsAsync())); }
public bool CheckObjectTypes( BaseCommand command, Extensions ext, out bool items, out bool mobiles ) { items = mobiles = false; ObjectConditional cond = ObjectConditional.Empty; foreach ( BaseExtension check in ext ) { if ( check is WhereExtension ) { cond = ( check as WhereExtension ).Conditional; break; } } bool condIsItem = cond.IsItem; bool condIsMobile = cond.IsMobile; switch ( command.ObjectTypes ) { case ObjectTypes.All: case ObjectTypes.Both: { if ( condIsItem ) items = true; if ( condIsMobile ) mobiles = true; break; } case ObjectTypes.Items: { if ( condIsItem ) { items = true; } else if ( condIsMobile ) { command.LogFailure( "You may not use a mobile type condition for this command." ); return false; } break; } case ObjectTypes.Mobiles: { if ( condIsMobile ) { mobiles = true; } else if ( condIsItem ) { command.LogFailure( "You may not use an item type condition for this command." ); return false; } break; } } return true; }
///GENMHASH:DA730BE4F3BEA4D8DCD1631C079435CB:AFDEF6B8993C33A8E723612D6EAD48B5 public IReadOnlyList <Microsoft.Azure.Management.Sql.Fluent.IElasticPoolDatabaseActivity> ListDatabaseActivities() { return(Extensions.Synchronize(() => this.ListDatabaseActivitiesAsync())); }
public void AddExtension(IExtension extension) { if (_Extensions == null) { _Extensions = new Extensions(); } Extension item = new Extension(); item.ExtensionType = extension.ExtensionType; item.SpecifcExtension = extension; _Extensions.Add(item); }
///GENMHASH:1C25D7B8D9084176A24655682A78634D:8E193D1268EA25434555A7B24DDEB33B public ISqlDatabase GetDatabase(string databaseName) { var databaseInner = Extensions.Synchronize(() => this.sqlServerManager.Inner.Databases.GetAsync(this.resourceGroupName, this.sqlServerName, databaseName)); return(databaseInner != null ? new SqlDatabaseImpl(this.resourceGroupName, this.sqlServerName, this.sqlServerLocation, databaseName, databaseInner, this.sqlServerManager) : null); }
public override void SetUp() { base.SetUp(); this.ext = new Extensions(); }
public ISqlElasticPool Refresh() { return(Extensions.Synchronize(() => this.RefreshAsync())); }
public ISqlElasticPool Create() { return(Extensions.Synchronize(() => this.CreateAsync())); }
public Caps(Extensions extensions) { this.RedBits = GL.GetInteger(IntegerName.RedBits); this.GreenBits = GL.GetInteger(IntegerName.GreenBits); this.BlueBits = GL.GetInteger(IntegerName.BlueBits); this.AlphaBits = GL.GetInteger(IntegerName.AlphaBits); this.DepthBits = GL.GetInteger(IntegerName.DepthBits); this.StencilBits = GL.GetInteger(IntegerName.StencilBits); this.MaxClipPlanes = GL.GetInteger(IntegerName.MaxClipPlanes); this.MaxTextureSize = GL.GetInteger(IntegerName.MaxTextureSize); int x, y; GL.GetInteger(Integer2Name.MaxViewportDims, out x, out y); this.MaxViewportWidth = x; this.MaxViewportHeight = y; if (extensions.ARB_draw_buffers) { this.MaxDrawBuffers = GL.GetInteger(IntegerName.MaxDrawBuffers); } if (extensions.ARB_texture_cube_map) { this.MaxCubeMapTextureSize = GL.GetInteger(IntegerName.MaxCubeMapTextureSize); } if (extensions.ARB_multisample) { this.Samples = GL.GetInteger(IntegerName.Samples); } if (extensions.ARB_fragment_shader) { this.MaxFragmentUniformComponents = GL.GetInteger(IntegerName.MaxFragmentUniformComponents); this.MaxTextureImageUnits = GL.GetInteger(IntegerName.MaxTextureImageUnits); } if (extensions.ARB_vertex_shader) { this.MaxVertexUniformComponents = GL.GetInteger(IntegerName.MaxVertexUniformComponents); this.MaxVaryingFloats = GL.GetInteger(IntegerName.MaxVaryingFloats); this.MaxVertexAttribs = GL.GetInteger(IntegerName.MaxVertexAttribs); this.MaxVertexTextureImageUnits = GL.GetInteger(IntegerName.MaxVertexTextureImageUnits); this.MaxCombinedTextureImageUnits = GL.GetInteger(IntegerName.MaxCombinedTextureImageUnits); } if (extensions.EXT_draw_range_elements) { this.MaxElementsVertices = GL.GetInteger(IntegerName.MaxElementsVertices); this.MaxElementsIndices = GL.GetInteger(IntegerName.MaxElementsIndices); } if (extensions.EXT_framebuffer_object) { this.MaxColorAttachments = GL.GetInteger(IntegerName.MaxColorAttachments); this.MaxRenderbufferSize = GL.GetInteger(IntegerName.MaxRenderbufferSize); } if (extensions.EXT_framebuffer_multisample) { this.MaxFramebufferSamples = GL.GetInteger(IntegerName.MaxSamples); } if (extensions.EXT_texture3D) { this.Max3DTextureSize = GL.GetInteger(IntegerName.Max3DTextureSize); } if (extensions.EXT_texture_filter_anisotropic) { this.MaxTextureMaxAnisotropy = GL.GetInteger(IntegerName.MaxTextureMaxAnisotropy); } }