• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IProgram类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IProgram的典型用法代码示例。如果您正苦于以下问题:C# IProgram类的具体用法?C# IProgram怎么用?C# IProgram使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IProgram类属于命名空间,在下文中一共展示了IProgram类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SubProgram

        protected SubProgram(IProgram program)
        {
            if (null == program)
                throw new ArgumentNullException(nameof(program));

            _program = program;
        }
开发者ID:henricj,项目名称:phonesm,代码行数:7,代码来源:SubProgram.cs


示例2: GetLinkStatus

        public Boolean GetLinkStatus(IProgram program)
        {
            int linkStatus;
            GL.GetProgram(program.ProgramId, GetProgramParameterName.LinkStatus, out linkStatus);

            return (Boolean)linkStatus;
        }
开发者ID:smoothdeveloper,项目名称:ProceduralGeneration,代码行数:7,代码来源:ProgramDiagnostics.cs


示例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;
 }
开发者ID:michaelgwelch,项目名称:brainmess,代码行数:14,代码来源:Interpreter.cs


示例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));
            }
        }
开发者ID:chris134pravin,项目名称:VisualStudio,代码行数:33,代码来源:LoggingConfiguration.cs


示例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();
 }
开发者ID:itsbth,项目名称:p55.net,代码行数:10,代码来源:OutputWindow.cs


示例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;
 }
开发者ID:residuum,项目名称:MonoMultiJack,代码行数:11,代码来源:AppStartController.cs


示例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;
 }
开发者ID:huha001,项目名称:TvWishList,代码行数:14,代码来源:SlimTvRunSingleEPG.cs


示例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;
        }
开发者ID:smoothdeveloper,项目名称:ProceduralGeneration,代码行数:13,代码来源:ProgramDiagnostics.cs


示例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);
		}
开发者ID:killbug2004,项目名称:PSExt,代码行数:14,代码来源:PSSession.cs


示例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;
    }
开发者ID:huha001,项目名称:TvWishList,代码行数:16,代码来源:SlimTvCreateTvWish.cs


示例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;
        }
开发者ID:nulltoken,项目名称:VisualStudio,代码行数:19,代码来源:ConnectionManager.cs


示例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;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:26,代码来源:SlimTVMPExtendedProvider.cs


示例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;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:25,代码来源:SlimTVMPExtendedProvider.cs


示例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;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:21,代码来源:SlimTVMPExtendedProvider.cs


示例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;
   }
 }
开发者ID:pacificIT,项目名称:MediaPortal-2,代码行数:18,代码来源:NativeTvProxy.cs


示例16: GetRecordingStatus

 public bool GetRecordingStatus(IProgram program, out RecordingStatus recordingStatus)
 {
   try
   {
     CpAction action = GetAction(Consts.ACTION_GET_REC_STATUS);
     IList<object> inParameters = new List<object> { program.ProgramId };
     IList<object> outParameters = action.InvokeAction(inParameters);
     bool result = (bool)outParameters[0];
     recordingStatus = (RecordingStatus)Enum.Parse(typeof(RecordingStatus), outParameters[1].ToString());
     return result;
   }
   catch (Exception ex)
   {
     NotifyException(ex);
     recordingStatus = RecordingStatus.None;
     return false;
   }
 }
开发者ID:pacificIT,项目名称:MediaPortal-2,代码行数:18,代码来源:NativeTvProxy.cs


示例17: DoSomethingWithProgram

 public bool DoSomethingWithProgram(IProgram program)
 {
   return true;
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:4,代码来源:ProgramExample.cs


示例18: RemoveSchedule

        public bool RemoveSchedule(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).CancelSchedule(program.ProgramId);
              }
              catch
              {
            return false;
              }
              return result.Result;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:20,代码来源:SlimTVMPExtendedProvider.cs


示例19: GetNextProgram

        public bool GetNextProgram(IChannel channel, out IProgram program)
        {
            program = null;

              Channel indexChannel = channel as Channel;
              if (indexChannel == null)
            return false;

              if (!CheckConnection(indexChannel.ServerIndex))
            return false;

              IProgram currentProgram;
              try
              {
            if (GetCurrentProgram(channel, out currentProgram))
            {
              IList<WebProgramDetailed> nextPrograms = TvServer(indexChannel.ServerIndex).GetProgramsDetailedForChannel(channel.ChannelId,
                                                                                          currentProgram.EndTime.AddMinutes(1),
                                                                                          currentProgram.EndTime.AddMinutes(1));
              if (nextPrograms != null && nextPrograms.Count > 0)
              {
            program = new Program(nextPrograms[0], indexChannel.ServerIndex);
            return true;
              }
            }
              }
              catch (Exception ex)
              {
            ServiceRegistration.Get<ILogger>().Error(ex.Message);
              }
              return false;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:32,代码来源:SlimTVMPExtendedProvider.cs


示例20: GetRecordingStatus

        public bool GetRecordingStatus(IProgram program, out RecordingStatus recordingStatus)
        {
            recordingStatus = RecordingStatus.None;

              Program indexProgram = program as Program;
              if (indexProgram == null)
            return false;

              if (!CheckConnection(indexProgram.ServerIndex))
            return false;

              try
              {
            WebProgramDetailed programDetailed = TvServer(indexProgram.ServerIndex).GetProgramDetailedById(program.ProgramId);
            recordingStatus = Program.GetRecordingStatus(programDetailed);
              }
              catch
              {
            return false;
              }
              return true;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-2,代码行数:22,代码来源:SlimTVMPExtendedProvider.cs



注:本文中的IProgram类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IProgress类代码示例发布时间:2022-05-24
下一篇:
C# IProfile类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap