当前位置: 首页>>代码示例>>C#>>正文


C# Topic类代码示例

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


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

示例1: ConnectData

 protected override object ConnectData(Topic topic, IList<string> topicInfo, ref bool newValues)
 {
     TestArrayTopic testArrayTopic = (TestArrayTopic)topic;
     _topics.Add(testArrayTopic);
     Debug.Print("ConnectData - Prefix {0}", testArrayTopic.Prefix);
     return ExcelErrorUtil.ToComError(ExcelError.ExcelErrorNA);
 }
开发者ID:stic,项目名称:Excel-DNA-Samples,代码行数:7,代码来源:TestRtdServer.cs

示例2: AddTopic

/* ================================ */
/*     Load メソッド        */
/* ================================ */

		public void AddTopic(Topic t){
			if(t.Id == 0) throw new Exception("トピックの番号がありません : " + t.ToString());
			Object[] data = new Object[]{t.Id, t.Date.Ticks, t.Created.Ticks, t};
			DataRow row = this.NewRow();
			row.ItemArray = data;
			this.Rows.Add(row);
		}
开发者ID:bakera,项目名称:Hatomaru.dll,代码行数:11,代码来源:diarytable.cs

示例3: TopicWorker

        public TopicWorker(Factories.TopicFactory factory, Map map, Topic parentTopic, ITopicConnection connectionType)
        {
            _topic = factory.CreateTopic(map, parentTopic);
            _topicPointer = factory.CreateTopicPointer(connectionType);

            _topic.Pointer = _topicPointer;
        }
开发者ID:DmitryKrohmal,项目名称:Mind-mapping,代码行数:7,代码来源:TopicWorker.cs

示例4: DomainParticipantTransportSource

		public DomainParticipantTransportSource(DomainParticipant participant, string senderTopic, string receiverTopic)
		{
			_participant = participant;

			var senderTopicQos = new TopicQos();
			participant.get_default_topic_qos(senderTopicQos);

			var receiverTopicQos = new TopicQos();
			participant.get_default_topic_qos(receiverTopicQos);

			_sender = participant.create_topic(senderTopic, BytesTypeSupport.TYPENAME, senderTopicQos, null, StatusMask.STATUS_MASK_NONE);
			_receiver = participant.create_topic(receiverTopic, BytesTypeSupport.TYPENAME, receiverTopicQos, null, StatusMask.STATUS_MASK_NONE);

			var writerQos = new DataWriterQos();
			//writerQos.publish_mode.kind = PublishModeQosPolicyKind.ASYNCHRONOUS_PUBLISH_MODE_QOS;
			writerQos.publish_mode.flow_controller_name = FlowController.FIXED_RATE_FLOW_CONTROLLER_NAME;

			participant.get_default_datawriter_qos(writerQos);
			
			var readerQos = new DataReaderQos();
			participant.get_default_datareader_qos(readerQos);

			_writer = participant.create_datawriter(_sender, writerQos, null, StatusMask.STATUS_MASK_NONE);
			_reader = participant.create_datareader(_receiver, readerQos, this, StatusMask.STATUS_MASK_ALL);
		}
开发者ID:BrannonKing,项目名称:Kts.Remoting,代码行数:25,代码来源:DdsExtensions.cs

示例5: Should_Have_List_Of_Topics_With_Name_And_Color

 public void Should_Have_List_Of_Topics_With_Name_And_Color()
 {
     var topic = new Topic {Id = 1, Color = Color.Red, Name = "Work"};
     var model =
       ((ViewResult) new TopicController().Index()).ViewData.Model;
     Assert.AreEqual(topic, ( (List<Topic>) model)[0]);
 }
开发者ID:gkeary,项目名称:myGetOrg,代码行数:7,代码来源:TopicControllerTest.cs

示例6: Init

 public void Init()
 {
     b1 = new Blog("blabla", "blabla");
     b2 = new Blog("blbal", "ujbghu");
     t1 = new Topic("blb");
     t2 = new Topic("blabla");
 }
开发者ID:ikatun,项目名称:embedb,代码行数:7,代码来源:OneToOneTests.cs

示例7: _DisplayListTopic

        public ActionResult _DisplayListTopic(Topic topic)
        {
            var notifications = db.PushNotifications.Where(pn => pn.TopicID == topic.ID)
                .ToDictionary(pn => pn.User, pn => pn.Confirmed);

            return PartialView("_DisplayListTopic", notifications);
        }
开发者ID:jfheins,项目名称:WARR-Protokoll,代码行数:7,代码来源:PushController.cs

示例8: StartConversation

	public void StartConversation( Topic[] topics )
	{
		// Verify topics we gave us aren't bunk
		// need to have a start topic
		// and the start topic needs to have options
		Topic start = null;

		foreach ( Topic topic in topics )
		{
			if ( topic._topicName == TopicName.START )
			{
				start = topic;
				break;
			}
		}

		if ( start == null )
		{
			Debug.LogError("Topics don't contain a START topic!");
			return;
		}

		_state = new ConversationState
		{ 
			_topics = topics,
			_currentTopicName = TopicName.START,
			_currentTopic = start
		};

		OnConversationStart();
	}
开发者ID:trgrote,项目名称:GGJ2016,代码行数:31,代码来源:ConversationPlayer.cs

示例9: Add

        public void Add(Topic topic, string ip)
        {
            DbCommand comm = this.GetCommand("SPTopicsInsert");
            comm.AddParameter<string>(this.Factory, "TopicTitle", topic.Title);
            comm.AddParameter<string>(this.Factory, "TopicShortName", topic.ShortName);
            comm.AddParameter<string>(this.Factory, "TopicDescription", topic.Description);
            comm.AddParameter<int>(this.Factory, "UserId", topic.User.Id);
            comm.AddParameter<string>(this.Factory, "TopicTags", topic.Tags.ToString());
            comm.AddParameter<string>(this.Factory, "Forum", topic.Forum.ShortName);
            comm.AddParameter(this.Factory, "TopicOrder", DbType.Int32, topic.IsSticky ? 1 : (int?)null);
            comm.AddParameter<string>(this.Factory, "Ip", ip);
            comm.AddParameter(this.Factory, "ReadAccessGroupId", DbType.Int16, topic.ReadAccessRole);
            comm.AddParameter(this.Factory, "PostAccessGroupId", DbType.Int16, topic.PostAccessRole);

            DbParameter idParameter = comm.AddParameter(this.Factory, "TopicId", DbType.Int32, null);
            idParameter.Direction = ParameterDirection.Output;

            this.SafeExecuteNonQuery(comm);
            if (idParameter.Value != DBNull.Value)
            {
                topic.Id = Convert.ToInt32(idParameter.Value);
            }
            else
            {
                throw new DataException("No value for the output parameter: " + idParameter.ParameterName);
            }
        }
开发者ID:jorgebay,项目名称:nearforums,代码行数:27,代码来源:TopicsDataAccess.cs

示例10: DeleteTopic

        /// <summary>
        /// Deletes a topic
        /// </summary>
        /// <param name="topic">Topic</param>
        public virtual void DeleteTopic(Topic topic)
        {
            if (topic == null)
                throw new ArgumentNullException("topic");

            _topicRepository.Delete(topic);
        }
开发者ID:khiemnd777,项目名称:aaron-core,代码行数:11,代码来源:TopicService.cs

示例11: GenerateContentsHtml

        //////////////////////////////////////////////////////////////////////////
        private void GenerateContentsHtml(Topic RootTopic, string HtmlPath, string BasePath)
        {
            using(StreamWriter sw = new StreamWriter(HtmlPath, false, Encoding.UTF8))
            {
                sw.WriteLine(@"<html>");
                sw.WriteLine(@"  <head>");
                sw.WriteLine(@"    <META http-equiv='Content-Type' content='text/html; charset=utf-8'>");
                sw.WriteLine(@"    <title>Contents</title>");
                sw.WriteLine(@"    <meta name='GENERATOR' content='hhc2html'>");
                sw.WriteLine(@"    <link rel='stylesheet' type='text/css' href='tree.css'>");
                sw.WriteLine(@"    <script src='tree.js' language='javascript' type='text/javascript'>");
                sw.WriteLine(@"    </script>");
                sw.WriteLine(@"  </head>");
                sw.WriteLine(@"  <body id='docBody' style='background-color: #f1f1f1; color: White; margin: 0px 0px 0px 0px;' onload='resizeTree()' onresize='resizeTree()' onselectstart='return false;'>");
                //sw.WriteLine(@"    <div id='synctoc'><div style='font-family: verdana; font-size: 8pt; cursor: pointer; margin: 6 4 8 2; text-align: right' onmouseover='this.style.textDecoration='underline'' onmouseout='this.style.textDecoration='none'' onclick='syncTree(window.parent.frames[1].document.URL)'>sync toc</div></div>");
                sw.WriteLine(@"    <div id=""synctoc""><div style=""font-family: verdana; font-size: 8pt; cursor: pointer; text-align: right"" onmouseover=""this.style.textDecoration='underline'"" onmouseout=""this.style.textDecoration='none'"" onclick=""syncTree(window.parent.frames[1].document.URL)"">sync toc</div></div>");
                sw.WriteLine(@"    <div id='tree' style='top: 35px; left: 0px;' class='treeDiv'>");
                sw.WriteLine(@"      <div id='treeRoot' onselectstart='return false' ondragstart='return false'>");

                foreach(Topic SubTopic in RootTopic.SubTopics)
                {
                    GenerateNode(sw, SubTopic, BasePath, 8);
                }

                sw.WriteLine(@"      </div>");
                sw.WriteLine(@"    </div>");
                sw.WriteLine(@"  </body>");
                sw.WriteLine(@"</html>");
            }
        }
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:31,代码来源:Program.cs

示例12: To

 public static IReadOnlyCollection<Address> To(this IMessageRouter router, Topic topic)
 {
     return new ReadOnlyCollection<Address>(new List<Address>
     {
         topic
     });
 }
开发者ID:kjellski,项目名称:async-dolls,代码行数:7,代码来源:MessageRouterExtensions.cs

示例13:

 void ITopicOwned.SetOwner(Topic owner) {
   if (_owner != owner) {
     if (_owner != null) {
       _owner.Unsubscribe("+", _owner_changed);
       Change_A(null);
       Change_B(null);
       _parent = null;
     }
     _owner = owner as DVar<PiWire>;
     if (_owner != null) {
       _owner.saved = true;
       var dc = _owner.Get<string>("_declarer");
       dc.saved = true;
       dc.value = "Wire";
       if (_owner.parent != null && _owner.parent.valueType == typeof(PiLogram)) {
         _parent = (_owner.parent as DVar<PiLogram>).value;
       }
       _owner.Subscribe("+", _owner_changed);
       if (exec) {
         Change_A(_a);
         Change_B(_b);
       }
     }
   }
 }
开发者ID:giapdangle,项目名称:X13.Host,代码行数:25,代码来源:PiWire.cs

示例14: CfgChanged

 private void CfgChanged(Topic sender, TopicChanged arg) {
   DVar<string> dv=sender as DVar<string>;
   if(dv==null || sender==_verbose) {
     return;
   }
   if(arg.Art==TopicChanged.ChangeArt.Remove) {
     foreach(var i in _items.Where(z => z.name==dv.name).ToArray()) {
       i.Dispose();
       _items.Remove(i);
     }
   } else if(!string.IsNullOrWhiteSpace(dv.value)) {
     Uri u;
     try {
       u=new Uri(dv.value);
     }
     catch(UriFormatException ex) {
       Log.Warning("{0}=\"{1}\" - {2}", dv.path, dv.value, ex.Message);
       return;
     }
     if(string.IsNullOrEmpty(u.AbsolutePath)) {
       return;
     }
     WsSyncItem it=_items.FirstOrDefault(z => z.name==dv.name);
     if(it==null) {
       it=new WsSyncItem(dv.name, u);
       _items.Add(it);
     } else {
       it.ChangeUri(u);
     }
   }
 }
开发者ID:giapdangle,项目名称:X13.Host,代码行数:31,代码来源:WsSyncPl.cs

示例15: Init

    public void Init() {
      _sign=Topic.root.Get("/etc/PersistentStorage");
      _verbose=_sign.Get("verbose");
      _verbose.config=true;

      if(!Directory.Exists("../data")) {
        Directory.CreateDirectory("../data");
      }
      _file=new FileStream("../data/persist.xdb", FileMode.OpenOrCreate, FileAccess.ReadWrite);
      if(_file.Length<=0x40) {
        _file.Write(new byte[0x40], 0, 0x40);
        _file.Flush(true);
        _nextBak=DateTime.Now.AddHours(1);
      } else {
        Load();
      }
      _fileLength=_file.Length;
      _work=new AutoResetEvent(false);
      _thread=new Thread(new ThreadStart(PrThread));
      _thread.Priority=ThreadPriority.BelowNormal;
      _now=DateTime.Now;
      if(_nextBak<_now) {
        Backup();
      }
      _thread.Start();
      Topic.root.all.changed+=MqChanged;
    }
开发者ID:Wassili-Hense,项目名称:Host.V04b,代码行数:27,代码来源:PersistentStorage.cs


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