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


C# Store.GetService方法代码示例

本文整理汇总了C#中Store.GetService方法的典型用法代码示例。如果您正苦于以下问题:C# Store.GetService方法的具体用法?C# Store.GetService怎么用?C# Store.GetService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Store的用法示例。


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

示例1: GetOptions

 public static ActiveWriterOptions GetOptions(Store store)
 {
     try
     {
         IDialogPageProvider package = store.GetService(typeof(Microsoft.VisualStudio.Shell.Package)) as IDialogPageProvider;
         return package.GetDialogPage<ActiveWriterOptions>() as ActiveWriterOptions;
     }
     catch
     {
         return new ActiveWriterOptions();
     }
 }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:12,代码来源:DTEHelper.cs

示例2: GetDTE

 public static DTE GetDTE(Store store)
 {
     return store.GetService(typeof (_DTE)) as DTE;
 }
开发者ID:mgagne-atman,项目名称:Projects,代码行数:4,代码来源:DTEHelper.cs

示例3: BuildProcessFileVisioToSubProcess


//.........这里部分代码省略.........
                                            //        Activity target = modelElementActivityList.FirstOrDefault(p => p.VisioId == shapeTarget.VisioId);

                                            //        #region Source Activity's Parent Task equal to Target Activity's Parent Task

                                            //        using (Transaction trans = source.Store.TransactionManager.BeginTransaction("update Flow Minimal"))
                                            //        {
                                            //            CreateNewFlow(source, target, connector.Outcome, connector.StoryLine, connector.VisioId, DetermineFlowType(connector.FlowType));

                                            //            trans.Commit();
                                            //        }

                                            //        #endregion
                                            //    }

                                            //    #endregion
                                            //}
                                        }
                                    }
                                }
                            }

                            #endregion

                            //vReader.CloseVisio();

                            if (deletedCode.Count > 0)
                            {
                                pnlBackup.Enabled = true;
                            }
                            else
                            {
                                deletedCode.Add(new DeletedInfo
                                                        {
                                                            Name = "No items will be deleted."
                                                        });

                                pnlBackup.Enabled = false;
                            }

                            lstDeleted.DataSource = deletedCode;
                            lstDeleted.DisplayMember = "Name";

                            pnlDeleted.Visible = true;

                            #endregion
                        }

                        transaction.Commit();
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }


            IModelBus modelBus = store.GetService(typeof(SModelBus)) as IModelBus;

            if (modelBus != null)
            {
                foreach (SubProcess process in subProcessList)
                {
                    using (Transaction transaction = process.Store.TransactionManager.BeginTransaction("update modelbus"))
                    {
                        //List<Activity> subProcessActivities = process.Activities.Where(a => a is SubProcessActivity).ToList();
                        //foreach (Activity act in subProcessActivities)
                        //{
                        //    var _act = (SubProcessActivity)act;

                        //    string toProc = ((SubProcessActivity)act).ToProcessId;
                        //    string toAct = ((SubProcessActivity)act).ToActivityId;

                        //    var toProcess = (SubProcess)subProcessList.Where(p => p.VisioId.ToString() == toProc).SingleOrDefault();

                        //    var toActivity = (SubProcessActivity)toProcess.Activities.Where(a => a.VisioId.ToString() == toAct).SingleOrDefault();

                        //    string projectPath = lstProjects.SelectedValue.ToString().Substring(0, lstProjects.SelectedValue.ToString().LastIndexOf(@"\"));
                        //    string folderPath = string.Format(@"{0}\processes\", _projectFolderPath);
                        //    string filePath = string.Format("{0}{1}.subprocess", _folderPath, toActivity.SubProcess.SubProcessName.Replace(" ", "_"));


                        //    ModelBusAdapterManager manager = modelBus.FindAdapterManagers(filePath).First();
                        //    ModelBusReference reference = manager.CreateReference(filePath);

                        //    using (ModelBusAdapter adapter = modelBus.CreateAdapter(reference))
                        //    {
                        //        _act.ExternalActivityRef = adapter.GetElementReference(toActivity);
                        //        _act.SubProcessActivityRef = adapter.GetElementReference(toActivity);
                        //    }
                        //}

                        transaction.Commit();
                    }
                }
            }
           
            vReader.CloseVisio();
            Close();
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:101,代码来源:Import.cs


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