Пример #1
0
 public virtual int QueryStartClean(uint options, int[] supported, int[] ready)
 {
     CCITracing.TraceCall();
     config.PrepareBuild(false);
     if (supported != null && supported.Length > 0)
     {
         supported[0] = 1;
     }
     if (ready != null && ready.Length > 0)
     {
         ready[0] = (IsInProgress()) ? 0 : 1;
     }
     return(VSConstants.S_OK);
 }
Пример #2
0
 public virtual int QueryStartUpToDateCheck(uint options, int[] supported, int[] ready)
 {
     CCITracing.TraceCall();
     config.PrepareBuild(false);
     if (supported != null && supported.Length > 0)
     {
         supported[0] = 0; // TODO:
     }
     if (ready != null && ready.Length > 0)
     {
         ready[0] = (this.config.ProjectMgr.BuildInProgress) ? 0 : 1;
     }
     return(VSConstants.S_OK);
 }
Пример #3
0
        public virtual int get_ProjectCfgProvider(out IVsProjectCfgProvider p)
        {
            CCITracing.TraceCall();
            p = null;
            IVsCfgProvider cfgProvider = null;

            this.project.GetCfgProvider(out cfgProvider);
            if (cfgProvider != null)
            {
                p = cfgProvider as IVsProjectCfgProvider;
            }

            return((null == p) ? VSConstants.E_NOTIMPL : VSConstants.S_OK);
        }
 public virtual void CreateDirectory()
 {
     try
     {
         if (Directory.Exists(this.Url) == false)
         {
             Directory.CreateDirectory(this.Url);
         }
     }
     //TODO - this should not digest all exceptions.
     catch (System.Exception e)
     {
         CCITracing.Trace(e);
         throw;
     }
 }
Пример #5
0
        /// <summary>
        /// Sets the value of a configuration dependent property.
        /// If the attribute does not exist it is created.
        /// If value is null it will be set to an empty string.
        /// </summary>
        /// <param name="name">property name.</param>
        /// <param name="value">value of property</param>
        public void SetConfigProperty(string name, string value)
        {
            CCITracing.TraceCall();
            if (value == null)
            {
                value = String.Empty;
            }

            //if(this.ProjectMgr != null)
            //{
            //    for(int i = 0, n = this.projectConfigs.Length; i < n; i++)
            //    {
            //        IVsProjectCfg2 config = projectConfigs[i];

            //        config.SetConfigurationProperty(name, value);
            //    }

            //    this.ProjectMgr.SetProjectFileDirty(true);
            //}
        }
Пример #6
0
        /// <summary>
        /// Sets the value of a configuration dependent property.
        /// If the attribute does not exist it is created.
        /// If value is null it will be set to an empty string.
        /// </summary>
        /// <param name="name">property name.</param>
        /// <param name="value">value of property</param>
        public void SetConfigProperty(string name, string value)
        {
            CCITracing.TraceCall();
            if (value == null)
            {
                value = String.Empty;
            }

            if (this.ProjectMgr != null)
            {
                for (int i = 0, n = this.projectConfigs.Length; i < n; i++)
                {
                    ProjectConfig config = projectConfigs[i];

                    config.SetConfigurationProperty(name, value);
                }

                this.ProjectMgr.SetProjectFileDirty(true);
            }
        }
Пример #7
0
        /// <summary>
        /// Gets properties whose values are GUIDs.
        /// </summary>
        /// <param name="propid">Identifier of the hierarchy property</param>
        /// <param name="guid"> Pointer to a GUID property specified in propid</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
        public override int GetGuidProperty(int propid, out Guid guid)
        {
            guid = Guid.Empty;
            switch ((__VSHPROPID)propid)
            {
            case __VSHPROPID.VSHPROPID_ProjectIDGuid:
                guid = this.projectInstanceGuid;
                break;

            default:
                return(base.GetGuidProperty(propid, out guid));
            }

            CCITracing.TraceCall(String.Format(CultureInfo.CurrentCulture, "Guid for {0} property", propid));
            if (guid.CompareTo(Guid.Empty) == 0)
            {
                return(VSConstants.DISP_E_MEMBERNOTFOUND);
            }

            return(VSConstants.S_OK);
        }
Пример #8
0
        // =========================================================================================
        // Methods
        // =========================================================================================

        /// <summary>
        /// Sets the node property.
        /// </summary>
        /// <param name="propid">Property id.</param>
        /// <param name="value">Property value.</param>
        /// <returns>Returns success or failure code.</returns>
        public override int SetProperty(int propid, object value)
        {
            int         result;
            __VSHPROPID id = (__VSHPROPID)propid;

            switch (id)
            {
            case __VSHPROPID.VSHPROPID_IsNonMemberItem:
                if (value == null)
                {
                    throw new ArgumentNullException("value");
                }

                bool boolValue;
                CCITracing.TraceCall(this.ID + "," + id.ToString());
                if (Boolean.TryParse(value.ToString(), out boolValue))
                {
                    this.isNonMemberItem = boolValue;

                    // Reset exclude from scc
                    this.ExcludeNodeFromScc = this.IsNonMemberItem;
                }
                else
                {
                    XHelperMethods.TraceFail("Could not parse the IsNonMemberItem property value.");
                }

                result = VSConstants.S_OK;
                break;

            default:
                ThreadHelper.ThrowIfNotOnUIThread();
                result = base.SetProperty(propid, value);
                break;
            }

            return(result);
        }
Пример #9
0
 public virtual int get_TargetCodePage(out uint target)
 {
     CCITracing.TraceCall();
     target = (uint)System.Text.Encoding.Default.CodePage;
     return(VSConstants.S_OK);
 }
Пример #10
0
 public virtual int get_RootURL(out string root)
 {
     CCITracing.TraceCall();
     root = null;
     return(VSConstants.S_OK);
 }
Пример #11
0
 static public void TraceCall(string strParameters)
 {
     CCITracing.InternalTraceCall(2);
     XSettings.LogMessage("\tParameters: \t" + strParameters);
 }
Пример #12
0
 public virtual int get_Platform(out Guid platform)
 {
     CCITracing.TraceCall();
     platform = Guid.Empty;
     return(VSConstants.E_NOTIMPL);
 }
Пример #13
0
 public virtual int get_IsSpecifyingOutputSupported(out int f)
 {
     CCITracing.TraceCall();
     f = 1;
     return(VSConstants.S_OK);
 }
Пример #14
0
 public virtual int get_IsPackaged(out int pkgd)
 {
     CCITracing.TraceCall();
     pkgd = 0;
     return(VSConstants.S_OK);
 }
Пример #15
0
 public virtual int EnumOutputs(out IVsEnumOutputs eo)
 {
     CCITracing.TraceCall();
     eo = null;
     return(VSConstants.E_NOTIMPL);
 }
Пример #16
0
        public virtual int Wait(uint ms, int fTickWhenMessageQNotEmpty)
        {
            CCITracing.TraceCall();

            return(VSConstants.E_NOTIMPL);
        }
Пример #17
0
 static public void Trace(System.Exception e)
 {
     CCITracing.InternalTraceCall(2);
     XSharpProjectPackage.Instance.DisplayException(e);
 }
Пример #18
0
 static public void Trace(System.Exception e)
 {
     CCITracing.InternalTraceCall(2);
     XSettings.LogException(e, "");
 }
Пример #19
0
 public virtual int OpenOutput(string name, out IVsOutput output)
 {
     CCITracing.TraceCall();
     output = null;
     return(VSConstants.E_NOTIMPL);
 }
Пример #20
0
 static public void Trace(System.Exception e)
 {
     CCITracing.InternalTraceCall(2);
     System.Diagnostics.Trace.WriteLine("ExceptionInfo: \t" + e.ToString());
 }
Пример #21
0
 static public void TraceCall(string strParameters)
 {
     CCITracing.InternalTraceCall(2);
     System.Diagnostics.Trace.WriteLine("\tParameters: \t" + strParameters);
 }
Пример #22
0
 static public void TraceCall()
 {
     // skip this one as well
     CCITracing.InternalTraceCall(2);
 }
Пример #23
0
        /// <summary>
        /// Called by the vs shell to start debugging (managed or unmanaged).
        /// Override this method to support other debug engines.
        /// </summary>
        /// <param name="grfLaunch">A flag that determines the conditions under which to start the debugger. For valid grfLaunch values, see __VSDBGLAUNCHFLAGS</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code</returns>
        public virtual int DebugLaunch(uint grfLaunch)
        {
            CCITracing.TraceCall();

            try
            {
                VsDebugTargetInfo info = new VsDebugTargetInfo();
                info.cbSize = (uint)Marshal.SizeOf(info);
                info.dlo    = Microsoft.VisualStudio.Shell.Interop.DEBUG_LAUNCH_OPERATION.DLO_CreateProcess;

                // On first call, reset the cache, following calls will use the cached values
                string property = GetConfigurationProperty("StartProgram", true);
                if (string.IsNullOrEmpty(property))
                {
                    info.bstrExe = this.project.GetOutputAssembly(this.ConfigName);
                }
                else
                {
                    info.bstrExe = property;
                }

                property = GetConfigurationProperty("WorkingDirectory", false);
                if (string.IsNullOrEmpty(property))
                {
                    info.bstrCurDir = Path.GetDirectoryName(info.bstrExe);
                }
                else
                {
                    info.bstrCurDir = property;
                }

                property = GetConfigurationProperty("CmdArgs", false);
                if (!string.IsNullOrEmpty(property))
                {
                    info.bstrArg = property;
                }

                property = GetConfigurationProperty("RemoteDebugMachine", false);
                if (property != null && property.Length > 0)
                {
                    info.bstrRemoteMachine = property;
                }

                info.fSendStdoutToOutputWindow = 0;

                property = GetConfigurationProperty("EnableUnmanagedDebugging", false);
                if (property != null && string.Compare(property, "true", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    //Set the unmanged debugger
                    //TODO change to vsconstant when it is available in VsConstants (guidNativeOnlyEng was the old name, maybe it has got a new name)
                    info.clsidCustom = new Guid("{3B476D35-A401-11D2-AAD4-00C04F990171}");
                }
                else
                {
                    //Set the managed debugger
                    info.clsidCustom = VSConstants.CLSID_ComPlusOnlyDebugEngine;
                }
                info.grfLaunch = grfLaunch;
                VsShellUtilities.LaunchDebugger(this.project.Site, info);
            }
            catch (Exception e)
            {
                Trace.WriteLine("Exception : " + e.Message);

                return(Marshal.GetHRForException(e));
            }

            return(VSConstants.S_OK);
        }
Пример #24
0
        public virtual int Stop(int fsync)
        {
            CCITracing.TraceCall();

            return(VSConstants.S_OK);
        }
Пример #25
0
        public virtual int StartUpToDateCheck(IVsOutputWindowPane pane, uint options)
        {
            CCITracing.TraceCall();

            return(VSConstants.E_NOTIMPL);
        }
Пример #26
0
 static public void TraceCall(string strParameters)
 {
     CCITracing.InternalTraceCall(2);
     XSharpProjectPackage.Instance.DisplayOutPutMessage("\tParameters: \t" + strParameters);
 }