Ejemplo n.º 1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Operation != null)
         {
             hashCode = hashCode * 59 + Operation.GetHashCode();
         }
         if (OperationIcon != null)
         {
             hashCode = hashCode * 59 + OperationIcon.GetHashCode();
         }
         if (TopicName != null)
         {
             hashCode = hashCode * 59 + TopicName.GetHashCode();
         }
         if (EmailEnabled != null)
         {
             hashCode = hashCode * 59 + EmailEnabled.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
 static CommandInfo GetStartButtonCommandInfo(out OperationIcon operation)
 {
     if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted || !IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted)
     {
         operation = OperationIcon.Stop;
         return(IdeApp.CommandService.GetCommandInfo(MonoDevelop.Ide.Commands.ProjectCommands.Stop));
     }
     else
     {
         operation = OperationIcon.Run;
         var ci = IdeApp.CommandService.GetCommandInfo("MonoDevelop.Debugger.DebugCommands.Debug");
         if (!ci.Enabled || !ci.Visible)
         {
             // If debug is not enabled, try Run
             ci = IdeApp.CommandService.GetCommandInfo(MonoDevelop.Ide.Commands.ProjectCommands.Run);
             if (!ci.Enabled || !ci.Visible)
             {
                 // Running is not possible, then allow building
                 var bci = IdeApp.CommandService.GetCommandInfo(MonoDevelop.Ide.Commands.ProjectCommands.BuildSolution);
                 if (bci.Enabled && bci.Visible)
                 {
                     operation = OperationIcon.Build;
                     ci        = bci;
                 }
             }
         }
         return(ci);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if ComDayCqDamCoreImplJobsMetadataimportAsyncMetadataImportConfigProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComDayCqDamCoreImplJobsMetadataimportAsyncMetadataImportConfigProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComDayCqDamCoreImplJobsMetadataimportAsyncMetadataImportConfigProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Operation == other.Operation ||
                     Operation != null &&
                     Operation.Equals(other.Operation)
                     ) &&
                 (
                     OperationIcon == other.OperationIcon ||
                     OperationIcon != null &&
                     OperationIcon.Equals(other.OperationIcon)
                 ) &&
                 (
                     TopicName == other.TopicName ||
                     TopicName != null &&
                     TopicName.Equals(other.TopicName)
                 ) &&
                 (
                     EmailEnabled == other.EmailEnabled ||
                     EmailEnabled != null &&
                     EmailEnabled.Equals(other.EmailEnabled)
                 ));
        }
Ejemplo n.º 4
0
        static Xwt.Drawing.Image GetIcon(OperationIcon icon)
        {
            switch (icon)
            {
            case OperationIcon.Stop:
                return(stopIcon);

            case OperationIcon.Run:
                return(executeIcon);

            case OperationIcon.Build:
                return(buildIcon);

            default:
                throw new InvalidOperationException();
            }
        }
Ejemplo n.º 5
0
        static string GetTooltip(OperationIcon icon)
        {
            switch (icon)
            {
            case OperationIcon.Stop:
                return(GettextCatalog.GetString("Stop currently running operation"));

            case OperationIcon.Run:
                return(GettextCatalog.GetString("Run current startup project"));

            case OperationIcon.Build:
                return(GettextCatalog.GetString("Build current startup project"));

            default:
                throw new InvalidOperationException();
            }
        }
        static string GetIconResource(OperationIcon icon)
        {
            switch (icon)
            {
            case OperationIcon.Stop:
                return("stop.png");

            case OperationIcon.Run:
                return("execute.png");

            case OperationIcon.Build:
                return("build.png");

            default:
                throw new InvalidOperationException();
            }
        }
Ejemplo n.º 7
0
        static Xwt.Drawing.Image GetIcon(OperationIcon icon)
        {
            string img;

            switch (icon)
            {
            case OperationIcon.Stop:
                img = "stop.png";
                break;

            case OperationIcon.Run:
                img = "execute.png";
                break;

            case OperationIcon.Build:
                img = "build.png";
                break;

            default:
                throw new InvalidOperationException();
            }

            return(Xwt.Drawing.Image.FromResource(typeof(RunButtonControl), img).WithSize(Xwt.IconSize.Medium));
        }
Ejemplo n.º 8
0
		static Xwt.Drawing.Image GetIcon (OperationIcon icon)
		{
			string img;
			switch (icon) {
				case OperationIcon.Stop:
					img = "stop.png";
					break;
				case OperationIcon.Run:
					img = "execute.png";
					break;
				case OperationIcon.Build:
					img = "build.png";
					break;
				default:
					throw new InvalidOperationException ();
			}

			return Xwt.Drawing.Image.FromResource (typeof (RunButtonControl), img).WithSize (Xwt.IconSize.Medium);
		}
Ejemplo n.º 9
0
		static string GetTooltip (OperationIcon icon)
		{
			switch (icon)
			{
				case OperationIcon.Stop:
					return GettextCatalog.GetString("Stop currently running operation");
				case OperationIcon.Run:
					return GettextCatalog.GetString("Run current startup project");
				case OperationIcon.Build:
					return GettextCatalog.GetString("Build current startup project");
				default:
					throw new InvalidOperationException();
			}
		}
Ejemplo n.º 10
0
		RunButtonControl (OperationIcon icon) : base(GetIcon(icon))
		{
			this.icon = icon;
			ToolTip = GetTooltip(icon);
		}
Ejemplo n.º 11
0
		static CommandInfo GetStartButtonCommandInfo (out OperationIcon operation)
		{
			if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted || !IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted) {
				operation = OperationIcon.Stop;
				return IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.ProjectCommands.Stop);
			}
			else {
				operation = OperationIcon.Run;
				var ci = IdeApp.CommandService.GetCommandInfo ("MonoDevelop.Debugger.DebugCommands.Debug");
				if (!ci.Enabled || !ci.Visible) {
					// If debug is not enabled, try Run
					ci = IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.ProjectCommands.Run);
					if (!ci.Enabled || !ci.Visible) {
						// Running is not possible, then allow building
						var bci = IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.ProjectCommands.BuildSolution);
						if (bci.Enabled && bci.Visible) {
							operation = OperationIcon.Build;
							ci = bci;
						}
					}
				}
				return ci;
			}
		}
Ejemplo n.º 12
0
 RunButtonControl(OperationIcon icon) : base(GetIcon(icon))
 {
     this.icon = icon;
     ToolTip   = GetTooltip(icon);
 }
		static string GetIconResource (OperationIcon icon)
		{
			switch (icon) {
				case OperationIcon.Stop:
					return "stop.png";
				case OperationIcon.Run:
					return "execute.png";
				case OperationIcon.Build:
					return "build.png";
				default:
					throw new InvalidOperationException ();
			}
		}