Here are the examples of the csharp api System.Reflection.Assembly.GetCallingAssembly() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
633 Examples
19
Source : EventIDLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static IEventIDLog Exists(string name)
{
return Exists(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : EventIDLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static IEventIDLog[] GetCurrentLoggers()
{
return GetCurrentLoggers(replacedembly.GetCallingreplacedembly());
}
19
Source : EventIDLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static IEventIDLog GetLogger(Type type)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), type.FullName);
}
19
Source : MarshalByRefLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILog Exists(string name)
{
return Exists(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : MarshalByRefLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILog[] GetCurrentLoggers()
{
return GetCurrentLoggers(replacedembly.GetCallingreplacedembly());
}
19
Source : TraceLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ITraceLog Exists(string name)
{
return Exists(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : TraceLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ITraceLog[] GetCurrentLoggers()
{
return GetCurrentLoggers(replacedembly.GetCallingreplacedembly());
}
19
Source : TraceLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ITraceLog GetLogger(string name)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : BasicConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure()
{
return BasicConfigurator.Configure(LogManager.GetRepository(replacedembly.GetCallingreplacedembly()));
}
19
Source : BasicConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure(params IAppender[] appenders)
{
ArrayList configurationMessages = new ArrayList();
ILoggerRepository repository = LogManager.GetRepository(replacedembly.GetCallingreplacedembly());
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigure(repository, appenders);
}
repository.ConfigurationMessages = configurationMessages;
return configurationMessages;
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure()
{
return Configure(LogManager.GetRepository(replacedembly.GetCallingreplacedembly()));
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure(XmlElement element)
{
ArrayList configurationMessages = new ArrayList();
ILoggerRepository repository = LogManager.GetRepository(replacedembly.GetCallingreplacedembly());
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigureFromXml(repository, element);
}
repository.ConfigurationMessages = configurationMessages;
return configurationMessages;
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure(FileInfo configFile)
{
ArrayList configurationMessages = new ArrayList();
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigure(LogManager.GetRepository(replacedembly.GetCallingreplacedembly()), configFile);
}
return configurationMessages;
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure(Uri configUri)
{
ArrayList configurationMessages = new ArrayList();
ILoggerRepository repository = LogManager.GetRepository(replacedembly.GetCallingreplacedembly());
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigure(repository, configUri);
}
repository.ConfigurationMessages = configurationMessages;
return configurationMessages;
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection Configure(Stream configStream)
{
ArrayList configurationMessages = new ArrayList();
ILoggerRepository repository = LogManager.GetRepository(replacedembly.GetCallingreplacedembly());
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigure(repository, configStream);
}
repository.ConfigurationMessages = configurationMessages;
return configurationMessages;
}
19
Source : SystemInfo.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static Type GetTypeFromString(string typeName, bool throwOnError, bool ignoreCase)
{
return GetTypeFromString(replacedembly.GetCallingreplacedembly(), typeName, throwOnError, ignoreCase);
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILog GetLogger(Type type)
{
#if NETSTANDARD1_3
return GetLogger(type.GetTypeInfo().replacedembly, type.FullName);
#else
return GetLogger(replacedembly.GetCallingreplacedembly(), type.FullName);
#endif
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static bool Flush(int millisecondsTimeout)
{
#if !NETSTANDARD1_3 // Excluded because GetCallingreplacedembly() is not available in CoreFX (https://github.com/dotnet/corefx/issues/2221).
Appender.IFlushable flushableRepository = LoggerManager.GetRepository(replacedembly.GetCallingreplacedembly()) as Appender.IFlushable;
if (flushableRepository == null)
{
return false;
}
else
{
return flushableRepository.Flush(millisecondsTimeout);
}
#else
return false;
#endif
}
19
Source : EventIDLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static IEventIDLog GetLogger(string name)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : MarshalByRefLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILog GetLogger(string name)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), name);
}
19
Source : MarshalByRefLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILog GetLogger(Type type)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), type.FullName);
}
19
Source : TraceLogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ITraceLog GetLogger(Type type)
{
return GetLogger(replacedembly.GetCallingreplacedembly(), type.FullName);
}
19
Source : XmlConfigurator.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ICollection ConfigureAndWatch(FileInfo configFile)
{
ArrayList configurationMessages = new ArrayList();
ILoggerRepository repository = LogManager.GetRepository(replacedembly.GetCallingreplacedembly());
using (new LogLog.LogReceivedAdapter(configurationMessages))
{
InternalConfigureAndWatch(repository, configFile);
}
repository.ConfigurationMessages = configurationMessages;
return configurationMessages;
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static void ShutdownRepository()
{
ShutdownRepository(replacedembly.GetCallingreplacedembly());
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static void ResetConfiguration()
{
ResetConfiguration(replacedembly.GetCallingreplacedembly());
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
[Obsolete("Use GetRepository instead of GetLoggerRepository")]
public static ILoggerRepository GetLoggerRepository()
{
return GetRepository(replacedembly.GetCallingreplacedembly());
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILoggerRepository GetRepository()
{
return GetRepository(replacedembly.GetCallingreplacedembly());
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
[Obsolete("Use CreateRepository instead of CreateDomain")]
public static ILoggerRepository CreateDomain(Type repositoryType)
{
return CreateRepository(replacedembly.GetCallingreplacedembly(), repositoryType);
}
19
Source : LogManager.cs
with Apache License 2.0
from apache
with Apache License 2.0
from apache
public static ILoggerRepository CreateRepository(Type repositoryType)
{
return CreateRepository(replacedembly.GetCallingreplacedembly(), repositoryType);
}
19
Source : TypeImplementation.cs
with MIT License
from apexsharp
with MIT License
from apexsharp
public Type forName(string fullyQualifiedName)
{
var type = SysType.GetType(fullyQualifiedName, throwOnError: false, ignoreCase: true);
if (type == null)
{
// traverse replacedemblies: mscorlib, Apex, entry point, calling replacedembly
var replacedemblies = new[]
{
typeof(string).replacedembly, typeof(Type).replacedembly,
replacedembly.GetEntryreplacedembly(),
replacedembly.GetCallingreplacedembly()
};
foreach (var asm in replacedemblies.Distinct())
{
type = asm.GetType(fullyQualifiedName, throwOnError: false, ignoreCase: true);
if (type != null)
{
break;
}
}
}
if (type == null)
{
throw new TypeException($"Type not found: {fullyQualifiedName}");
}
var typeInst = new TypeInstance(type);
return new Type(typeInst);
}
19
Source : MockConditions.cs
with MIT License
from Apps72
with MIT License
from Apps72
public void LoadTagsFromResources(params string[] fileNames)
{
this.LoadTagsFromResources(replacedembly.GetCallingreplacedembly(), fileNames);
}
19
Source : ModelToIconConverter.cs
with MIT License
from Aptacode
with MIT License
from Aptacode
public static BitmapImage LoadBitmapFromResource(string pathInApplication, replacedembly replacedembly = null)
{
if (replacedembly == null)
{
replacedembly = replacedembly.GetCallingreplacedembly();
}
if (pathInApplication[0] == '/')
{
pathInApplication = pathInApplication.Substring(1);
}
try
{
return new BitmapImage(new Uri(
@"pack://application:,,,/Aptacode.Forms.Wpf;component/" + pathInApplication, UriKind.Absolute));
}
catch { }
return null;
}
19
Source : Browser.cs
with Apache License 2.0
from aquality-automation
with Apache License 2.0
from aquality-automation
public void ExecuteScriptFromFile(string embeddedResourcePath, params object[] arguments)
{
ExecuteScript(embeddedResourcePath.GetScript(replacedembly.GetCallingreplacedembly()), arguments);
}
19
Source : Browser.cs
with Apache License 2.0
from aquality-automation
with Apache License 2.0
from aquality-automation
public T ExecuteScriptFromFile<T>(string embeddedResourcePath, params object[] arguments)
{
return ExecuteScript<T>(embeddedResourcePath.GetScript(replacedembly.GetCallingreplacedembly()), arguments);
}
19
Source : Browser.cs
with Apache License 2.0
from aquality-automation
with Apache License 2.0
from aquality-automation
public object ExecuteAsyncScriptFromFile(string embeddedResourcePath, params object[] arguments)
{
return ExecuteAsyncScript(embeddedResourcePath.GetScript(replacedembly.GetCallingreplacedembly()), arguments);
}
19
Source : CommandManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void RegisterCommand(string commandName, Action<OS, string[]> handler, bool addAutocomplete = true, bool caseSensitive = false)
{
var pluginAsm = replacedembly.GetCallingreplacedembly();
if (CustomCommands.AllItems.Any(x => x.Name == commandName))
throw new ArgumentException($"Command {commandName} has already been registered!", nameof(commandName));
CustomCommands.Add(new CustomCommand
{
Name = commandName,
CommandAction = handler,
Autocomplete = addAutocomplete,
CaseSensitive = caseSensitive
}, pluginAsm);
if (addAutocomplete)
RebuildAutoComplete();
}
19
Source : CommandManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void UnregisterCommand(string commandName, replacedembly pluginAsm = null)
{
CustomCommands.RemoveAll(x => x.Name == commandName, pluginAsm ?? replacedembly.GetCallingreplacedembly());
}
19
Source : EventManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void AddHandler(Action<T> handler, EventHandlerOptions options = default)
{
Instance.AddHandlerInternal(new EventHandler<T>(handler, options), replacedembly.GetCallingreplacedembly());
}
19
Source : EventManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void RemoveHandler(Action<T> handler, replacedembly eventreplacedembly = null)
{
Instance.RemoveHandlerInternal(handler.Method, eventreplacedembly ?? replacedembly.GetCallingreplacedembly());
}
19
Source : PortManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void RegisterPort(string protocol, string displayName, int defaultPort = -1) => RegisterPortInternal(new PortData(protocol, defaultPort, displayName), replacedembly.GetCallingreplacedembly());
19
Source : PortManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void RegisterPort(PortData info) => RegisterPortInternal(info, replacedembly.GetCallingreplacedembly());
19
Source : PortManager.cs
with MIT License
from Arkhist
with MIT License
from Arkhist
[MethodImpl(MethodImplOptions.NoInlining)]
public static void UnregisterPort(string protocol, replacedembly pluginAsm = null)
{
pluginAsm = pluginAsm ?? replacedembly.GetCallingreplacedembly();
CustomPorts.RemoveAll(x => x.Protocol == protocol, pluginAsm);
}
19
Source : VideoSource.cs
with MIT License
from arqueror
with MIT License
from arqueror
public static VideoSource FromResource(string resource, replacedembly replacedembly = default(replacedembly))
{
if (string.IsNullOrEmpty(resource))
return null;
if (!Path.HasExtension(resource))
throw new Exception($"The specified resource '{resource}' must contain a valid file extension.");
var foundResource = false;
var format = Path.GetExtension(resource)?.Replace(".", string.Empty);
replacedembly parameterreplacedembly = null, callingreplacedembly = null, entryreplacedembly = null;
if (replacedembly != null)
{
parameterreplacedembly = replacedembly;
foundResource = replacedembly.ContainsManifestResource(resource);
}
if (!foundResource)
{
replacedembly = replacedembly.GetCallingreplacedembly();
callingreplacedembly = replacedembly;
foundResource = replacedembly.ContainsManifestResource(resource);
}
if (!foundResource)
{
replacedembly = replacedembly.GetEntryreplacedembly();
entryreplacedembly = replacedembly;
foundResource = replacedembly.ContainsManifestResource(resource);
}
if (!foundResource)
{
var resourceNames = new List<string>();
if (parameterreplacedembly != null)
resourceNames.AddRange(parameterreplacedembly.GetManifestResourceNames());
if (callingreplacedembly != null)
resourceNames.AddRange(callingreplacedembly.GetManifestResourceNames());
if (entryreplacedembly != null)
resourceNames.AddRange(entryreplacedembly.GetManifestResourceNames());
Log.Error($"Unable to locate the embedded resource '{resource}'. " +
$"Possible candidates are: {Environment.NewLine}{string.Join(Environment.NewLine, resourceNames)}");
return null;
}
return FromStream(() => replacedembly.GetEmbeddedResourceStream(resource), format);
}
19
Source : FrameworkConfigurationBuilder.cs
with GNU Affero General Public License v3.0
from asmejkal
with GNU Affero General Public License v3.0
from asmejkal
public FrameworkConfigurationBuilder AddModulesFromExecutingreplacedembly() =>
AddModulesFromreplacedembly(replacedembly.GetCallingreplacedembly());
19
Source : ResourceUtils.cs
with MIT License
from Astropilot
with MIT License
from Astropilot
public static byte[] GetEmbeddedResource(string resourceFileName, replacedembly containingreplacedembly = null)
{
if (containingreplacedembly == null)
{
containingreplacedembly = replacedembly.GetCallingreplacedembly();
}
string name = Enumerable.Single<string>(containingreplacedembly.GetManifestResourceNames(), (string str) => str.EndsWith(resourceFileName));
byte[] result;
using (Stream manifestResourceStream = containingreplacedembly.GetManifestResourceStream(name))
{
byte[] array = manifestResourceStream.ReadAllBytes();
if (array.Length == 0)
{
Debug.LogWarning(string.Format("The resource %1 was not found", resourceFileName));
}
result = array;
}
return result;
}
19
Source : Help.cs
with Apache License 2.0
from atifaziz
with Apache License 2.0
from atifaziz
static Stream? GetManifestResourceStream(Type? type, string name) =>
type != null ? type.replacedembly.GetManifestResourceStream(type, name)
: replacedembly.GetCallingreplacedembly().GetManifestResourceStream(name);
19
Source : Submission.cs
with MIT License
from Auros
with MIT License
from Auros
public Ticket DisableScoreSubmission(string source, string? subsource = null)
{
var ticket = _tickets.FirstOrDefault(x => x.Source == source);
if (ticket is null)
{
ticket = new Ticket(source, replacedembly.GetCallingreplacedembly());
_tickets.Add(ticket);
ticket.AddReason(subsource);
}
else
{
ticket.AddReason(subsource);
}
return ticket;
}
19
Source : Submission.cs
with MIT License
from Auros
with MIT License
from Auros
public void Remove(string source)
{
Remove(_tickets.FirstOrDefault(x => x.Source == source && x.replacedembly == replacedembly.GetCallingreplacedembly()));
}
19
Source : DirectoryModuleCatalogFixture.Desktop.cs
with MIT License
from AvaloniaCommunity
with MIT License
from AvaloniaCommunity
[TestMethod]
public void ShouldNotGetModuleInfoForAnreplacedemblyAlreadyLoadedInTheMainDomain()
{
var replacedemblyPath = replacedembly.GetCallingreplacedembly().Location;
DirectoryModuleCatalog catalog = new DirectoryModuleCatalog
{
ModulePath = ModulesDirectory5
};
catalog.Load();
var modules = catalog.Modules.ToArray();
replacedert.AreEqual(0, modules.Length);
}
19
Source : CodeGenConsoleWrapper.cs
with MIT License
from Avanade
with MIT License
from Avanade
public static CodeGenConsoleWrapper Create(string company, string appName, string apiName = "Api", string? outDir = null)
{
return new CodeGenConsoleWrapper(new replacedembly[] { replacedembly.GetCallingreplacedembly() }, company, appName, apiName, outDir);
}
See More Examples