本文整理汇总了C#中IProgram类的典型用法代码示例。如果您正苦于以下问题:C# IProgram类的具体用法?C# IProgram怎么用?C# IProgram使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProgram类属于命名空间,在下文中一共展示了IProgram类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubProgram
protected SubProgram(IProgram program)
{
if (null == program)
throw new ArgumentNullException(nameof(program));
_program = program;
}
示例2: GetLinkStatus
public Boolean GetLinkStatus(IProgram program)
{
int linkStatus;
GL.GetProgram(program.ProgramId, GetProgramParameterName.LinkStatus, out linkStatus);
return (Boolean)linkStatus;
}
示例3: Interpreter
/// <summary>
/// Creates an instance of an Interpreter. Each of the parameters except program is optional..
/// </summary>
/// <param name="program">The program to execute. If this is null, the empty program is executed.</param>
/// <param name="tape">The tape to use as a memory story. If this is null, a default tape is used.</param>
/// <param name="input">The input source to use. If this is null then Console.In is used.</param>
/// <param name="output">The output source to use. If this is null then Console.Out is used.</param>
public Interpreter(IProgram program, Tape tape = null, TextReader input = null, TextWriter output = null)
{
_program = program;
_tape = tape ?? Tape.Default;
_input = input ?? Console.In;
_output = output ?? Console.Out;
}
示例4: LoggingConfiguration
public LoggingConfiguration(IProgram program, IOperatingSystem os, IVSServices vsservice)
{
NLog.Config.LoggingConfiguration conf;
string assemblyFolder = program.ExecutingAssemblyDirectory;
try
{
conf = new XmlLoggingConfiguration(Path.Combine(assemblyFolder, "NLog.config"), true);
}
catch (Exception ex)
{
vsservice.ActivityLogError(string.Format(CultureInfo.InvariantCulture, "Error loading nlog.config. {0}", ex));
conf = new NLog.Config.LoggingConfiguration();
}
var fileTarget = conf.FindTargetByName("file") as FileTarget;
if (fileTarget == null)
{
fileTarget = new FileTarget();
conf.AddTarget(Path.GetRandomFileName(), fileTarget);
conf.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, fileTarget));
}
fileTarget.FileName = Path.Combine(os.Environment.GetLocalGitHubApplicationDataPath(), "extension.log");
fileTarget.Layout = layout;
try
{
LogManager.Configuration = conf;
}
catch (Exception ex)
{
vsservice.ActivityLogError(string.Format(CultureInfo.InvariantCulture, "Error configuring the log. {0}", ex));
}
}
示例5: OutputWindow
public OutputWindow(IProgram program)
{
_program = program;
Width = 512;
Height = 512;
Background = Brushes.Transparent;
var timer = new DispatcherTimer(TimeSpan.FromMilliseconds(50), DispatcherPriority.Render, OnTimer,
Dispatcher);
timer.Start();
}
示例6: AppStartController
public AppStartController(AppConfiguration appConfiguration)
{
_application = DependencyResolver.GetImplementation<IProgram> ("IProgram", new object[] { appConfiguration });
_appWidget = new AppStartWidget ();
_appWidget.SetApp (appConfiguration.Name, appConfiguration.Command);
_appWidget.Start += AppWidgetStart;
_appWidget.Stop += AppWidgetStop;
_application.HasExited += Application_HasExited;
_application.HasStarted += Application_HasStarted;
_appName = appConfiguration.Name;
}
示例7: DoSomethingWithProgram
//ILogger Log = ServiceRegistration.Get<ILogger>();
public bool DoSomethingWithProgram(IProgram program)
{
Log.Debug("SlimTv Button SlimTvRunSingleEPG was pressed");
if (Main_GUI.Instance != null)
{
Main_GUI.Instance.Title(program.Title);
Main_GUI.Instance.Name(program.Title);
string mycommand = "RUN_EPG_SINGLE//VIEWONLY=TRUE//TITLE//NAME";
Log.Debug("Executing command " + mycommand);
Main_GUI.Instance.Command(mycommand);
}
return true;
}
示例8: GetActiveUniforms
public IEnumerable<UniformInfo> GetActiveUniforms(IProgram program)
{
var uniforms = new List<UniformInfo>();
var numberOfActiveUniforms = program.GetNumberOfActiveUniforms();
for (var uniformIndex = 0; uniformIndex < numberOfActiveUniforms; uniformIndex++)
{
var uniform = GetActiveUniform(program.ProgramId, uniformIndex);
uniforms.Add(uniform);
}
return uniforms;
}
示例9: PSSession
public PSSession(IDebugger debugger, IProgram program)
{
_program = program;
var initialSessionState = InitialSessionState.CreateDefault();
initialSessionState.Variables.Add(new SessionStateVariableEntry("Debugger", debugger,
"Interface to the Windows debuggers", ScopedItemOptions.Constant));
initialSessionState.Variables.Add(new SessionStateVariableEntry("ShellID", "PSExt", "", ScopedItemOptions.Constant));
var location = Assembly.GetExecutingAssembly().Location;
initialSessionState.ImportPSModule(new []{location });
var formatFile = Path.Combine(Path.GetDirectoryName(location), "PSExtCmdlets.Format.ps1xml");
initialSessionState.Formats.Add(new SessionStateFormatEntry(formatFile));
_host = new DbgPsHost(debugger, program);
_runspace = RunspaceFactory.CreateRunspace(_host, initialSessionState);
}
示例10: DoSomethingWithProgram
//ILogger Log = ServiceRegistration.Get<ILogger>();
public bool DoSomethingWithProgram(IProgram program)
{
Log.Debug("SlimTv Button Create TvWish was pressed");
if (Main_GUI.Instance != null)
{
Main_GUI.Instance.Title(program.Title);
Main_GUI.Instance.Name(program.Title);
string mycommand = "NEWTVWISH//TITLE//NAME";
Log.Debug("Executing command " + mycommand);
Main_GUI.Instance.Command(mycommand);
}
return true;
}
示例11: ConnectionManager
public ConnectionManager(IProgram program, Rothko.IOperatingSystem os)
{
fileExists = (path) => os.File.Exists(path);
readAllText = (path, encoding) => os.File.ReadAllText(path, encoding);
writeAllText = (path, content) => os.File.WriteAllText(path, content);
fileDelete = (path) => os.File.Delete(path);
dirExists = (path) => os.Directory.Exists(path);
dirCreate = (path) => os.Directory.CreateDirectory(path);
Connections = new ObservableCollection<IConnection>();
cachePath = System.IO.Path.Combine(
os.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
program.ApplicationName,
cacheFile);
LoadConnectionsFromCache();
Connections.CollectionChanged += RefreshConnections;
}
示例12: GetCurrentProgram
public bool GetCurrentProgram(IChannel channel, out IProgram program)
{
program = null;
Channel indexChannel = channel as Channel;
if (indexChannel == null)
return false;
if (!CheckConnection(indexChannel.ServerIndex))
return false;
try
{
WebProgramDetailed tvProgram = TvServer(indexChannel.ServerIndex).GetCurrentProgramOnChannel(channel.ChannelId);
if (tvProgram != null)
{
program = new Program(tvProgram, indexChannel.ServerIndex);
return true;
}
}
catch (Exception ex)
{
ServiceRegistration.Get<ILogger>().Error(ex.Message);
}
return false;
}
示例13: GetChannel
public bool GetChannel(IProgram program, out IChannel channel)
{
channel = null;
Program indexProgram = program as Program;
if (indexProgram == null)
return false;
if (!CheckConnection(indexProgram.ServerIndex))
return false;
try
{
WebChannelBasic tvChannel = TvServer(indexProgram.ServerIndex).GetChannelBasicById(indexProgram.ChannelId);
if (tvChannel != null)
{
channel = new Channel { ChannelId = tvChannel.Id, Name = tvChannel.DisplayName, ServerIndex = indexProgram.ServerIndex };
return true;
}
}
catch (Exception ex)
{
ServiceRegistration.Get<ILogger>().Error(ex.Message);
}
return false;
}
示例14: CreateSchedule
public bool CreateSchedule(IProgram program)
{
Program indexProgram = program as Program;
if (indexProgram == null)
return false;
if (!CheckConnection(indexProgram.ServerIndex))
return false;
WebResult result;
try
{
result = TvServer(indexProgram.ServerIndex).AddSchedule(program.ChannelId, program.Title, program.StartTime,
program.EndTime, WebScheduleType.Once);
}
catch
{
return false;
}
return result.Result;
}
示例15: GetRecordingFileOrStream
public bool GetRecordingFileOrStream(IProgram program, out string fileOrStream)
{
try
{
CpAction action = GetAction(Consts.ACTION_GET_REC_FILE_OR_STREAM);
IList<object> inParameters = new List<object> { program.ProgramId };
IList<object> outParameters = action.InvokeAction(inParameters);
bool result = (bool)outParameters[0];
fileOrStream = (string)outParameters[1];
return result;
}
catch (Exception ex)
{
NotifyException(ex);
fileOrStream = null;
return false;
}
}