本文整理汇总了C#中Topic类的典型用法代码示例。如果您正苦于以下问题:C# Topic类的具体用法?C# Topic怎么用?C# Topic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Topic类属于命名空间,在下文中一共展示了Topic类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetByTopic
/// <summary>
/// Return all notifications for a specified topic
/// </summary>
/// <param name="topic"></param>
/// <returns></returns>
public IList<TopicNotification> GetByTopic(Topic topic)
{
return _context.TopicNotification
.Where(x => x.Topic.Id == topic.Id)
.AsNoTracking()
.ToList();
}
开发者ID:lenwen,项目名称:mvcforum,代码行数:12,代码来源:TopicNotificationService.cs
示例17: MyClassInitialize
public static void MyClassInitialize(TestContext testContext) {
r=new Random((int)DateTime.Now.Ticks);
root=Topic.root;
//root.SetJson("{\"$type\":\"X13.Engine_UT.TestObj, Engine_UT\",\"A\":315,\"B\":0.41}");
//PLC.instance.Tick();
//root.ToJson();
}
开发者ID:Wassili-Hense,项目名称:Host.V04b,代码行数:7,代码来源:Topic_UT.cs
示例18: DeclarerChanged
private static void DeclarerChanged(Topic sender, TopicChanged param) {
DVar<string> dec=sender as DVar<string>;
Topic infoT;
DVar<string> infoD;
if(dec==null) {
return;
}
StatementDescription stR=null;
if(param.Art==TopicChanged.ChangeArt.Remove) {
stR=_statements.FirstOrDefault(z => z.name==dec.name);
if(stR!=null) {
_statements.Remove(stR);
}
} else {
if(param.Art==TopicChanged.ChangeArt.Value) {
stR=_statements.FirstOrDefault(z => z.name==dec.name);
}
if(stR==null) {
stR=new StatementDescription() { name=dec.name };
_statements.Add(stR);
}
stR.image=dec.value;
if(dec.Exist("_description", out infoT) && (infoD=(infoT as DVar<string>))!=null && !string.IsNullOrEmpty(infoD.value)) {
stR.sortKey=infoD.value.Substring(0, 2);
stR.info=infoD.value.Substring(2);
}
}
}
开发者ID:X13home,项目名称:X13.Host,代码行数:30,代码来源:LogramView.xaml.cs
示例19: Serialize
internal static byte[] Serialize(Topic t) {
List<byte> ret=new List<byte>();
switch(Type.GetTypeCode(t.valueType)) {
case TypeCode.Boolean:
ret.Add((byte)((t as DVar<bool>).value?1:0));
break;
case TypeCode.Int64: {
long vo=(t as DVar<long>).value;
long v=vo;
do {
ret.Add((byte)v);
v=v>>8;
} while(vo<0?(v<-1 || (ret[ret.Count-1]&0x80)==0):(v>0 || (ret[ret.Count-1]&0x80)!=0));
}
break;
//case TypeCode.Double:
case TypeCode.String: {
string v=(string)t.GetValue();
if(!string.IsNullOrEmpty(v)) {
ret.AddRange(Encoding.Default.GetBytes(v));
}
}
break;
case TypeCode.Object:
if(t.valueType==typeof(PLC.ByteArray) && t.GetValue()!=null) {
ret.AddRange(((PLC.ByteArray)t.GetValue()).GetBytes());
}
break;
}
return ret.ToArray();
}
开发者ID:giapdangle,项目名称:X13.Host,代码行数:31,代码来源:MsDevice.cs
示例20: Init
public void Init() {
Topic.paused=true;
_sign=Topic.root.Get("/local/cfg/PersistentStorage");
_verbose=Topic.root.Get<bool>("/local/cfg/PersistentStorage/verbose");
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.Lowest;
_now=DateTime.Now;
if(_nextBak<_now) {
Backup();
}
_thread.Start();
Topic.root.Subscribe("/#", MqChanged);
}
开发者ID:giapdangle,项目名称:X13.Host,代码行数:27,代码来源:PersistentStorage.cs
注:本文中的Topic类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论