本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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]);
}
示例6: Init
public void Init()
{
b1 = new Blog("blabla", "blabla");
b2 = new Blog("blbal", "ujbghu");
t1 = new Topic("blb");
t2 = new Topic("blabla");
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
示例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>");
}
}
示例12: To
public static IReadOnlyCollection<Address> To(this IMessageRouter router, Topic topic)
{
return new ReadOnlyCollection<Address>(new List<Address>
{
topic
});
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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;
}