private void btnStart_Click(object sender, EventArgs e) { btnStop.Enabled = true; btnStart.Enabled = false; scraper = new WrapperBase((int)(double.Parse(txtInterval.Text) * 60000)); scraper.Start(); }
private bool MeetsRequirements(WrapperBase wrapper) { var mockWrapper = Mock.Get(wrapper); return((mockWrapper == _mockX && _xMeetsRequirements) || (mockWrapper == _mockY && _yMeetsRequirements)); }
// codebase/idl/idl.somename.dll contains generated API wrapper for somename // codebase/api/api.somename.dll contains actual user-written code for API private ApiInstance(string name, string codepath) { path = Path.Combine(Path.Combine(codepath, "idl"), "idl." + name + ".dll"); // todo: for runtime code replacement, use appdomains and refcount active requests assy = Assembly.LoadFile(path); if (assy == null) { throw new FileNotFoundException("Could not find assembly: " + path); } Console.WriteLine("Loaded {0} from {1}", name, path); foreach (Type t in assy.GetExportedTypes()) { Console.WriteLine("Examining type {0}", t.Name); if ((t.Name == name || t.Name == "idl." + name) && typeof(WrapperBase).IsAssignableFrom(t)) { Console.WriteLine("Found type {0}", t.Name); wrapper = (WrapperBase)assy.CreateInstance(t.FullName); wrapper.CodePath = codepath; wrapper.Initialize(); break; } } if (wrapper == null) { throw new FileNotFoundException("Could not instantiate wrapper type: " + path); } api_counter.Count(); }
public BiendeoCHLib() { Instance = this; WrapperBase.InitializeWrappers(Logger); CloneHeroDefaultFont = null; }
static void Main(string[] args) { var logger = new ManualLogSource("stdout"); logger.LogEvent += LogEvent; LoggingEnabled = false; // The current working directory should be the repository root. WrapperBase.InitializeWrappers(logger); LoggingEnabled = true; var validators = new IValidator[] { new StandaloneVsLauncherValidator(logger), new SourceMapValidator(logger), new WrapperValidator(logger), }; foreach (var validator in validators) { if (!validator.AssertWorkingDirectory()) { Environment.Exit(1); } } foreach (var validator in validators) { validator.Validate(); } }
public void RemoteSingleton(Type iFace, string uri, object obj) { var newType = BuildWrapperType(module, iFace); WrapperBase newObj = (WrapperBase)Activator.CreateInstance(newType); newObj.src = obj; RemotingServices.Marshal(newObj, uri, iFace); marshaledObjects.Add(newObj); }
public void LoadTweak() { WrapperBase.InitializeLoaders(); if (this.gameObject != null) { return; } this.gameObject = new GameObject("Biendeo Tweak - Splash Text Editor", new Type[] { typeof(SplashTextEditor) }); UnityEngine.Object.DontDestroyOnLoad(this.gameObject); this.gameObject.SetActive(true); }
public void LoadTweak() { WrapperBase.InitializeLoaders(); if (this.gameObject != null) { return; } this.gameObject = new GameObject("Joost Tweak - Twitch Chat", new Type[] { typeof(TwitchChat) }); UnityEngine.Object.DontDestroyOnLoad(this.gameObject); this.gameObject.SetActive(true); }
public void LoadTweak() { WrapperBase.InitializeLoaders(); //Only if you use Biendeo's code wrappers if (this.gameObject != null) { return; } this.gameObject = new GameObject("Tweak - Template", new Type[] { typeof(TemplateTweak) }); UnityEngine.Object.DontDestroyOnLoad(this.gameObject); this.gameObject.SetActive(true); }
// Called once per method definition. Very static. public Task <IBinding> TryCreateAsync(BindingProviderContext context) { if (context == null) { throw new ArgumentNullException("context"); } ParameterInfo parameter = context.Parameter; TAttribute attribute = parameter.GetCustomAttribute <TAttribute>(inherit: false); if (attribute == null) { return(Task.FromResult <IBinding>(null)); } // Now we can instantiate against the user's type. // throws if can't infer the type. Type typeMessage = BindingFactoryHelpers.GetAsyncCollectorCoreType(parameter.ParameterType); if (typeMessage == null) { // incompatible type. Skip. return(Task.FromResult <IBinding>(null)); } // Apply filter var cloner = new AttributeCloner <TAttribute>(attribute, context.BindingDataContract, _nameResolver); var attrNameResolved = cloner.GetNameResolvedAttribute(); bool canUse = _filter(attrNameResolved, typeMessage); if (!canUse) { return(Task.FromResult <IBinding>(null)); } var wrapper = WrapperBase.New( typeMessage, _builder, _nameResolver, parameter, context); IBinding binding = wrapper.CreateBinding(); return(Task.FromResult(binding)); }
public WrapperBaseTests() { mock = new Mock <IDatabaseAsync>(); wrapper = new WrapperBase <IDatabaseAsync>(mock.Object, Encoding.UTF8.GetBytes("prefix:")); }
public void Initialize() { mock = new Mock<IDatabaseAsync>(); wrapper = new WrapperBase<IDatabaseAsync>(mock.Object, Encoding.UTF8.GetBytes("prefix:")); }
/// <summary> /// Creates a new instance of the WrapperWrapperBase object. /// </summary> /// <param name="value">The WrapperBase to Wrap.</param> protected WrapperWrapperBase(WrapperBase value) { Debug.Assert(value != null); m_corObject = value; }
public void Initialize() { mock = new Mock <IDatabaseAsync>(); wrapper = new WrapperBase <IDatabaseAsync>(mock.Object, "prefix:"); }
public void Initialize() { mock = new Mock <IDatabaseAsync>(); wrapper = new WrapperBase <IDatabaseAsync>(mock.Object, Encoding.UTF8.GetBytes("prefix:")); }