本文整理汇总了C#中WorkspaceModel类的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceModel类的具体用法?C# WorkspaceModel怎么用?C# WorkspaceModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkspaceModel类属于命名空间,在下文中一共展示了WorkspaceModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnWorkspaceAdded
protected virtual void OnWorkspaceAdded(WorkspaceModel obj)
{
var handler = WorkspaceAdded;
if (handler != null) handler(obj);
WorkspaceEvents.OnWorkspaceAdded(obj.Guid, obj.Name, obj.GetType());
}
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs
示例2: OnWorkspaceCleared
public virtual void OnWorkspaceCleared(WorkspaceModel workspace)
{
if (WorkspaceCleared != null)
WorkspaceCleared(workspace);
WorkspaceEvents.OnWorkspaceCleared();
}
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:7,代码来源:DynamoModelEvents.cs
示例3: OnWorkspaceAdded
static void OnWorkspaceAdded(WorkspaceModel obj)
{
if (obj is CustomNodeWorkspaceModel)
Analytics.TrackScreenView("CustomWorkspace");
else
Analytics.TrackScreenView("Workspace");
}
开发者ID:DynamoDS,项目名称:Dynamo,代码行数:7,代码来源:AnalyticsService.cs
示例4: WorkspaceComparisonData
public WorkspaceComparisonData(WorkspaceModel workspace, EngineController controller)
{
Guid = workspace.Guid;
NodeCount = workspace.Nodes.Count();
ConnectorCount = workspace.Connectors.Count();
GroupCount = workspace.Annotations.Count();
NoteCount = workspace.Notes.Count();
NodeTypeMap = new Dictionary<Guid, Type>();
NodeDataMap = new Dictionary<Guid, List<object>>();
InportCountMap = new Dictionary<Guid, int>();
OutportCountMap = new Dictionary<Guid, int>();
foreach (var n in workspace.Nodes)
{
NodeTypeMap.Add(n.GUID, n.GetType());
var portvalues = new List<object>();
foreach (var p in n.OutPorts)
{
var value = n.GetValue(p.Index, controller);
if (value.IsCollection)
{
portvalues.Add(GetStringRepOfCollection(value));
}
else
{
portvalues.Add(value.StringData);
}
}
NodeDataMap.Add(n.GUID, portvalues);
InportCountMap.Add(n.GUID, n.InPorts.Count);
OutportCountMap.Add(n.GUID, n.OutPorts.Count);
}
}
开发者ID:DynamoDS,项目名称:Dynamo,代码行数:35,代码来源:SerializationTests.cs
示例5: NewTagViewController
public NewTagViewController (WorkspaceModel workspace)
{
this.model = new TagModel () {
Workspace = workspace,
};
Title = "NewTagTitle".Tr ();
}
开发者ID:ZhangLeiCharles,项目名称:mobile,代码行数:7,代码来源:NewTagViewController.cs
示例6: CreateClientViewModel
CreateClientViewModel (WorkspaceModel workspaceModel)
{
model = new ClientModel {
Workspace = workspaceModel
};
ServiceContainer.Resolve<ITracker> ().CurrentScreen = "New Client Screen";
}
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:7,代码来源:CreateClientViewModel.cs
示例7: NewProjectViewController
public NewProjectViewController (WorkspaceModel workspace, int color)
{
this.model = Model.Update (new ProjectModel () {
Workspace = workspace,
Color = color,
IsActive = true,
});
Title = "NewProjectTitle".Tr ();
}
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:9,代码来源:NewProjectViewController.cs
示例8: NewClientViewController
public NewClientViewController (WorkspaceModel workspace)
{
this.model = new ClientModel () {
Workspace = workspace,
Name = "",
};
Title = "NewClientTitle".Tr ();
}
开发者ID:ZhangLeiCharles,项目名称:mobile,代码行数:9,代码来源:NewClientViewController.cs
示例9: OnCreate
public override void OnCreate (Bundle state)
{
base.OnCreate (state);
timeEntry = Model.ById<TimeEntryModel> (TimeEntryId);
workspace = Model.ById<WorkspaceModel> (WorkspaceId);
if (workspace == null) {
Dismiss ();
}
}
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:10,代码来源:CreateProjectDialogFragment.cs
示例10: NewProjectViewController
public NewProjectViewController (WorkspaceModel workspace, int color)
{
model = new ProjectModel {
Workspace = workspace,
Color = color,
IsActive = true,
IsPrivate = true
};
Title = "NewProjectTitle".Tr ();
}
开发者ID:ZhangLeiCharles,项目名称:mobile,代码行数:10,代码来源:NewProjectViewController.cs
示例11: Init
public static async Task<NewProjectViewModel> Init (Guid workspaceId)
{
var workspaceModel = new WorkspaceModel (workspaceId);
await workspaceModel.LoadAsync ();
return new NewProjectViewModel (new ProjectModel {
Workspace = workspaceModel,
IsActive = true,
IsPrivate = true
});
}
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:11,代码来源:NewProjectViewModel.cs
示例12: InitializeWorkspaceModel
private void InitializeWorkspaceModel()
{
var workspaceView = WpfUtilities.FindUpVisualTree<WorkspaceView>(this);
if (workspaceView == null)
{
throw new InvalidOperationException(
"InfiniteGridView should be a nested element of WorkspaceView");
}
workspaceModel = workspaceView.ViewModel.Model;
}
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:12,代码来源:InfiniteGridView.xaml.cs
示例13: CreateProjectDialogFragment
public CreateProjectDialogFragment (TimeEntryModel timeEntry, WorkspaceModel workspace, int color)
{
var args = new Bundle ();
if (timeEntry != null) {
args.PutString (TimeEntryIdArgument, timeEntry.Id.ToString ());
}
args.PutString (WorkspaceIdArgument, workspace.Id.ToString ());
args.PutInt (ProjectColorArgument, color);
Arguments = args;
}
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:12,代码来源:CreateProjectDialogFragment.cs
示例14: Initialize
/// <summary>
/// This method is called by task creator to associate the trace data with
/// the current instance of virtual machine. The given WorkspaceModel can
/// optionally contain saved trace data in a previous execution session. As
/// a side-effect, this method resets "WorkspaceModel.PreloadedTraceData"
/// data member to ensure the correctness of the execution flow.
/// </summary>
/// <param name="controller">Reference to the EngineController on which the
/// loaded trace data should be set.</param>
/// <param name="workspace">The workspace from which the trace data should
/// be retrieved.</param>
/// <returns>If the given WorkspaceModel contains saved trace data, this
/// method returns true, in which case the task needs to be scheduled.
/// Otherwise, the method returns false.</returns>
///
internal bool Initialize(EngineController controller, WorkspaceModel workspace)
{
if (controller == null || (controller.LiveRunnerCore == null))
return false;
engineController = controller;
traceData = workspace.PreloadedTraceData;
TargetedWorkspace = workspace;
workspace.PreloadedTraceData = null;
return ((traceData != null) && traceData.Any());
}
开发者ID:jbenoit44,项目名称:Dynamo,代码行数:27,代码来源:SetTraceDataAsyncTask.cs
示例15: CreateTestData
private void CreateTestData ()
{
workspace = Model.Update (new WorkspaceModel () {
RemoteId = 1,
Name = "Unit Testing",
IsDirty = true,
IsPersisted = true,
});
user = Model.Update (new UserModel () {
RemoteId = 1,
Name = "Tester",
DefaultWorkspace = workspace,
IsDirty = true,
IsPersisted = true,
});
var project = Model.Update (new ProjectModel () {
RemoteId = 1,
Name = "Ad design",
Workspace = workspace,
IsDirty = true,
IsPersisted = true,
});
Model.Update (new TimeEntryModel () {
RemoteId = 1,
Description = "Initial concept",
State = TimeEntryState.Finished,
StartTime = new DateTime (2013, 01, 01, 09, 12, 0, DateTimeKind.Utc),
StopTime = new DateTime (2013, 01, 01, 10, 1, 0, DateTimeKind.Utc),
Project = project,
Workspace = workspace,
User = user,
IsDirty = true,
IsPersisted = true,
});
Model.Update (new TimeEntryModel () {
RemoteId = 2,
Description = "Breakfast",
State = TimeEntryState.Finished,
StartTime = new DateTime (2013, 01, 01, 10, 12, 0, DateTimeKind.Utc),
StopTime = new DateTime (2013, 01, 01, 10, 52, 0, DateTimeKind.Utc),
Workspace = workspace,
User = user,
IsDirty = true,
IsPersisted = true,
});
}
开发者ID:nagyist,项目名称:toggl-mobile,代码行数:50,代码来源:ModelGraphTest.cs
示例16: Initialize
/// <summary>
/// This method is called by codes that intent to start a graph update.
/// This method is called on the main thread where node collection in a
/// WorkspaceModel can be safely accessed.
/// </summary>
/// <param name="controller">Reference to an instance of EngineController
/// to assist in generating GraphSyncData object for the given set of nodes.
/// </param>
/// <param name="workspace">Reference to the WorkspaceModel from which a
/// set of updated nodes is computed. The EngineController generates the
/// resulting GraphSyncData from this list of updated nodes.</param>
/// <param name="dynamoLogger"> Logs the error message</param>
/// <returns>Returns the list of node id's that will be executed in the next run
/// for execution).</returns>
internal List<Guid> Initialize(EngineController controller, WorkspaceModel workspace)
{
try
{
engineController = controller;
TargetedWorkspace = workspace;
modifiedNodes = ComputeModifiedNodes(workspace);
previewGraphData = engineController.PreviewGraphSyncData(modifiedNodes,verboseLogging);
return previewGraphData;
}
catch (Exception e)
{
return null;
}
}
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:29,代码来源:PreviewGraphAsyncTask.cs
示例17: Initialize
/// <summary>
/// This method is called by codes that intent to start a graph update.
/// This method is called on the main thread where node collection in a
/// WorkspaceModel can be safely accessed.
/// </summary>
/// <param name="controller">Reference to an instance of EngineController
/// to assist in generating GraphSyncData object for the given set of nodes.
/// </param>
/// <param name="workspace">Reference to the WorkspaceModel from which a
/// set of updated nodes is computed. The EngineController generates the
/// resulting GraphSyncData from this list of updated nodes.</param>
/// <returns>Returns true if there is any GraphSyncData, or false otherwise
/// (in which case there will be no need to schedule UpdateGraphAsyncTask
/// for execution).</returns>
///
internal bool Initialize(EngineController controller, WorkspaceModel workspace)
{
try
{
engineController = controller;
TargetedWorkspace = workspace;
modifiedNodes = ComputeModifiedNodes(workspace);
graphSyncData = engineController.ComputeSyncData(modifiedNodes);
return graphSyncData != null;
}
catch (Exception)
{
return false;
}
}
开发者ID:jbenoit44,项目名称:Dynamo,代码行数:31,代码来源:UpdateGraphAsyncTask.cs
示例18: WorkspaceComparisonData
public WorkspaceComparisonData(WorkspaceModel workspace)
{
Guid = workspace.Guid;
NodeCount = workspace.Nodes.Count();
ConnectorCount = workspace.Connectors.Count();
GroupCount = workspace.Annotations.Count();
NoteCount = workspace.Notes.Count();
NodeTypeMap = new Dictionary<Guid, Type>();
NodeDataMap = new Dictionary<Guid, object>();
InportCountMap = new Dictionary<Guid, int>();
OutportCountMap = new Dictionary<Guid, int>();
foreach (var n in workspace.Nodes)
{
NodeTypeMap.Add(n.GUID, n.GetType());
NodeDataMap.Add(n.GUID, n.CachedValue == null? null:n.CachedValue.Data);
InportCountMap.Add(n.GUID, n.InPorts.Count);
OutportCountMap.Add(n.GUID, n.OutPorts.Count);
}
}
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:20,代码来源:SerializationTests.cs
示例19: OnWorkspaceRemoved
private void OnWorkspaceRemoved(WorkspaceModel workspace)
{
workspace.Saving -= OnWorkspaceSaving;
workspace.NodeAdded -= OnNodeAddedToWorkspace;
workspace.NodeRemoved -= OnNodeRemovedFromWorkspace;
foreach (var node in workspace.Nodes)
{
UnregisterNodeEventHandlers(node);
}
OnClear();
}
开发者ID:YanmengLi,项目名称:Dynamo,代码行数:13,代码来源:DefaultWatch3DViewModel.cs
示例20: OnWorkspaceSaved
internal void OnWorkspaceSaved(WorkspaceModel model)
{
if (WorkspaceSaved != null)
WorkspaceSaved(model);
}
开发者ID:ksobon,项目名称:Dynamo,代码行数:5,代码来源:DynamoModel.cs
注:本文中的WorkspaceModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论