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

C# Interface类代码示例

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

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



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

示例1: DoControl

        public override Model.Cache DoControl(Interface.IView view, Interface.IController controller)
        {
            if (controller.Cache.getCrudModeInCache() != Model.Cache.crudMode.Stateless)
            {
                // CRUD FUNCTIONALITY HERE
                switch (controller.Cache.getCrudModeInCache())
                {
                    case Model.Cache.crudMode.Create:
                        menuSwitcher(view, controller);

                        Model.Member member = new Model.Member
                                                            (
                                                                view.getResponse("Firstname"),
                                                                view.getResponse("Lastname"),
                                                                view.getResponse("Personal Number")
                                                            );

                        Console.WriteLine(member);
                        return null;

                    default:
                        throw new NotImplementedException();
                }
            }
            else
            {
                menuSwitcher(view, controller);
                ClientResponse = view.getResponse();
                SelectedInMenuBoat = (Model.Cache.menuBoat)int.Parse(ClientResponse);
                return prepareNewCacheFromMenuBoat();
            }
        }
开发者ID:AndreasAnemyrLNU,项目名称:1dv607,代码行数:32,代码来源:Boat.cs


示例2: InterfacesArray

        public Interface[] InterfacesArray()
        {
            System.Collections.ArrayList arrList = new System.Collections.ArrayList();
                        int i = 0;

                        while (true)
                        {
                                IntPtr cIf;
                                Interface iface;

                                cIf = UnmanagedGetInterfaceN(cNode, i);

                                if (cIf == IntPtr.Zero)
                                {
                                        //Debug.WriteLine("UnmanagedAttribute zero pointer");
                                        break;
                                }

                                iface = new Interface(cIf);
                                i++;
                                arrList.Add(iface);
                        }
                        Interface[] array = (Interface[])arrList.ToArray(typeof(Interface));

                        Debug.WriteLine("NodeList with " + i + " nodes");

                        return array;
        }
开发者ID:iamsamwood,项目名称:ENCODERS,代码行数:28,代码来源:Node.cs


示例3: Add

 // v=v+cv2;
 public void Add(Interface.IVector v2, double c)
 {
     for (int i = 0; i < v2.Size; i++)
     {
         v[i] += v2[i]*c;
     }
 }
开发者ID:SLAEPM23,项目名称:SLAE,代码行数:8,代码来源:Vector.cs


示例4: updateList

 private void updateList(Interface.IGame game)
 {
     if (!lbxListGames.Items.Contains(game.getGameID()))
     {
         lbxListGames.Items.Add(game.getGameID());
     }
 }
开发者ID:faustodavid,项目名称:Test,代码行数:7,代码来源:Form1.cs


示例5: Translate

        /// <summary>
        /// Translates control using InterfaceLanguage instance
        /// </summary>
        /// <param name="control">Control to translate</param>
        /// <param name="lang">Language object</param>
        /// <returns>True if control has been translated, false otherwise</returns>
        public static bool Translate( this Control control, Interface.InterfaceLanguage lang )
        {
            string prefix = "lang";

            if( control.Tag == null )
                return (false);

            if( !control.Tag.ToString().StartsWith( prefix ) )
                return (false);

            string tag = control.Tag.ToString().Substring( prefix.Length );

            FieldInfo field = null;
            try
            {
                field = lang.GetType().GetField( tag );
            }
            catch( Exception )
            {
                return (false);
            }

            if( field == null )
                return (false);
            else if( !field.IsPublic )
                return (false);
            else if( field.FieldType != typeof( string ) )
                return (false);

            string value = (string)field.GetValue( lang );
            control.Text = value;

            return (true);
        }
开发者ID:SnakeSolidNL,项目名称:fonline-config,代码行数:40,代码来源:Language.cs


示例6: GetUtilization

        public override Task<IEnumerable<Interface.InterfaceUtilization>> GetUtilization(Interface nodeInteface, DateTime? start, DateTime? end, int? pointCount = null)
        {
            const string allSql = @"
Select itd.DateTime,
		       itd.In_Maxbps InMaxBps,
		       itd.In_Averagebps InAvgBps,
		       itd.Out_Maxbps OutMaxBps,
		       itd.Out_Averagebps OutAvgBps,
		       Row_Number() Over(Order By itd.DateTime) RowNumber
          From InterfaceTraffic itd
         Where itd.InterfaceID = @Id
           And {dateRange}
";

                const string sampledSql = @"
Select * 
  From (Select itd.DateTime,
		       itd.In_Maxbps InMaxBps,
		       itd.In_Averagebps InAvgBps,
		       itd.Out_Maxbps OutMaxBps,
		       itd.Out_Averagebps OutAvgBps,
		       Row_Number() Over(Order By itd.DateTime) RowNumber
          From InterfaceTraffic itd
         Where itd.InterfaceID = @Id
           And {dateRange}) itd
 Where itd.RowNumber % ((Select Count(*) + @intervals
						   From InterfaceTraffic itd
					      Where itd.InterfaceID = @Id
                            And {dateRange})/@intervals) = 0";

            return UtilizationQuery<Interface.InterfaceUtilization>(nodeInteface.Id, allSql, sampledSql, "itd.DateTime", start, end, pointCount);
        }
开发者ID:riiiqpl,项目名称:Opserver,代码行数:32,代码来源:OrionDataProvider.Interfaces.cs


示例7: InExecutive

        protected override Object InExecutive(Interface.WATFDictionary<String, String> attributes)
        {
            object rtn = default(object);
            if (this.context.Assemblys.ContainsKey(attributes[GlobalDefine.Keyword.Executive.From]))
            {
                //执行反射外部函数
                WATF.Plugin.IPlugin reflection = (WATF.Plugin.IPlugin)this.context.Assemblys[attributes[GlobalDefine.Keyword.Executive.From]].CreateInstance(attributes[GlobalDefine.Keyword.Executive.Select]);
                Dictionary<string, object> paramList = GetParamsFromWhere(attributes[GlobalDefine.Keyword.Executive.Where],this.context);
                if (this.context.Results.Count > 0)
                {
                    rtn = reflection.StartMethod(this.context.Results.Peek(), paramList);
                }
                else
                {
                    rtn = reflection.StartMethod(null, paramList);
                }
                if (attributes.ContainsKey(GlobalDefine.Keyword.Executive.Into)
                && !attributes[GlobalDefine.Keyword.Executive.Into].Equals(string.Empty))
                {
                    this.context.SetVar(attributes[GlobalDefine.Keyword.Executive.Into], rtn);
                }
            }
            else//如果没有from关键字,则执行内部函数逻辑
            {

            }
            return rtn;
        }
开发者ID:huangchaosuper,项目名称:watf,代码行数:28,代码来源:Select.cs


示例8: AddTestDataToIndex

        public static void AddTestDataToIndex(Interface.IIndexService indexService, Api.Index index, string testData)
        {
            string[] lines = testData.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
            string[] headers = lines[0].Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in lines.Skip(1))
            {
                string[] items = line.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                var indexDocument = new Document();
                indexDocument.Id = items[0];
                indexDocument.Index = index.IndexName;
                indexDocument.Fields = new Api.KeyValuePairs();

                for (int i = 1; i < items.Length; i++)
                {
                    indexDocument.Fields.Add(headers[i], items[i]);
                }

                indexService.PerformCommand(
                    index.IndexName,
                    IndexCommand.NewCreate(indexDocument.Id, indexDocument.Fields));
            }

            indexService.PerformCommand(index.IndexName, IndexCommand.Commit);
            Thread.Sleep(100);
        }
开发者ID:Enielezi,项目名称:FlexSearch,代码行数:25,代码来源:MockHelpers.cs


示例9: Register

        /// <summary>
        /// 注册收听者
        /// </summary>
        /// <param name="listenerMember">收听者对象</param>
        /// <returns></returns>
        public bool Register(Interface.IListenerMember listenerMember)
        {
            listenerMember.OnlyListenerKey = Guid.NewGuid().ToString();
            this.ListenerMemberList.Add(listenerMember);
            this.OnAddListenerMember(listenerMember);

            return true;
        }
开发者ID:AMMing,项目名称:KcvExtension,代码行数:13,代码来源:RadioHub.cs


示例10: Begin

		public static void Begin(Interface.Struct.BeginSession session)
		{
			roundNumber = session.roundNumber;
			techniteSubRoundNumber = session.techniteSubRoundNumber;
			FactionUUID = session.factionUUID;
			TechniteGridID = session.techniteGridID;
			Out.Log(Significance.Important, "Session started: "+FactionUUID+" in round "+roundNumber+"/"+techniteSubRoundNumber);
		}
开发者ID:MatthiasLenz,项目名称:TechniteLogic,代码行数:8,代码来源:Session.cs


示例11: multScalar

 //res = vec*v
 public static Interface.IVector multScalar(double v, Interface.IVector vec)
 {
     for (int i = 0; i < vec.Size; i++)
     {
         vec[i] *= v;
     }
     return vec;
 }
开发者ID:SLAEPM23,项目名称:SLAE,代码行数:9,代码来源:VectorAssistant.cs


示例12: AddModules

        /// <summary>
        /// 添加模块
        /// </summary>
        /// <param name="modules"></param>
        /// <returns></returns>
        public bool AddModules(Interface.IModules modules)
        {
            if (this.ModulesList.ContainsKey(modules.Key)) return false;

            this.ModulesList.Add(modules.Key, modules);

            return true;
        }
开发者ID:AMMing,项目名称:KcvExtension,代码行数:13,代码来源:ModulesHelper.cs


示例13: DoControl

        public override Model.Cache DoControl(Interface.IView view, Interface.IController controller)
        {
            menuSwitcher(view, controller);
            ClientResponse = view.getResponse();
            SelectedInMenuIndex = (Model.Cache.menuIndex)int.Parse(ClientResponse);

            return prepareNewCacheFromMenuIndex();
        }
开发者ID:AndreasAnemyrLNU,项目名称:1dv607,代码行数:8,代码来源:Index.cs


示例14: InterfaceOperation

        public InterfaceOperation(Mapping.InterfaceOperation operation, Interface iface, IpAddress ipAddress = null)
            : base(operation)
        {
            this.InterfaceId = operation.InterfaceId;
            this.Interface = iface;

            this.IpAddressId = operation.IpAddressId;
            this.IpAddress = ipAddress;
        }
开发者ID:nevasion,项目名称:gandi-desktop,代码行数:9,代码来源:InterfaceOperation.cs


示例15: SetupFixture

		public void SetupFixture()
		{
			if (System.IO.File.Exists(filename))
				System.IO.File.Delete(filename);

			intf = new Interface();
			intf.CreateAccessDatabase(filename);
			intf.CreateDefaultDatabaseContent();
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:9,代码来源:TestResults.cs


示例16: ParametersNativeDll

        public ParametersNativeDll(IExternalType nativeDll, Interface inter, Uri dataFile, bool debuggerLaunch)
        {
            if (nativeDll == null)
                nativeDll = new ExternalType();

            _nativeDllImplementingNetAssembly = (ExternalType)nativeDll.Clone();
            _interface = inter;
            _debuggerLaunch = debuggerLaunch;
        }
开发者ID:CNH-Hyper-Extractive,项目名称:parallel-sdk,代码行数:9,代码来源:ParametersNativeDll.cs


示例17: Add

 // vres =v1+cv2;
 public static Interface.IVector Add(Interface.IVector v1, Interface.IVector v2, double c)
 {
     Vector result = new Vector(v1.Size);
     for (int i = 0; i < v2.Size; i++)
     {
         v1[i] += v2[i] * c;
     }
     return result;
 }
开发者ID:SLAEPM23,项目名称:SLAE,代码行数:10,代码来源:VectorAssistant.cs


示例18: multVector

 //res = v1*v2 scalar multiplication
 public static double multVector(Interface.IVector v1, Interface.IVector v2)
 {
     double result = 0;
     for (int i = 0; i < v1.Size; i++)
     {
         result += v1[i] * v2[i];
     }
     return result;
 }
开发者ID:SLAEPM23,项目名称:SLAE,代码行数:10,代码来源:VectorAssistant.cs


示例19: InitSetting

        /// <summary>
        /// 初始化配置文件
        /// </summary>
        /// <param name="setting"></param>
        public static bool InitSetting(Interface.ISettings setting)
        {
            if (setting == null) return false;

            if (string.IsNullOrWhiteSpace(setting.SettingFilePath))
            {
                if (!SetSettingFilePath(setting)) return false;
            }
            return LoadSetting(setting);
        }
开发者ID:AMMing,项目名称:KcvExtension,代码行数:14,代码来源:SettingsHelper.cs


示例20: ExtractItem

 protected override Sitecore.Data.Items.Item ExtractItem(Interface.DisplayElement dElement)
 {
     var item = base.ExtractItem(dElement);
     if (item != null && item.Source != null)
     {
         return item.Source;
     }
     //if it does not have a clone source, return null so we don't display any data
     return null;
 }
开发者ID:earlnuclear,项目名称:AdvancedSystemReporter,代码行数:10,代码来源:ItemViewerCloneSource.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Interfaces类代码示例发布时间:2022-05-24
下一篇:
C# InteractionRequest类代码示例发布时间: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