InitializeItemHandler() static private method

static private InitializeItemHandler ( SolutionItem item ) : void
item SolutionItem
return void
示例#1
0
 public void WriteFile(FilePath file, object obj, IProgressMonitor monitor)
 {
     if (slnFileFormat.CanWriteFile(obj, this))
     {
         slnFileFormat.WriteFile(file, obj, this, true, monitor);
     }
     else
     {
         SolutionEntityItem item = (SolutionEntityItem)obj;
         if (!(item.ItemHandler is MSBuildProjectHandler))
         {
             MSBuildProjectService.InitializeItemHandler(item);
         }
         MSBuildProjectHandler handler = (MSBuildProjectHandler)item.ItemHandler;
         handler.SetSolutionFormat(this, false);
         handler.Save(monitor);
     }
 }
示例#2
0
        public void ConvertToFormat(object obj)
        {
            if (obj == null)
            {
                return;
            }

            MSBuildHandler handler;
            SolutionItem   item = obj as SolutionItem;

            if (item != null)
            {
                handler = item.GetItemHandler() as MSBuildHandler;
                if (handler != null)
                {
                    handler.SetSolutionFormat(this, true);
                    return;
                }
            }

            MSBuildProjectService.InitializeItemHandler(item);
            handler = (MSBuildHandler)item.ItemHandler;
            handler.SetSolutionFormat(this, true);
        }